AudioPlaybackConfiguration release/death: notify listeners
When a player dies or is released, dispatch an update to the AudioPlaybackConfiguration listeners. Bug: 70195346 Test: atest AudioPlaybackConfiguration#testCallbackMediaPlayerRelease Change-Id: Id0b62abb32879d3166da26f20a334d0447183ac0
This commit is contained in:
@@ -267,6 +267,7 @@ public final class PlaybackActivityMonitor
|
||||
|
||||
public void releasePlayer(int piid, int binderUid) {
|
||||
if (DEBUG) { Log.v(TAG, "releasePlayer() for piid=" + piid); }
|
||||
boolean change = false;
|
||||
synchronized(mPlayerLock) {
|
||||
final AudioPlaybackConfiguration apc = mPlayers.get(new Integer(piid));
|
||||
if (checkConfigurationCaller(piid, apc, binderUid)) {
|
||||
@@ -275,9 +276,12 @@ public final class PlaybackActivityMonitor
|
||||
mPlayers.remove(new Integer(piid));
|
||||
mDuckingManager.removeReleased(apc);
|
||||
checkVolumeForPrivilegedAlarm(apc, AudioPlaybackConfiguration.PLAYER_STATE_RELEASED);
|
||||
apc.handleStateEvent(AudioPlaybackConfiguration.PLAYER_STATE_RELEASED);
|
||||
change = apc.handleStateEvent(AudioPlaybackConfiguration.PLAYER_STATE_RELEASED);
|
||||
}
|
||||
}
|
||||
if (change) {
|
||||
dispatchPlaybackChange(true /*iplayerreleased*/);
|
||||
}
|
||||
}
|
||||
|
||||
// Implementation of AudioPlaybackConfiguration.PlayerDeathMonitor
|
||||
|
||||
Reference in New Issue
Block a user