diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2012-09-25 09:42:54 -0700 |
---|---|---|
committer | Jean-Baptiste Queru <jbq@google.com> | 2012-09-25 09:42:57 -0700 |
commit | bf2e088b008cdc80059b943c3b144ec982963f4e (patch) | |
tree | cc03b5f732c3ed2dc83f6c9885d28c902c9eab51 /media/java | |
parent | 164ff6bb64ad022366e9fdec9b40bcedcbb3925a (diff) | |
parent | 9903e2638a6c502d96413680d3ebae4fb77fc412 (diff) | |
download | frameworks_base-bf2e088b008cdc80059b943c3b144ec982963f4e.zip frameworks_base-bf2e088b008cdc80059b943c3b144ec982963f4e.tar.gz frameworks_base-bf2e088b008cdc80059b943c3b144ec982963f4e.tar.bz2 |
Merge into jb-mr1-dev
Change-Id: Iba23d16643b8754f6e0a7288b2ca242f722f1bdd
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioService.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index c366a8d..94b510f 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -388,9 +388,11 @@ public class AudioService extends IAudioService.Stub implements OnFinished { private Looper mSoundPoolLooper = null; // volume applied to sound played with playSoundEffect() private static int sSoundEffectVolumeDb; - // getActiveStreamType() will return STREAM_NOTIFICATION during this period after a notification + // getActiveStreamType() will return: + // - STREAM_NOTIFICATION on tablets during this period after a notification stopped + // - STREAM_MUSIC on phones during this period after music or talkback/voice search prompt // stopped - private static final int NOTIFICATION_VOLUME_DELAY_MS = 5000; + private static final int DEFAULT_STREAM_TYPE_OVERRIDE_DELAY_MS = 5000; // previous volume adjustment direction received by checkForRingerModeChange() private int mPrevVolDirection = AudioManager.ADJUST_SAME; // Keyguard manager proxy @@ -2341,7 +2343,8 @@ public class AudioService extends IAudioService.Stub implements OnFinished { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: Forcing STREAM_REMOTE_MUSIC"); return STREAM_REMOTE_MUSIC; - } else if (AudioSystem.isStreamActive(AudioSystem.STREAM_MUSIC, 0)) { + } else if (AudioSystem.isStreamActive(AudioSystem.STREAM_MUSIC, + DEFAULT_STREAM_TYPE_OVERRIDE_DELAY_MS)) { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: Forcing STREAM_MUSIC stream active"); return AudioSystem.STREAM_MUSIC; @@ -2370,9 +2373,9 @@ public class AudioService extends IAudioService.Stub implements OnFinished { return AudioSystem.STREAM_VOICE_CALL; } } else if (AudioSystem.isStreamActive(AudioSystem.STREAM_NOTIFICATION, - NOTIFICATION_VOLUME_DELAY_MS) || + DEFAULT_STREAM_TYPE_OVERRIDE_DELAY_MS) || AudioSystem.isStreamActive(AudioSystem.STREAM_RING, - NOTIFICATION_VOLUME_DELAY_MS)) { + DEFAULT_STREAM_TYPE_OVERRIDE_DELAY_MS)) { if (DEBUG_VOL) Log.v(TAG, "getActiveStreamType: Forcing STREAM_NOTIFICATION"); return AudioSystem.STREAM_NOTIFICATION; } else if (suggestedStreamType == AudioManager.USE_DEFAULT_STREAM_TYPE) { |