Loading core/java/com/android/internal/inputmethod/Completable.java +20 −8 Original line number Original line Diff line number Diff line Loading @@ -117,7 +117,7 @@ public final class Completable { } } /** /** * @return {@link true} if {@link #onComplete()} gets called and {@link #mState} is * @return {@code true} if {@link #onComplete()} gets called and {@link #mState} is * {@link CompletionState#COMPLETED_WITH_VALUE}. * {@link CompletionState#COMPLETED_WITH_VALUE}. */ */ @AnyThread @AnyThread Loading Loading @@ -232,13 +232,25 @@ public final class Completable { } } /** /** * Blocks the calling thread until this object becomes ready to return the value. * Blocks the calling thread until this object becomes ready to return the value, even if * {@link InterruptedException} is thrown. */ */ @AnyThread @AnyThread public void await() { public void await() { boolean interrupted = false; while (true) { try { try { mLatch.await(); mLatch.await(); } catch (InterruptedException ignored) { } break; } catch (InterruptedException ignored) { interrupted = true; } } if (interrupted) { // Try to preserve the interrupt bit on this thread. Thread.currentThread().interrupt(); } } } } } Loading Loading @@ -487,7 +499,7 @@ public final class Completable { /** /** * Await the result by the {@link Completable.Values}. * Await the result by the {@link Completable.Values}. * * * @return the result once {@link ValueBase#onComplete()} * @return the result once {@link ValueBase#onComplete()}. */ */ @AnyThread @AnyThread @Nullable @Nullable Loading @@ -499,7 +511,7 @@ public final class Completable { /** /** * Await the int result by the {@link Completable.Int}. * Await the int result by the {@link Completable.Int}. * * * @return the result once {@link ValueBase#onComplete()} * @return the result once {@link ValueBase#onComplete()}. */ */ @AnyThread @AnyThread public static int getIntResult(@NonNull Completable.Int value) { public static int getIntResult(@NonNull Completable.Int value) { Loading Loading
core/java/com/android/internal/inputmethod/Completable.java +20 −8 Original line number Original line Diff line number Diff line Loading @@ -117,7 +117,7 @@ public final class Completable { } } /** /** * @return {@link true} if {@link #onComplete()} gets called and {@link #mState} is * @return {@code true} if {@link #onComplete()} gets called and {@link #mState} is * {@link CompletionState#COMPLETED_WITH_VALUE}. * {@link CompletionState#COMPLETED_WITH_VALUE}. */ */ @AnyThread @AnyThread Loading Loading @@ -232,13 +232,25 @@ public final class Completable { } } /** /** * Blocks the calling thread until this object becomes ready to return the value. * Blocks the calling thread until this object becomes ready to return the value, even if * {@link InterruptedException} is thrown. */ */ @AnyThread @AnyThread public void await() { public void await() { boolean interrupted = false; while (true) { try { try { mLatch.await(); mLatch.await(); } catch (InterruptedException ignored) { } break; } catch (InterruptedException ignored) { interrupted = true; } } if (interrupted) { // Try to preserve the interrupt bit on this thread. Thread.currentThread().interrupt(); } } } } } Loading Loading @@ -487,7 +499,7 @@ public final class Completable { /** /** * Await the result by the {@link Completable.Values}. * Await the result by the {@link Completable.Values}. * * * @return the result once {@link ValueBase#onComplete()} * @return the result once {@link ValueBase#onComplete()}. */ */ @AnyThread @AnyThread @Nullable @Nullable Loading @@ -499,7 +511,7 @@ public final class Completable { /** /** * Await the int result by the {@link Completable.Int}. * Await the int result by the {@link Completable.Int}. * * * @return the result once {@link ValueBase#onComplete()} * @return the result once {@link ValueBase#onComplete()}. */ */ @AnyThread @AnyThread public static int getIntResult(@NonNull Completable.Int value) { public static int getIntResult(@NonNull Completable.Int value) { Loading