Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 470c8f6a authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Give location providers a known identity

Providers no longer need the ability to specify additional packages,
this can be replaced with tracking the provider identity.

In addition, move CallerIdentity into the client space, and fix some
minor GNSS bugs.

Bug: 149839935
Test: atest LocationProviderTest
Change-Id: Ide107abc61531946b20d2ac50cd9555fc215ef03
parent 054e5a3b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -4164,7 +4164,8 @@ package android.location {
    method public boolean isExtraLocationControllerPackageEnabled();
    method public boolean isLocationEnabledForUser(@NonNull android.os.UserHandle);
    method public boolean isProviderEnabledForUser(@NonNull String, @NonNull android.os.UserHandle);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@NonNull String);
    method @Deprecated @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@NonNull String);
    method @RequiresPermission(android.Manifest.permission.READ_DEVICE_CONFIG) public boolean isProviderPackage(@Nullable String, @NonNull String);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean registerGnssBatchedLocationCallback(long, boolean, @NonNull android.location.BatchedLocationCallback, @Nullable android.os.Handler);
    method @RequiresPermission(allOf={android.Manifest.permission.ACCESS_FINE_LOCATION, android.Manifest.permission.LOCATION_HARDWARE}) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssRequest, @NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback);
    method @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);
+1 −1
Original line number Diff line number Diff line
@@ -1387,7 +1387,7 @@ package android.location {
    method @NonNull public String[] getBackgroundThrottlingWhitelist();
    method @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 @NonNull public String[] getIgnoreSettingsWhitelist();
    method @Nullable @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public java.util.List<java.lang.String> getProviderPackages(@NonNull String);
    method @Deprecated @Nullable @RequiresPermission("android.permission.READ_DEVICE_CONFIG") public java.util.List<java.lang.String> getProviderPackages(@NonNull String);
    method @NonNull public java.util.List<android.location.LocationRequest> getTestProviderCurrentRequests(String);
    method @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 @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);
+3 −2
Original line number Diff line number Diff line
@@ -4987,9 +4987,10 @@
    <feature android:featureId="CountryDetector" android:label="@string/country_detector"/>
    <!-- Feature Id for Location service. -->
    <feature android:featureId="LocationService" android:label="@string/location_service"/>
    <!-- Feature Id for Gnss service. -->
    <feature android:featureId="GnssService" android:label="@string/gnss_service"/>
    <!-- Feature Id for Sensor Notification service. -->
    <feature android:featureId="SensorNotificationService"
             android:label="@string/sensor_notification_service"/>
    <feature android:featureId="SensorNotificationService" android:label="@string/sensor_notification_service"/>
    <!-- Feature Id for Twilight service. -->
    <feature android:featureId="TwilightService" android:label="@string/twilight_service"/>

+2 −0
Original line number Diff line number Diff line
@@ -425,6 +425,8 @@
    <string name="country_detector">Country Detector</string>
    <!-- Feature Id for Location service. [CHAR LIMIT=NONE]-->
    <string name="location_service">Location Service</string>
    <!-- Feature Id for Gnss service. [CHAR LIMIT=NONE]-->
    <string name="gnss_service">GNSS Service</string>
    <!-- Feature Id for Sensor Notification service. [CHAR LIMIT=NONE]-->
    <string name="sensor_notification_service">Sensor Notification Service</string>
    <!-- Feature Id for Twilight service. [CHAR LIMIT=NONE]-->
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ interface ILocationManager
    List<String> getProviders(in Criteria criteria, boolean enabledOnly);
    String getBestProvider(in Criteria criteria, boolean enabledOnly);
    ProviderProperties getProviderProperties(String provider);
    boolean isProviderPackage(String packageName);
    boolean isProviderPackage(String provider, String packageName);
    List<String> getProviderPackages(String provider);

    void setExtraLocationControllerPackage(String packageName);
Loading