summaryrefslogtreecommitdiff
path: root/location/lib/java
diff options
context:
space:
mode:
Diffstat (limited to 'location/lib/java')
-rw-r--r--location/lib/java/com/android/location/provider/LocationProviderBase.java7
-rw-r--r--location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java4
2 files changed, 11 insertions, 0 deletions
diff --git a/location/lib/java/com/android/location/provider/LocationProviderBase.java b/location/lib/java/com/android/location/provider/LocationProviderBase.java
index fa113a8aa3ef..6bde3a884c30 100644
--- a/location/lib/java/com/android/location/provider/LocationProviderBase.java
+++ b/location/lib/java/com/android/location/provider/LocationProviderBase.java
@@ -22,6 +22,7 @@ import android.location.ILocationManager;
import android.location.Location;
import android.location.LocationManager;
import android.location.LocationProvider;
+import android.os.Build.VERSION_CODES;
import android.os.Bundle;
import android.os.IBinder;
import android.os.RemoteException;
@@ -29,6 +30,8 @@ import android.os.ServiceManager;
import android.os.WorkSource;
import android.util.Log;
+import androidx.annotation.RequiresApi;
+
import com.android.internal.location.ILocationProvider;
import com.android.internal.location.ILocationProviderManager;
import com.android.internal.location.ProviderProperties;
@@ -125,6 +128,7 @@ public abstract class LocationProviderBase {
* taken into account in the parent's enabled/disabled state. For most providers, it is expected
* that they will be always enabled.
*/
+ @RequiresApi(VERSION_CODES.Q)
public void setEnabled(boolean enabled) {
synchronized (mBinder) {
if (mEnabled == enabled) {
@@ -148,6 +152,7 @@ public abstract class LocationProviderBase {
* Sets the provider properties that may be queried by clients. Generally speaking, providers
* should try to avoid changing their properties after construction.
*/
+ @RequiresApi(VERSION_CODES.Q)
public void setProperties(ProviderPropertiesUnbundled properties) {
synchronized (mBinder) {
mProperties = properties.getProviderProperties();
@@ -170,6 +175,7 @@ public abstract class LocationProviderBase {
* providing location. This will inform location services to treat the other packages as
* location providers as well.
*/
+ @RequiresApi(VERSION_CODES.Q)
public void setAdditionalProviderPackages(List<String> packageNames) {
synchronized (mBinder) {
mAdditionalProviderPackages.clear();
@@ -190,6 +196,7 @@ public abstract class LocationProviderBase {
* Returns true if this provider has been set as enabled. This will be true unless explicitly
* set otherwise.
*/
+ @RequiresApi(VERSION_CODES.Q)
public boolean isEnabled() {
return mEnabled;
}
diff --git a/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java b/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java
index febbf1b23e0c..d12d6b777856 100644
--- a/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java
+++ b/location/lib/java/com/android/location/provider/ProviderRequestUnbundled.java
@@ -17,6 +17,9 @@
package com.android.location.provider;
import android.location.LocationRequest;
+import android.os.Build;
+
+import androidx.annotation.RequiresApi;
import com.android.internal.location.ProviderRequest;
@@ -46,6 +49,7 @@ public final class ProviderRequestUnbundled {
return mRequest.interval;
}
+ @RequiresApi(Build.VERSION_CODES.Q)
public boolean isLocationSettingsIgnored() {
return mRequest.locationSettingsIgnored;
}