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

Commit 83c69f5b authored by Evan Rosky's avatar Evan Rosky
Browse files

Run transitions when starting into paused and use starting-windows for split

Starting activities into resumed state would wait until
resumed to execute transitions. However, if a new activity
starts into the primary-split, it actually starts in paused
state. This is valid, but transitions weren't being
executed.

Second, we avoided starting-windows for split-screen before there
were hierarchical animations to avoid clipping issues. Now that
animations are hierarchical, this shouldn't be a problem.

Bug: 155345309
Test: Cold-start an activity into primary-split. Observe an
      immediate starting-window.
Change-Id: I54d80b3faf45981e3b512548d32aada6e08b5241
parent 9b35a417
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -104,7 +104,6 @@ import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION;
import static android.view.WindowManager.LayoutParams.TYPE_APPLICATION_STARTING;
import static android.view.WindowManager.LayoutParams.TYPE_BASE_APPLICATION;
import static android.view.WindowManager.TRANSIT_ACTIVITY_CLOSE;
import static android.view.WindowManager.TRANSIT_DOCK_TASK_FROM_RECENTS;
import static android.view.WindowManager.TRANSIT_TASK_CLOSE;
import static android.view.WindowManager.TRANSIT_TASK_OPEN_BEHIND;
import static android.view.WindowManager.TRANSIT_UNSET;
@@ -1906,13 +1905,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
    private int getStartingWindowType(boolean newTask, boolean taskSwitch, boolean processRunning,
            boolean allowTaskSnapshot, boolean activityCreated, boolean fromRecents,
            ActivityManager.TaskSnapshot snapshot) {
        if (getDisplayContent().mAppTransition.getAppTransition()
                == TRANSIT_DOCK_TASK_FROM_RECENTS) {
            // TODO(b/34099271): Remove this statement to add back the starting window and figure
            // out why it causes flickering, the starting window appears over the thumbnail while
            // the docked from recents transition occurs
            return STARTING_WINDOW_TYPE_NONE;
        } else if (newTask || !processRunning || (taskSwitch && !activityCreated)) {
        if (newTask || !processRunning || (taskSwitch && !activityCreated)) {
            return STARTING_WINDOW_TYPE_SPLASH_SCREEN;
        } else if (taskSwitch && allowTaskSnapshot) {
            if (snapshotOrientationSameAsTask(snapshot) || (snapshot != null && fromRecents)) {
+1 −3
Original line number Diff line number Diff line
@@ -45,7 +45,6 @@ import static android.os.Process.SYSTEM_UID;
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Display.TYPE_VIRTUAL;
import static android.view.WindowManager.TRANSIT_DOCK_TASK_FROM_RECENTS;

import static com.android.server.wm.ActivityStack.ActivityState.PAUSED;
import static com.android.server.wm.ActivityStack.ActivityState.PAUSING;
@@ -915,6 +914,7 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
            if (DEBUG_STATES) Slog.v(TAG_STATES,
                    "Moving to PAUSED: " + r + " (starting in paused state)");
            r.setState(PAUSED, "realStartActivityLocked");
            mRootWindowContainer.executeAppTransitionForAllDisplay();
        }
        // Perform OOM scoring after the activity state is set, so the process can be updated with
        // the latest state.
@@ -2496,8 +2496,6 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks {
                // not run into issues where we still need to draw the task in recents but the
                // docked stack is already created.
                deferUpdateRecentsHomeStackBounds();
                // TODO(multi-display): currently recents animation only support default display.
                mWindowManager.prepareAppTransition(TRANSIT_DOCK_TASK_FROM_RECENTS, false);
                // TODO(task-hierarchy): Remove when tiles are in hierarchy.
                // Unset launching windowing mode to prevent creating split-screen-primary stack
                // in RWC#anyTaskForId() below.