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

Commit efb75842 authored by Bryce Lee's avatar Bryce Lee Committed by Android (Google) Code Review
Browse files

Merge "Make ActivityStarter single use."

parents 5826e469 d3624e10
Loading
Loading
Loading
Loading
+56 −113
Original line number Diff line number Diff line
@@ -44,7 +44,9 @@ import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN_OR_SPLIT
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS;
import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
import static android.content.Intent.FLAG_ACTIVITY_TASK_ON_HOME;
import static android.content.pm.PackageManager.FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS;
import static android.content.pm.PackageManager.FEATURE_FREEFORM_WINDOW_MANAGEMENT;
import static android.content.pm.PackageManager.FEATURE_LEANBACK_ONLY;
@@ -632,7 +634,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    final ActivityStackSupervisor mStackSupervisor;
    private final KeyguardController mKeyguardController;
    final ActivityStarter mActivityStarter;
    private final ActivityStartController mActivityStartController;
    final ClientLifecycleManager mLifecycleManager;
@@ -1361,7 +1363,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    @GuardedBy("this") boolean mCallFinishBooting = false;
    @GuardedBy("this") boolean mBootAnimationComplete = false;
    @GuardedBy("this") boolean mLaunchWarningShown = false;
    @GuardedBy("this") boolean mCheckedForSetup = false;
    private @GuardedBy("this") boolean mCheckedForSetup = false;
    final Context mContext;
@@ -1707,7 +1709,6 @@ public class ActivityManagerService extends IActivityManager.Stub
    static final int SHOW_UID_ERROR_UI_MSG = 14;
    static final int SHOW_FINGERPRINT_ERROR_UI_MSG = 15;
    static final int PROC_START_TIMEOUT_MSG = 20;
    static final int DO_PENDING_ACTIVITY_LAUNCHES_MSG = 21;
    static final int KILL_APPLICATION_MSG = 22;
    static final int FINALIZE_PENDING_INTENT_MSG = 23;
    static final int POST_HEAVY_NOTIFICATION_MSG = 24;
