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

Commit 8754d401 authored by Jay Aliomer's avatar Jay Aliomer
Browse files

Don't disable DND permission settings for apps that have disabled NLS

ZenAccessController.getPackagesRequestingNotificationPolicyAccess
was including disabled packages.
We change this behavior to exclude any disabled package

Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.applications.specialaccess.zenaccess.ZenAccessControllerTest"
Change-Id: I354b8f0bdbf602d1f35233d5003ce09f01df3cb2
Fix: 141318822
parent 8ed25688
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -70,9 +70,11 @@ public class ZenAccessController extends BasePreferenceController {
            final List<PackageInfo> pkgs = list.getList();
            if (pkgs != null) {
                for (PackageInfo info : pkgs) {
                    if (info.applicationInfo.enabled) {
                        requestingPackages.add(info.packageName);
                    }
                }
            }
        } catch (RemoteException e) {
            Log.e(TAG, "Cannot reach packagemanager", e);
        }
+0 −1
Original line number Diff line number Diff line
@@ -114,7 +114,6 @@ public class ZenAccessSettings extends EmptyTextSettings implements
        }
        ArraySet<String> autoApproved = new ArraySet<>();
        autoApproved.addAll(mNoMan.getEnabledNotificationListenerPackages());
        requesting.addAll(autoApproved);
        Collections.sort(apps, new PackageItemInfo.DisplayNameComparator(mPkgMan));
        for (ApplicationInfo app : apps) {
            final String pkg = app.packageName;