Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca4a835a authored by Ariana Mott's avatar Ariana Mott Committed by Android (Google) Code Review
Browse files

Merge "Remove package AutomaticZenRules for revoked Notification Policy Access" into nyc-dev

parents d3caf46a 0c9ac648
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -490,8 +490,15 @@ public class VrManagerService extends SystemService implements EnabledComponentC
    private void revokeNotificationPolicyAccess(String pkg) {
        NotificationManager nm = mContext.getSystemService(NotificationManager.class);
        if (mPreviousNotificationPolicyAccessPackage != null) {
            if (mPreviousNotificationPolicyAccessPackage.equals(pkg)) {
                // Remove any DND zen rules possibly created by the package.
                nm.removeAutomaticZenRules(mPreviousNotificationPolicyAccessPackage);
                // Remove Notification Policy Access.
                nm.setNotificationPolicyAccessGranted(mPreviousNotificationPolicyAccessPackage, false);
                mPreviousNotificationPolicyAccessPackage = null;
            } else {
                Slog.e(TAG, "Couldn't remove Notification Policy Access for package: " + pkg);
            }
        }
    }