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

Commit 4122026f authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allow Throwable to represent errors" into main

parents 617373ce 7200cd5a
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -616,8 +616,8 @@ package android.location.provider {
  @FlaggedApi(Flags.FLAG_NEW_GEOCODER) public abstract class GeocodeProviderBase {
  @FlaggedApi(Flags.FLAG_NEW_GEOCODER) public abstract class GeocodeProviderBase {
    ctor public GeocodeProviderBase(@NonNull android.content.Context, @NonNull String);
    ctor public GeocodeProviderBase(@NonNull android.content.Context, @NonNull String);
    method @NonNull public final android.os.IBinder getBinder();
    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 onForwardGeocode(@NonNull android.location.provider.ForwardGeocodeRequest, @NonNull android.os.OutcomeReceiver<java.util.List<android.location.Address>,java.lang.Throwable>);
    method public abstract void onReverseGeocode(@NonNull android.location.provider.ReverseGeocodeRequest, @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.Throwable>);
    field public static final String ACTION_GEOCODE_PROVIDER = "com.android.location.service.GeocodeProvider";
    field public static final String ACTION_GEOCODE_PROVIDER = "com.android.location.service.GeocodeProvider";
  }
  }


+4 −4
Original line number Original line Diff line number Diff line
@@ -104,14 +104,14 @@ public abstract class GeocodeProviderBase {
     */
     */
    public abstract void onForwardGeocode(
    public abstract void onForwardGeocode(
            @NonNull ForwardGeocodeRequest request,
            @NonNull ForwardGeocodeRequest request,
            @NonNull OutcomeReceiver<List<Address>, Exception> callback);
            @NonNull OutcomeReceiver<List<Address>, Throwable> callback);


    /**
    /**
     * Requests reverse geocoding of the given arguments. The given callback must be invoked once.
     * Requests reverse geocoding of the given arguments. The given callback must be invoked once.
     */
     */
    public abstract void onReverseGeocode(
    public abstract void onReverseGeocode(
            @NonNull ReverseGeocodeRequest request,
            @NonNull ReverseGeocodeRequest request,
            @NonNull OutcomeReceiver<List<Address>, Exception> callback);
            @NonNull OutcomeReceiver<List<Address>, Throwable> callback);


    private class Service extends IGeocodeProvider.Stub {
    private class Service extends IGeocodeProvider.Stub {
        @Override
        @Override
@@ -145,7 +145,7 @@ public abstract class GeocodeProviderBase {
        }
        }
    }
    }


    private static class SingleUseCallback implements OutcomeReceiver<List<Address>, Exception> {
    private static class SingleUseCallback implements OutcomeReceiver<List<Address>, Throwable> {


        private final AtomicReference<IGeocodeCallback> mCallback;
        private final AtomicReference<IGeocodeCallback> mCallback;


@@ -154,7 +154,7 @@ public abstract class GeocodeProviderBase {
        }
        }


        @Override
        @Override
        public void onError(Exception e) {
        public void onError(Throwable e) {
            try {
            try {
                Objects.requireNonNull(mCallback.getAndSet(null)).onError(e.toString());
                Objects.requireNonNull(mCallback.getAndSet(null)).onError(e.toString());
            } catch (RemoteException r) {
            } catch (RemoteException r) {