diff options
author | Igor Murashkin <iam@google.com> | 2014-08-11 19:47:12 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-11 18:14:57 +0000 |
commit | de975ca87c3dbdf9b7d92dae54b3446670b2a50e (patch) | |
tree | eb03ba57e8142e3dec3c639286b92bd1db3992c9 /services/camera | |
parent | 088308a685ee54a476c96649af48ca3eca0bdd9c (diff) | |
parent | ebe865b175b3f1b2a9212cea7b008937c919d8f3 (diff) | |
download | frameworks_av-de975ca87c3dbdf9b7d92dae54b3446670b2a50e.zip frameworks_av-de975ca87c3dbdf9b7d92dae54b3446670b2a50e.tar.gz frameworks_av-de975ca87c3dbdf9b7d92dae54b3446670b2a50e.tar.bz2 |
Merge "camera: Allow Camera#getParameters to be called by mediaserver anytime" into lmp-dev
Diffstat (limited to 'services/camera')
-rw-r--r-- | services/camera/libcameraservice/api1/Camera2Client.cpp | 3 | ||||
-rw-r--r-- | services/camera/libcameraservice/api1/CameraClient.cpp | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp index 046988e..5eb5181 100644 --- a/services/camera/libcameraservice/api1/Camera2Client.cpp +++ b/services/camera/libcameraservice/api1/Camera2Client.cpp @@ -1368,7 +1368,8 @@ String8 Camera2Client::getParameters() const { ATRACE_CALL(); ALOGV("%s: Camera %d", __FUNCTION__, mCameraId); Mutex::Autolock icl(mBinderSerializationLock); - if ( checkPid(__FUNCTION__) != OK) return String8(); + // The camera service can unconditionally get the parameters at all times + if (getCallingPid() != mServicePid && checkPid(__FUNCTION__) != OK) return String8(); SharedParameters::ReadLock l(mParameters); diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp index 517226d..fb6b678 100644 --- a/services/camera/libcameraservice/api1/CameraClient.cpp +++ b/services/camera/libcameraservice/api1/CameraClient.cpp @@ -556,7 +556,8 @@ status_t CameraClient::setParameters(const String8& params) { // get preview/capture parameters - key/value pairs String8 CameraClient::getParameters() const { Mutex::Autolock lock(mLock); - if (checkPidAndHardware() != NO_ERROR) return String8(); + // The camera service can unconditionally get the parameters at all times + if (getCallingPid() != mServicePid && checkPidAndHardware() != NO_ERROR) return String8(); String8 params(mHardware->getParameters().flatten()); LOG1("getParameters (pid %d) (%s)", getCallingPid(), params.string()); |