summaryrefslogtreecommitdiff
path: root/packages/FusedLocation/test
diff options
context:
space:
mode:
author Soonil Nagarkar <sooniln@google.com> 2020-12-24 14:02:44 -0800
committer Soonil Nagarkar <sooniln@google.com> 2021-01-08 10:33:44 -0800
commit49983fcbbd085bd55dd8ef14d146120ec95cf256 (patch)
treeb1fc7efe872d7aa8e231271907817c83502a5224 /packages/FusedLocation/test
parenta4c1faff5b1e280e0bae1903780b53ba08539b1f (diff)
Copy LocationProviderBase API into SystemApi surface
This allows third party location providers to link against the standard API surface. This replaces the LocationProviderBase implementation in the com.android.location.providers API. Both will temporarily coexist until third party applications can be migrated, and then old version will be removed. Only the LocationProviderBase API is migrated right now as its the only API that has undergone changes. This also restores some old, unused classes which should not have been remove from the API surface. Clients that support older API version will still need to link against these classes. Bug: 176115245 Test: builds Change-Id: I2d688447e1f59e441f5c48ff36d3f0dd8b5dc7f6
Diffstat (limited to 'packages/FusedLocation/test')
-rw-r--r--packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java b/packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java
index 2bda530b83d4..d47231147a38 100644
--- a/packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java
+++ b/packages/FusedLocation/test/src/com/android/location/fused/tests/FusedLocationServiceTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2020 The Android Open Source Project
+ * Copyright (C) 2021 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.
@@ -27,18 +27,18 @@ import android.location.Location;
import android.location.LocationManager;
import android.location.LocationRequest;
import android.location.LocationResult;
-import android.location.ProviderProperties;
+import android.location.provider.ILocationProvider;
+import android.location.provider.ILocationProviderManager;
+import android.location.provider.ProviderProperties;
+import android.location.provider.ProviderRequest;
import android.os.ParcelFileDescriptor;
import android.os.SystemClock;
-import android.os.WorkSource;
import android.util.Log;
import androidx.test.InstrumentationRegistry;
+import androidx.test.core.app.ApplicationProvider;
import androidx.test.runner.AndroidJUnit4;
-import com.android.internal.location.ILocationProvider;
-import com.android.internal.location.ILocationProviderManager;
-import com.android.internal.location.ProviderRequest;
import com.android.location.fused.FusedLocationProvider;
import org.junit.After;
@@ -71,7 +71,7 @@ public class FusedLocationServiceTest {
long seed = System.currentTimeMillis();
Log.i(TAG, "location seed: " + seed);
- Context context = InstrumentationRegistry.getTargetContext();
+ Context context = ApplicationProvider.getApplicationContext();
mRandom = new Random(seed);
mLocationManager = context.getSystemService(LocationManager.class);
@@ -120,8 +120,7 @@ public class FusedLocationServiceTest {
mProvider.setRequest(
new ProviderRequest.Builder()
.setIntervalMillis(1000)
- .build(),
- new WorkSource());
+ .build());
Location location = createLocation(NETWORK_PROVIDER, mRandom);
mLocationManager.setTestProviderLocation(NETWORK_PROVIDER, location);
@@ -135,8 +134,7 @@ public class FusedLocationServiceTest {
new ProviderRequest.Builder()
.setQuality(LocationRequest.QUALITY_HIGH_ACCURACY)
.setIntervalMillis(1000)
- .build(),
- new WorkSource());
+ .build());
Location location = createLocation(GPS_PROVIDER, mRandom);
mLocationManager.setTestProviderLocation(GPS_PROVIDER, location);