Skip to content

Commit 0273af5

Browse files
committed
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
1 parent bff6a51 commit 0273af5

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

media/java/android/media/AudioManager.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,9 +911,18 @@ public boolean isStreamMute(int streamType) {
911911
* @hide
912912
*/
913913
public void setMasterMute(boolean state) {
914+
setMasterMute(state, FLAG_SHOW_UI);
915+
}
916+
917+
/**
918+
* set master mute state with optional flags.
919+
*
920+
* @hide
921+
*/
922+
public void setMasterMute(boolean state, int flags) {
914923
IAudioService service = getService();
915924
try {
916-
service.setMasterMute(state, mICallBack);
925+
service.setMasterMute(state, flags, mICallBack);
917926
} catch (RemoteException e) {
918927
Log.e(TAG, "Dead object in setMasterMute", e);
919928
}

media/java/android/media/AudioService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,13 +779,13 @@ public boolean isStreamMute(int streamType) {
779779
}
780780

781781
/** @see AudioManager#setMasterMute(boolean, IBinder) */
782-
public void setMasterMute(boolean state, IBinder cb) {
782+
public void setMasterMute(boolean state, int flags, IBinder cb) {
783783
if (state != AudioSystem.getMasterMute()) {
784784
AudioSystem.setMasterMute(state);
785785
// Post a persist master volume msg
786786
sendMsg(mAudioHandler, MSG_PERSIST_MASTER_VOLUME_MUTE, 0, SENDMSG_REPLACE, state ? 1
787787
: 0, 0, null, PERSIST_DELAY);
788-
sendMasterMuteUpdate(state, AudioManager.FLAG_SHOW_UI);
788+
sendMasterMuteUpdate(state, flags);
789789
}
790790
}
791791

media/java/android/media/IAudioService.aidl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ interface IAudioService {
4545

4646
boolean isStreamMute(int streamType);
4747

48-
void setMasterMute(boolean state, IBinder cb);
48+
void setMasterMute(boolean state, int flags, IBinder cb);
4949

5050
boolean isMasterMute();
5151

0 commit comments

Comments
 (0)