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

This commit is contained in:
Justin Koh
2012-04-05 10:40:29 -07:00
committed by Android (Google) Code Review
3 changed files with 13 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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);
}
}

View File

@@ -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();