@@ -2077,11 +2078,6 @@ public class ActivityManagerService extends IActivityManager.Stub
                    processContentProviderPublishTimedOutLocked(app);
                }
            } break;
            case DO_PENDING_ACTIVITY_LAUNCHES_MSG: {
                synchronized (ActivityManagerService.this) {
                    mActivityStarter.doPendingActivityLaunchesLocked(true);
                }
            } break;
            case KILL_APPLICATION_MSG: {
                synchronized (ActivityManagerService.this) {
                    final int appId = msg.arg1;
@@ -2677,7 +2673,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        mContext = mInjector.getContext();
        mUiContext = null;
        GL_ES_VERSION = 0;
        mActivityStarter = null;
        mActivityStartController = null;
        mAppErrors = null;
        mAppWarnings = null;
        mAppOpsService = mInjector.getAppOpsService(null, null);
@@ -2801,7 +2797,7 @@ public class ActivityManagerService extends IActivityManager.Stub
        mIntentFirewall = new IntentFirewall(new IntentFirewallInterface(), mHandler);
        mTaskChangeNotificationController =
                new TaskChangeNotificationController(this, mStackSupervisor, mHandler);
        mActivityStarter = new ActivityStarter(this);
        mActivityStartController = new ActivityStartController(this);
        mRecentTasks = createRecentTasks();
        mStackSupervisor.setRecentTasks(mRecentTasks);
        mLockTaskController = new LockTaskController(mContext, mStackSupervisor, mHandler);
@@ -4121,7 +4117,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                // For ANR debugging to verify if the user activity is the one that actually
                // launched.
                final String myReason = reason + ":" + userId + ":" + resolvedUserId;
                mActivityStarter.startHomeActivityLocked(intent, aInfo, myReason);
                mActivityStartController.startHomeActivity(intent, aInfo, myReason);
            }
        } else {
            Slog.wtf(TAG, "No home screen found for " + intent, new Throwable());
@@ -4154,49 +4150,12 @@ public class ActivityManagerService extends IActivityManager.Stub
        return ai;
    }
    /**
     * Starts the "new version setup screen" if appropriate.
     */
    void startSetupActivityLocked() {
        // Only do this once per boot.
        if (mCheckedForSetup) {
            return;
    boolean getCheckedForSetup() {
        return mCheckedForSetup;
    }
        // We will show this screen if the current one is a different
        // version than the last one shown, and we are not running in
        // low-level factory test mode.
        final ContentResolver resolver = mContext.getContentResolver();
        if (mFactoryTest != FactoryTest.FACTORY_TEST_LOW_LEVEL &&
                Settings.Global.getInt(resolver,
                        Settings.Global.DEVICE_PROVISIONED, 0) != 0) {
            mCheckedForSetup = true;
            // See if we should be showing the platform update setup UI.
            final Intent intent = new Intent(Intent.ACTION_UPGRADE_SETUP);
            final List<ResolveInfo> ris = mContext.getPackageManager().queryIntentActivities(intent,
                    PackageManager.MATCH_SYSTEM_ONLY | PackageManager.GET_META_DATA);
            if (!ris.isEmpty()) {
                final ResolveInfo ri = ris.get(0);
                String vers = ri.activityInfo.metaData != null
                        ? ri.activityInfo.metaData.getString(Intent.METADATA_SETUP_VERSION)
                        : null;
                if (vers == null && ri.activityInfo.applicationInfo.metaData != null) {
                    vers = ri.activityInfo.applicationInfo.metaData.getString(
                            Intent.METADATA_SETUP_VERSION);
                }
                String lastVers = Settings.Secure.getString(
                        resolver, Settings.Secure.LAST_SETUP_SHOWN);
                if (vers != null && !vers.equals(lastVers)) {
                    intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
                    intent.setComponent(new ComponentName(
                            ri.activityInfo.packageName, ri.activityInfo.name));
                    mActivityStarter.startActivityLocked(null, intent, null /*ephemeralIntent*/,
                            null, ri.activityInfo, null /*rInfo*/, null, null, null, null, 0, 0, 0,
                            null, 0, 0, 0, null, false, false, null, null, "startSetupActivity");
                }
            }
        }
    void setCheckedForSetup(boolean checked) {
        mCheckedForSetup = checked;
    }
    CompatibilityInfo compatibilityInfoForPackageLocked(ApplicationInfo ai) {
@@ -4562,8 +4521,8 @@ public class ActivityManagerService extends IActivityManager.Stub
        userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
                userId, false, ALLOW_FULL_ONLY, "startActivity", null);
        // TODO: Switch to user app stacks here.
        return mActivityStarter.startActivityMayWait(caller, -1, callingPackage, intent,
                resolvedType, null, null, resultTo, resultWho, requestCode, startFlags,
        return mActivityStartController.startActivityMayWait(caller, -1, callingPackage,
                intent, resolvedType, null, null, resultTo, resultWho, requestCode, startFlags,
                profilerInfo, null, null, bOptions, false, userId, null, "startActivityAsUser");
    }
@@ -4625,10 +4584,10 @@ public class ActivityManagerService extends IActivityManager.Stub
        // TODO: Switch to user app stacks here.
        try {
            int ret = mActivityStarter.startActivityMayWait(null, targetUid, targetPackage, intent,
                    resolvedType, null, null, resultTo, resultWho, requestCode, startFlags, null,
                    null, null, bOptions, ignoreTargetSecurity, userId, null,
                    "startActivityAsCaller");
            int ret = mActivityStartController.startActivityMayWait(null, targetUid,
                    targetPackage, intent, resolvedType, null, null, resultTo, resultWho,
                    requestCode, startFlags, null, null, null, bOptions, ignoreTargetSecurity,
                    userId, null, "startActivityAsCaller");
            return ret;
        } catch (SecurityException e) {
            // XXX need to figure out how to propagate to original app.
@@ -4655,9 +4614,9 @@ public class ActivityManagerService extends IActivityManager.Stub
                userId, false, ALLOW_FULL_ONLY, "startActivityAndWait", null);
        WaitResult res = new WaitResult();
        // TODO: Switch to user app stacks here.
        mActivityStarter.startActivityMayWait(caller, -1, callingPackage, intent, resolvedType,
                null, null, resultTo, resultWho, requestCode, startFlags, profilerInfo, res, null,
                bOptions, false, userId, null, "startActivityAndWait");
        mActivityStartController.startActivityMayWait(caller, -1, callingPackage, intent,
                resolvedType, null, null, resultTo, resultWho, requestCode, startFlags,
                profilerInfo, res, null, bOptions, false, userId, null, "startActivityAndWait");
        return res;
    }
@@ -4669,9 +4628,9 @@ public class ActivityManagerService extends IActivityManager.Stub
        userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
                userId, false, ALLOW_FULL_ONLY, "startActivityWithConfig", null);
        // TODO: Switch to user app stacks here.
        int ret = mActivityStarter.startActivityMayWait(caller, -1, callingPackage, intent,
                resolvedType, null, null, resultTo, resultWho, requestCode, startFlags,
                null, null, config, bOptions, false, userId, null, "startActivityWithConfig");
        int ret = mActivityStartController.startActivityMayWait(caller, -1, callingPackage, intent,
                resolvedType, null, null, resultTo, resultWho, requestCode, startFlags, null, null,
                config, bOptions, false, userId, null, "startActivityWithConfig");
        return ret;
    }
