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

Commit 79f3adcf authored by Soonil Nagarkar's avatar Soonil Nagarkar Committed by Android (Google) Code Review
Browse files

Merge "Various GNSS cleanups"

parents e239821b 623cf937
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -310,6 +310,7 @@ public abstract class AbstractLocationProvider {
     * Sets a new request and worksource for the provider.
     */
    public final void setRequest(ProviderRequest request) {
        // TODO: do we want to hold a wakelock until onSetRequest is run?
        // all calls into the provider must be moved onto the provider thread to prevent deadlock
        mExecutor.execute(() -> onSetRequest(request));
    }
+2 −0
Original line number Diff line number Diff line
@@ -324,6 +324,8 @@ public class LocationManagerService extends ILocationManager.Stub {
    }

    void onSystemThirdPartyAppsCanStart() {
        // network provider should always be initialized before the gps provider since the gps
        // provider has unfortunate hard dependencies on the network provider
        ProxyLocationProvider networkProvider = ProxyLocationProvider.createAndRegister(
                mContext,
                NETWORK_LOCATION_SERVICE_ACTION,
+147 −284

File changed.

Preview size limit exceeded, changes collapsed.

+9 −4
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@ import static android.os.PowerManager.LOCATION_MODE_GPS_DISABLED_WHEN_SCREEN_OFF
import static android.os.PowerManager.LOCATION_MODE_NO_CHANGE;
import static android.os.PowerManager.LOCATION_MODE_THROTTLE_REQUESTS_WHEN_SCREEN_OFF;

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

import android.annotation.Nullable;
import android.location.LocationRequest;
import android.location.util.identity.CallerIdentity;
@@ -29,14 +31,13 @@ import android.os.Build;
import android.os.PowerManager.LocationPowerSaveMode;

import com.android.internal.location.ProviderRequest;
import com.android.server.location.LocationManagerService;
import com.android.server.utils.eventlog.LocalEventLog;

/** In memory event log for location events. */
public class LocationEventLog extends LocalEventLog {

    private static int getLogSize() {
        if (Build.IS_DEBUGGABLE || LocationManagerService.D) {
        if (Build.IS_DEBUGGABLE || D) {
            return 500;
        } else {
            return 200;
@@ -91,14 +92,18 @@ public class LocationEventLog extends LocalEventLog {

    /** Logs a new incoming location for a location provider. */
    public synchronized void logProviderReceivedLocations(String provider, int numLocations) {
        if (Build.IS_DEBUGGABLE || D) {
            addLogEvent(EVENT_PROVIDER_RECEIVE_LOCATION, provider, numLocations);
        }
    }

    /** Logs a location deliver for a client of a location provider. */
    public synchronized void logProviderDeliveredLocations(String provider, int numLocations,
            CallerIdentity identity) {
        if (Build.IS_DEBUGGABLE || D) {
            addLogEvent(EVENT_PROVIDER_DELIVER_LOCATION, provider, numLocations, identity);
        }
    }

    /** Logs that the location power save mode has changed. */
    public synchronized void logLocationPowerSaveMode(