Merge "Merge "Stop InCall Notification to avoid track leak" am: b47c9019b5 am: 1105966734" into pi-dev-plus-aosp
This commit is contained in:
committed by
Android (Google) Code Review
commit
e89aa91d11
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user