diff options
Diffstat (limited to 'services/devicepolicy/java')
-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 5845363..bec0f66 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -3918,7 +3918,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); @@ -4839,7 +4839,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); @@ -4904,7 +4905,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); @@ -5368,7 +5370,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); } |