Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 23bbe02b authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by Android (Google) Code Review
Browse files

Merge "No AudioFocus for notifications when media played remotely"

parents 0450086a 97ad2cd1
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ public class NotificationPlayer implements OnCompletionListener {
                    player.prepare();
                    if ((mCmd.uri != null) && (mCmd.uri.getEncodedPath() != null)
                            && (mCmd.uri.getEncodedPath().length() > 0)) {
                        if (!audioManager.isMusicActiveRemotely()) {
                            if (mCmd.looping) {
                                audioManager.requestAudioFocus(null, mCmd.stream,
                                        AudioManager.AUDIOFOCUS_GAIN);
@@ -98,6 +99,7 @@ public class NotificationPlayer implements OnCompletionListener {
                                        AudioManager.AUDIOFOCUS_GAIN_TRANSIENT_MAY_DUCK);
                            }
                        }
                    }
                    player.setOnCompletionListener(NotificationPlayer.this);
                    player.start();
                    if (mPlayer != null) {