diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2015-06-03 16:03:30 -0700 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2015-06-05 17:19:39 -0700 |
commit | e3afb2cc438b76ae433c8c40ceabf0457ad7a678 (patch) | |
tree | 4410c41bb351d0b646e5d156a0e8fbd4cb69e533 /services | |
parent | afd492436efc7f66b958da14659b52232efa5910 (diff) | |
download | frameworks_av-e3afb2cc438b76ae433c8c40ceabf0457ad7a678.zip frameworks_av-e3afb2cc438b76ae433c8c40ceabf0457ad7a678.tar.gz frameworks_av-e3afb2cc438b76ae433c8c40ceabf0457ad7a678.tar.bz2 |
Camera: Change error for app ops reject, propagate binder errors
INVALID_OPERATION surfaces as an non-specific device-level error to
applications in the onError callback. This is not a condition apps
targeting camera2 in L will generally have to deal with.
Instead, return -EACCESS which maps to throwing
CameraAccessException.CAMERA_DISABLED, same as disabling camera access
with DevicePolicyManager.
The old camera API converts any error code to -EACCESS at the JNI layer,
so this doesn't change anything for the older API.
Also update the various native ICameraService binder connect calls to
check for the transact error code, and return it if it is not OK.
Without this, PERMISSION_DENIED transact errors from the camera
service cannot be distinguished from CAMERA_DISABLED errors in
some codepaths.
Bug: 21604925
Change-Id: Ifccc8989b8c20653429e2d3e51dba7abb2be9c35
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 6f073ed..f42fada 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -1864,7 +1864,8 @@ status_t CameraService::BasicClient::startCameraOps() { if (res == AppOpsManager::MODE_IGNORED) { ALOGI("Camera %d: Access for \"%s\" has been restricted", mCameraId, String8(mClientPackageName).string()); - return INVALID_OPERATION; + // Return the same error as for device policy manager rejection + return -EACCES; } mOpsActive = true; |