diff options
author | 2024-11-13 13:57:20 -0800 | |
---|---|---|
committer | 2024-11-13 14:01:00 -0800 | |
commit | de53d9657cd5e352984697fc130159c474e819a9 (patch) | |
tree | 79b7d2c74d20c83b9adaddfde7862240e4d3725e /location | |
parent | 70a1e5dcf316f8ddf6d1b3b00341c7a35a8dcc58 (diff) | |
parent | 8eecb1a1afe454e3233f27b06f9e5d41b5bec011 (diff) |
Merge 24Q4 (ab/12406339) into aosp-main-future
Bug: 370570306
Merged-In: Ic2ffd5a1f4420121b958cadb726c3e805cda1434
Change-Id: If0f7008f8e699bf1fca8d20ee5e05877a61ea002
Diffstat (limited to 'location')
-rw-r--r-- | location/Android.bp | 1 | ||||
-rw-r--r-- | location/api/system-current.txt | 4 | ||||
-rw-r--r-- | location/java/android/location/LocationManager.java | 14 | ||||
-rw-r--r-- | location/java/android/location/flags/location.aconfig | 60 | ||||
-rw-r--r-- | location/lint-baseline.xml | 81 |
5 files changed, 150 insertions, 10 deletions
diff --git a/location/Android.bp b/location/Android.bp index 10ca97d74660..bc02d1f852de 100644 --- a/location/Android.bp +++ b/location/Android.bp @@ -37,6 +37,7 @@ java_sdk_library { ], }, lint: { + baseline_filename: "lint-baseline.xml", warning_checks: [ "FlaggedApi", ], diff --git a/location/api/system-current.txt b/location/api/system-current.txt index f6e76a246947..cf3f74085d66 100644 --- a/location/api/system-current.txt +++ b/location/api/system-current.txt @@ -437,7 +437,7 @@ package android.location { } public class LocationManager { - method @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.INTERACT_ACROSS_USERS}) public void addProviderRequestChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.provider.ProviderRequest.ChangedListener); + method @Deprecated @FlaggedApi("android.location.flags.deprecate_provider_request_apis") @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.INTERACT_ACROSS_USERS}) public void addProviderRequestChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.provider.ProviderRequest.ChangedListener); method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void flushGnssBatch(); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void getCurrentLocation(@NonNull android.location.LocationRequest, @Nullable android.os.CancellationSignal, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.location.Location>); method @Nullable public String getExtraLocationControllerPackage(); @@ -452,7 +452,7 @@ package android.location { method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String, @Nullable String); method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.LOCATION_HARDWARE, android.Manifest.permission.UPDATE_APP_OPS_STATS}) public boolean registerGnssBatchedLocationCallback(long, boolean, @NonNull android.location.BatchedLocationCallback, @Nullable android.os.Handler); method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback); - method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void removeProviderRequestChangedListener(@NonNull android.location.provider.ProviderRequest.ChangedListener); + method @Deprecated @FlaggedApi("android.location.flags.deprecate_provider_request_apis") @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void removeProviderRequestChangedListener(@NonNull android.location.provider.ProviderRequest.ChangedListener); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.location.LocationListener, @Nullable android.os.Looper); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.LocationListener); method @Deprecated @RequiresPermission(anyOf={android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION}) public void requestLocationUpdates(@Nullable android.location.LocationRequest, @NonNull android.app.PendingIntent); diff --git a/location/java/android/location/LocationManager.java b/location/java/android/location/LocationManager.java index d9217307d2b4..306643d8477e 100644 --- a/location/java/android/location/LocationManager.java +++ b/location/java/android/location/LocationManager.java @@ -28,6 +28,7 @@ import static com.android.internal.util.ConcurrentUtils.DIRECT_EXECUTOR; import android.Manifest; import android.annotation.CallbackExecutor; +import android.annotation.FlaggedApi; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresFeature; @@ -47,6 +48,7 @@ import android.compat.annotation.EnabledAfter; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; +import android.location.flags.Flags; import android.location.provider.IProviderRequestListener; import android.location.provider.ProviderProperties; import android.location.provider.ProviderRequest; @@ -449,7 +451,7 @@ public class LocationManager { private static final long MAX_SINGLE_LOCATION_TIMEOUT_MS = 30 * 1000; private static final String CACHE_KEY_LOCATION_ENABLED_PROPERTY = - "cache_key.location_enabled"; + PropertyInvalidatedCache.createSystemCacheKey("location_enabled"); static ILocationManager getService() throws RemoteException { try { @@ -2957,8 +2959,13 @@ public class LocationManager { * * @param executor the executor that the callback runs on * @param listener the listener to register + * + * @deprecated Do not use - this API was intended for testing only, and may not return any + * results in the future. * @hide */ + @FlaggedApi(Flags.FLAG_DEPRECATE_PROVIDER_REQUEST_APIS) + @Deprecated @SystemApi @RequiresPermission(allOf = {Manifest.permission.LOCATION_HARDWARE, Manifest.permission.INTERACT_ACROSS_USERS}) @@ -2973,8 +2980,13 @@ public class LocationManager { * Removes a {@link ProviderRequest.ChangedListener} that has been added. * * @param listener the listener to remove. + * + * @deprecated Do not use - this API was intended for testing only, and may not return any + * results in the future. * @hide */ + @FlaggedApi(Flags.FLAG_DEPRECATE_PROVIDER_REQUEST_APIS) + @Deprecated @SystemApi @RequiresPermission(Manifest.permission.LOCATION_HARDWARE) public void removeProviderRequestChangedListener( diff --git a/location/java/android/location/flags/location.aconfig b/location/java/android/location/flags/location.aconfig index 5f84862ddf49..c3cb4927ac10 100644 --- a/location/java/android/location/flags/location.aconfig +++ b/location/java/android/location/flags/location.aconfig @@ -2,6 +2,27 @@ package: "android.location.flags" container: "system" flag { + name: "deprecate_provider_request_apis" + namespace: "location" + description: "Deprecates LocationManager ProviderChanged APIs" + bug: "361811782" +} + +flag { + name: "keep_gnss_stationary_throttling" + namespace: "location" + description: "Keeps stationary throttling for the GNSS provider even if the disable_stationary_throttling flag is true." + bug: "354000147" +} + +flag { + name: "disable_stationary_throttling" + namespace: "location" + description: "Disables stationary throttling for all providers" + bug: "354000147" +} + +flag { name: "new_geocoder" namespace: "location" description: "Flag for new Geocoder APIs" @@ -45,13 +66,6 @@ flag { } flag { - name: "gnss_call_stop_before_set_position_mode" - namespace: "location" - description: "Flag for calling stop() before setPositionMode()" - bug: "306874828" -} - -flag { name: "gnss_api_measurement_request_work_source" namespace: "location" description: "Flag for GnssMeasurementRequest WorkSource API" @@ -80,6 +94,16 @@ flag { } flag { + name: "use_legacy_ntp_time" + namespace: "location" + description: "Flag for switching to legacy NtpNetworkTimeHelper" + bug: "368034558" + metadata { + purpose: PURPOSE_BUGFIX + } +} + +flag { name: "subscriptions_changed_listener_thread" namespace: "location" description: "Flag for running onSubscriptionsChangedListener on FgThread" @@ -95,3 +119,25 @@ flag { description: "Flag for GNSS configuration from resource" bug: "317734846" } + +flag { + name: "enable_ni_supl_message_injection_by_carrier_config_bugfix" + namespace: "location" + description: "Flag for enabling NI SUPL message injection by carrier config" + bug: "242105192" + is_fixed_read_only: true + metadata { + purpose: PURPOSE_BUGFIX + } +} + +flag { + name: "enable_ni_supl_message_injection_by_carrier_config" + namespace: "location" + description: "Flag for enabling NI SUPL message injection by carrier config" + bug: "242105192" + is_fixed_read_only: true + metadata { + purpose: PURPOSE_BUGFIX + } +} diff --git a/location/lint-baseline.xml b/location/lint-baseline.xml new file mode 100644 index 000000000000..a5a2e259b8ac --- /dev/null +++ b/location/lint-baseline.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="UTF-8"?> +<issues format="6" by="lint 8.4.0-alpha08" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha08"> + + <issue + id="FlaggedApi" + message="Method `Builder()` is a flagged API and should be inside an `if (Flags.newGeocoder())` check (or annotate the surrounding method `getFromLocation` with `@FlaggedApi(Flags.FLAG_NEW_GEOCODER) to transfer requirement to caller`)" + errorLine1=" new ReverseGeocodeRequest.Builder(" + errorLine2=" ^"> + <location + file="frameworks/base/location/java/android/location/Geocoder.java" + line="170" + column="17"/> + </issue> + + <issue + id="FlaggedApi" + message="Method `setCallingAttributionTag()` is a flagged API and should be inside an `if (Flags.newGeocoder())` check (or annotate the surrounding method `getFromLocation` with `@FlaggedApi(Flags.FLAG_NEW_GEOCODER) to transfer requirement to caller`)" + errorLine1=" b.setCallingAttributionTag(mContext.getAttributionTag());" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + <location + file="frameworks/base/location/java/android/location/Geocoder.java" + line="178" + column="13"/> + </issue> + + <issue + id="FlaggedApi" + message="Method `build()` is a flagged API and should be inside an `if (Flags.newGeocoder())` check (or annotate the surrounding method `getFromLocation` with `@FlaggedApi(Flags.FLAG_NEW_GEOCODER) to transfer requirement to caller`)" + errorLine1=" mService.reverseGeocode(b.build(), new GeocodeCallbackImpl(listener));" + errorLine2=" ~~~~~~~~~"> + <location + file="frameworks/base/location/java/android/location/Geocoder.java" + line="181" + column="37"/> + </issue> + + <issue + id="FlaggedApi" + message="Method `Builder()` is a flagged API and should be inside an `if (Flags.newGeocoder())` check (or annotate the surrounding method `getFromLocationName` with `@FlaggedApi(Flags.FLAG_NEW_GEOCODER) to transfer requirement to caller`)" + errorLine1=" new ForwardGeocodeRequest.Builder(" + errorLine2=" ^"> + <location + file="frameworks/base/location/java/android/location/Geocoder.java" + line="322" + column="17"/> + </issue> + + <issue + id="FlaggedApi" + message="Method `setCallingAttributionTag()` is a flagged API and should be inside an `if (Flags.newGeocoder())` check (or annotate the surrounding method `getFromLocationName` with `@FlaggedApi(Flags.FLAG_NEW_GEOCODER) to transfer requirement to caller`)" + errorLine1=" b.setCallingAttributionTag(mContext.getAttributionTag());" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"> + <location + file="frameworks/base/location/java/android/location/Geocoder.java" + line="333" + column="13"/> + </issue> + + <issue + id="FlaggedApi" + message="Method `build()` is a flagged API and should be inside an `if (Flags.newGeocoder())` check (or annotate the surrounding method `getFromLocationName` with `@FlaggedApi(Flags.FLAG_NEW_GEOCODER) to transfer requirement to caller`)" + errorLine1=" mService.forwardGeocode(b.build(), new GeocodeCallbackImpl(listener));" + errorLine2=" ~~~~~~~~~"> + <location + file="frameworks/base/location/java/android/location/Geocoder.java" + line="336" + column="37"/> + </issue> + + <issue + id="FlaggedApi" + message="Method `getWorkSource()` is a flagged API and should be inside an `if (Flags.gnssApiMeasurementRequestWorkSource())` check (or annotate the surrounding method `Builder` with `@FlaggedApi(Flags.FLAG_GNSS_API_MEASUREMENT_REQUEST_WORK_SOURCE) to transfer requirement to caller`)" + errorLine1=" mWorkSource = request.getWorkSource();" + errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~"> + <location + file="frameworks/base/location/java/android/location/GnssMeasurementRequest.java" + line="234" + column="27"/> + </issue> + +</issues> |