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

Commit 76b0e057 authored by Riddle Hsu's avatar Riddle Hsu Committed by Automerger Merge Worker
Browse files

Merge "Reduce flickering when swiping auto-pip with orientation change" into...

Merge "Reduce flickering when swiping auto-pip with orientation change" into udc-dev am: beda91f6 am: f4c5678f

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23199017



Change-Id: I64d49a6575644e7220f07e1835122a25e6c294ad
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 599f92eb f4c5678f
Loading
Loading
Loading
Loading
+16 −2
Original line number Diff line number Diff line
@@ -21,6 +21,8 @@ import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS;
import static android.app.WindowConfiguration.ACTIVITY_TYPE_STANDARD;
import static android.app.WindowConfiguration.ROTATION_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.INVALID_DISPLAY;
@@ -959,8 +961,20 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                    true /* beforeStopping */)) {
                return false;
            }
            return mController.mAtm.enterPictureInPictureMode(ar, ar.pictureInPictureArgs,
                    false /* fromClient */, true /* isAutoEnter */);
            final int prevMode = ar.getTask().getWindowingMode();
            final boolean inPip = mController.mAtm.enterPictureInPictureMode(ar,
                    ar.pictureInPictureArgs, false /* fromClient */, true /* isAutoEnter */);
            final int currentMode = ar.getTask().getWindowingMode();
            if (prevMode == WINDOWING_MODE_FULLSCREEN && currentMode == WINDOWING_MODE_PINNED
                    && mTransientLaunches != null
                    && ar.mDisplayContent.hasTopFixedRotationLaunchingApp()) {
                // There will be a display configuration change after finishing this transition.
                // Skip dispatching the change for PiP task to avoid its activity drawing for the
                // intermediate state which will cause flickering. The final PiP bounds in new
                // rotation will be applied by PipTransition.
                ar.mDisplayContent.mPinnedTaskController.setEnterPipTransaction(null);
            }
            return inPip;
        }

        // Legacy pip-entry (not via isAutoEnterEnabled).