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

Commit 35017cbc authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Additional debug logging

-Add some additional logging around screen off and location battery
saver mode.
-Fix a minor bug in refreshing locationSettingsIgnored location
requests.

Test: manual + presubmit
Change-Id: I897d65dc8e9af05f3f9f5bf4233e6a58c8aec55a
parent 6ca55a31
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -524,16 +524,18 @@ class LocationProviderManager extends
                }
            }

            if (baseRequest.isLocationSettingsIgnored()) {
            boolean locationSettingsIgnored = baseRequest.isLocationSettingsIgnored();
            if (locationSettingsIgnored) {
                // if we are not currently allowed use location settings ignored, disable it
                if (!mSettingsHelper.getIgnoreSettingsPackageWhitelist().contains(
                        getIdentity().getPackageName()) && !mLocationManagerInternal.isProvider(
                        null, getIdentity())) {
                    builder.setLocationSettingsIgnored(false);
                    locationSettingsIgnored = false;
                }
            }

            if (!baseRequest.isLocationSettingsIgnored() && !isThrottlingExempt()) {
            if (!locationSettingsIgnored && !isThrottlingExempt()) {
                // throttle in the background
                if (!mForeground) {
                    builder.setIntervalMillis(max(baseRequest.getIntervalMillis(),
+11 −0
Original line number Diff line number Diff line
@@ -16,7 +16,13 @@

package com.android.server.location.util;

import static android.os.PowerManager.locationPowerSaveModeToString;

import static com.android.server.location.LocationManagerService.D;
import static com.android.server.location.LocationManagerService.TAG;

import android.os.PowerManager.LocationPowerSaveMode;
import android.util.Log;

import java.util.concurrent.CopyOnWriteArrayList;

@@ -60,7 +66,12 @@ public abstract class LocationPowerSaveModeHelper {

    protected final void notifyLocationPowerSaveModeChanged(
            @LocationPowerSaveMode int locationPowerSaveMode) {
        if (D) {
            Log.d(TAG, "location power save mode is now " + locationPowerSaveModeToString(
                    locationPowerSaveMode));
        }
        mLocationEventLog.logLocationPowerSaveMode(locationPowerSaveMode);

        for (LocationPowerSaveModeChangedListener listener : mListeners) {
            listener.onLocationPowerSaveModeChanged(locationPowerSaveMode);
        }
+9 −0
Original line number Diff line number Diff line
@@ -16,6 +16,11 @@

package com.android.server.location.util;

import static com.android.server.location.LocationManagerService.D;
import static com.android.server.location.LocationManagerService.TAG;

import android.util.Log;

import java.util.concurrent.CopyOnWriteArrayList;

/**
@@ -55,6 +60,10 @@ public abstract class ScreenInteractiveHelper {
    }

    protected final void notifyScreenInteractiveChanged(boolean interactive) {
        if (D) {
            Log.d(TAG, "screen interactive is now " + interactive);
        }

        for (ScreenInteractiveChangedListener listener : mListeners) {
            listener.onScreenInteractiveChanged(interactive);
        }