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

Commit 63718879 authored by Soonil Nagarkar's avatar Soonil Nagarkar Committed by Android (Google) Code Review
Browse files

Merge "Refactor Geocoder Provider System APIs" into main

parents 07a53766 8e54d085
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -133,8 +133,6 @@ Landroid/hardware/input/IInputManager$Stub;->asInterface(Landroid/os/IBinder;)La
Landroid/hardware/location/IContextHubService$Stub;->asInterface(Landroid/os/IBinder;)Landroid/hardware/location/IContextHubService;
Landroid/hardware/usb/IUsbManager$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/location/ICountryListener$Stub;-><init>()V
Landroid/location/IGeocodeProvider$Stub;-><init>()V
Landroid/location/IGeocodeProvider$Stub;->asInterface(Landroid/os/IBinder;)Landroid/location/IGeocodeProvider;
Landroid/location/ILocationListener$Stub$Proxy;-><init>(Landroid/os/IBinder;)V
Landroid/location/ILocationListener$Stub$Proxy;->mRemote:Landroid/os/IBinder;
Landroid/location/ILocationListener$Stub;-><init>()V
+6 −6
Original line number Diff line number Diff line
@@ -88,12 +88,12 @@ package android.location {
  public final class Geocoder {
    ctor public Geocoder(@NonNull android.content.Context);
    ctor public Geocoder(@NonNull android.content.Context, @NonNull java.util.Locale);
    method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange int) throws java.io.IOException;
    method public void getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange int, @NonNull android.location.Geocoder.GeocodeListener);
    method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange int) throws java.io.IOException;
    method public void getFromLocationName(@NonNull String, @IntRange int, @NonNull android.location.Geocoder.GeocodeListener);
    method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double) throws java.io.IOException;
    method public void getFromLocationName(@NonNull String, @IntRange int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @NonNull android.location.Geocoder.GeocodeListener);
    method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange(from=1) int) throws java.io.IOException;
    method public void getFromLocation(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange(from=1) int, @NonNull android.location.Geocoder.GeocodeListener);
    method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange(from=1) int) throws java.io.IOException;
    method public void getFromLocationName(@NonNull String, @IntRange(from=1) int, @NonNull android.location.Geocoder.GeocodeListener);
    method @Deprecated @Nullable public java.util.List<android.location.Address> getFromLocationName(@NonNull String, @IntRange(from=1) int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double) throws java.io.IOException;
    method public void getFromLocationName(@NonNull String, @IntRange(from=1) int, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @NonNull android.location.Geocoder.GeocodeListener);
    method public static boolean isPresent();
  }