@@ -4718,9 +4677,9 @@ public class ActivityManagerService extends IActivityManager.Stub
        userId = mUserController.handleIncomingUser(callingPid, callingUid, userId, false,
                ALLOW_FULL_ONLY, "startVoiceActivity", null);
        // TODO: Switch to user app stacks here.
        return mActivityStarter.startActivityMayWait(null, callingUid, callingPackage, intent,
                resolvedType, session, interactor, null, null, 0, startFlags, profilerInfo, null,
                null, bOptions, false, userId, null, "startVoiceActivity");
        return mActivityStartController.startActivityMayWait(null, callingUid, callingPackage,
                intent, resolvedType, session, interactor, null, null, 0, startFlags, profilerInfo,
                null, null, bOptions, false, userId, null, "startVoiceActivity");
    }
    @Override
@@ -4729,9 +4688,9 @@ public class ActivityManagerService extends IActivityManager.Stub
        enforceCallingPermission(BIND_VOICE_INTERACTION, "startAssistantActivity()");
        userId = mUserController.handleIncomingUser(callingPid, callingUid, userId, false,
                ALLOW_FULL_ONLY, "startAssistantActivity", null);
        return mActivityStarter.startActivityMayWait(null, callingUid, callingPackage, intent,
                resolvedType, null, null, null, null, 0, 0, null, null, null, bOptions, false,
                userId, null, "startAssistantActivity");
        return mActivityStartController.startActivityMayWait(null, callingUid, callingPackage,
                intent, resolvedType, null, null, null, null, 0, 0, null, null, null, bOptions,
                false, userId, null, "startAssistantActivity");
    }
    @Override
