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

Commit 135d3e90 authored by Michael Cheng's avatar Michael Cheng
Browse files

Skip filtering apps that have indicator already running.

Only non-system & non-background apps should trigger the location indicator. But if the location indicator is already visible, keep it in the list during the holding period.

Fixes: 435271798
Change-Id: If990226baeb91c1cbb73fb70d8e00e6584776d01
Test: on device
Flag: android.location.flags.location_indicators_enabled
parent 42bdf1c4
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -609,7 +609,12 @@ public class PermissionUsageHelper implements AppOpsManager.OnOpActiveChangedLis

                    String permGroupName = getGroupForOp(op);
                    if (LOCATION.equals(permGroupName)) {
                        if (isSystemApp(op, packageName, user, uid) || isBackgroundApp(uid)) {
                        // Only non-system, non-background apps should trigger location indicator.
                        // But if the location indicator is already visible (e.g. an app
                        // transitioned from foreground to background), we should not filter it out
                        // if it's within the holding period.
                        if (isSystemApp(op, packageName, user, uid)
                                || (isBackgroundApp(uid) && !isRunning)) {
                            // Remove the system & background apps for location op
                            continue;
                        }