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

Commit db9b114b authored by Justin Koh's avatar Justin Koh Committed by Android (Google) Code Review
Browse files

Merge "Adds flag argument to setMasterMute." into ics-aah

parents 31361742 0273af55
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -911,9 +911,18 @@ public class AudioManager {
     * @hide
     * @hide
     */
     */
    public void setMasterMute(boolean state) {
    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();
        IAudioService service = getService();
        try {
        try {
            service.setMasterMute(state, mICallBack);
            service.setMasterMute(state, flags, mICallBack);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
            Log.e(TAG, "Dead object in setMasterMute", e);
            Log.e(TAG, "Dead object in setMasterMute", e);
        }
        }
+2 −2
Original line number Original line Diff line number Diff line
@@ -779,13 +779,13 @@ public class AudioService extends IAudioService.Stub {
    }
    }


    /** @see AudioManager#setMasterMute(boolean, IBinder) */
    /** @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()) {
        if (state != AudioSystem.getMasterMute()) {
            AudioSystem.setMasterMute(state);
            AudioSystem.setMasterMute(state);
            // Post a persist master volume msg
            // Post a persist master volume msg
            sendMsg(mAudioHandler, MSG_PERSIST_MASTER_VOLUME_MUTE, 0, SENDMSG_REPLACE, state ? 1
            sendMsg(mAudioHandler, MSG_PERSIST_MASTER_VOLUME_MUTE, 0, SENDMSG_REPLACE, state ? 1
                    : 0, 0, null, PERSIST_DELAY);
                    : 0, 0, null, PERSIST_DELAY);
            sendMasterMuteUpdate(state, AudioManager.FLAG_SHOW_UI);
            sendMasterMuteUpdate(state, flags);
        }
        }
    }
    }


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


    boolean isStreamMute(int streamType);
    boolean isStreamMute(int streamType);


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


    boolean isMasterMute();
    boolean isMasterMute();