diff options
| author | Tiger Huang <tigerhuang@google.com> | 2020-06-19 00:12:55 +0800 |
|---|---|---|
| committer | Tiger Huang <tigerhuang@google.com> | 2020-06-23 00:58:05 +0800 |
| commit | 618dbe022ff715cadff46e1d4102b2f0715e85ea (patch) | |
| tree | 4b6a857d31e0866870df0a70bb29df988e3a2aac /core/java/android/view/InsetsSourceConsumer.java | |
| parent | 5d544ddff061eafa2adfa2d00cf9dd5e663f5cd0 (diff) | |
Disable user animations on insets whose visible frame is empty (refined)
Floating IME or fullscreen IME won't cause insets (except the area
overlapped with navigation bar). It doesn't make much sense to let
apps move the IME at these cases.
Fix: 157777145
Test: atest InsetsSourceConsumerTest GlobalActionsImeTest
ImeInsetsControllerTest
Change-Id: Id70f59be7653beedc02d6c8bc3b1bd50a357f4fe
Diffstat (limited to 'core/java/android/view/InsetsSourceConsumer.java')
| -rw-r--r-- | core/java/android/view/InsetsSourceConsumer.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/java/android/view/InsetsSourceConsumer.java b/core/java/android/view/InsetsSourceConsumer.java index 565846638acc..8d92d7b5ab20 100644 --- a/core/java/android/view/InsetsSourceConsumer.java +++ b/core/java/android/view/InsetsSourceConsumer.java @@ -18,8 +18,8 @@ package android.view; import static android.view.InsetsController.ANIMATION_TYPE_NONE; import static android.view.InsetsController.AnimationType; -import static android.view.InsetsState.getDefaultVisibility; import static android.view.InsetsController.DEBUG; +import static android.view.InsetsState.getDefaultVisibility; import static android.view.InsetsState.toPublicType; import static com.android.internal.annotations.VisibleForTesting.Visibility.PACKAGE; @@ -275,9 +275,9 @@ public class InsetsSourceConsumer { } @VisibleForTesting(visibility = PACKAGE) - public void updateSource(InsetsSource newSource) { + public void updateSource(InsetsSource newSource, @AnimationType int animationType) { InsetsSource source = mState.peekSource(mType); - if (source == null || mController.getAnimationType(mType) == ANIMATION_TYPE_NONE + if (source == null || animationType == ANIMATION_TYPE_NONE || source.getFrame().equals(newSource.getFrame())) { mPendingFrame = null; mPendingVisibleFrame = null; @@ -286,7 +286,7 @@ public class InsetsSourceConsumer { } // Frame is changing while animating. Keep note of the new frame but keep existing frame - // until animaition is finished. + // until animation is finished. newSource = new InsetsSource(newSource); mPendingFrame = new Rect(newSource.getFrame()); mPendingVisibleFrame = newSource.getVisibleFrame() != null |
