Merge "AudioService: prevent NPE on an invalid PIID"
This commit is contained in:
committed by
Android (Google) Code Review
commit
827225b46d
@@ -106,7 +106,9 @@ public final class PlaybackActivityMonitor
|
||||
synchronized(mPlayerLock) {
|
||||
final AudioPlaybackConfiguration apc = mPlayers.get(new Integer(piid));
|
||||
// FIXME SoundPool not ready for state reporting
|
||||
if (apc.getPlayerType() == AudioPlaybackConfiguration.PLAYER_TYPE_JAM_SOUNDPOOL) {
|
||||
if (apc != null
|
||||
&& apc.getPlayerType() == AudioPlaybackConfiguration.PLAYER_TYPE_JAM_SOUNDPOOL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (checkConfigurationCaller(piid, apc, binderUid)) {
|
||||
@@ -278,6 +280,9 @@ public final class PlaybackActivityMonitor
|
||||
while (piidIterator.hasNext()) {
|
||||
final Integer piid = piidIterator.next();
|
||||
final AudioPlaybackConfiguration apc = mPlayers.get(piid);
|
||||
if (apc == null) {
|
||||
continue;
|
||||
}
|
||||
if (!winner.hasSameUid(apc.getClientUid())
|
||||
&& loser.hasSameUid(apc.getClientUid())
|
||||
&& apc.getPlayerState() == AudioPlaybackConfiguration.PLAYER_STATE_STARTED)
|
||||
@@ -363,6 +368,9 @@ public final class PlaybackActivityMonitor
|
||||
while (piidIterator.hasNext()) {
|
||||
final Integer piid = piidIterator.next();
|
||||
final AudioPlaybackConfiguration apc = mPlayers.get(piid);
|
||||
if (apc == null) {
|
||||
continue;
|
||||
}
|
||||
final int playerUsage = apc.getAudioAttributes().getUsage();
|
||||
boolean mute = false;
|
||||
for (int usageToMute : usagesToMute) {
|
||||
|
||||
Reference in New Issue
Block a user