From fa6f24d973d87c3174c8ea742d05a429c697a435 Mon Sep 17 00:00:00 2001 From: Felix Stern Date: Wed, 28 Aug 2024 14:07:43 +0000 Subject: Fix duration and insetsInterpolator when the IME is shown in landscape The bug is caused by the wrong condition check. The condition should be !hasZeroInsetsIme instead of hasZeroInsetsIme. Change-Id: I55edbcc49cdc10fe8641df75936cbc3fe2578832 Test: manual: Open app with animation callback in landscape mode and hide IME Flag: EXEMPT bugfix Bug: 349213527 --- core/java/android/view/InsetsController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/InsetsController.java b/core/java/android/view/InsetsController.java index b1df51f7affa..7c8cd932f737 100644 --- a/core/java/android/view/InsetsController.java +++ b/core/java/android/view/InsetsController.java @@ -488,7 +488,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @Override public Interpolator getInsetsInterpolator(boolean hasZeroInsetsIme) { if ((mRequestedTypes & ime()) != 0) { - if (mHasAnimationCallbacks && hasZeroInsetsIme) { + if (mHasAnimationCallbacks && !hasZeroInsetsIme) { return SYNC_IME_INTERPOLATOR; } else if (mShow) { return LINEAR_OUT_SLOW_IN_INTERPOLATOR; @@ -536,7 +536,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation @Override public long getDurationMs(boolean hasZeroInsetsIme) { if ((mRequestedTypes & ime()) != 0) { - if (mHasAnimationCallbacks && hasZeroInsetsIme) { + if (mHasAnimationCallbacks && !hasZeroInsetsIme) { return ANIMATION_DURATION_SYNC_IME_MS; } else { return ANIMATION_DURATION_UNSYNC_IME_MS; -- cgit v1.2.3-59-g8ed1b