diff options
author | Soonil Nagarkar <sooniln@google.com> | 2019-02-06 15:57:26 -0800 |
---|---|---|
committer | Soonil Nagarkar <sooniln@google.com> | 2019-02-13 13:34:45 -0800 |
commit | 509580fbdfdbd6b1a129bd348d40f56b43a5a0f1 (patch) | |
tree | 8faba9fd22f8b711c1932fecc9a5fdaf95533b41 /location/lib | |
parent | d56355755b17db8a3c4ca58552747456671e32cc (diff) |
Refactor API naming and add unbundled support
Rename APIs while there are no clients. Also prevent throttling when
location settings are being ignored.
Bug: 118883513
Test: manual
Change-Id: I225c50b152e77ab181c959ecd9dc652333f59d5e
Diffstat (limited to 'location/lib')
3 files changed, 14 insertions, 4 deletions
diff --git a/location/lib/api/current.txt b/location/lib/api/current.txt index 67d64965ac96..dbb581fe54b2 100644 --- a/location/lib/api/current.txt +++ b/location/lib/api/current.txt @@ -31,6 +31,7 @@ package com.android.location.provider { method public long getInterval(); method public int getQuality(); method public float getSmallestDisplacement(); + method public boolean isLocationSettingsIgnored(); field public static final int ACCURACY_BLOCK = 102; // 0x66 field public static final int ACCURACY_CITY = 104; // 0x68 field public static final int ACCURACY_FINE = 100; // 0x64 @@ -44,10 +45,10 @@ package com.android.location.provider { } public final class ProviderRequestUnbundled { - method public boolean getForceLocation(); method public long getInterval(); method public java.util.List<com.android.location.provider.LocationRequestUnbundled> getLocationRequests(); method public boolean getReportLocation(); + method public boolean isLocationSettingsIgnored(); } } diff --git a/location/lib/java/com/android/location/provider/LocationRequestUnbundled.java b/location/lib/java/com/android/location/provider/LocationRequestUnbundled.java index 41fd769b5abd..2511c39caf5c 100644 --- a/location/lib/java/com/android/location/provider/LocationRequestUnbundled.java +++ b/location/lib/java/com/android/location/provider/LocationRequestUnbundled.java @@ -121,6 +121,15 @@ public final class LocationRequestUnbundled { return delegate.getSmallestDisplacement(); } + /** + * Returns true if location settings will be ignored in order to satisfy this request. + * + * @return true if location settings will be ignored in order to satisfy this request + */ + public boolean isLocationSettingsIgnored() { + return delegate.isLocationSettingsIgnored(); + } + @Override public String toString() { return delegate.toString(); diff --git a/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java b/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java index b825b58cd3e9..febbf1b23e0c 100644 --- a/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java +++ b/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java @@ -46,15 +46,15 @@ public final class ProviderRequestUnbundled { return mRequest.interval; } - public boolean getForceLocation() { - return mRequest.forceLocation; + public boolean isLocationSettingsIgnored() { + return mRequest.locationSettingsIgnored; } /** * Never null. */ public List<LocationRequestUnbundled> getLocationRequests() { - List<LocationRequestUnbundled> result = new ArrayList<LocationRequestUnbundled>( + List<LocationRequestUnbundled> result = new ArrayList<>( mRequest.locationRequests.size()); for (LocationRequest r : mRequest.locationRequests) { result.add(new LocationRequestUnbundled(r)); |