diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-06-16 01:05:43 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-06-16 01:05:43 -0700 |
commit | 01bded1246cd770b54b8011527f5c29e1b5663e3 (patch) | |
tree | 1f5a10e4db7e61b4ad526f2356a8f4edd307a993 | |
parent | 50b0f02dea21f31ec1fbe45b86893aa9233483b8 (diff) | |
parent | a3355430a36bbfa7b2c0d90eb30834f1c5dac337 (diff) | |
download | frameworks_av-01bded1246cd770b54b8011527f5c29e1b5663e3.zip frameworks_av-01bded1246cd770b54b8011527f5c29e1b5663e3.tar.gz frameworks_av-01bded1246cd770b54b8011527f5c29e1b5663e3.tar.bz2 |
Merge "Allow camera to be disabled via Device Policy Manager"
-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(); |