summaryrefslogtreecommitdiff
path: root/packages/PrintSpooler/src
diff options
context:
space:
mode:
author Soonil Nagarkar <sooniln@google.com> 2020-08-26 19:08:21 -0700
committer Soonil Nagarkar <sooniln@google.com> 2020-09-11 12:29:50 -0700
commit757380517baed7274a55a2fa4ef7bfe1cc774fc1 (patch)
treeca054c428b6b07ce71b8ad52246cb6d961a03da9 /packages/PrintSpooler/src
parent9de9f13ef26dd1f0305040493a396c5a54a8f600 (diff)
Make LocationRequest a public API
LocationRequest and associated APIs have historically always been SystemApi, for no real reason. In keeping with the Android-wide push to clean up API surfaces like this, we make LocationRequest a public API. Bug: 166692379 Test: manual + presubmits Change-Id: I6a93fca1a5613c96bf35da158bc542e47864dbff
Diffstat (limited to 'packages/PrintSpooler/src')
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java b/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java
index 467a60e62e14..8e140ca27971 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java
@@ -31,6 +31,7 @@ import android.location.LocationRequest;
import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
+import android.os.HandlerExecutor;
import android.os.Looper;
import android.os.SystemClock;
import android.print.PrintManager;
@@ -250,9 +251,13 @@ public final class FusedPrintersProvider extends Loader<List<PrinterInfo>>
Log.i(LOG_TAG, "onStartLoading() " + FusedPrintersProvider.this.hashCode());
}
- mLocationManager.requestLocationUpdates(LocationRequest.create()
- .setQuality(LocationRequest.POWER_LOW).setInterval(LOCATION_UPDATE_MS), this,
- Looper.getMainLooper());
+ mLocationManager.requestLocationUpdates(
+ LocationManager.FUSED_PROVIDER,
+ new LocationRequest.Builder(LOCATION_UPDATE_MS)
+ .setQuality(LocationRequest.POWER_LOW)
+ .build(),
+ new HandlerExecutor(new Handler(Looper.getMainLooper())),
+ this);
Location lastLocation = mLocationManager.getLastLocation();
if (lastLocation != null) {