summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Riddle Hsu <riddlehsu@google.com> 2022-06-21 15:03:36 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-06-21 15:03:36 +0000
commitff3c85f51bd1ecc101263c22759862816ae09a93 (patch)
treeb351c5cb25879c6529af4268a0c9476b7e704e88
parent0592820f44bd09f31c4d57fc2007da595e450150 (diff)
parentd6ad543b7cc0abd7efdf99fc42443715f531a39e (diff)
Merge "Use top activity for fixed rotation from snapshot starting window" into tm-dev am: d6ad543b7c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18924772 Change-Id: I1d1621dc2aa8cac0e9b34ceb66b65e4f607e07f0 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--services/core/java/com/android/server/wm/ActivityRecord.java12
-rw-r--r--services/core/java/com/android/server/wm/StartingSurfaceController.java5
2 files changed, 12 insertions, 5 deletions
diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java
index 8a3193abc225..4f222a4f8b83 100644
--- a/services/core/java/com/android/server/wm/ActivityRecord.java
+++ b/services/core/java/com/android/server/wm/ActivityRecord.java
@@ -2462,8 +2462,16 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
if (!newTask && taskSwitch && processRunning && !activityCreated && task.intent != null
&& mActivityComponent.equals(task.intent.getComponent())) {
final ActivityRecord topAttached = task.getActivity(ActivityRecord::attachedToProcess);
- if (topAttached != null && topAttached.isSnapshotCompatible(snapshot)) {
- return STARTING_WINDOW_TYPE_SNAPSHOT;
+ if (topAttached != null) {
+ if (topAttached.isSnapshotCompatible(snapshot)
+ // This trampoline must be the same rotation.
+ && mDisplayContent.getDisplayRotation().rotationForOrientation(mOrientation,
+ mDisplayContent.getRotation()) == snapshot.getRotation()) {
+ return STARTING_WINDOW_TYPE_SNAPSHOT;
+ }
+ // No usable snapshot. And a splash screen may also be weird because an existing
+ // activity may be shown right after the trampoline is finished.
+ return STARTING_WINDOW_TYPE_NONE;
}
}
final boolean isActivityHome = isActivityTypeHome();
diff --git a/services/core/java/com/android/server/wm/StartingSurfaceController.java b/services/core/java/com/android/server/wm/StartingSurfaceController.java
index e8445ab8c35e..f83173bd46c0 100644
--- a/services/core/java/com/android/server/wm/StartingSurfaceController.java
+++ b/services/core/java/com/android/server/wm/StartingSurfaceController.java
@@ -158,14 +158,13 @@ public class StartingSurfaceController {
+ topFullscreenActivity);
return null;
}
- if (topFullscreenActivity.getWindowConfiguration().getRotation()
- != taskSnapshot.getRotation()) {
+ if (activity.mDisplayContent.getRotation() != taskSnapshot.getRotation()) {
// The snapshot should have been checked by ActivityRecord#isSnapshotCompatible
// that the activity will be updated to the same rotation as the snapshot. Since
// the transition is not started yet, fixed rotation transform needs to be applied
// earlier to make the snapshot show in a rotated container.
activity.mDisplayContent.handleTopActivityLaunchingInDifferentOrientation(
- topFullscreenActivity, false /* checkOpening */);
+ activity, false /* checkOpening */);
}
mService.mAtmService.mTaskOrganizerController.addStartingWindow(task,
activity, 0 /* launchTheme */, taskSnapshot);