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

Commit 2ed5718b authored by Jean-Michel Trivi's avatar Jean-Michel Trivi Committed by android-build-merger
Browse files

Merge "AudioService: fix broadcast of ACTION_SPEAKERPHONE_STATE_CHANGED" into qt-dev am: 95baff25

am: 1cc42746

Change-Id: I21300751508dddf5f8ce87c5ee148c15db73e88f
parents c164dc12 1cc42746
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -3368,8 +3368,14 @@ public class AudioService extends IAudioService.Stub
                .append(Binder.getCallingPid()).toString();
        final boolean stateChanged = mDeviceBroker.setSpeakerphoneOn(on, eventSource);
        if (stateChanged) {
            mContext.sendBroadcast(new Intent(AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED)
                    .setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY));
            final long ident = Binder.clearCallingIdentity();
            try {
                mContext.sendBroadcastAsUser(
                        new Intent(AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED)
                                .setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY), UserHandle.ALL);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
        }
    }