summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Tiger Huang <tigerhuang@google.com> 2024-05-27 05:56:56 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-05-27 05:56:56 +0000
commit576a3491db71fb8966d4e3197b8fd3f02a8a746c (patch)
treecd5c40c1906ff36d5402c8a66ae0fd3c67d62371
parentc99c31146f0285d56bf975f8513ac69269e78e4a (diff)
parentb6ce9a4b204f09328caac2cfca2b6e4a594fda01 (diff)
Merge "Pause insets position for seamless rotation" into 24D1-dev
-rw-r--r--services/core/java/com/android/server/wm/AsyncRotationController.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/wm/AsyncRotationController.java b/services/core/java/com/android/server/wm/AsyncRotationController.java
index 24d4be83c82b..eb85c1a73212 100644
--- a/services/core/java/com/android/server/wm/AsyncRotationController.java
+++ b/services/core/java/com/android/server/wm/AsyncRotationController.java
@@ -290,7 +290,7 @@ class AsyncRotationController extends FadeAnimationController implements Consume
}
// The insets position may be frozen by shouldFreezeInsetsPosition(), so refresh the
// position to the latest state when it is ready to show in new rotation.
- if (mTransitionOp == OP_APP_SWITCH) {
+ if (isSeamlessTransition()) {
for (int i = windowToken.getChildCount() - 1; i >= 0; i--) {
final WindowState w = windowToken.getChildAt(i);
final InsetsSourceProvider insetsProvider = w.getControllableInsetProvider();
@@ -505,10 +505,15 @@ class AsyncRotationController extends FadeAnimationController implements Consume
*/
boolean shouldFreezeInsetsPosition(WindowState w) {
// Non-change transition (OP_APP_SWITCH) and METHOD_BLAST don't use screenshot so the
- // insets should keep original position before the start transaction is applied.
- return mTransitionOp != OP_LEGACY && (mTransitionOp == OP_APP_SWITCH
+ // insets should keep original position before the window is done with new rotation.
+ return mTransitionOp != OP_LEGACY && (isSeamlessTransition()
|| TransitionController.SYNC_METHOD == BLASTSyncEngine.METHOD_BLAST)
- && !mIsStartTransactionCommitted && canBeAsync(w.mToken) && isTargetToken(w.mToken);
+ && canBeAsync(w.mToken) && isTargetToken(w.mToken);
+ }
+
+ /** Returns true if there won't be a screen rotation animation (screenshot-based). */
+ private boolean isSeamlessTransition() {
+ return mTransitionOp == OP_APP_SWITCH || mTransitionOp == OP_CHANGE_MAY_SEAMLESS;
}
/**