Merge "AudioService: fix VolumeShaper operation for muteAwaitConnection" into tm-dev am: 57961f0cf5 am: 372bc1c3bd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18624718 Change-Id: I692cd50fa04000000f1cb45694cfdfff09f7f7f8 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -9171,7 +9171,7 @@ public class AudioService extends IAudioService.Stub
|
||||
throw new IllegalArgumentException("Invalid timeOutMs/usagesToMute");
|
||||
}
|
||||
Log.i(TAG, "muteAwaitConnection dev:" + device + " timeOutMs:" + timeOutMs
|
||||
+ " usages:" + usages);
|
||||
+ " usages:" + Arrays.toString(usages));
|
||||
|
||||
if (mDeviceBroker.isDeviceConnected(device)) {
|
||||
// not throwing an exception as there could be a race between a connection (server-side,
|
||||
@@ -9223,7 +9223,7 @@ public class AudioService extends IAudioService.Stub
|
||||
mutedUsages = mMutedUsagesAwaitingConnection;
|
||||
mMutingExpectedDevice = null;
|
||||
mMutedUsagesAwaitingConnection = null;
|
||||
mPlaybackMonitor.cancelMuteAwaitConnection();
|
||||
mPlaybackMonitor.cancelMuteAwaitConnection("cancelMuteAwaitConnection dev:" + device);
|
||||
}
|
||||
dispatchMuteAwaitConnection(cb -> { try { cb.dispatchOnUnmutedEvent(
|
||||
AudioManager.MuteAwaitConnectionCallback.EVENT_CANCEL, device, mutedUsages);
|
||||
@@ -9259,8 +9259,8 @@ public class AudioService extends IAudioService.Stub
|
||||
}
|
||||
mMutingExpectedDevice = null;
|
||||
mMutedUsagesAwaitingConnection = null;
|
||||
Log.i(TAG, "muteAwaitConnection device " + device + " connected, unmuting");
|
||||
mPlaybackMonitor.cancelMuteAwaitConnection();
|
||||
mPlaybackMonitor.cancelMuteAwaitConnection(
|
||||
"checkMuteAwaitConnection device " + device + " connected, unmuting");
|
||||
}
|
||||
dispatchMuteAwaitConnection(cb -> { try { cb.dispatchOnUnmutedEvent(
|
||||
AudioManager.MuteAwaitConnectionCallback.EVENT_CONNECTION, device, mutedUsages);
|
||||
|
||||
@@ -1170,8 +1170,8 @@ public final class PlaybackActivityMonitor
|
||||
}
|
||||
}
|
||||
|
||||
void cancelMuteAwaitConnection() {
|
||||
sEventLogger.loglogi("cancelMuteAwaitConnection()", TAG);
|
||||
void cancelMuteAwaitConnection(String source) {
|
||||
sEventLogger.loglogi("cancelMuteAwaitConnection() from:" + source, TAG);
|
||||
synchronized (mPlayerLock) {
|
||||
// cancel scheduled timeout, ignore device, only one expected device at a time
|
||||
mEventHandler.removeMessages(MSG_L_TIMEOUT_MUTE_AWAIT_CONNECTION);
|
||||
@@ -1223,7 +1223,7 @@ public final class PlaybackActivityMonitor
|
||||
+ " uid:" + apc.getClientUid())).printLog(TAG));
|
||||
apc.getPlayerProxy().applyVolumeShaper(
|
||||
MUTE_AWAIT_CONNECTION_VSHAPE,
|
||||
PLAY_CREATE_IF_NEEDED);
|
||||
PLAY_SKIP_RAMP);
|
||||
mMutedPlayersAwaitingConnection.add(apc.getPlayerInterfaceId());
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "awaiting connection: error muting player "
|
||||
|
||||
Reference in New Issue
Block a user