Loading api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5205,6 +5205,7 @@ package android.app.admin { method public boolean isApplicationBlocked(android.content.ComponentName, java.lang.String); method public boolean isDeviceOwnerApp(java.lang.String); method public boolean isLockTaskPermitted(android.content.ComponentName); method public boolean isMasterVolumeMuted(android.content.ComponentName); method public boolean isProfileOwnerApp(java.lang.String); method public void lockNow(); method public void removeActiveAdmin(android.content.ComponentName); Loading @@ -5218,6 +5219,7 @@ package android.app.admin { method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String); method public void setKeyguardDisabledFeatures(android.content.ComponentName, int); method public void setLockTaskComponents(android.content.ComponentName[]) throws java.lang.SecurityException; method public void setMasterVolumeMuted(android.content.ComponentName, boolean); method public void setMaximumFailedPasswordsForWipe(android.content.ComponentName, int); method public void setMaximumTimeToLock(android.content.ComponentName, long); method public void setPasswordExpirationTimeout(android.content.ComponentName, long); core/java/android/app/admin/DevicePolicyManager.java +34 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.RestrictionsManager; import android.media.AudioService; import android.net.ProxyInfo; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -2406,4 +2407,37 @@ public class DevicePolicyManager { } } } /** * Called by profile or device owners to set the master volume mute on or off. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param on {@code true} to mute master volume, {@code false} to turn mute off. */ public void setMasterVolumeMuted(ComponentName admin, boolean on) { if (mService != null) { try { mService.setMasterVolumeMuted(admin, on); } catch (RemoteException re) { Log.w(TAG, "Failed to setMasterMute on device policy service"); } } } /** * Called by profile or device owners to check whether the master volume mute is on or off. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @return {@code true} if master volume is muted, {@code false} if it's not. */ public boolean isMasterVolumeMuted(ComponentName admin) { if (mService != null) { try { return mService.isMasterVolumeMuted(admin); } catch (RemoteException re) { Log.w(TAG, "Failed to get isMasterMute on device policy service"); } } return false; } } core/java/android/app/admin/IDevicePolicyManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -147,4 +147,7 @@ interface IDevicePolicyManager { void setGlobalSetting(in ComponentName who, in String setting, in String value); void setSecureSetting(in ComponentName who, in String setting, in String value); void setMasterVolumeMuted(in ComponentName admin, boolean on); boolean isMasterVolumeMuted(in ComponentName admin); } media/java/android/media/AudioManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1017,7 +1017,7 @@ public class AudioManager { public void setMasterMute(boolean state, int flags) { IAudioService service = getService(); try { service.setMasterMute(state, flags, mICallBack); service.setMasterMute(state, flags, mContext.getOpPackageName(), mICallBack); } catch (RemoteException e) { Log.e(TAG, "Dead object in setMasterMute", e); } Loading media/java/android/media/AudioService.java +6 −1 Original line number Diff line number Diff line Loading @@ -1321,11 +1321,16 @@ public class AudioService extends IAudioService.Stub { } /** @see AudioManager#setMasterMute(boolean, int) */ public void setMasterMute(boolean state, int flags, IBinder cb) { public void setMasterMute(boolean state, int flags, String callingPackage, IBinder cb) { if (mUseFixedVolume) { return; } if (mAppOps.noteOp(AppOpsManager.OP_AUDIO_MASTER_VOLUME, Binder.getCallingUid(), callingPackage) != AppOpsManager.MODE_ALLOWED) { return; } if (state != AudioSystem.getMasterMute()) { AudioSystem.setMasterMute(state); // Post a persist master volume msg Loading Loading
api/current.txt +2 −0 Original line number Diff line number Diff line Loading @@ -5205,6 +5205,7 @@ package android.app.admin { method public boolean isApplicationBlocked(android.content.ComponentName, java.lang.String); method public boolean isDeviceOwnerApp(java.lang.String); method public boolean isLockTaskPermitted(android.content.ComponentName); method public boolean isMasterVolumeMuted(android.content.ComponentName); method public boolean isProfileOwnerApp(java.lang.String); method public void lockNow(); method public void removeActiveAdmin(android.content.ComponentName); Loading @@ -5218,6 +5219,7 @@ package android.app.admin { method public void setGlobalSetting(android.content.ComponentName, java.lang.String, java.lang.String); method public void setKeyguardDisabledFeatures(android.content.ComponentName, int); method public void setLockTaskComponents(android.content.ComponentName[]) throws java.lang.SecurityException; method public void setMasterVolumeMuted(android.content.ComponentName, boolean); method public void setMaximumFailedPasswordsForWipe(android.content.ComponentName, int); method public void setMaximumTimeToLock(android.content.ComponentName, long); method public void setPasswordExpirationTimeout(android.content.ComponentName, long);
core/java/android/app/admin/DevicePolicyManager.java +34 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.content.pm.ActivityInfo; import android.content.pm.PackageManager; import android.content.pm.ResolveInfo; import android.content.RestrictionsManager; import android.media.AudioService; import android.net.ProxyInfo; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -2406,4 +2407,37 @@ public class DevicePolicyManager { } } } /** * Called by profile or device owners to set the master volume mute on or off. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @param on {@code true} to mute master volume, {@code false} to turn mute off. */ public void setMasterVolumeMuted(ComponentName admin, boolean on) { if (mService != null) { try { mService.setMasterVolumeMuted(admin, on); } catch (RemoteException re) { Log.w(TAG, "Failed to setMasterMute on device policy service"); } } } /** * Called by profile or device owners to check whether the master volume mute is on or off. * * @param admin Which {@link DeviceAdminReceiver} this request is associated with. * @return {@code true} if master volume is muted, {@code false} if it's not. */ public boolean isMasterVolumeMuted(ComponentName admin) { if (mService != null) { try { return mService.isMasterVolumeMuted(admin); } catch (RemoteException re) { Log.w(TAG, "Failed to get isMasterMute on device policy service"); } } return false; } }
core/java/android/app/admin/IDevicePolicyManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -147,4 +147,7 @@ interface IDevicePolicyManager { void setGlobalSetting(in ComponentName who, in String setting, in String value); void setSecureSetting(in ComponentName who, in String setting, in String value); void setMasterVolumeMuted(in ComponentName admin, boolean on); boolean isMasterVolumeMuted(in ComponentName admin); }
media/java/android/media/AudioManager.java +1 −1 Original line number Diff line number Diff line Loading @@ -1017,7 +1017,7 @@ public class AudioManager { public void setMasterMute(boolean state, int flags) { IAudioService service = getService(); try { service.setMasterMute(state, flags, mICallBack); service.setMasterMute(state, flags, mContext.getOpPackageName(), mICallBack); } catch (RemoteException e) { Log.e(TAG, "Dead object in setMasterMute", e); } Loading
media/java/android/media/AudioService.java +6 −1 Original line number Diff line number Diff line Loading @@ -1321,11 +1321,16 @@ public class AudioService extends IAudioService.Stub { } /** @see AudioManager#setMasterMute(boolean, int) */ public void setMasterMute(boolean state, int flags, IBinder cb) { public void setMasterMute(boolean state, int flags, String callingPackage, IBinder cb) { if (mUseFixedVolume) { return; } if (mAppOps.noteOp(AppOpsManager.OP_AUDIO_MASTER_VOLUME, Binder.getCallingUid(), callingPackage) != AppOpsManager.MODE_ALLOWED) { return; } if (state != AudioSystem.getMasterMute()) { AudioSystem.setMasterMute(state); // Post a persist master volume msg Loading