summaryrefslogtreecommitdiff
path: root/packages/PrintSpooler
diff options
context:
space:
mode:
authorSoonil Nagarkar <sooniln@google.com>2019-10-18 11:59:21 -0700
committerSoonil Nagarkar <sooniln@google.com>2019-10-18 17:46:58 -0700
commit559e51aa087d22fb860f228e894e42476edf1455 (patch)
tree91e7fbb481eb938d864d959585c32f8170e151ec /packages/PrintSpooler
parente4f30281d23334d06207f7a2cd4d7e8f22797502 (diff)
Move away from deprecated API
Replace requestSingleUpdate() with getCurrentLocation(). Bug: 133356925 Test: none Change-Id: I2416c5526f0c7cd54c8d7a6d7b042a32cc768218
Diffstat (limited to 'packages/PrintSpooler')
-rw-r--r--packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java8
1 files changed, 1 insertions, 7 deletions
diff --git a/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java b/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java
index c5138c533cd0..17095063c68c 100644
--- a/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java
+++ b/packages/PrintSpooler/src/com/android/printspooler/ui/FusedPrintersProvider.java
@@ -24,7 +24,6 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Loader;
import android.content.pm.ServiceInfo;
-import android.location.Criteria;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
@@ -265,11 +264,6 @@ public final class FusedPrintersProvider extends Loader<List<PrinterInfo>>
onLocationChanged(lastLocation);
}
- // Jumpstart location with a single forced update
- Criteria oneTimeCriteria = new Criteria();
- oneTimeCriteria.setAccuracy(Criteria.ACCURACY_FINE);
- mLocationManager.requestSingleUpdate(oneTimeCriteria, this, Looper.getMainLooper());
-
// The contract is that if we already have a valid,
// result the we have to deliver it immediately.
(new Handler(Looper.getMainLooper())).post(new Runnable() {
@@ -423,7 +417,7 @@ public final class FusedPrintersProvider extends Loader<List<PrinterInfo>>
}
@Override
- public void onLocationChanged(Location location) {
+ public void onLocationChanged(@Nullable Location location) {
synchronized(mLocationLock) {
// We expect the user to not move too fast while printing. Hence prefer more accurate
// updates over more recent ones for LOCATION_UPDATE_MS. We add a 10% fudge factor here