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

Commit 0273af55 authored by Justin Koh's avatar Justin Koh
Browse files

Adds flag argument to setMasterMute.

Adds flag argument to setMasterMute. This allows third parties to edit it
without showing the UI, for example.

TESTED = runs on Tungsten.

Change-Id: Idfd99a2476e60059cd93c9dfe07d03a389c3f5f5
parent bff6a514
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -911,9 +911,18 @@ public class AudioManager {
     * @hide
     */
    public void setMasterMute(boolean state) {
        setMasterMute(state, FLAG_SHOW_UI);
    }

    /**
     * set master mute state with optional flags.
     *
     * @hide
     */
    public void setMasterMute(boolean state, int flags) {
        IAudioService service = getService();
        try {
            service.setMasterMute(state, mICallBack);
            service.setMasterMute(state, flags, mICallBack);
        } catch (RemoteException e) {
            Log.e(TAG, "Dead object in setMasterMute", e);
        }
+2 −2
Original line number Diff line number Diff line
@@ -779,13 +779,13 @@ public class AudioService extends IAudioService.Stub {
    }

    /** @see AudioManager#setMasterMute(boolean, IBinder) */
    public void setMasterMute(boolean state, IBinder cb) {
    public void setMasterMute(boolean state, int flags, IBinder cb) {
        if (state != AudioSystem.getMasterMute()) {
            AudioSystem.setMasterMute(state);
            // Post a persist master volume msg
            sendMsg(mAudioHandler, MSG_PERSIST_MASTER_VOLUME_MUTE, 0, SENDMSG_REPLACE, state ? 1
                    : 0, 0, null, PERSIST_DELAY);
            sendMasterMuteUpdate(state, AudioManager.FLAG_SHOW_UI);
            sendMasterMuteUpdate(state, flags);
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ interface IAudioService {

    boolean isStreamMute(int streamType);

    void setMasterMute(boolean state, IBinder cb);
    void setMasterMute(boolean state, int flags, IBinder cb);

    boolean isMasterMute();