diff options
-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()); |