diff options
author | Likai Ding <likaid@codeaurora.org> | 2014-06-24 16:33:05 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-07-09 02:39:45 -0700 |
commit | 45dbf2ed679d99ca2bec1b05ca9e533a911da607 (patch) | |
tree | 8e10a4809007f25bc47d2159c6caa39e1213630c | |
parent | 38cc61512bb6615e52bc373986edfadb039c7753 (diff) | |
download | android_packages_apps_Snap-45dbf2ed679d99ca2bec1b05ca9e533a911da607.tar.gz android_packages_apps_Snap-45dbf2ed679d99ca2bec1b05ca9e533a911da607.tar.bz2 android_packages_apps_Snap-45dbf2ed679d99ca2bec1b05ca9e533a911da607.zip |
Camera2: optionally force count down sound
set count down sound as STREAM_SYSTEM_ENFORCED for carrier compliance
Change-Id: Ie60bb4c7059ad8930be2c6650808107dcaaa22a2
CRs-Fixed: 684591
-rw-r--r-- | res/values/bool.xml | 3 | ||||
-rw-r--r-- | src/com/android/camera/ui/CountDownView.java | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/res/values/bool.xml b/res/values/bool.xml index 464842ab4..4488d70bb 100644 --- a/res/values/bool.xml +++ b/res/values/bool.xml @@ -15,4 +15,5 @@ --> <resources> <bool name="show_action_bar_title">false</bool> -</resources>
\ No newline at end of file + <bool name="force_count_down_sound">false</bool> +</resources> diff --git a/src/com/android/camera/ui/CountDownView.java b/src/com/android/camera/ui/CountDownView.java index 6f4ae8cda..9cfe3f9b0 100644 --- a/src/com/android/camera/ui/CountDownView.java +++ b/src/com/android/camera/ui/CountDownView.java @@ -51,7 +51,11 @@ public class CountDownView extends FrameLayout { super(context, attrs); mCountDownAnim = AnimationUtils.loadAnimation(context, R.anim.count_down_exit); // Load the beeps - mSoundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0); + if (context.getResources().getBoolean(R.bool.force_count_down_sound)) { + mSoundPool = new SoundPool(1, AudioManager.STREAM_SYSTEM_ENFORCED, 0); + } else { + mSoundPool = new SoundPool(1, AudioManager.STREAM_NOTIFICATION, 0); + } mBeepOnce = mSoundPool.load(context, R.raw.beep_once, 1); mBeepTwice = mSoundPool.load(context, R.raw.beep_twice, 1); } @@ -128,4 +132,4 @@ public class CountDownView extends FrameLayout { } } } -}
\ No newline at end of file +} |