summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java14
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java b/packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java
index 6a12eb1..ba2fbe3 100644
--- a/packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java
+++ b/packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java
@@ -90,12 +90,14 @@ public class NotificationPlayer implements OnCompletionListener {
player.prepare();
if ((mCmd.uri != null) && (mCmd.uri.getEncodedPath() != null)
&& (mCmd.uri.getEncodedPath().length() > 0)) {
- if (mCmd.looping) {
- audioManager.requestAudioFocus(null, mCmd.stream,
- AudioManager.AUDIOFOCUS_GAIN);
- } else {
- audioManager.requestAudioFocus(null, mCmd.stream,
- AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK);
+ if (!audioManager.isMusicActiveRemotely()) {
+ if (mCmd.looping) {
+ audioManager.requestAudioFocus(null, mCmd.stream,
+ AudioManager.AUDIOFOCUS_GAIN);
+ } else {
+ audioManager.requestAudioFocus(null, mCmd.stream,
+ AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK);
+ }
}
}
player.setOnCompletionListener(NotificationPlayer.this);