+49 −0
Original line number Diff line number Diff line
@@ -591,6 +591,36 @@ package android.location {

package android.location.provider {

  @FlaggedApi(Flags.FLAG_NEW_GEOCODER) public final class ForwardGeocodeRequest implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getCallingAttributionTag();
    method @NonNull public String getCallingPackage();
    method public int getCallingUid();
    method @NonNull public java.util.Locale getLocale();
    method @NonNull public String getLocationName();
    method @FloatRange(from=-90.0, to=90.0) public double getLowerLeftLatitude();
    method @FloatRange(from=-180.0, to=180.0) public double getLowerLeftLongitude();
    method @IntRange(from=1) public int getMaxResults();
    method @FloatRange(from=-90.0, to=90.0) public double getUpperRightLatitude();
    method @FloatRange(from=-180.0, to=180.0) public double getUpperRightLongitude();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.location.provider.ForwardGeocodeRequest> CREATOR;
  }

  public static final class ForwardGeocodeRequest.Builder {
    ctor public ForwardGeocodeRequest.Builder(@NonNull String, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange(from=1) int, @NonNull java.util.Locale, int, @NonNull String);
    method @NonNull public android.location.provider.ForwardGeocodeRequest build();
    method @NonNull public android.location.provider.ForwardGeocodeRequest.Builder setCallingAttributionTag(@NonNull String);
  }

  @FlaggedApi(Flags.FLAG_NEW_GEOCODER) public abstract class GeocodeProviderBase {
    ctor public GeocodeProviderBase(@NonNull android.content.Context, @NonNull String);
    method @NonNull public final android.os.IBinder getBinder();
    method public abstract void onForwardGeocode(@NonNull android.location.provider.ForwardGeocodeRequest, @NonNull android.os.OutcomeReceiver<java.util.List<android.location.Address>,java.lang.Exception>);
    method public abstract void onReverseGeocode(@NonNull android.location.provider.ReverseGeocodeRequest, @NonNull android.os.OutcomeReceiver<java.util.List<android.location.Address>,java.lang.Exception>);
    field public static final String ACTION_GEOCODE_PROVIDER = "com.android.location.service.GeocodeProvider";
  }

  public abstract class LocationProviderBase {
    ctor public LocationProviderBase(@NonNull android.content.Context, @NonNull String, @NonNull android.location.provider.ProviderProperties);
    method @Nullable public final android.os.IBinder getBinder();
@@ -642,5 +672,24 @@ package android.location.provider {
    method public void onProviderRequestChanged(@NonNull String, @NonNull android.location.provider.ProviderRequest);
  }

  @FlaggedApi(Flags.FLAG_NEW_GEOCODER) public final class ReverseGeocodeRequest implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public String getCallingAttributionTag();
    method @NonNull public String getCallingPackage();
    method public int getCallingUid();
    method @FloatRange(from=-90.0, to=90.0) public double getLatitude();
    method @NonNull public java.util.Locale getLocale();
    method @FloatRange(from=-180.0, to=180.0) public double getLongitude();
    method @IntRange(from=1) public int getMaxResults();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.location.provider.ReverseGeocodeRequest> CREATOR;
  }

  public static final class ReverseGeocodeRequest.Builder {
    ctor public ReverseGeocodeRequest.Builder(@FloatRange(from=-90.0, to=90.0) double, @FloatRange(from=-180.0, to=180.0) double, @IntRange(from=0) int, @NonNull java.util.Locale, int, @NonNull String);
    method @NonNull public android.location.provider.ReverseGeocodeRequest build();
    method @NonNull public android.location.provider.ReverseGeocodeRequest.Builder setCallingAttributionTag(@NonNull String);
  }

}
+122 −109

File changed.

Preview size limit exceeded, changes collapsed.

+6 −9
Original line number Diff line number Diff line
@@ -19,13 +19,11 @@ package android.location;
import android.app.PendingIntent;
import android.location.Address;
import android.location.Criteria;
import android.location.GeocoderParams;
import android.location.Geofence;
import android.location.GnssAntennaInfo;
import android.location.GnssCapabilities;
import android.location.GnssMeasurementCorrections;
import android.location.GnssMeasurementRequest;
import android.location.IGeocodeListener;
import android.location.IGnssAntennaInfoListener;
import android.location.IGnssMeasurementsListener;
import android.location.IGnssStatusListener;
@@ -37,8 +35,11 @@ import android.location.LastLocationRequest;
import android.location.Location;
import android.location.LocationRequest;
import android.location.LocationTime;
import android.location.provider.ForwardGeocodeRequest;
import android.location.provider.IGeocodeCallback;
import android.location.provider.IProviderRequestListener;
import android.location.provider.ProviderProperties;
import android.location.provider.ReverseGeocodeRequest;
import android.os.Bundle;
import android.os.ICancellationSignal;
import android.os.PackageTagsList;
@@ -68,13 +69,9 @@ interface ILocationManager
    void requestGeofence(in Geofence geofence, in PendingIntent intent, String packageName, String attributionTag);
    void removeGeofence(in PendingIntent intent);

    boolean geocoderIsPresent();
    void getFromLocation(double latitude, double longitude, int maxResults,
        in GeocoderParams params, in IGeocodeListener listener);
    void getFromLocationName(String locationName,
        double lowerLeftLatitude, double lowerLeftLongitude,
        double upperRightLatitude, double upperRightLongitude, int maxResults,
        in GeocoderParams params, in IGeocodeListener listener);
    boolean isGeocodeAvailable();
    void reverseGeocode(in ReverseGeocodeRequest request, in IGeocodeCallback callback);
    void forwardGeocode(in ForwardGeocodeRequest request, in IGeocodeCallback callback);

    GnssCapabilities getGnssCapabilities();
    int getGnssYearOfHardware();
Loading