Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e1212c05 authored by Riddle Hsu's avatar Riddle Hsu
Browse files

Do not wrap activity surface if it is handled by rotator

Otherwise the effect of rotation transform is lost and the closing
app will show in new rotation.

Bug: 346930322
Bug: 343398802
Flag: EXEMPT bugfix
Test: Launch an activity in the same task and set a different
      orientation in onCreate. The previous activity should
      show in previous rotation.
Change-Id: I38ab53303f1d2d05fb9b039f658423aa21640e7c
parent a1ff4c14
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -94,6 +94,11 @@ public class CounterRotatorHelper {
        return rotatedBounds;
    }

    /** Returns true if the change is put on a surface in previous rotation. */
    public boolean isRotated(@NonNull TransitionInfo.Change change) {
        return mLastRotationDelta != 0 && mRotatorMap.containsKey(change.getParent());
    }

    /**
     * Removes the counter rotation surface in the finish transaction. No need to reparent the
     * children as the finish transaction should have already taken care of that.
+2 −1
Original line number Diff line number Diff line
@@ -517,7 +517,8 @@ public class DefaultTransitionHandler implements Transitions.TransitionHandler {
                    animRelOffset.y = Math.max(animRelOffset.y, change.getEndRelOffset().y);
                }

                if (change.getActivityComponent() != null && !isActivityLevel) {
                if (change.getActivityComponent() != null && !isActivityLevel
                        && !mRotator.isRotated(change)) {
                    // At this point, this is an independent activity change in a non-activity
                    // transition. This means that an activity transition got erroneously combined
                    // with another ongoing transition. This then means that the animation root may