summaryrefslogtreecommitdiff
path: root/location/java
diff options
context:
space:
mode:
author Soonil Nagarkar <sooniln@google.com> 2024-03-08 10:39:14 -0800
committer Soonil Nagarkar <sooniln@google.com> 2024-03-08 10:49:33 -0800
commit7200cd5ab4dd657a9396ffca88627a5d5ee4c700 (patch)
tree5176271d1559df0eeb64f8064ae755cf3a7b58dc /location/java
parent1d651eb223ab8529977d77a38306d9ada9d856cf (diff)
Allow Throwable to represent errors
Previously used Exception, but there's no good reason not to allow any Throwable instead which allows for slightly more client flexibility. Bug: 229872126 Test: atest GeocodeProviderBaseTest Change-Id: Ie81f00dd2c082c331c10045e93fbeb8f2a393354
Diffstat (limited to 'location/java')
-rw-r--r--location/java/android/location/provider/GeocodeProviderBase.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/location/java/android/location/provider/GeocodeProviderBase.java b/location/java/android/location/provider/GeocodeProviderBase.java
index e2c48b9c3515..71644d07be57 100644
--- a/location/java/android/location/provider/GeocodeProviderBase.java
+++ b/location/java/android/location/provider/GeocodeProviderBase.java
@@ -104,14 +104,14 @@ public abstract class GeocodeProviderBase {
*/
public abstract void onForwardGeocode(
@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.
*/
public abstract void onReverseGeocode(
@NonNull ReverseGeocodeRequest request,
- @NonNull OutcomeReceiver<List<Address>, Exception> callback);
+ @NonNull OutcomeReceiver<List<Address>, Throwable> callback);
private class Service extends IGeocodeProvider.Stub {
@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;
@@ -154,7 +154,7 @@ public abstract class GeocodeProviderBase {
}
@Override
- public void onError(Exception e) {
+ public void onError(Throwable e) {
try {
Objects.requireNonNull(mCallback.getAndSet(null)).onError(e.toString());
} catch (RemoteException r) {