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

Commit a9dfbe8b authored by John Spurlock's avatar John Spurlock
Browse files

Volume: Allow dialog to query "muteable" streams.

Similar to the existing ability to query streams affected
by ringer mode.

Bug:19260237
Change-Id: I76eb5ab6b7c7e3a4d73ac1909289c560194d4fe8
parent b25334ca
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -3330,6 +3330,19 @@ public class AudioManager {
        }
    }

    /**
     * Only useful for volume controllers.
     * @hide
     */
    public boolean isStreamAffectedByMute(int streamType) {
        try {
            return getService().isStreamAffectedByMute(streamType);
        } catch (RemoteException e) {
            Log.w(TAG, "Error calling isStreamAffectedByMute", e);
            return false;
        }
    }

    /**
     * Only useful for volume controllers.
     * @hide
+2 −0
Original line number Diff line number Diff line
@@ -202,6 +202,8 @@ interface IAudioService {

    boolean isStreamAffectedByRingerMode(int streamType);

    boolean isStreamAffectedByMute(int streamType);

    void disableSafeMediaVolume();

    int setHdmiSystemAudioSupported(boolean on);
+1 −0
Original line number Diff line number Diff line
@@ -3208,6 +3208,7 @@ public class AudioService extends IAudioService.Stub {
        return false;
    }

    @Override
    public boolean isStreamAffectedByMute(int streamType) {
        return (mMuteAffectedStreams & (1 << streamType)) != 0;
    }