diff options
-rwxr-xr-x | src/com/android/camera/ui/CountDownView.java | 13 |
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) { |