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

Commit 8dbefd4b authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Remove DeviceIdleController location prefetching

This prefetching behavior interrupts location power saving measures
causing increased power usage, and appears to serve no purpose (the
locations are dropped and never used). The original intention appears to
have been to prime the location service prior to entering doze in some
circumstances, but this has never been useful to the location service.

Bug: 332770178
Test: pre-existing
Change-Id: I26d4e5fb6dfa6fc578068bbfc17b272d6140fc96
parent 7f991aa6
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
package: "com.android.server.deviceidle"

flag {
  name: "remove_idle_location"
  namespace: "location"
  description: "Remove DeviceIdleController usage of location"
  bug: "332770178"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

flag {
    name: "disable_wakelocks_in_light_idle"
    namespace: "backstage_power"
+2 −1
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ import com.android.modules.expresslog.Counter;
import com.android.server.am.BatteryStatsService;
import com.android.server.deviceidle.ConstraintController;
import com.android.server.deviceidle.DeviceIdleConstraintTracker;
import com.android.server.deviceidle.Flags;
import com.android.server.deviceidle.IDeviceIdleConstraint;
import com.android.server.deviceidle.TvConstraintController;
import com.android.server.net.NetworkPolicyManagerInternal;
@@ -2558,7 +2559,7 @@ public class DeviceIdleController extends SystemService
        }

        boolean isLocationPrefetchEnabled() {
            return mContext.getResources().getBoolean(
            return !Flags.removeIdleLocation() && mContext.getResources().getBoolean(
                   com.android.internal.R.bool.config_autoPowerModePrefetchLocation);
        }