diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2015-06-03 16:27:11 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2015-06-04 16:15:35 -0700 |
commit | db70a9785315a29c1d0d1233d883062b8d07c46f (patch) | |
tree | 645e178d0e377250b516e499cb4f2586514a42f8 /core/java/android/hardware | |
parent | 81f2992fac1667336cc526a380c696258569de09 (diff) | |
download | frameworks_base-db70a9785315a29c1d0d1233d883062b8d07c46f.zip frameworks_base-db70a9785315a29c1d0d1233d883062b8d07c46f.tar.gz frameworks_base-db70a9785315a29c1d0d1233d883062b8d07c46f.tar.bz2 |
Camera2: Legacy: Do not remap EACCES error code to PERMISSION_DENIED
This remap causes non-Legacy and Legacy devices to have different
error behavior when the camera permission is removed from a pre-M
application.
Without the remap, both routes map to CameraAccessException with
code CAMERA_DISABLED.
Bug: 21604925
Change-Id: I4ab18dca961cc7cedaccba0531253c9c4ef1d60e
Diffstat (limited to 'core/java/android/hardware')
-rw-r--r-- | core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java b/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java index bc0a3a8..6020d37 100644 --- a/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java +++ b/core/java/android/hardware/camera2/legacy/CameraDeviceUserShim.java @@ -88,15 +88,6 @@ public class CameraDeviceUserShim implements ICameraDeviceUser { mSurfaceIdCounter = 0; } - private static int translateErrorsFromCamera1(int errorCode) { - switch (errorCode) { - case CameraBinderDecorator.EACCES: - return CameraBinderDecorator.PERMISSION_DENIED; - default: - return errorCode; - } - } - /** * Create a separate looper/thread for the camera to run on; open the camera. * @@ -140,7 +131,7 @@ public class CameraDeviceUserShim implements ICameraDeviceUser { // Save the looper so that we can terminate this thread // after we are done with it. mLooper = Looper.myLooper(); - mInitErrors = translateErrorsFromCamera1(mCamera.cameraInitUnspecified(mCameraId)); + mInitErrors = mCamera.cameraInitUnspecified(mCameraId); mStartDone.open(); Looper.loop(); // Blocks forever until #close is called. } |