Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8468834d authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "AudioService: fix VolumeShaper operation for muteAwaitConnection" into tm-dev am: 57961f0c

parents f072aa97 57961f0c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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);
+3 −3
Original line number Diff line number Diff line
@@ -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 "