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

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

Clear calling identity before getting the current user.

This is necessary so non-privilged apps can call setInterruptionFilter.

Bug: 23156657
Change-Id: Ia903a39626c93957276d66805446cd25a91341b5
parent bd29b07e
Loading
Loading
Loading
Loading
+20 −14
Original line number Diff line number Diff line
@@ -3615,6 +3615,9 @@ public class NotificationManagerService extends SystemService {

        public ArraySet<String> getGrantedPackages() {
            final ArraySet<String> pkgs = new ArraySet<>();

            long identity = Binder.clearCallingIdentity();
            try {
                final String setting = Settings.Secure.getStringForUser(
                        getContext().getContentResolver(),
                        Settings.Secure.ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES,
@@ -3632,6 +3635,9 @@ public class NotificationManagerService extends SystemService {
                        pkgs.add(token);
                    }
                }
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
            return pkgs;
        }