Merge "Merge "Stop InCall Notification to avoid track leak" am: b47c9019b5 am: 1105966734" into pi-dev-plus-aosp

This commit is contained in:
Android Build Merger (Role)
2018-04-18 14:17:51 +00:00
committed by Android (Google) Code Review

View File

@@ -348,6 +348,7 @@ public class NotificationManagerService extends SystemService {
private Uri mInCallNotificationUri; private Uri mInCallNotificationUri;
private AudioAttributes mInCallNotificationAudioAttributes; private AudioAttributes mInCallNotificationAudioAttributes;
private float mInCallNotificationVolume; private float mInCallNotificationVolume;
private Binder mCallNotificationToken = null;
// used as a mutex for access to all active notifications & listeners // used as a mutex for access to all active notifications & listeners
final Object mNotificationLock = new Object(); final Object mNotificationLock = new Object();
@@ -4875,7 +4876,11 @@ public class NotificationManagerService extends SystemService {
try { try {
final IRingtonePlayer player = mAudioManager.getRingtonePlayer(); final IRingtonePlayer player = mAudioManager.getRingtonePlayer();
if (player != null) { if (player != null) {
player.play(new Binder(), mInCallNotificationUri, if (mCallNotificationToken != null) {
player.stop(mCallNotificationToken);
}
mCallNotificationToken = new Binder();
player.play(mCallNotificationToken, mInCallNotificationUri,
mInCallNotificationAudioAttributes, mInCallNotificationAudioAttributes,
mInCallNotificationVolume, false); mInCallNotificationVolume, false);
} }