summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSascha Haeberling <haeberling@google.com>2013-04-18 01:48:34 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-18 01:48:34 +0000
commit49ee213fbb0f3434002693889bdae3e7c0d5b378 (patch)
tree309654352061d062424dc10cfc5c1ef54bdabb18 /src
parent12cd022273f14a64d9cdf79aa6a27feb099b9107 (diff)
parenteb8562ae2a6614a0d06d2511ea388c3499fe7480 (diff)
downloadandroid_packages_apps_Gallery2-49ee213fbb0f3434002693889bdae3e7c0d5b378.tar.gz
android_packages_apps_Gallery2-49ee213fbb0f3434002693889bdae3e7c0d5b378.tar.bz2
android_packages_apps_Gallery2-49ee213fbb0f3434002693889bdae3e7c0d5b378.zip
Merge "Add method for returning SoundPool audio type." into gb-ub-photos-bryce
Diffstat (limited to 'src')
-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];