diff options
author | RoboErik <epastern@google.com> | 2015-01-21 15:45:32 -0800 |
---|---|---|
committer | RoboErik <epastern@google.com> | 2015-01-29 16:14:30 -0800 |
commit | 4197cb60bc74629fe4c04ab10cb3b1c9a7427d24 (patch) | |
tree | 04c5eed56571406e90aaee427df07a8ca688a4c3 /services/devicepolicy | |
parent | 8bd95f16235fccbcdcaf102fea56b4c436827527 (diff) | |
download | frameworks_base-4197cb60bc74629fe4c04ab10cb3b1c9a7427d24.zip frameworks_base-4197cb60bc74629fe4c04ab10cb3b1c9a7427d24.tar.gz frameworks_base-4197cb60bc74629fe4c04ab10cb3b1c9a7427d24.tar.bz2 |
Move mute/unmute handling to adjust volume paths
This deprecates the setStreamMute and setStreamSolo APIs. Soloing is no
longer supported and muting is redirected through the adjust volume APIs.
Also updates the hidden master versions of these APIs.
Change-Id: I65d2a5d5fc15b386bd497abf8ca6869fec75a26a
Diffstat (limited to 'services/devicepolicy')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index e4d0b77..ecb3c27 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -3920,7 +3920,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Bundle userRestrictions = mUserManager.getUserRestrictions(); mUserManager.setUserRestrictions(new Bundle(), userHandle); if (userRestrictions.getBoolean(UserManager.DISALLOW_ADJUST_VOLUME)) { - audioManager.setMasterMute(false); + audioManager.adjustMasterVolume(AudioManager.ADJUST_UNMUTE, 0); } if (userRestrictions.getBoolean(UserManager.DISALLOW_UNMUTE_MICROPHONE)) { audioManager.setMicrophoneMute(false); @@ -4841,7 +4841,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (UserManager.DISALLOW_UNMUTE_MICROPHONE.equals(key)) { iAudioService.setMicrophoneMute(true, who.getPackageName()); } else if (UserManager.DISALLOW_ADJUST_VOLUME.equals(key)) { - iAudioService.setMasterMute(true, 0, who.getPackageName(), null); + iAudioService.adjustMasterVolume(AudioManager.ADJUST_MUTE, 0, + who.getPackageName()); } } catch (RemoteException re) { Slog.e(LOG_TAG, "Failed to talk to AudioService.", re); @@ -4906,7 +4907,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { if (UserManager.DISALLOW_UNMUTE_MICROPHONE.equals(key)) { iAudioService.setMicrophoneMute(false, who.getPackageName()); } else if (UserManager.DISALLOW_ADJUST_VOLUME.equals(key)) { - iAudioService.setMasterMute(false, 0, who.getPackageName(), null); + iAudioService.adjustMasterVolume(AudioManager.ADJUST_UNMUTE, 0, + who.getPackageName()); } } catch (RemoteException re) { Slog.e(LOG_TAG, "Failed to talk to AudioService.", re); @@ -5372,7 +5374,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { IAudioService iAudioService = IAudioService.Stub.asInterface( ServiceManager.getService(Context.AUDIO_SERVICE)); try{ - iAudioService.setMasterMute(on, 0, who.getPackageName(), null); + iAudioService.adjustMasterVolume( + on ? AudioManager.ADJUST_MUTE : AudioManager.ADJUST_UNMUTE, 0, + who.getPackageName()); } catch (RemoteException re) { Slog.e(LOG_TAG, "Failed to setMasterMute", re); } |