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

Commit 3d5a2c2d authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Assorted renaming and repackaging

-Move contexthub classes into their own package
-Move countrydetector classes into their own package
-Rename passive/mock location providers appropriately

Test: presubmits
Change-Id: If8bd3c5ea314fddbd4097f94c7558ff707abde04
parent c335e905
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ import android.content.Context;
import android.util.Log;

import com.android.internal.util.ConcurrentUtils;
import com.android.server.location.ContextHubService;
import com.android.server.location.contexthub.ContextHubService;

import java.util.concurrent.Future;

+5 −6
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ import com.android.internal.R;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.os.BackgroundThread;
import com.android.internal.util.DumpUtils;
import com.android.server.location.ComprehensiveCountryDetector;
import com.android.server.location.CountryDetectorBase;
import com.android.server.location.countrydetector.ComprehensiveCountryDetector;
import com.android.server.location.countrydetector.CountryDetectorBase;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -43,10 +43,9 @@ import java.util.HashMap;

/**
 * This class detects the country that the user is in. The default country detection is made through
 * {@link com.android.server.location.ComprehensiveCountryDetector}. It is possible to overlay the
 * detection algorithm by overlaying the attribute R.string.config_customCountryDetector with the
 * custom class name to use instead. The custom class must extend
 * {@link com.android.server.location.CountryDetectorBase}
 * {@link ComprehensiveCountryDetector}. It is possible to overlay the detection algorithm by
 * overlaying the attribute R.string.config_customCountryDetector with the custom class name to use
 * instead. The custom class must extend {@link CountryDetectorBase}
 *
 * @hide
 */
+5 −5
Original line number Diff line number Diff line
@@ -245,7 +245,7 @@ public class LocationManagerService extends ILocationManager.Stub {
        // set up passive provider first since it will be required for all other location providers,
        // which are loaded later once the system is ready.
        mPassiveManager = new PassiveLocationProviderManager(mContext, injector);
        addLocationProviderManager(mPassiveManager, new PassiveProvider(mContext));
        addLocationProviderManager(mPassiveManager, new PassiveLocationProvider(mContext));

        // TODO: load the gps provider here as well, which will require refactoring

@@ -320,7 +320,7 @@ public class LocationManagerService extends ILocationManager.Stub {
    }

    void onSystemThirdPartyAppsCanStart() {
        LocationProviderProxy networkProvider = LocationProviderProxy.createAndRegister(
        ProxyLocationProvider networkProvider = ProxyLocationProvider.createAndRegister(
                mContext,
                NETWORK_LOCATION_SERVICE_ACTION,
                com.android.internal.R.bool.config_enableNetworkLocationOverlay,
@@ -339,7 +339,7 @@ public class LocationManagerService extends ILocationManager.Stub {
                MATCH_DIRECT_BOOT_AWARE | MATCH_SYSTEM_ONLY, UserHandle.USER_SYSTEM).isEmpty(),
                "Unable to find a direct boot aware fused location provider");

        LocationProviderProxy fusedProvider = LocationProviderProxy.createAndRegister(
        ProxyLocationProvider fusedProvider = ProxyLocationProvider.createAndRegister(
                mContext,
                FUSED_LOCATION_SERVICE_ACTION,
                com.android.internal.R.bool.config_enableFusedLocationOverlay,
@@ -404,7 +404,7 @@ public class LocationManagerService extends ILocationManager.Stub {
                    Integer.parseInt(fragments[8]) /* powerRequirement */,
                    Integer.parseInt(fragments[9]) /* accuracy */);
            getOrAddLocationProviderManager(name).setMockProvider(
                    new MockProvider(properties, CallerIdentity.fromContext(mContext)));
                    new MockLocationProvider(properties, CallerIdentity.fromContext(mContext)));
        }
    }

@@ -1027,7 +1027,7 @@ public class LocationManagerService extends ILocationManager.Stub {
        }

        getOrAddLocationProviderManager(provider).setMockProvider(
                new MockProvider(properties, identity));
                new MockLocationProvider(properties, identity));
    }

    @Override
+1 −1
Original line number Diff line number Diff line
@@ -1300,7 +1300,7 @@ class LocationProviderManager extends
        }
    }

    public void setMockProvider(@Nullable MockProvider provider) {
    public void setMockProvider(@Nullable MockLocationProvider provider) {
        synchronized (mLock) {
            Preconditions.checkState(mState != STATE_STOPPED);

+2 −2
Original line number Diff line number Diff line
@@ -34,11 +34,11 @@ import java.io.PrintWriter;
 *
 * {@hide}
 */
public class MockProvider extends AbstractLocationProvider {
public class MockLocationProvider extends AbstractLocationProvider {

    @Nullable private Location mLocation;

    public MockProvider(ProviderProperties properties, CallerIdentity identity) {
    public MockLocationProvider(ProviderProperties properties, CallerIdentity identity) {
        // using a direct executor is ok because this class has no locks that could deadlock
        super(DIRECT_EXECUTOR, identity);
        setProperties(properties);
Loading