summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjinwu <jinwu@codeaurora.org>2017-12-09 15:38:45 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-12-10 23:45:55 -0800
commitf37735325307310745d01d5a4eca05270839238c (patch)
tree387c6f51e1b5fd3588b687fd40705b0f1364479f /src
parent273d8b8b8a163bb1d092db48e3c79ff11049a311 (diff)
downloadandroid_packages_apps_Snap-f37735325307310745d01d5a4eca05270839238c.tar.gz
android_packages_apps_Snap-f37735325307310745d01d5a4eca05270839238c.tar.bz2
android_packages_apps_Snap-f37735325307310745d01d5a4eca05270839238c.zip
Play sound when start/stop recording
Add an action of playing sound when start or stop recording. Change-Id: I5351d347beea26cddef7c87e8a2b37a1f2f421c2
Diffstat (limited to 'src')
-rwxr-xr-xsrc/com/android/camera/CaptureModule.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java
index d9625a5ee..129497d7e 100755
--- a/src/com/android/camera/CaptureModule.java
+++ b/src/com/android/camera/CaptureModule.java
@@ -3196,6 +3196,7 @@ public class CaptureModule implements CameraModule, PhotoController,
mIsRecordingVideo = true;
mMediaRecorderPausing = false;
+ checkAndPlayRecordSound(cameraId, true);
mActivity.updateStorageSpaceAndHint();
if (mActivity.getStorageSpaceBytes() <= Storage.LOW_STORAGE_THRESHOLD_BYTES) {
Log.w(TAG, "Storage issue, ignore the start request");
@@ -3571,6 +3572,7 @@ public class CaptureModule implements CameraModule, PhotoController,
mStopRecPending = true;
boolean shouldAddToMediaStoreNow = false;
// Stop recording
+ checkAndPlayRecordSound(cameraId, false);
mFrameProcessor.setVideoOutputSurface(null);
mFrameProcessor.onClose();
closePreviewSession();
@@ -4524,6 +4526,16 @@ public class CaptureModule implements CameraModule, PhotoController,
}
}
+ private void checkAndPlayRecordSound(int id, boolean isStarted) {
+ if (id == getMainCameraId()) {
+ String value = mSettingsManager.getValue(SettingsManager.KEY_SHUTTER_SOUND);
+ if (value != null && value.equals("on") && mSound != null) {
+ mSound.play(isStarted? MediaActionSound.START_VIDEO_RECORDING
+ : MediaActionSound.STOP_VIDEO_RECORDING);
+ }
+ }
+ }
+
public void checkAndPlayShutterSound(int id) {
if (id == getMainCameraId()) {
String value = mSettingsManager.getValue(SettingsManager.KEY_SHUTTER_SOUND);