diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-05-20 14:54:25 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-05-30 20:05:38 +0800 |
commit | a3355430a36bbfa7b2c0d90eb30834f1c5dac337 (patch) | |
tree | 7273f455fc8d672547d5a0828ac6cd23df230116 /services/camera | |
parent | 2cf9c5073ca3342ee52673ad68763fadd2c2be79 (diff) | |
download | frameworks_av-a3355430a36bbfa7b2c0d90eb30834f1c5dac337.zip frameworks_av-a3355430a36bbfa7b2c0d90eb30834f1c5dac337.tar.gz frameworks_av-a3355430a36bbfa7b2c0d90eb30834f1c5dac337.tar.bz2 |
Allow camera to be disabled via Device Policy Manager
bug:4185309
Change-Id: I8be89d892b8f540fd05913c93f97b92346a0a282
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 1e8c30b..a011ae2 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -147,6 +147,14 @@ sp<ICamera> CameraService::connect( return NULL; } + char value[PROPERTY_VALUE_MAX]; + property_get("sys.secpolicy.camera.disabled", value, "0"); + if (strcmp(value, "1") == 0) { + // Camera is disabled by DevicePolicyManager. + LOGI("Camera is disabled. connect X (pid %d) rejected", callingPid); + return NULL; + } + Mutex::Autolock lock(mServiceLock); if (mClient[cameraId] != 0) { client = mClient[cameraId].promote(); |