diff options
author | xianming wang <mingwax@codeaurora.org> | 2017-12-09 15:07:47 +0800 |
---|---|---|
committer | xianming wang <mingwax@codeaurora.org> | 2017-12-09 15:12:50 +0800 |
commit | 273d8b8b8a163bb1d092db48e3c79ff11049a311 (patch) | |
tree | 9907eac67d3459cb7fc574adf4cc9da8cf001571 | |
parent | fbac58b4605d37ba0dab906a4e42a0ee12d16438 (diff) | |
download | android_packages_apps_Snap-273d8b8b8a163bb1d092db48e3c79ff11049a311.tar.gz android_packages_apps_Snap-273d8b8b8a163bb1d092db48e3c79ff11049a311.tar.bz2 android_packages_apps_Snap-273d8b8b8a163bb1d092db48e3c79ff11049a311.zip |
SnapdragonCamera: Reset audioMute when mute in the recording
When mute in the recording, and exit camera, reset the unmute
value, so that does not affect the sound recorder.
CRs-Fixed: 2153745
Change-Id: I3d8413dce714d3bc09f219ac4d10f605f5481f0d
-rwxr-xr-x | src/com/android/camera/CaptureModule.java | 7 | ||||
-rwxr-xr-x | src/com/android/camera/CaptureUI.java | 20 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/com/android/camera/CaptureModule.java b/src/com/android/camera/CaptureModule.java index a3502a381..d9625a5ee 100755 --- a/src/com/android/camera/CaptureModule.java +++ b/src/com/android/camera/CaptureModule.java @@ -2015,6 +2015,12 @@ public class CaptureModule implements CameraModule, PhotoController, } } + private void resetAudioMute() { + if (isAudioMute()) { + setMute(false, true); + } + } + /** * Closes the current {@link CameraDevice}. */ @@ -2289,6 +2295,7 @@ public class CaptureModule implements CameraModule, PhotoController, ClearSightImageProcessor.getInstance().close(); } closeCamera(); + resetAudioMute(); mUI.showPreviewCover(); mUI.hideSurfaceView(); mFirstPreviewLoaded = false; diff --git a/src/com/android/camera/CaptureUI.java b/src/com/android/camera/CaptureUI.java index 9a52396dd..364459cb7 100755 --- a/src/com/android/camera/CaptureUI.java +++ b/src/com/android/camera/CaptureUI.java @@ -350,20 +350,13 @@ public class CaptureUI implements FocusOverlayManager.FocusUI, mMuteButton = (RotateImageView)mRootView.findViewById(R.id.mute_button); mMuteButton.setVisibility(View.VISIBLE); - if(!mModule.isAudioMute()) { - mMuteButton.setImageResource(R.drawable.ic_unmuted_button); - } else { - mMuteButton.setImageResource(R.drawable.ic_muted_button); - } + setMuteButtonResource(!mModule.isAudioMute()); mMuteButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { boolean isEnabled = !mModule.isAudioMute(); mModule.setMute(isEnabled, true); - if (!isEnabled) - mMuteButton.setImageResource(R.drawable.ic_unmuted_button); - else - mMuteButton.setImageResource(R.drawable.ic_muted_button); + setMuteButtonResource(!isEnabled); } }); @@ -753,6 +746,7 @@ public class CaptureUI implements FocusOverlayManager.FocusUI, mRecordingTimeView.setText(""); mRecordingTimeRect.setVisibility(View.VISIBLE); mMuteButton.setVisibility(View.VISIBLE); + setMuteButtonResource(!mModule.isAudioMute()); } else { mFlashButton.setVisibility(View.VISIBLE); mFlashButton.init(false); @@ -762,6 +756,14 @@ public class CaptureUI implements FocusOverlayManager.FocusUI, } } + private void setMuteButtonResource(boolean isUnMute) { + if(isUnMute) { + mMuteButton.setImageResource(R.drawable.ic_unmuted_button); + } else { + mMuteButton.setImageResource(R.drawable.ic_muted_button); + } + } + private boolean needShowInstructional() { boolean needShow = true; final SharedPreferences pref = mActivity.getSharedPreferences( |