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

Commit f5076dfc authored by Lifu Tang's avatar Lifu Tang
Browse files

Filter "Android System" from recent location apps

Bug: 134674484
Test: build, flash, and test manually
Change-Id: I86879e034b6605a4d3db2024f5e27601a45580fd
parent 4127f049
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -90,12 +90,16 @@ public class RecentLocationApps {

        for (int i = 0; i < appOpsCount; ++i) {
            AppOpsManager.PackageOps ops = appOps.get(i);
            // Don't show the Android System in the list - it's not actionable for the user.
            // Also don't show apps belonging to background users except managed users.
            String packageName = ops.getPackageName();
            int uid = ops.getUid();
            final UserHandle user = UserHandle.getUserHandleForUid(uid);

            // Don't show apps belonging to background users except managed users.
            if (!profiles.contains(user)) {
            boolean isAndroidOs =
                    (uid == android.os.Process.SYSTEM_UID) && ANDROID_SYSTEM_PACKAGE_NAME.equals(
                            packageName);
            if (isAndroidOs || !profiles.contains(user)) {
                continue;
            }