diff options
3 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/window/TransitionInfo.java b/core/java/android/window/TransitionInfo.java index 3685bbabf4d3..5227724e705e 100644 --- a/core/java/android/window/TransitionInfo.java +++ b/core/java/android/window/TransitionInfo.java @@ -542,6 +542,9 @@ public final class TransitionInfo implements Parcelable { // independent either. if (change.getMode() == TRANSIT_CHANGE) return false; + // Always fold the activity embedding change into the parent change. + if (change.hasFlags(FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY)) return false; + TransitionInfo.Change parentChg = info.getChange(change.getParent()); while (parentChg != null) { // If the parent is a visibility change, it will include the results of all child diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java index 6a53d33243db..a77602b3d2d0 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/Transitions.java @@ -495,6 +495,7 @@ public class Transitions implements RemoteCallable<Transitions>, if (mode == TRANSIT_TO_FRONT) { // When the window is moved to front, make sure the crop is updated to prevent it // from using the old crop. + t.setPosition(leash, change.getEndRelOffset().x, change.getEndRelOffset().y); t.setWindowCrop(leash, change.getEndAbsBounds().width(), change.getEndAbsBounds().height()); } @@ -506,6 +507,8 @@ public class Transitions implements RemoteCallable<Transitions>, t.setMatrix(leash, 1, 0, 0, 1); t.setAlpha(leash, 1.f); t.setPosition(leash, change.getEndRelOffset().x, change.getEndRelOffset().y); + t.setWindowCrop(leash, change.getEndAbsBounds().width(), + change.getEndAbsBounds().height()); } continue; } diff --git a/services/core/java/com/android/server/wm/Transition.java b/services/core/java/com/android/server/wm/Transition.java index 66c2e537ba9b..319e2b024f2f 100644 --- a/services/core/java/com/android/server/wm/Transition.java +++ b/services/core/java/com/android/server/wm/Transition.java @@ -2468,7 +2468,15 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener { for (WindowContainer<?> p = getAnimatableParent(wc); p != null; p = getAnimatableParent(p)) { final ChangeInfo parentChange = changes.get(p); - if (parentChange == null || !parentChange.hasChanged()) break; + if (parentChange == null) { + break; + } + if (!parentChange.hasChanged()) { + // In case the target is collected after the parent has been changed, it could + // be too late to snapshot the parent change. Skip to see if there is any + // parent window further up to be considered as change parent. + continue; + } if (p.mRemoteToken == null) { // Intermediate parents must be those that has window to be managed by Shell. continue; |