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

Commit 74272138 authored by Ruben Brunk's avatar Ruben Brunk
Browse files

Fix admin check in Settings.

- This check is broken when there are no Admins on the device.
- Blocks enabling NotificationListenerServices in Settings.

Change-Id: I2c30daf2fc4632d55e84f0e499e3ceedbe162b98
parent e33d41f8
Loading
Loading
Loading
Loading
+12 −10
Original line number Diff line number Diff line
@@ -128,6 +128,7 @@ public class RestrictedLockUtils {
        boolean isDisabledByMultipleAdmins = false;
        ComponentName adminComponent = null;
        List<ComponentName> admins = dpm.getActiveAdmins();
        if (admins != null) {
            int disabledKeyguardFeatures;
            for (ComponentName admin : admins) {
                disabledKeyguardFeatures = dpm.getKeyguardDisabledFeatures(admin);
@@ -140,6 +141,7 @@ public class RestrictedLockUtils {
                    }
                }
            }
        }
        EnforcedAdmin enforcedAdmin = null;
        if (adminComponent != null) {
            if (!isDisabledByMultipleAdmins) {