Loading core/java/android/view/InsetsController.java +15 −3 Original line number Diff line number Diff line Loading @@ -260,6 +260,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private final boolean mHasAnimationCallbacks; private final @InsetsType int mRequestedTypes; private final long mDurationMs; private final boolean mDisable; private ThreadLocal<AnimationHandler> mSfAnimationHandlerThreadLocal = new ThreadLocal<AnimationHandler>() { Loading @@ -272,11 +273,12 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation }; public InternalAnimationControlListener(boolean show, boolean hasAnimationCallbacks, int requestedTypes) { int requestedTypes, boolean disable) { mShow = show; mHasAnimationCallbacks = hasAnimationCallbacks; mRequestedTypes = requestedTypes; mDurationMs = calculateDurationMs(); mDisable = disable; } @Override Loading @@ -284,6 +286,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation mController = controller; if (DEBUG) Log.d(TAG, "default animation onReady types: " + types); if (mDisable) { onAnimationFinish(); return; } mAnimator = ValueAnimator.ofFloat(0f, 1f); mAnimator.setDuration(mDurationMs); mAnimator.setInterpolator(new LinearInterpolator()); Loading Loading @@ -477,6 +483,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private DisplayCutout mLastDisplayCutout; private boolean mStartingAnimation; private int mCaptionInsetsHeight = 0; private boolean mAnimationsDisabled; private Runnable mPendingControlTimeout = this::abortPendingImeControlRequest; private final ArrayList<OnControllableInsetsChangedListener> mControllableInsetsChangedListeners Loading Loading @@ -1213,8 +1220,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } boolean hasAnimationCallbacks = mHost.hasAnimationCallbacks(); final InternalAnimationControlListener listener = new InternalAnimationControlListener(show, hasAnimationCallbacks, types); final InternalAnimationControlListener listener = new InternalAnimationControlListener( show, hasAnimationCallbacks, types, mAnimationsDisabled); // Show/hide animations always need to be relative to the display frame, in order that shown // and hidden state insets are correct. Loading Loading @@ -1329,6 +1336,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation return mHost.getSystemBarsBehavior(); } @Override public void setAnimationsDisabled(boolean disable) { mAnimationsDisabled = disable; } private @InsetsType int calculateControllableTypes() { @InsetsType int result = 0; for (int i = mSourceConsumers.size() - 1; i >= 0; i--) { Loading core/java/android/view/PendingInsetsController.java +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -102,6 +103,15 @@ public class PendingInsetsController implements WindowInsetsController { return mBehavior; } @Override public void setAnimationsDisabled(boolean disable) { if (mReplayedInsetsController != null) { mReplayedInsetsController.setAnimationsDisabled(disable); } else { mAnimationsDisabled = disable; } } @Override public InsetsState getState() { return mDummyState; Loading Loading @@ -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); Loading @@ -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; Loading core/java/android/view/WindowInsetsController.java +7 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,13 @@ public interface WindowInsetsController { */ @Behavior int getSystemBarsBehavior(); /** * Disables or enables the animations. * * @hide */ void setAnimationsDisabled(boolean disable); /** * @hide */ Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -459,6 +459,18 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } } @Override public void onStartedWakingUp() { mStatusBar.getNotificationShadeWindowView().getWindowInsetsController() .setAnimationsDisabled(false); } @Override public void onStartedGoingToSleep() { mStatusBar.getNotificationShadeWindowView().getWindowInsetsController() .setAnimationsDisabled(true); } @Override public void onFinishedGoingToSleep() { mBouncer.onScreenTurnedOff(); Loading services/core/java/com/android/server/wm/InsetsPolicy.java +1 −1 Original line number Diff line number Diff line Loading @@ -384,7 +384,7 @@ class InsetsPolicy { InsetsPolicyAnimationControlCallbacks mControlCallbacks; InsetsPolicyAnimationControlListener(boolean show, Runnable finishCallback, int types) { super(show, false /* hasCallbacks */, types); super(show, false /* hasCallbacks */, types, false /* disable */); mFinishCallback = finishCallback; mControlCallbacks = new InsetsPolicyAnimationControlCallbacks(this); } Loading Loading
core/java/android/view/InsetsController.java +15 −3 Original line number Diff line number Diff line Loading @@ -260,6 +260,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private final boolean mHasAnimationCallbacks; private final @InsetsType int mRequestedTypes; private final long mDurationMs; private final boolean mDisable; private ThreadLocal<AnimationHandler> mSfAnimationHandlerThreadLocal = new ThreadLocal<AnimationHandler>() { Loading @@ -272,11 +273,12 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation }; public InternalAnimationControlListener(boolean show, boolean hasAnimationCallbacks, int requestedTypes) { int requestedTypes, boolean disable) { mShow = show; mHasAnimationCallbacks = hasAnimationCallbacks; mRequestedTypes = requestedTypes; mDurationMs = calculateDurationMs(); mDisable = disable; } @Override Loading @@ -284,6 +286,10 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation mController = controller; if (DEBUG) Log.d(TAG, "default animation onReady types: " + types); if (mDisable) { onAnimationFinish(); return; } mAnimator = ValueAnimator.ofFloat(0f, 1f); mAnimator.setDuration(mDurationMs); mAnimator.setInterpolator(new LinearInterpolator()); Loading Loading @@ -477,6 +483,7 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation private DisplayCutout mLastDisplayCutout; private boolean mStartingAnimation; private int mCaptionInsetsHeight = 0; private boolean mAnimationsDisabled; private Runnable mPendingControlTimeout = this::abortPendingImeControlRequest; private final ArrayList<OnControllableInsetsChangedListener> mControllableInsetsChangedListeners Loading Loading @@ -1213,8 +1220,8 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation } boolean hasAnimationCallbacks = mHost.hasAnimationCallbacks(); final InternalAnimationControlListener listener = new InternalAnimationControlListener(show, hasAnimationCallbacks, types); final InternalAnimationControlListener listener = new InternalAnimationControlListener( show, hasAnimationCallbacks, types, mAnimationsDisabled); // Show/hide animations always need to be relative to the display frame, in order that shown // and hidden state insets are correct. Loading Loading @@ -1329,6 +1336,11 @@ public class InsetsController implements WindowInsetsController, InsetsAnimation return mHost.getSystemBarsBehavior(); } @Override public void setAnimationsDisabled(boolean disable) { mAnimationsDisabled = disable; } private @InsetsType int calculateControllableTypes() { @InsetsType int result = 0; for (int i = mSourceConsumers.size() - 1; i >= 0; i--) { Loading
core/java/android/view/PendingInsetsController.java +14 −0 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -102,6 +103,15 @@ public class PendingInsetsController implements WindowInsetsController { return mBehavior; } @Override public void setAnimationsDisabled(boolean disable) { if (mReplayedInsetsController != null) { mReplayedInsetsController.setAnimationsDisabled(disable); } else { mAnimationsDisabled = disable; } } @Override public InsetsState getState() { return mDummyState; Loading Loading @@ -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); Loading @@ -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; Loading
core/java/android/view/WindowInsetsController.java +7 −0 Original line number Diff line number Diff line Loading @@ -221,6 +221,13 @@ public interface WindowInsetsController { */ @Behavior int getSystemBarsBehavior(); /** * Disables or enables the animations. * * @hide */ void setAnimationsDisabled(boolean disable); /** * @hide */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -459,6 +459,18 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb } } @Override public void onStartedWakingUp() { mStatusBar.getNotificationShadeWindowView().getWindowInsetsController() .setAnimationsDisabled(false); } @Override public void onStartedGoingToSleep() { mStatusBar.getNotificationShadeWindowView().getWindowInsetsController() .setAnimationsDisabled(true); } @Override public void onFinishedGoingToSleep() { mBouncer.onScreenTurnedOff(); Loading
services/core/java/com/android/server/wm/InsetsPolicy.java +1 −1 Original line number Diff line number Diff line Loading @@ -384,7 +384,7 @@ class InsetsPolicy { InsetsPolicyAnimationControlCallbacks mControlCallbacks; InsetsPolicyAnimationControlListener(boolean show, Runnable finishCallback, int types) { super(show, false /* hasCallbacks */, types); super(show, false /* hasCallbacks */, types, false /* disable */); mFinishCallback = finishCallback; mControlCallbacks = new InsetsPolicyAnimationControlCallbacks(this); } Loading