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

Commit 865cf6de authored by Soonil Nagarkar's avatar Soonil Nagarkar Committed by android-build-merger
Browse files

Merge "Fix foreground importance bug in LocationManagerService." into oc-dev

am: 25a263a3

Change-Id: If35b625802224f7f1dbfb24d83e469093bdc718b
parents 648e0075 25a263a3
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -146,6 +146,9 @@ public class LocationManagerService extends ILocationManager.Stub {
    // The maximum interval a location request can have and still be considered "high power".
    private static final long HIGH_POWER_INTERVAL_MS = 5 * 60 * 1000;

    private static final int FOREGROUND_IMPORTANCE_CUTOFF
        = ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE;

    // default background throttling interval if not overriden in settings
    private static final long DEFAULT_BACKGROUND_THROTTLE_INTERVAL_MS = 30 * 60 * 1000;

@@ -375,7 +378,7 @@ public class LocationManagerService extends ILocationManager.Stub {
                }
            };
            mActivityManager.addOnUidImportanceListener(uidImportanceListener,
                    ActivityManager.RunningAppProcessInfo.IMPORTANCE_PERCEPTIBLE);
                    FOREGROUND_IMPORTANCE_CUTOFF);

            mUserManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE);
            updateUserProfiles(mCurrentUserId);
@@ -452,7 +455,7 @@ public class LocationManagerService extends ILocationManager.Stub {
    }

    private static boolean isImportanceForeground(int importance) {
        return importance <= ActivityManager.RunningAppProcessInfo.IMPORTANCE_FOREGROUND_SERVICE;
        return importance <= FOREGROUND_IMPORTANCE_CUTOFF;
    }

    /**