- streamType
- The stream to be muted/unmuted.
- state
- The required mute state: true for mute ON, false for mute OFF
Mute or unmute an audio stream.
The mute command is protected against client process death: if a process with an active mute request on a stream dies, this stream will be unmuted automatically.
The mute requests for a given stream are cumulative: the AudioManager can receive several mute requests from one or more clients and the stream will be unmuted only when the same number of unmute requests are received.
For a better user experience, applications MUST unmute a muted stream in onPause() and mute is again in onResume() if appropriate.
This method should only be used by applications that replace the platform-wide management of audio settings or the main telephony application.
This method has no effect if the device implements a fixed volume policy as indicated by AudioManager.IsVolumeFixed.