Loading core/java/android/app/INotificationManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ interface INotificationManager AutomaticZenRule addAutomaticZenRule(in AutomaticZenRule automaticZenRule); boolean updateAutomaticZenRule(in AutomaticZenRule automaticZenRule); boolean removeAutomaticZenRule(String id); boolean removeAutomaticZenRules(String packageName); byte[] getBackupPayload(int user); void applyRestore(in byte[] payload, int user); Loading core/java/android/app/NotificationManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,20 @@ public class NotificationManager return false; } /** * Deletes all automatic zen rules owned by the given package. * * @hide */ public boolean removeAutomaticZenRules(String packageName) { INotificationManager service = getService(); try { return service.removeAutomaticZenRules(packageName); } catch (RemoteException e) { } return false; } /** * Checks the ability to read/modify notification policy for the calling package. * Loading core/java/android/service/notification/ZenModeConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -1110,7 +1110,7 @@ public class ZenModeConfig implements Parcelable { if (!Objects.equals(id, to.id)) { d.addLine(item, "id", id, to.id); } if (creationTime == to.creationTime) { if (creationTime != to.creationTime) { d.addLine(item, "creationTime", creationTime, to.creationTime); } } Loading services/core/java/com/android/server/am/ActivityManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -5389,6 +5389,11 @@ public final class ActivityManagerService extends ActivityManagerNative removeUriPermissionsForPackageLocked(packageName, userId, true); } // Remove all zen rules created by this package; revoke it's zen access. INotificationManager inm = NotificationManager.getService(); inm.removeAutomaticZenRules(packageName); inm.setNotificationPolicyAccessGranted(packageName, false); Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED, Uri.fromParts("package", packageName, null)); intent.putExtra(Intent.EXTRA_UID, pkgUid); Loading services/core/java/com/android/server/notification/NotificationManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -1633,6 +1633,14 @@ public class NotificationManagerService extends SystemService { return mZenModeHelper.removeAutomaticZenRule(id, "removeAutomaticZenRule"); } @Override public boolean removeAutomaticZenRules(String packageName) throws RemoteException { Preconditions.checkNotNull(packageName, "Package name is null"); enforceSystemOrSystemUI("removeAutomaticZenRules"); return mZenModeHelper.removeAutomaticZenRules(packageName, "removeAutomaticZenRules"); } @Override public void setInterruptionFilter(String pkg, int filter) throws RemoteException { enforcePolicyAccess(pkg, "setInterruptionFilter"); Loading Loading
core/java/android/app/INotificationManager.aidl +1 −0 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ interface INotificationManager AutomaticZenRule addAutomaticZenRule(in AutomaticZenRule automaticZenRule); boolean updateAutomaticZenRule(in AutomaticZenRule automaticZenRule); boolean removeAutomaticZenRule(String id); boolean removeAutomaticZenRules(String packageName); byte[] getBackupPayload(int user); void applyRestore(in byte[] payload, int user); Loading
core/java/android/app/NotificationManager.java +14 −0 Original line number Diff line number Diff line Loading @@ -469,6 +469,20 @@ public class NotificationManager return false; } /** * Deletes all automatic zen rules owned by the given package. * * @hide */ public boolean removeAutomaticZenRules(String packageName) { INotificationManager service = getService(); try { return service.removeAutomaticZenRules(packageName); } catch (RemoteException e) { } return false; } /** * Checks the ability to read/modify notification policy for the calling package. * Loading
core/java/android/service/notification/ZenModeConfig.java +1 −1 Original line number Diff line number Diff line Loading @@ -1110,7 +1110,7 @@ public class ZenModeConfig implements Parcelable { if (!Objects.equals(id, to.id)) { d.addLine(item, "id", id, to.id); } if (creationTime == to.creationTime) { if (creationTime != to.creationTime) { d.addLine(item, "creationTime", creationTime, to.creationTime); } } Loading
services/core/java/com/android/server/am/ActivityManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -5389,6 +5389,11 @@ public final class ActivityManagerService extends ActivityManagerNative removeUriPermissionsForPackageLocked(packageName, userId, true); } // Remove all zen rules created by this package; revoke it's zen access. INotificationManager inm = NotificationManager.getService(); inm.removeAutomaticZenRules(packageName); inm.setNotificationPolicyAccessGranted(packageName, false); Intent intent = new Intent(Intent.ACTION_PACKAGE_DATA_CLEARED, Uri.fromParts("package", packageName, null)); intent.putExtra(Intent.EXTRA_UID, pkgUid); Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +8 −0 Original line number Diff line number Diff line Loading @@ -1633,6 +1633,14 @@ public class NotificationManagerService extends SystemService { return mZenModeHelper.removeAutomaticZenRule(id, "removeAutomaticZenRule"); } @Override public boolean removeAutomaticZenRules(String packageName) throws RemoteException { Preconditions.checkNotNull(packageName, "Package name is null"); enforceSystemOrSystemUI("removeAutomaticZenRules"); return mZenModeHelper.removeAutomaticZenRules(packageName, "removeAutomaticZenRules"); } @Override public void setInterruptionFilter(String pkg, int filter) throws RemoteException { enforcePolicyAccess(pkg, "setInterruptionFilter"); Loading