@@ -4771,9 +4730,9 @@ public class ActivityManagerService extends IActivityManager.Stub
                intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
                intent.setComponent(recentsComponent);
                intent.putExtras(options);
                return mActivityStarter.startActivityMayWait(null, recentsUid, recentsPackage,
                        intent, null, null, null, null, null, 0, 0, null, null, null, activityOptions,
                        false, userId, null, "startRecentsActivity");
                return mActivityStartController.startActivityMayWait(null, recentsUid,
                        recentsPackage, intent, null, null, null, null, null, 0, 0, null, null,
                        null, activityOptions, false, userId, null, "startRecentsActivity");
            }
        } finally {
            Binder.restoreCallingIdentity(origId);
@@ -4946,7 +4905,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
            final long origId = Binder.clearCallingIdentity();
            int res = mActivityStarter.startActivityLocked(r.app.thread, intent,
            int res = mActivityStartController.startActivity(r.app.thread, intent,
                    null /*ephemeralIntent*/, r.resolvedType, aInfo, null /*rInfo*/, null,
                    null, resultTo != null ? resultTo.appToken : null, resultWho, requestCode, -1,
                    r.launchedFromUid, r.launchedFromPackage, -1, r.launchedFromUid, 0, options,
@@ -4976,20 +4935,6 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
    }
    final int startActivityInPackage(int uid, String callingPackage,
            Intent intent, String resolvedType, IBinder resultTo,
            String resultWho, int requestCode, int startFlags, Bundle bOptions, int userId,
            TaskRecord inTask, String reason) {
        userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
                userId, false, ALLOW_FULL_ONLY, "startActivityInPackage", null);
        // TODO: Switch to user app stacks here.
        return mActivityStarter.startActivityMayWait(null, uid, callingPackage, intent,
                resolvedType, null, null, resultTo, resultWho, requestCode, startFlags,
                null, null, null, bOptions, false, userId, inTask, reason);
    }
    @Override
    public final int startActivities(IApplicationThread caller, String callingPackage,
            Intent[] intents, String[] resolvedTypes, IBinder resultTo, Bundle bOptions,
@@ -4999,21 +4944,8 @@ public class ActivityManagerService extends IActivityManager.Stub
        userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
                userId, false, ALLOW_FULL_ONLY, reason, null);
        // TODO: Switch to user app stacks here.
        int ret = mActivityStarter.startActivities(caller, -1, callingPackage, intents,
                resolvedTypes, resultTo, bOptions, userId, reason);
        return ret;
    }
    final int startActivitiesInPackage(int uid, String callingPackage,
            Intent[] intents, String[] resolvedTypes, IBinder resultTo,
            Bundle bOptions, int userId) {
        final String reason = "startActivityInPackage";
        userId = mUserController.handleIncomingUser(Binder.getCallingPid(), Binder.getCallingUid(),
                userId, false, ALLOW_FULL_ONLY, reason, null);
        // TODO: Switch to user app stacks here.
        int ret = mActivityStarter.startActivities(null, uid, callingPackage, intents, resolvedTypes,
                resultTo, bOptions, userId, reason);
        int ret = mActivityStartController.startActivities(caller, -1, callingPackage,
                intents, resolvedTypes, resultTo, bOptions, userId, reason);
        return ret;
    }
