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

Commit 336aebcd authored by Wale Ogunwale's avatar Wale Ogunwale Committed by Android (Google) Code Review
Browse files

Merge "Fix launcher failing tests."

parents b45e5a7f fef90a09
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.os.FactoryTest.FACTORY_TEST_LOW_LEVEL;

import static com.android.server.wm.ActivityStackSupervisor.ON_TOP;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_ATM;
import static com.android.server.wm.ActivityTaskManagerDebugConfig.TAG_WITH_CLASS_NAME;

@@ -178,6 +179,13 @@ public class ActivityStartController {
            options.setLaunchActivityType(ACTIVITY_TYPE_HOME);
        }
        options.setLaunchDisplayId(displayId);

        final ActivityDisplay display =
                mService.mRootActivityContainer.getActivityDisplay(displayId);
        // Make sure home stack exist on display.
        final ActivityStack homeStack =
                display.getOrCreateStack(WINDOWING_MODE_FULLSCREEN, ACTIVITY_TYPE_HOME, ON_TOP);

        mLastHomeActivityStartResult = obtainStarter(intent, "startHomeActivity: " + reason)
                .setOutActivity(tmpOutRecord)
                .setCallingUid(0)
@@ -185,10 +193,7 @@ public class ActivityStartController {
                .setActivityOptions(options.toBundle())
                .execute();
        mLastHomeActivityStartRecord = tmpOutRecord[0];
        final ActivityDisplay display =
                mService.mRootActivityContainer.getActivityDisplay(displayId);
        final ActivityStack homeStack = display != null ? display.getHomeStack() : null;
        if (homeStack != null && homeStack.mInResumeTopActivity) {
        if (homeStack.mInResumeTopActivity) {
            // If we are in resume section already, home activity will be initialized, but not
            // resumed (to avoid recursive resume) and will stay that way until something pokes it
            // again. We need to schedule another resume.
+2 −1
Original line number Diff line number Diff line
@@ -358,7 +358,8 @@ class RootActivityContainer extends ConfigurationContainer
            boolean fromHomeKey) {
        // Fallback to top focused display if the displayId is invalid.
        if (displayId == INVALID_DISPLAY) {
            displayId = getTopDisplayFocusedStack().mDisplayId;
            final ActivityStack stack = getTopDisplayFocusedStack();
            displayId = stack != null ? stack.mDisplayId : DEFAULT_DISPLAY;
        }

        Intent homeIntent = null;