diff options
| author | Tiger Huang <tigerhuang@google.com> | 2020-05-21 22:16:14 +0800 |
|---|---|---|
| committer | Tiger Huang <tigerhuang@google.com> | 2020-06-15 19:36:37 +0800 |
| commit | f23211979e6481f8ad2f2d60e7b0f005d0f70c15 (patch) | |
| tree | 20f6f89ff4dee13833d4c9cc451ce06e29ae7390 /core/java/android/view/PendingInsetsController.java | |
| parent | 1e5e8ecad18f16ccc48fafe4a66ac2e19f1b1461 (diff) | |
Let animations of insets controller can be disabled
In some cases, System UI needs to hide navigation bar without any
animation, i.e. transitioning to AOD. This CL creates a method in
insets controller to disable/enable animations.
Fix: 150729581
Test: Enable AOD, and go to AOD from home screen by pressing power key.
Test: Enter/leave bouncer while screen is on.
Change-Id: I3fb7be898b9e615c661d07eca97c9ffcb6bbf8c3
Diffstat (limited to 'core/java/android/view/PendingInsetsController.java')
| -rw-r--r-- | core/java/android/view/PendingInsetsController.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/core/java/android/view/PendingInsetsController.java b/core/java/android/view/PendingInsetsController.java index 0283ada0dd40..c018d1cf1782 100644 --- a/core/java/android/view/PendingInsetsController.java +++ b/core/java/android/view/PendingInsetsController.java @@ -38,6 +38,7 @@ public class PendingInsetsController implements WindowInsetsController { private @Appearance int mAppearance; private @Appearance int mAppearanceMask; private @Behavior int mBehavior = KEEP_BEHAVIOR; + private boolean mAnimationsDisabled; private final InsetsState mDummyState = new InsetsState(); private InsetsController mReplayedInsetsController; private ArrayList<OnControllableInsetsChangedListener> mControllableInsetsChangedListeners @@ -103,6 +104,15 @@ public class PendingInsetsController implements WindowInsetsController { } @Override + public void setAnimationsDisabled(boolean disable) { + if (mReplayedInsetsController != null) { + mReplayedInsetsController.setAnimationsDisabled(disable); + } else { + mAnimationsDisabled = disable; + } + } + + @Override public InsetsState getState() { return mDummyState; } @@ -151,6 +161,9 @@ public class PendingInsetsController implements WindowInsetsController { if (mCaptionInsetsHeight != 0) { controller.setCaptionInsetsHeight(mCaptionInsetsHeight); } + if (mAnimationsDisabled) { + controller.setAnimationsDisabled(true); + } int size = mRequests.size(); for (int i = 0; i < size; i++) { mRequests.get(i).replay(controller); @@ -167,6 +180,7 @@ public class PendingInsetsController implements WindowInsetsController { mBehavior = KEEP_BEHAVIOR; mAppearance = 0; mAppearanceMask = 0; + mAnimationsDisabled = false; // After replaying, we forward everything directly to the replayed instance. mReplayedInsetsController = controller; |
