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
This commit is contained in:
@@ -1243,36 +1243,6 @@ public class LocationManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the last know Location that satisfies the given
|
||||
* criteria. This can be done without starting the provider.
|
||||
* Note that this location could
|
||||
* be out-of-date, for example if the device was turned off and
|
||||
* moved to another location.
|
||||
*
|
||||
* <p> If no location is found that satisfies the criteria, null is returned
|
||||
*
|
||||
* @param criteria location criteria
|
||||
* @return the last known location that satisfies criteria, or null
|
||||
*
|
||||
* @throws SecurityException if no suitable permission is present
|
||||
* @throws IllegalArgumentException if criteria is null
|
||||
* @deprecated use the {@link LocationRequest} class instead
|
||||
*/
|
||||
@Deprecated
|
||||
public Location getLastKnownLocation(Criteria criteria) {
|
||||
checkCriteria(criteria);
|
||||
|
||||
LocationRequest request = LocationRequest.createFromDeprecatedCriteria(
|
||||
criteria, 0, 0, true);
|
||||
try {
|
||||
return mService.getLastLocation(request);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "RemoteException", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Mock provider support
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user