diff options
author | Igor Murashkin <iam@google.com> | 2014-08-19 14:53:08 -0700 |
---|---|---|
committer | Igor Murashkin <iam@google.com> | 2014-08-19 15:19:58 -0700 |
commit | a858ea0495c887621a2fd9c0afc13780deccb597 (patch) | |
tree | dbe17ab6e77cfe3e40ce6c8114898e3ac5aef5b4 /services/camera/libcameraservice/api1/CameraClient.cpp | |
parent | 97c7fa1b1596a062147f034a2b44781193c052cf (diff) | |
download | frameworks_av-a858ea0495c887621a2fd9c0afc13780deccb597.zip frameworks_av-a858ea0495c887621a2fd9c0afc13780deccb597.tar.gz frameworks_av-a858ea0495c887621a2fd9c0afc13780deccb597.tar.bz2 |
camera: Allow shutter sounds to be disabled from camera2 api
When using the connectLegacy binder interface (available only
through an @hide java api), then consider the camera to be in the
camera2 api legacy mode.
In legacy mode, allow disabling the shutter sound unconditionally.
Bug: 17109582
Change-Id: Ieb3fc61ff111d792cc657c018e278349c25472cf
Diffstat (limited to 'services/camera/libcameraservice/api1/CameraClient.cpp')
-rw-r--r-- | services/camera/libcameraservice/api1/CameraClient.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp index fb6b678..abe1235 100644 --- a/services/camera/libcameraservice/api1/CameraClient.cpp +++ b/services/camera/libcameraservice/api1/CameraClient.cpp @@ -38,7 +38,7 @@ CameraClient::CameraClient(const sp<CameraService>& cameraService, const String16& clientPackageName, int cameraId, int cameraFacing, int clientPid, int clientUid, - int servicePid): + int servicePid, bool legacyMode): Client(cameraService, cameraClient, clientPackageName, cameraId, cameraFacing, clientPid, clientUid, servicePid) { @@ -54,6 +54,7 @@ CameraClient::CameraClient(const sp<CameraService>& cameraService, // Callback is disabled by default mPreviewCallbackFlag = CAMERA_FRAME_CALLBACK_FLAG_NOOP; mOrientation = getOrientation(0, mCameraFacing == CAMERA_FACING_FRONT); + mLegacyMode = legacyMode; mPlayShutterSound = true; LOG1("CameraClient::CameraClient X (pid %d, id %d)", callingPid, cameraId); } @@ -576,6 +577,13 @@ status_t CameraClient::enableShutterSound(bool enable) { return OK; } + // the camera2 api legacy mode can unconditionally disable the shutter sound + if (mLegacyMode) { + ALOGV("%s: Disable shutter sound in legacy mode", __FUNCTION__); + mPlayShutterSound = false; + return OK; + } + // Disabling shutter sound may not be allowed. In that case only // allow the mediaserver process to disable the sound. char value[PROPERTY_VALUE_MAX]; |