add a crashfix when debugging
This commit is contained in:
parent
0520babf09
commit
9ba9f9723e
|
@ -23,7 +23,8 @@ public class MarshmallowCamera {
|
||||||
try {
|
try {
|
||||||
final CameraManager manager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
|
final CameraManager manager = (CameraManager) mContext.getSystemService(Context.CAMERA_SERVICE);
|
||||||
final String[] list = manager.getCameraIdList();
|
final String[] list = manager.getCameraIdList();
|
||||||
manager.setTorchMode(list[0], enable);
|
if (list.length > 0)
|
||||||
|
manager.setTorchMode(list[0], enable);
|
||||||
} catch (CameraAccessException e) {
|
} catch (CameraAccessException e) {
|
||||||
Log.e(TAG, "toggle marshmallow flashlight " + e.getMessage());
|
Log.e(TAG, "toggle marshmallow flashlight " + e.getMessage());
|
||||||
bus.post(new Events.CameraUnavailable());
|
bus.post(new Events.CameraUnavailable());
|
||||||
|
|
Loading…
Reference in New Issue