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

Commit 03e0b893 authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Add asynchronous geocoding API

Geocoding is unsupported, but the old APIs encourage bad behavior and
force clients to waste a thread blocking for results. This often causes
ANRs in a variety of applications. Provider an asynchronous API so
clients can avoid ANRs.

Bug: 197585308
Test: presubmits
Change-Id: I6fdd90d467f01892ce34371c2161721bd5976ca9
parent 60a7931d
Loading
Loading
Loading
Loading
+13 −5
Original line number Diff line number Diff line
@@ -19606,14 +19606,22 @@ package android.location {
  }
  public final class Geocoder {
    ctor public Geocoder(android.content.Context, java.util.Locale);
    ctor public Geocoder(android.content.Context);
    method public java.util.List<android.location.Address> getFromLocation(double, double, int) throws java.io.IOException;
    method public java.util.List<android.location.Address> getFromLocationName(String, int) throws java.io.IOException;
    method public java.util.List<android.location.Address> getFromLocationName(String, int, double, double, double, double) throws java.io.IOException;
    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 public static boolean isPresent();
  }
  public static interface Geocoder.GeocodeListener {
    method public default void onError(@Nullable String);
    method public void onGeocode(@NonNull java.util.List<android.location.Address>);
  }
  public final class GnssAntennaInfo implements android.os.Parcelable {
    method public int describeContents();
    method @FloatRange(from=0.0f) public double getCarrierFrequencyMHz();
+225 −84

File changed.

Preview size limit exceeded, changes collapsed.

+10 −10

File changed.

Preview size limit exceeded, changes collapsed.