summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2023-06-04 18:17:21 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-06-04 18:17:21 +0000
commit81347bb6b274222e98608ac03c9da1e974716b51 (patch)
tree8da32453e10e40500dde52a4c574ad7c4c2c789f
parent522aee3631c5e0d857f2fc3d619c05f9cc778d17 (diff)
parent4456f22c17671f75f334a1b8eb92c904d7f7dda6 (diff)
Merge "Fix next call WIC#show(ime()) failed when the app in multi-window mode" into udc-dev am: 4456f22c17
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23434717 Change-Id: I0cee6a16e088f72ad13a7fd481e5bc4435469815 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--core/java/android/view/InsetsController.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java
index 7e4e4022f00f..5019b85ca503 100644
--- a/core/java/android/view/InsetsController.java
+++ b/core/java/android/view/InsetsController.java
@@ -1099,21 +1099,25 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
// TODO: Support a ResultReceiver for IME.
// TODO(b/123718661): Make show() work for multi-session IME.
int typesReady = 0;
+ final boolean imeVisible = mState.isSourceOrDefaultVisible(
+ mImeSourceConsumer.getId(), ime());
for (int type = FIRST; type <= LAST; type = type << 1) {
if ((types & type) == 0) {
continue;
}
@AnimationType final int animationType = getAnimationType(type);
final boolean requestedVisible = (type & mRequestedVisibleTypes) != 0;
- final boolean isImeAnimation = type == ime();
- if (requestedVisible && animationType == ANIMATION_TYPE_NONE
- || animationType == ANIMATION_TYPE_SHOW) {
+ final boolean isIme = type == ime();
+ var alreadyVisible = requestedVisible && (!isIme || imeVisible)
+ && animationType == ANIMATION_TYPE_NONE;
+ var alreadyAnimatingShow = animationType == ANIMATION_TYPE_SHOW;
+ if (alreadyVisible || alreadyAnimatingShow) {
// no-op: already shown or animating in (because window visibility is
// applied before starting animation).
if (DEBUG) Log.d(TAG, String.format(
"show ignored for type: %d animType: %d requestedVisible: %s",
type, animationType, requestedVisible));
- if (isImeAnimation) {
+ if (isIme) {
ImeTracker.forLogging().onCancelled(statsToken,
ImeTracker.PHASE_CLIENT_APPLY_ANIMATION);
}
@@ -1121,13 +1125,13 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation
}
if (fromIme && animationType == ANIMATION_TYPE_USER) {
// App is already controlling the IME, don't cancel it.
- if (isImeAnimation) {
+ if (isIme) {
ImeTracker.forLogging().onFailed(
statsToken, ImeTracker.PHASE_CLIENT_APPLY_ANIMATION);
}
continue;
}
- if (isImeAnimation) {
+ if (isIme) {
ImeTracker.forLogging().onProgress(
statsToken, ImeTracker.PHASE_CLIENT_APPLY_ANIMATION);
}