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

Commit 7c2fdc44 authored by Alexander Dorokhine's avatar Alexander Dorokhine
Browse files

Fix completeExceptionally() wrapping in AndroidFuture.

writeToParcel() called get(), which obtained the exception wrapped in ExecutionException.
ExecutionException is not handled by Parcel's exception parcelling mechanism, causing it
to throw out of completeExceptionally without sending any data, leading to hangs.

Bug: 145838772
Test: presubmit
Change-Id: I5bb9b8b441264195039c9a2abe6a617af4ec8316
parent 700c836e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -513,6 +513,11 @@ public class AndroidFuture<T> extends CompletableFuture<T> implements Parcelable
            try {
                result = get();
            } catch (Exception t) {
                // Exceptions coming out of get() are wrapped in ExecutionException, which is not
                // handled by Parcel.
                if (t instanceof ExecutionException && t.getCause() instanceof Exception) {
                    t = (Exception) t.getCause();
                }
                dest.writeBoolean(true);
                dest.writeException(t);
                return;