summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/SoundClips.java
diff options
context:
space:
mode:
authorSascha Haeberling <haeberling@google.com>2013-04-17 14:55:44 -0700
committerSascha Haeberling <haeberling@google.com>2013-04-17 14:55:44 -0700
commit02cc9b9fbd42edfe6edd6db872f7eec84a274849 (patch)
tree91ae95e4e1696063d51471974689fb073dd8f1c0 /src/com/android/camera/SoundClips.java
parent1b4d875d0434b226182dd37c4756ac468a660b94 (diff)
downloadandroid_packages_apps_Snap-02cc9b9fbd42edfe6edd6db872f7eec84a274849.tar.gz
android_packages_apps_Snap-02cc9b9fbd42edfe6edd6db872f7eec84a274849.tar.bz2
android_packages_apps_Snap-02cc9b9fbd42edfe6edd6db872f7eec84a274849.zip
Add method for returning SoundPool audio type.
Bug: 7402245 Change-Id: Ib45ef78265a66d59f0b27473d9dfcdfa4624c8fa
Diffstat (limited to 'src/com/android/camera/SoundClips.java')
-rw-r--r--src/com/android/camera/SoundClips.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/com/android/camera/SoundClips.java b/src/com/android/camera/SoundClips.java
index 6388fec56..8155c03dc 100644
--- a/src/com/android/camera/SoundClips.java
+++ b/src/com/android/camera/SoundClips.java
@@ -48,6 +48,11 @@ public class SoundClips {
}
}
+ public static int getAudioTypeForSoundPool() {
+ return ApiHelper.getIntFieldIfExists(AudioManager.class,
+ "STREAM_SYSTEM_ENFORCED", null, AudioManager.STREAM_RING);
+ }
+
/**
* This class implements SoundClips.Player using MediaActionSound,
* which exists since API level 16.
@@ -121,12 +126,10 @@ public class SoundClips {
public SoundPoolPlayer(Context context) {
mContext = context;
- int audioType = ApiHelper.getIntFieldIfExists(AudioManager.class,
- "STREAM_SYSTEM_ENFORCED", null, AudioManager.STREAM_RING);
mSoundIDToPlay = ID_NOT_LOADED;
- mSoundPool = new SoundPool(NUM_SOUND_STREAMS, audioType, 0);
+ mSoundPool = new SoundPool(NUM_SOUND_STREAMS, getAudioTypeForSoundPool(), 0);
mSoundPool.setOnLoadCompleteListener(this);
mSoundIDs = new int[SOUND_RES.length];