diff options
| author | 2013-02-13 19:37:44 +0000 | |
|---|---|---|
| committer | 2013-02-13 19:37:45 +0000 | |
| commit | 23bbe02b363bb96bd56d4008141e8cf800bb46b7 (patch) | |
| tree | 7f386b928c96d80cf59d7f496d555628d9ae22d9 | |
| parent | 0450086a845709091e176f142d60dbe553c1bce3 (diff) | |
| parent | 97ad2cd1a80eef7db0fe19f15c417de4fa752519 (diff) | |
Merge "No AudioFocus for notifications when media played remotely"
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/media/NotificationPlayer.java | 14 |
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 6a12eb1916aa..ba2fbe3d6f2e 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); |