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
diff --git a/services/core/java/com/android/server/ContextHubSystemService.java b/services/core/java/com/android/server/ContextHubSystemService.java
index c6853a5..a353519 100644
--- a/services/core/java/com/android/server/ContextHubSystemService.java
+++ b/services/core/java/com/android/server/ContextHubSystemService.java
@@ -20,7 +20,7 @@
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;
diff --git a/services/core/java/com/android/server/CountryDetectorService.java b/services/core/java/com/android/server/CountryDetectorService.java
index b0132d3..a2a7dd3 100644
--- a/services/core/java/com/android/server/CountryDetectorService.java
+++ b/services/core/java/com/android/server/CountryDetectorService.java
@@ -33,8 +33,8 @@
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 @@
/**
* 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
*/
diff --git a/services/core/java/com/android/server/location/LocationManagerService.java b/services/core/java/com/android/server/location/LocationManagerService.java
index 9c48d23..6651ed6 100644
--- a/services/core/java/com/android/server/location/LocationManagerService.java
+++ b/services/core/java/com/android/server/location/LocationManagerService.java
@@ -245,7 +245,7 @@
// 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 @@
}
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 @@
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 @@
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 @@
}
getOrAddLocationProviderManager(provider).setMockProvider(
- new MockProvider(properties, identity));
+ new MockLocationProvider(properties, identity));
}
@Override
diff --git a/services/core/java/com/android/server/location/LocationProviderManager.java b/services/core/java/com/android/server/location/LocationProviderManager.java
index f8d1195..4829020 100644
--- a/services/core/java/com/android/server/location/LocationProviderManager.java
+++ b/services/core/java/com/android/server/location/LocationProviderManager.java
@@ -1300,7 +1300,7 @@
}
}
- public void setMockProvider(@Nullable MockProvider provider) {
+ public void setMockProvider(@Nullable MockLocationProvider provider) {
synchronized (mLock) {
Preconditions.checkState(mState != STATE_STOPPED);
diff --git a/services/core/java/com/android/server/location/MockProvider.java b/services/core/java/com/android/server/location/MockLocationProvider.java
similarity index 92%
rename from services/core/java/com/android/server/location/MockProvider.java
rename to services/core/java/com/android/server/location/MockLocationProvider.java
index fc88f14..e806728 100644
--- a/services/core/java/com/android/server/location/MockProvider.java
+++ b/services/core/java/com/android/server/location/MockLocationProvider.java
@@ -34,11 +34,11 @@
*
* {@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);
diff --git a/services/core/java/com/android/server/location/MockableLocationProvider.java b/services/core/java/com/android/server/location/MockableLocationProvider.java
index d8d435a..6744d2a 100644
--- a/services/core/java/com/android/server/location/MockableLocationProvider.java
+++ b/services/core/java/com/android/server/location/MockableLocationProvider.java
@@ -54,7 +54,7 @@
@GuardedBy("mOwnerLock")
@Nullable private AbstractLocationProvider mRealProvider;
@GuardedBy("mOwnerLock")
- @Nullable private MockProvider mMockProvider;
+ @Nullable private MockLocationProvider mMockProvider;
@GuardedBy("mOwnerLock")
private ProviderRequest mRequest;
@@ -113,7 +113,7 @@
* inline invocation of {@link Listener#onStateChanged(State, State)} if this results in a
* state change.
*/
- public void setMockProvider(@Nullable MockProvider provider) {
+ public void setMockProvider(@Nullable MockLocationProvider provider) {
synchronized (mOwnerLock) {
if (mMockProvider == provider) {
return;
diff --git a/services/core/java/com/android/server/location/PassiveProvider.java b/services/core/java/com/android/server/location/PassiveLocationProvider.java
similarity index 94%
rename from services/core/java/com/android/server/location/PassiveProvider.java
rename to services/core/java/com/android/server/location/PassiveLocationProvider.java
index f6896b8..fba9a89 100644
--- a/services/core/java/com/android/server/location/PassiveProvider.java
+++ b/services/core/java/com/android/server/location/PassiveLocationProvider.java
@@ -37,7 +37,7 @@
*
* {@hide}
*/
-public class PassiveProvider extends AbstractLocationProvider {
+public class PassiveLocationProvider extends AbstractLocationProvider {
private static final ProviderProperties PROPERTIES = new ProviderProperties(
/* requiresNetwork = */false,
@@ -50,7 +50,7 @@
Criteria.POWER_LOW,
Criteria.ACCURACY_COARSE);
- public PassiveProvider(Context context) {
+ public PassiveLocationProvider(Context context) {
// using a direct executor is ok because this class has no locks that could deadlock
super(DIRECT_EXECUTOR, CallerIdentity.fromContext(context));
diff --git a/services/core/java/com/android/server/location/PassiveLocationProviderManager.java b/services/core/java/com/android/server/location/PassiveLocationProviderManager.java
index b771861..e390138 100644
--- a/services/core/java/com/android/server/location/PassiveLocationProviderManager.java
+++ b/services/core/java/com/android/server/location/PassiveLocationProviderManager.java
@@ -36,12 +36,12 @@
@Override
public void setRealProvider(AbstractLocationProvider provider) {
- Preconditions.checkArgument(provider instanceof PassiveProvider);
+ Preconditions.checkArgument(provider instanceof PassiveLocationProvider);
super.setRealProvider(provider);
}
@Override
- public void setMockProvider(@Nullable MockProvider provider) {
+ public void setMockProvider(@Nullable MockLocationProvider provider) {
if (provider != null) {
throw new IllegalArgumentException("Cannot mock the passive provider");
}
@@ -49,12 +49,12 @@
public void updateLocation(Location location) {
synchronized (mLock) {
- PassiveProvider passiveProvider = (PassiveProvider) mProvider.getProvider();
- Preconditions.checkState(passiveProvider != null);
+ PassiveLocationProvider passive = (PassiveLocationProvider) mProvider.getProvider();
+ Preconditions.checkState(passive != null);
final long identity = Binder.clearCallingIdentity();
try {
- passiveProvider.updateLocation(location);
+ passive.updateLocation(location);
} finally {
Binder.restoreCallingIdentity(identity);
}
diff --git a/services/core/java/com/android/server/location/LocationProviderProxy.java b/services/core/java/com/android/server/location/ProxyLocationProvider.java
similarity index 96%
rename from services/core/java/com/android/server/location/LocationProviderProxy.java
rename to services/core/java/com/android/server/location/ProxyLocationProvider.java
index b111c15..5ab7abd 100644
--- a/services/core/java/com/android/server/location/LocationProviderProxy.java
+++ b/services/core/java/com/android/server/location/ProxyLocationProvider.java
@@ -43,16 +43,16 @@
/**
* Proxy for ILocationProvider implementations.
*/
-public class LocationProviderProxy extends AbstractLocationProvider {
+public class ProxyLocationProvider extends AbstractLocationProvider {
/**
* Creates and registers this proxy. If no suitable service is available for the proxy, returns
* null.
*/
@Nullable
- public static LocationProviderProxy createAndRegister(Context context, String action,
+ public static ProxyLocationProvider createAndRegister(Context context, String action,
int enableOverlayResId, int nonOverlayPackageResId) {
- LocationProviderProxy proxy = new LocationProviderProxy(context, action, enableOverlayResId,
+ ProxyLocationProvider proxy = new ProxyLocationProvider(context, action, enableOverlayResId,
nonOverlayPackageResId);
if (proxy.register()) {
return proxy;
@@ -73,7 +73,7 @@
private volatile ProviderRequest mRequest;
- private LocationProviderProxy(Context context, String action, int enableOverlayResId,
+ private ProxyLocationProvider(Context context, String action, int enableOverlayResId,
int nonOverlayPackageResId) {
// safe to use direct executor since our locks are not acquired in a code path invoked by
// our owning provider
diff --git a/services/core/java/com/android/server/location/ConcurrentLinkedEvictingDeque.java b/services/core/java/com/android/server/location/contexthub/ConcurrentLinkedEvictingDeque.java
similarity index 91%
rename from services/core/java/com/android/server/location/ConcurrentLinkedEvictingDeque.java
rename to services/core/java/com/android/server/location/contexthub/ConcurrentLinkedEvictingDeque.java
index 6910c35..0427007 100644
--- a/services/core/java/com/android/server/location/ConcurrentLinkedEvictingDeque.java
+++ b/services/core/java/com/android/server/location/contexthub/ConcurrentLinkedEvictingDeque.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2020 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import java.util.concurrent.ConcurrentLinkedDeque;
diff --git a/services/core/java/com/android/server/location/ContextHubClientBroker.java b/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
similarity index 98%
rename from services/core/java/com/android/server/location/ContextHubClientBroker.java
rename to services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
index e27eb65..20458b4 100644
--- a/services/core/java/com/android/server/location/ContextHubClientBroker.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubClientBroker.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
@@ -37,6 +37,8 @@
import android.util.Log;
import android.util.proto.ProtoOutputStream;
+import com.android.server.location.ClientBrokerProto;
+
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Supplier;
diff --git a/services/core/java/com/android/server/location/ContextHubClientManager.java b/services/core/java/com/android/server/location/contexthub/ContextHubClientManager.java
similarity index 98%
rename from services/core/java/com/android/server/location/ContextHubClientManager.java
rename to services/core/java/com/android/server/location/contexthub/ContextHubClientManager.java
index 33ceeef..eda89ab 100644
--- a/services/core/java/com/android/server/location/ContextHubClientManager.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubClientManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import android.annotation.IntDef;
import android.app.PendingIntent;
@@ -29,6 +29,8 @@
import android.util.Log;
import android.util.proto.ProtoOutputStream;
+import com.android.server.location.ClientManagerProto;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.text.DateFormat;
diff --git a/services/core/java/com/android/server/location/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java
similarity index 99%
rename from services/core/java/com/android/server/location/ContextHubService.java
rename to services/core/java/com/android/server/location/contexthub/ContextHubService.java
index 7a2e4ed..63a42f8 100644
--- a/services/core/java/com/android/server/location/ContextHubService.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
@@ -54,6 +54,7 @@
import android.util.proto.ProtoOutputStream;
import com.android.internal.util.DumpUtils;
+import com.android.server.location.ContextHubServiceProto;
import java.io.FileDescriptor;
import java.io.PrintWriter;
diff --git a/services/core/java/com/android/server/location/ContextHubServiceTransaction.java b/services/core/java/com/android/server/location/contexthub/ContextHubServiceTransaction.java
similarity index 97%
rename from services/core/java/com/android/server/location/ContextHubServiceTransaction.java
rename to services/core/java/com/android/server/location/contexthub/ContextHubServiceTransaction.java
index 62bd91b..a31aecb 100644
--- a/services/core/java/com/android/server/location/ContextHubServiceTransaction.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubServiceTransaction.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import android.hardware.location.ContextHubTransaction;
import android.hardware.location.NanoAppState;
diff --git a/services/core/java/com/android/server/location/ContextHubServiceUtil.java b/services/core/java/com/android/server/location/contexthub/ContextHubServiceUtil.java
similarity index 98%
rename from services/core/java/com/android/server/location/ContextHubServiceUtil.java
rename to services/core/java/com/android/server/location/contexthub/ContextHubServiceUtil.java
index 9145eca..88ed105 100644
--- a/services/core/java/com/android/server/location/ContextHubServiceUtil.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubServiceUtil.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
diff --git a/services/core/java/com/android/server/location/ContextHubTransactionManager.java b/services/core/java/com/android/server/location/contexthub/ContextHubTransactionManager.java
similarity index 99%
rename from services/core/java/com/android/server/location/ContextHubTransactionManager.java
rename to services/core/java/com/android/server/location/contexthub/ContextHubTransactionManager.java
index d3fc705..f81208f 100644
--- a/services/core/java/com/android/server/location/ContextHubTransactionManager.java
+++ b/services/core/java/com/android/server/location/contexthub/ContextHubTransactionManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import android.hardware.contexthub.V1_0.IContexthub;
import android.hardware.contexthub.V1_0.Result;
diff --git a/services/core/java/com/android/server/location/IContextHubWrapper.java b/services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java
similarity index 99%
rename from services/core/java/com/android/server/location/IContextHubWrapper.java
rename to services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java
index 9ac7c6b..4242d72 100644
--- a/services/core/java/com/android/server/location/IContextHubWrapper.java
+++ b/services/core/java/com/android/server/location/contexthub/IContextHubWrapper.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import android.annotation.Nullable;
import android.hardware.contexthub.V1_1.Setting;
diff --git a/services/core/java/com/android/server/location/NanoAppStateManager.java b/services/core/java/com/android/server/location/contexthub/NanoAppStateManager.java
similarity index 98%
rename from services/core/java/com/android/server/location/NanoAppStateManager.java
rename to services/core/java/com/android/server/location/contexthub/NanoAppStateManager.java
index e26ccc3..60109fe 100644
--- a/services/core/java/com/android/server/location/NanoAppStateManager.java
+++ b/services/core/java/com/android/server/location/contexthub/NanoAppStateManager.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2017 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.contexthub;
import android.annotation.Nullable;
import android.hardware.contexthub.V1_0.HubAppInfo;
diff --git a/services/core/java/com/android/server/location/ComprehensiveCountryDetector.java b/services/core/java/com/android/server/location/countrydetector/ComprehensiveCountryDetector.java
similarity index 98%
rename from services/core/java/com/android/server/location/ComprehensiveCountryDetector.java
rename to services/core/java/com/android/server/location/countrydetector/ComprehensiveCountryDetector.java
index 6117a9b..af3907e 100644
--- a/services/core/java/com/android/server/location/ComprehensiveCountryDetector.java
+++ b/services/core/java/com/android/server/location/countrydetector/ComprehensiveCountryDetector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -11,10 +11,10 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.countrydetector;
import android.content.Context;
import android.location.Country;
diff --git a/services/core/java/com/android/server/location/CountryDetectorBase.java b/services/core/java/com/android/server/location/countrydetector/CountryDetectorBase.java
similarity index 93%
rename from services/core/java/com/android/server/location/CountryDetectorBase.java
rename to services/core/java/com/android/server/location/countrydetector/CountryDetectorBase.java
index 682b104..6e2e28c 100644
--- a/services/core/java/com/android/server/location/CountryDetectorBase.java
+++ b/services/core/java/com/android/server/location/countrydetector/CountryDetectorBase.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -11,10 +11,10 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.countrydetector;
import android.content.Context;
import android.location.Country;
diff --git a/services/core/java/com/android/server/location/LocationBasedCountryDetector.java b/services/core/java/com/android/server/location/countrydetector/LocationBasedCountryDetector.java
similarity index 98%
rename from services/core/java/com/android/server/location/LocationBasedCountryDetector.java
rename to services/core/java/com/android/server/location/countrydetector/LocationBasedCountryDetector.java
index 8ee1285..638f36f 100644
--- a/services/core/java/com/android/server/location/LocationBasedCountryDetector.java
+++ b/services/core/java/com/android/server/location/countrydetector/LocationBasedCountryDetector.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -11,10 +11,10 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.countrydetector;
import android.content.Context;
import android.location.Address;
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/LocationProviderManagerTest.java b/services/tests/mockingservicestests/src/com/android/server/location/LocationProviderManagerTest.java
index d260e4d..cc46d9d 100644
--- a/services/tests/mockingservicestests/src/com/android/server/location/LocationProviderManagerTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/location/LocationProviderManagerTest.java
@@ -152,7 +152,7 @@
mPassive = new PassiveLocationProviderManager(mContext, mInjector);
mPassive.startManager();
- mPassive.setRealProvider(new PassiveProvider(mContext));
+ mPassive.setRealProvider(new PassiveLocationProvider(mContext));
mProvider = new TestProvider(PROPERTIES, IDENTITY);
mProvider.setProviderAllowed(true);
@@ -308,7 +308,7 @@
@Test
public void testGetLastLocation_ClearOnMockRemoval() {
- MockProvider mockProvider = new MockProvider(PROPERTIES, IDENTITY);
+ MockLocationProvider mockProvider = new MockLocationProvider(PROPERTIES, IDENTITY);
mockProvider.setAllowed(true);
mManager.setMockProvider(mockProvider);
diff --git a/services/tests/mockingservicestests/src/com/android/server/location/MockableLocationProviderTest.java b/services/tests/mockingservicestests/src/com/android/server/location/MockableLocationProviderTest.java
index 374fc77..85cb7a0 100644
--- a/services/tests/mockingservicestests/src/com/android/server/location/MockableLocationProviderTest.java
+++ b/services/tests/mockingservicestests/src/com/android/server/location/MockableLocationProviderTest.java
@@ -50,7 +50,7 @@
private ProviderListenerCapture mListener;
private AbstractLocationProvider mRealProvider;
- private MockProvider mMockProvider;
+ private MockLocationProvider mMockProvider;
private MockableLocationProvider mProvider;
@@ -60,7 +60,7 @@
mListener = new ProviderListenerCapture(lock);
mRealProvider = spy(new FakeProvider());
- mMockProvider = spy(new MockProvider(new ProviderProperties(
+ mMockProvider = spy(new MockLocationProvider(new ProviderProperties(
false,
false,
false,
diff --git a/services/tests/servicestests/src/com/android/server/CountryDetectorServiceTest.java b/services/tests/servicestests/src/com/android/server/CountryDetectorServiceTest.java
index d5483ff..83a597d 100644
--- a/services/tests/servicestests/src/com/android/server/CountryDetectorServiceTest.java
+++ b/services/tests/servicestests/src/com/android/server/CountryDetectorServiceTest.java
@@ -35,8 +35,8 @@
import androidx.test.core.app.ApplicationProvider;
import com.android.internal.R;
-import com.android.server.location.ComprehensiveCountryDetector;
-import com.android.server.location.CustomCountryDetectorTestClass;
+import com.android.server.location.countrydetector.ComprehensiveCountryDetector;
+import com.android.server.location.countrydetector.CustomCountryDetectorTestClass;
import com.google.common.truth.Expect;
@@ -53,7 +53,7 @@
public class CountryDetectorServiceTest {
private static final String VALID_CUSTOM_TEST_CLASS =
- "com.android.server.location.CustomCountryDetectorTestClass";
+ "com.android.server.location.countrydetector.CustomCountryDetectorTestClass";
private static final String INVALID_CUSTOM_TEST_CLASS =
"com.android.server.location.MissingCountryDetectorTestClass";
diff --git a/services/tests/servicestests/src/com/android/server/location/ComprehensiveCountryDetectorTest.java b/services/tests/servicestests/src/com/android/server/location/countrydetector/ComprehensiveCountryDetectorTest.java
similarity index 98%
rename from services/tests/servicestests/src/com/android/server/location/ComprehensiveCountryDetectorTest.java
rename to services/tests/servicestests/src/com/android/server/location/countrydetector/ComprehensiveCountryDetectorTest.java
index 98966c0..41cfa62 100644
--- a/services/tests/servicestests/src/com/android/server/location/ComprehensiveCountryDetectorTest.java
+++ b/services/tests/servicestests/src/com/android/server/location/countrydetector/ComprehensiveCountryDetectorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -11,10 +11,10 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.countrydetector;
import android.location.Country;
import android.location.CountryListener;
diff --git a/services/tests/servicestests/src/com/android/server/location/CustomCountryDetectorTestClass.java b/services/tests/servicestests/src/com/android/server/location/countrydetector/CustomCountryDetectorTestClass.java
similarity index 89%
rename from services/tests/servicestests/src/com/android/server/location/CustomCountryDetectorTestClass.java
rename to services/tests/servicestests/src/com/android/server/location/countrydetector/CustomCountryDetectorTestClass.java
index e159012..fc19a94 100644
--- a/services/tests/servicestests/src/com/android/server/location/CustomCountryDetectorTestClass.java
+++ b/services/tests/servicestests/src/com/android/server/location/countrydetector/CustomCountryDetectorTestClass.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.countrydetector;
import android.content.Context;
import android.location.Country;
diff --git a/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java b/services/tests/servicestests/src/com/android/server/location/countrydetector/LocationBasedCountryDetectorTest.java
similarity index 98%
rename from services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java
rename to services/tests/servicestests/src/com/android/server/location/countrydetector/LocationBasedCountryDetectorTest.java
index 5f5d668..46269eb 100644
--- a/services/tests/servicestests/src/com/android/server/location/LocationBasedCountryDetectorTest.java
+++ b/services/tests/servicestests/src/com/android/server/location/countrydetector/LocationBasedCountryDetectorTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2020 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -11,9 +11,9 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License
+ * limitations under the License.
*/
-package com.android.server.location;
+package com.android.server.location.countrydetector;
import android.location.Country;
import android.location.CountryListener;