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

Commit aa8164a3 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Propagate exceptions in RemoteInputConnectionImpl"

parents efd47fa5 0c1f2a11
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -752,6 +752,15 @@ public final class RemoteInputConnectionImpl extends IInputContext.Stub {
    private <T> void dispatch(@NonNull AndroidFuture untypedFuture, @NonNull Supplier<T> supplier) {
        @SuppressWarnings("unchecked")
        final AndroidFuture<T> future = untypedFuture;
        dispatch(() -> future.complete(supplier.get()));
        dispatch(() -> {
            final T result;
            try {
                result = supplier.get();
            } catch (Throwable throwable) {
                future.completeExceptionally(throwable);
                throw throwable;
            }
            future.complete(result);
        });
    }
}