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

Commit 10789371 authored by Wei Sheng Shih's avatar Wei Sheng Shih Committed by Android (Google) Code Review
Browse files

Merge "Do not transfer starting window if requested orientation isn't match." into main

parents 6d1e533a 8a201490
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4658,6 +4658,12 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
                // at #postWindowRemoveCleanupLocked
                return false;
            }
            // Do not transfer if the orientation doesn't match, redraw starting window while it is
            // on top will cause flicker.
            if (fromActivity.getRequestedConfigurationOrientation()
                    != getRequestedConfigurationOrientation()) {
                return false;
            }
            // In this case, the starting icon has already been displayed, so start
            // letting windows get shown immediately without any more transitions.
            if (fromActivity.mVisible) {
+9 −4
Original line number Diff line number Diff line
@@ -112,7 +112,6 @@ import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.Executor;
import java.util.function.Predicate;

/**
@@ -3254,9 +3253,15 @@ class Transition implements BLASTSyncEngine.TransactionReadyListener {
                    // Whether this is in a Task with embedded activity.
                    flags |= FLAG_IN_TASK_WITH_EMBEDDED_ACTIVITY;
                }
                if (parentTask.forAllActivities(ActivityRecord::hasStartingWindow)) {
                    // The starting window should cover all windows inside the leaf Task.
                final ActivityRecord starting = parentTask.topActivityContainsStartingWindow();
                if (starting != null) {
                    if (starting == record || (starting.mStartingData != null
                            && starting.mStartingData.mAssociatedTask != null)) {
                        flags |= FLAG_IS_BEHIND_STARTING_WINDOW;
                    } else if (record != null && parentTask.mChildren.indexOf(record)
                            < parentTask.mChildren.indexOf(starting)) {
                        flags |= FLAG_IS_BEHIND_STARTING_WINDOW;
                    }
                }
                if (isWindowFillingTask(wc, parentTask)) {
                    // Whether the container fills its parent Task bounds.
+6 −1
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_NOSENSOR;
import static android.content.pm.ActivityInfo.SCREEN_ORIENTATION_UNSET;
import static android.view.WindowManager.LayoutParams.ROTATION_ANIMATION_SEAMLESS;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_INPUT_METHOD;
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR;
@@ -1665,7 +1666,11 @@ public class TransitionTests extends WindowTestsBase {
        final Task task = createTask(mDisplayContent);
        final ActivityRecord activity0 = createActivityRecord(task);
        final ActivityRecord activity1 = createActivityRecord(task);
        doReturn(true).when(activity1).hasStartingWindow();
        final WindowManager.LayoutParams attrs =
                new WindowManager.LayoutParams(TYPE_APPLICATION_STARTING);
        final TestWindowState startingWindow = createWindowState(attrs, activity1);
        activity1.mStartingData = mock(StartingData.class);
        activity1.addWindow(startingWindow);

        // Start states.
        changes.put(activity0,