Loading core/java/android/hardware/Camera.java +36 −2 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ public class Camera { private OnZoomChangeListener mZoomListener; private FaceDetectionListener mFaceListener; private ErrorCallback mErrorCallback; private ErrorCallback mDetailedErrorCallback; private boolean mOneShot; private boolean mWithBuffer; private boolean mFaceDetectionRunning = false; Loading Loading @@ -1240,9 +1241,15 @@ public class Camera { case CAMERA_MSG_ERROR : Log.e(TAG, "Error " + msg.arg1); if (mErrorCallback != null) { if (mDetailedErrorCallback != null) { mDetailedErrorCallback.onError(msg.arg1, mCamera); } else if (mErrorCallback != null) { if (msg.arg1 == CAMERA_ERROR_DISABLED) { mErrorCallback.onError(CAMERA_ERROR_EVICTED, mCamera); } else { mErrorCallback.onError(msg.arg1, mCamera); } } return; case CAMERA_MSG_FOCUS_MOVE: Loading Loading @@ -2004,6 +2011,15 @@ public class Camera { */ public static final int CAMERA_ERROR_EVICTED = 2; /** * Camera was disconnected due to device policy change or client * application going to background. * @see Camera.ErrorCallback * * @hide */ public static final int CAMERA_ERROR_DISABLED = 3; /** * Media server died. In this case, the application must release the * Camera object and instantiate a new one. Loading Loading @@ -2043,6 +2059,24 @@ public class Camera { mErrorCallback = cb; } /** * Registers a callback to be invoked when an error occurs. * The detailed error callback may contain error code that * gives more detailed information about the error. * * When a detailed callback is set, the callback set via * #setErrorCallback(ErrorCallback) will stop receiving * onError call. * * @param cb The callback to run * * @hide */ public final void setDetailedErrorCallback(ErrorCallback cb) { mDetailedErrorCallback = cb; } private native final void native_setParameters(String params); private native final String native_getParameters(); Loading core/java/android/hardware/camera2/legacy/RequestThreadManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -193,6 +193,11 @@ public class RequestThreadManager { mDeviceState.setError( CameraDeviceImpl.CameraDeviceCallbacks.ERROR_CAMERA_DISCONNECTED); } break; case Camera.CAMERA_ERROR_DISABLED: { flush(); mDeviceState.setError( CameraDeviceImpl.CameraDeviceCallbacks.ERROR_CAMERA_DISABLED); } break; default: { Log.e(TAG, "Received error " + i + " from the Camera1 ErrorCallback"); mDeviceState.setError( Loading Loading @@ -1005,7 +1010,7 @@ public class RequestThreadManager { mFaceDetectMapper = new LegacyFaceDetectMapper(mCamera, mCharacteristics); mCaptureCollector = new CaptureCollector(MAX_IN_FLIGHT_REQUESTS, mDeviceState); mRequestThread = new RequestHandlerThread(name, mRequestHandlerCb); mCamera.setErrorCallback(mErrorCallback); mCamera.setDetailedErrorCallback(mErrorCallback); } /** Loading Loading
core/java/android/hardware/Camera.java +36 −2 Original line number Diff line number Diff line Loading @@ -177,6 +177,7 @@ public class Camera { private OnZoomChangeListener mZoomListener; private FaceDetectionListener mFaceListener; private ErrorCallback mErrorCallback; private ErrorCallback mDetailedErrorCallback; private boolean mOneShot; private boolean mWithBuffer; private boolean mFaceDetectionRunning = false; Loading Loading @@ -1240,9 +1241,15 @@ public class Camera { case CAMERA_MSG_ERROR : Log.e(TAG, "Error " + msg.arg1); if (mErrorCallback != null) { if (mDetailedErrorCallback != null) { mDetailedErrorCallback.onError(msg.arg1, mCamera); } else if (mErrorCallback != null) { if (msg.arg1 == CAMERA_ERROR_DISABLED) { mErrorCallback.onError(CAMERA_ERROR_EVICTED, mCamera); } else { mErrorCallback.onError(msg.arg1, mCamera); } } return; case CAMERA_MSG_FOCUS_MOVE: Loading Loading @@ -2004,6 +2011,15 @@ public class Camera { */ public static final int CAMERA_ERROR_EVICTED = 2; /** * Camera was disconnected due to device policy change or client * application going to background. * @see Camera.ErrorCallback * * @hide */ public static final int CAMERA_ERROR_DISABLED = 3; /** * Media server died. In this case, the application must release the * Camera object and instantiate a new one. Loading Loading @@ -2043,6 +2059,24 @@ public class Camera { mErrorCallback = cb; } /** * Registers a callback to be invoked when an error occurs. * The detailed error callback may contain error code that * gives more detailed information about the error. * * When a detailed callback is set, the callback set via * #setErrorCallback(ErrorCallback) will stop receiving * onError call. * * @param cb The callback to run * * @hide */ public final void setDetailedErrorCallback(ErrorCallback cb) { mDetailedErrorCallback = cb; } private native final void native_setParameters(String params); private native final String native_getParameters(); Loading
core/java/android/hardware/camera2/legacy/RequestThreadManager.java +6 −1 Original line number Diff line number Diff line Loading @@ -193,6 +193,11 @@ public class RequestThreadManager { mDeviceState.setError( CameraDeviceImpl.CameraDeviceCallbacks.ERROR_CAMERA_DISCONNECTED); } break; case Camera.CAMERA_ERROR_DISABLED: { flush(); mDeviceState.setError( CameraDeviceImpl.CameraDeviceCallbacks.ERROR_CAMERA_DISABLED); } break; default: { Log.e(TAG, "Received error " + i + " from the Camera1 ErrorCallback"); mDeviceState.setError( Loading Loading @@ -1005,7 +1010,7 @@ public class RequestThreadManager { mFaceDetectMapper = new LegacyFaceDetectMapper(mCamera, mCharacteristics); mCaptureCollector = new CaptureCollector(MAX_IN_FLIGHT_REQUESTS, mDeviceState); mRequestThread = new RequestHandlerThread(name, mRequestHandlerCb); mCamera.setErrorCallback(mErrorCallback); mCamera.setDetailedErrorCallback(mErrorCallback); } /** Loading