|
|
@ -40,6 +40,7 @@ class Camera1 extends CameraController { |
|
|
|
private Runnable mPostFocusResetRunnable = new Runnable() { |
|
|
|
private Runnable mPostFocusResetRunnable = new Runnable() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
public void run() { |
|
|
|
|
|
|
|
try { |
|
|
|
if (!isCameraAvailable()) return; |
|
|
|
if (!isCameraAvailable()) return; |
|
|
|
mCamera.cancelAutoFocus(); |
|
|
|
mCamera.cancelAutoFocus(); |
|
|
|
synchronized (mLock) { |
|
|
|
synchronized (mLock) { |
|
|
@ -50,6 +51,15 @@ class Camera1 extends CameraController { |
|
|
|
mCamera.setParameters(params); |
|
|
|
mCamera.setParameters(params); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception e) { |
|
|
|
|
|
|
|
// at least setParameters may fail.
|
|
|
|
|
|
|
|
// problem may be device-specific to the Samsung Galaxy J5
|
|
|
|
|
|
|
|
// TODO why does it fail occasionally and is it possible to prevent such errors?
|
|
|
|
|
|
|
|
CameraException cameraException = new CameraConfigurationFailedException("Failed to " + |
|
|
|
|
|
|
|
"reset auto focus.", e); |
|
|
|
|
|
|
|
mCameraCallbacks.onError(cameraException); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
private Mapper mMapper = new Mapper.Mapper1(); |
|
|
|
private Mapper mMapper = new Mapper.Mapper1(); |
|
|
|