@@ -6667,7 +6599,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                ProcessList.INVALID_ADJ, callerWillRestart, true, doit, evenPersistent,
                packageName == null ? ("stop user " + userId) : ("stop " + packageName));
        didSomething |= mActivityStarter.clearPendingActivityLaunchesLocked(packageName);
        didSomething |= mActivityStartController.clearPendingActivityLaunches(packageName);
        if (mStackSupervisor.finishDisabledPackageActivitiesLocked(
                packageName, null, doit, evenPersistent, userId)) {
@@ -11755,6 +11687,10 @@ public class ActivityManagerService extends IActivityManager.Stub
        return AppGlobals.getPackageManager();
    }
    ActivityStartController getActivityStartController() {
        return mActivityStartController;
    }
    PackageManagerInternal getPackageManagerInternalLocked() {
        if (mPackageManagerInt == null) {
            mPackageManagerInt = LocalServices.getService(PackageManagerInternal.class);
@@ -12604,7 +12540,16 @@ public class ActivityManagerService extends IActivityManager.Stub
        synchronized (this) {
            final long ident = Binder.clearCallingIdentity();
            try {
                mActivityStarter.startConfirmCredentialIntent(intent, options);
                intent.addFlags(FLAG_ACTIVITY_NEW_TASK |
                        FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS |
                        FLAG_ACTIVITY_TASK_ON_HOME);
                ActivityOptions activityOptions = options != null
                        ? new ActivityOptions(options)
                        : ActivityOptions.makeBasic();
                activityOptions.setLaunchTaskId(
                        mStackSupervisor.getHomeActivity().getTask().taskId);
                mContext.startActivityAsUser(intent, activityOptions.toBundle(),
                        UserHandle.CURRENT);
            } finally {
                Binder.restoreCallingIdentity(ident);
            }
@@ -12623,9 +12568,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            mAppSwitchesAllowedTime = SystemClock.uptimeMillis()
                    + APP_SWITCH_DELAY_TIME;
            mDidAppSwitch = false;
            mHandler.removeMessages(DO_PENDING_ACTIVITY_LAUNCHES_MSG);
            Message msg = mHandler.obtainMessage(DO_PENDING_ACTIVITY_LAUNCHES_MSG);
            mHandler.sendMessageDelayed(msg, APP_SWITCH_DELAY_TIME);
            mActivityStartController.schedulePendingActivityLaunches(APP_SWITCH_DELAY_TIME);
        }
    }
@@ -15491,7 +15434,7 @@ public class ActivityManagerService extends IActivityManager.Stub
    private void dumpActivityStarterLocked(PrintWriter pw, String dumpPackage) {
        pw.println("ACTIVITY MANAGER STARTER (dumpsys activity starter)");
        mActivityStarter.dump(pw, "", dumpPackage);
        mActivityStartController.dump(pw, "", dumpPackage);
    }
    void dumpActivitiesLocked(FileDescriptor fd, PrintWriter pw, String[] args,
@@ -24248,8 +24191,8 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
            synchronized (ActivityManagerService.this) {
                return startActivitiesInPackage(packageUid, packageName, intents, resolvedTypes,
                        /*resultTo*/ null, bOptions, userId);
                return mActivityStartController.startActivitiesInPackage(packageUid, packageName,
                        intents, resolvedTypes, /*resultTo*/ null, bOptions, userId);
            }
        }
@@ -24400,7 +24343,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                    pw.println("  Reason: " + reason);
                }
                pw.println();
                mActivityStarter.dump(pw, "  ", null);
                mActivityStartController.dump(pw, "  ", null);
                pw.println();
                pw.println("-------------------------------------------------------------------------------");
                dumpActivitiesLocked(null /* fd */, pw, null /* args */, 0 /* opti */,
+6 −5
Original line number Diff line number Diff line
@@ -3892,11 +3892,12 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai
                try {
                    ActivityInfo aInfo = AppGlobals.getPackageManager().getActivityInfo(
                            destIntent.getComponent(), 0, srec.userId);
                    int res = mService.mActivityStarter.startActivityLocked(srec.app.thread,
                            destIntent, null /*ephemeralIntent*/, null, aInfo, null /*rInfo*/, null,
                            null, parent.appToken, null, 0, -1, parent.launchedFromUid,
                            parent.launchedFromPackage, -1, parent.launchedFromUid, 0, null,
                            false, true, null, null, "navigateUpTo");
                    int res = mService.getActivityStartController().startActivity(
                            srec.app.thread, destIntent, null /*ephemeralIntent*/, null, aInfo,
                            null /*rInfo*/, null, null, parent.appToken, null, 0, -1,
                            parent.launchedFromUid, parent.launchedFromPackage, -1,
                            parent.launchedFromUid, 0, null, false, true, null, null,
                            "navigateUpTo");
                    foundParentInTask = res == ActivityManager.START_SUCCESS;
                } catch (RemoteException e) {
                    foundParentInTask = false;
+43 −13
Original line number Diff line number Diff line
@@ -129,7 +129,7 @@ import android.graphics.Rect;
import android.hardware.display.DisplayManager;
import android.hardware.display.DisplayManager.DisplayListener;
import android.hardware.display.DisplayManagerInternal;
import android.hardware.input.InputManagerInternal;
import android.hardware.power.V1_0.PowerHint;
import android.os.Binder;
import android.os.Bundle;
import android.os.Debug;
@@ -364,6 +364,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
     * is being brought in front of us. */
    boolean mUserLeaving = false;

    /** Set when a power hint has started, but not ended. */
    private boolean mPowerHintSent;

    /**
     * We don't want to allow the device to go to sleep while in the process
     * of launching an activity.  This is primarily to allow alarm intent
@@ -978,7 +981,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
            }
        }
        // Send launch end powerhint when idle
        mService.mActivityStarter.sendPowerHintForLaunchEndIfNeeded();
        sendPowerHintForLaunchEndIfNeeded();
        return true;
    }

@@ -1470,7 +1473,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
        // a chance to initialize itself while in the background, making the
        // switch back to it faster and look better.
        if (isFocusedStack(stack)) {
            mService.startSetupActivityLocked();
            mService.getActivityStartController().startSetupActivity();
        }

        // Update any services we are bound to that might care about whether
@@ -1531,6 +1534,32 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                "activity", r.intent.getComponent(), false, false, true);
    }

    void sendPowerHintForLaunchStartIfNeeded(boolean forceSend, ActivityRecord targetActivity) {
        boolean sendHint = forceSend;

        if (!sendHint) {
            // If not forced, send power hint when the activity's process is different than the
            // current resumed activity.
            final ActivityRecord resumedActivity = getResumedActivityLocked();
            sendHint = resumedActivity == null
                    || resumedActivity.app == null
                    || !resumedActivity.app.equals(targetActivity.app);
        }

        if (sendHint && mService.mLocalPowerManager != null) {
            mService.mLocalPowerManager.powerHint(PowerHint.LAUNCH, 1);
            mPowerHintSent = true;
        }
    }

    void sendPowerHintForLaunchEndIfNeeded() {
        // Trigger launch power hint if activity is launched
        if (mPowerHintSent && mService.mLocalPowerManager != null) {
            mService.mLocalPowerManager.powerHint(PowerHint.LAUNCH, 0);
            mPowerHintSent = false;
        }
    }

    boolean checkStartAnyActivityPermission(Intent intent, ActivityInfo aInfo,
            String resultWho, int requestCode, int callingPid, int callingUid,
            String callingPackage, boolean ignoreTargetSecurity, ProcessRecord callerApp,
@@ -2481,14 +2510,14 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
        }
    }

    private void deferUpdateBounds(int activityType) {
    void deferUpdateBounds(int activityType) {
        final ActivityStack stack = getStack(WINDOWING_MODE_UNDEFINED, activityType);
        if (stack != null) {
            stack.deferUpdateBounds();
        }
    }

    private void continueUpdateBounds(int activityType) {
    void continueUpdateBounds(int activityType) {
        final ActivityStack stack = getStack(WINDOWING_MODE_UNDEFINED, activityType);
        if (stack != null) {
            stack.continueUpdateBounds();
@@ -3335,7 +3364,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
        }

        // Send launch end powerhint before going sleep
        mService.mActivityStarter.sendPowerHintForLaunchEndIfNeeded();
        sendPowerHintForLaunchEndIfNeeded();

        removeSleepTimeouts();

@@ -4473,7 +4502,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
     *
     * @param task The task to put into resizing mode
     */
    private void setResizingDuringAnimation(TaskRecord task) {
    void setResizingDuringAnimation(TaskRecord task) {
        mResizingTasksDuringAnimation.add(task.taskId);
        task.setTaskDockedResizing(true);
    }
@@ -4532,8 +4561,7 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                    && task.getRootActivity() != null) {
                final ActivityRecord targetActivity = task.getTopActivity();

                mService.mActivityStarter.sendPowerHintForLaunchStartIfNeeded(true /* forceSend */,
                        targetActivity);
                sendPowerHintForLaunchStartIfNeeded(true /* forceSend */, targetActivity);
                mActivityMetricsLogger.notifyActivityLaunching();
                try {
                    mService.moveTaskToFrontLocked(task.taskId, 0, bOptions,
@@ -4550,8 +4578,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
                    setResizingDuringAnimation(task);
                }

                mService.mActivityStarter.postStartActivityProcessing(task.getTopActivity(),
                        ActivityManager.START_TASK_TO_FRONT, task.getStack());
                mService.getActivityStartController().postStartActivityProcessingForLastStarter(
                        task.getTopActivity(), ActivityManager.START_TASK_TO_FRONT,
                        task.getStack());
                return ActivityManager.START_TASK_TO_FRONT;
            }
            callingUid = task.mCallingUid;
@@ -4559,8 +4588,9 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D
            intent = task.intent;
            intent.addFlags(Intent.FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY);
            userId = task.userId;
            int result = mService.startActivityInPackage(callingUid, callingPackage, intent, null,
                    null, null, 0, 0, bOptions, userId, task, "startActivityFromRecents");
            int result = mService.getActivityStartController().startActivityInPackage(callingUid,
                    callingPackage, intent, null, null, null, 0, 0, bOptions, userId, task,
                    "startActivityFromRecents");
            if (windowingMode == WINDOWING_MODE_SPLIT_SCREEN_PRIMARY) {
                setResizingDuringAnimation(task);
            }
+434 −0

File added.

Preview size limit exceeded, changes collapsed.

+52 −246

File changed.

Preview size limit exceeded, changes collapsed.

Loading