Skip to content

Commit 3914e4b

Browse files
author
Nick Pelly
committed
Remove LocationManager#getLastKnownLocation(Criteria).
This was never a public API, so we don't need to follow an orderly deprecation. And it breaks a CTS test: cts/tests/tests/location/src/android/location/cts/LocationManagerTest.java:521: reference to getLastKnownLocation is ambiguous, both method getLastKnownLocation(java.lang.String) in android.location.LocationManager and method getLastKnownLocation(android.location.Criteria) in android.location.LocationManager match mManager.getLastKnownLocation(null); ^ Change-Id: I503267e4fa577ce4bf684239da777f11b0e511f5
1 parent 6fa9ad4 commit 3914e4b

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

api/current.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10598,7 +10598,6 @@ package android.location {
1059810598
method public deprecated java.lang.String getBestProvider(android.location.Criteria, boolean);
1059910599
method public android.location.GpsStatus getGpsStatus(android.location.GpsStatus);
1060010600
method public deprecated android.location.Location getLastKnownLocation(java.lang.String);
10601-
method public deprecated android.location.Location getLastKnownLocation(android.location.Criteria);
1060210601
method public android.location.Location getLastLocation(android.location.LocationRequest);
1060310602
method public deprecated android.location.LocationProvider getProvider(java.lang.String);
1060410603
method public deprecated java.util.List<java.lang.String> getProviders(boolean);

location/java/android/location/LocationManager.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1243,36 +1243,6 @@ public Location getLastKnownLocation(String provider) {
12431243
}
12441244
}
12451245

1246-
/**
1247-
* Return the last know Location that satisfies the given
1248-
* criteria. This can be done without starting the provider.
1249-
* Note that this location could
1250-
* be out-of-date, for example if the device was turned off and
1251-
* moved to another location.
1252-
*
1253-
* <p> If no location is found that satisfies the criteria, null is returned
1254-
*
1255-
* @param criteria location criteria
1256-
* @return the last known location that satisfies criteria, or null
1257-
*
1258-
* @throws SecurityException if no suitable permission is present
1259-
* @throws IllegalArgumentException if criteria is null
1260-
* @deprecated use the {@link LocationRequest} class instead
1261-
*/
1262-
@Deprecated
1263-
public Location getLastKnownLocation(Criteria criteria) {
1264-
checkCriteria(criteria);
1265-
1266-
LocationRequest request = LocationRequest.createFromDeprecatedCriteria(
1267-
criteria, 0, 0, true);
1268-
try {
1269-
return mService.getLastLocation(request);
1270-
} catch (RemoteException e) {
1271-
Log.e(TAG, "RemoteException", e);
1272-
return null;
1273-
}
1274-
}
1275-
12761246
// Mock provider support
12771247

12781248
/**

0 commit comments

Comments
 (0)