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

Commit 35c4065a authored by Joel Galenson's avatar Joel Galenson
Browse files

Ensure filtered views are sorted correctly.

Now that we do not show the bar chart in the filtered views, we can
filter out permissions that don't match the chosen view early.  This
fixes a bug where the filtered view would be sorted incorrectly.

Fixes: 129558331
Test: View filtered and unfiltered screens.
Change-Id: I6d2fdcc000b6605a99a8dbddb1ad53729809b9c5
parent 83372671
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -400,6 +400,9 @@ public class PermissionUsageFragment extends SettingsWithLargeHeader implements
                        || groupUsage.getLastAccessTime() < startTime) {
                    continue;
                }
                if (mFilterGroup != null && !mFilterGroup.equals(groupUsage.getGroup().getName())) {
                    continue;
                }
                final boolean isSystemApp = !Utils.isGroupOrBgGroupUserSensitive(
                        groupUsage.getGroup());
                if (!mHasSystemApps) {
@@ -455,9 +458,6 @@ public class PermissionUsageFragment extends SettingsWithLargeHeader implements
            Log.w(LOG_TAG, "Unexpected sort option: " + mSort);
        }

        usages.removeIf((Pair<AppPermissionUsage, GroupUsage> usage) -> mFilterGroup != null
                && !mFilterGroup.equals(usage.second.getGroup().getName()));

        // If there are no entries, don't show anything.
        if (permApps.isEmpty()) {
            screen.removeAll();