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

Commit a2d0102b authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Apps that can change DND state can also pass audiomanager DND policy checks.

Bug: 27735850
Bug: 27708335
Change-Id: Ia9cc3e6ba93836ddb00d7e709c32da3d6a244f5e
parent e08dc6cb
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -1852,6 +1852,10 @@ public class NotificationManagerService extends SystemService {
        }

        private boolean checkPolicyAccess(String pkg) {
            if (PackageManager.PERMISSION_GRANTED == getContext().checkCallingPermission(
                    android.Manifest.permission.MANAGE_NOTIFICATIONS)) {
                return true;
            }
            if (mAudioManagerInternal != null) {
                final int vcuid = mAudioManagerInternal.getVolumeControllerUid();
                if (vcuid > 0 && Binder.getCallingUid() == vcuid) {
@@ -1952,7 +1956,7 @@ public class NotificationManagerService extends SystemService {
        public boolean isNotificationPolicyAccessGrantedForPackage(String pkg) {;
            enforceSystemOrSystemUIOrSamePackage(pkg,
                    "request policy access status for another package");
            return checkPackagePolicyAccess(pkg);
            return checkPolicyAccess(pkg);
        }

        @Override