summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2018-12-05 16:02:26 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2018-12-05 16:02:26 -0800
commit739a1f840136a6f6e1f30a035804a27ced46e0d3 (patch)
tree6ef83b33b5cae4fe006f4c203a0c99f950a7ab0d /src/com/android/camera/ui
parent006d1ec64b266fe38b081b67e008686aae1a2760 (diff)
parentff0e747b7a76f221ed7a1062d58a8498a02bd7cb (diff)
downloadandroid_packages_apps_Snap-739a1f840136a6f6e1f30a035804a27ced46e0d3.tar.gz
android_packages_apps_Snap-739a1f840136a6f6e1f30a035804a27ced46e0d3.tar.bz2
android_packages_apps_Snap-739a1f840136a6f6e1f30a035804a27ced46e0d3.zip
Merge "SnapdraongCamera:Fix CountDown sound" into camera-SnapdragonCamera.lnx.2.0
Diffstat (limited to 'src/com/android/camera/ui')
-rwxr-xr-xsrc/com/android/camera/ui/CountDownView.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/com/android/camera/ui/CountDownView.java b/src/com/android/camera/ui/CountDownView.java
index d9d0244e5..f62c99958 100755
--- a/src/com/android/camera/ui/CountDownView.java
+++ b/src/com/android/camera/ui/CountDownView.java
@@ -99,8 +99,19 @@ public class CountDownView extends FrameLayout {
mRemainingSecondsView.clearAnimation();
mRemainingSecondsView.startAnimation(mCountDownAnim);
+ if (mSoundPool == null) {
+ // Load the beeps
+ if (mContext.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(mContext, R.raw.beep_once, 1);
+ mBeepTwice = mSoundPool.load(mContext, R.raw.beep_twice, 1);
+ }
+
// Play sound effect for the last 3 seconds of the countdown
- if (mPlaySound) {
+ if (mPlaySound && mSoundPool != null) {
if (newVal == 1) {
mSoundPool.play(mBeepTwice, 1.0f, 1.0f, 0, 0, 1.0f);
} else if (newVal <= 3) {