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

Commit fea8d956 authored by George Mount's avatar George Mount Committed by Android (Google) Code Review
Browse files

Merge "Fix null ActivityOptions when starting an Activity in a new Process."

parents 07e1b900 2c92c970
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -688,7 +688,8 @@ final class ActivityRecord {
    }

    void applyOptionsLocked() {
        if (pendingOptions != null) {
        if (pendingOptions != null
                && pendingOptions.getAnimationType() != ActivityOptions.ANIM_SCENE_TRANSITION) {
            final int animationType = pendingOptions.getAnimationType();
            switch (animationType) {
                case ActivityOptions.ANIM_CUSTOM:
+4 −3
Original line number Diff line number Diff line
@@ -1145,7 +1145,7 @@ final class ActivityStack {
                                mWindowManager.setAppVisibility(r.appToken, true);
                            }
                            if (r != starting) {
                                mStackSupervisor.startSpecificActivityLocked(r, false, false, null);
                                mStackSupervisor.startSpecificActivityLocked(r, false, false);
                            }
                        }

@@ -1678,6 +1678,7 @@ final class ActivityStack {
                mService.showAskCompatModeDialogLocked(next);
                next.app.pendingUiClean = true;
                next.app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_TOP);
                next.clearOptionsLocked();
                next.app.thread.scheduleResumeActivity(next.appToken, next.app.repProcState,
                        mService.isNextTransitionForward(), resumeAnimOptions);

@@ -1703,7 +1704,7 @@ final class ActivityStack {
                            next.nonLocalizedLabel, next.labelRes, next.icon, next.logo,
                            next.windowFlags, null, true);
                }
                mStackSupervisor.startSpecificActivityLocked(next, true, false, resumeAnimOptions);
                mStackSupervisor.startSpecificActivityLocked(next, true, false);
                if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
                return true;
            }
@@ -1741,7 +1742,7 @@ final class ActivityStack {
                if (DEBUG_SWITCH) Slog.v(TAG, "Restarting: " + next);
            }
            if (DEBUG_STATES) Slog.d(TAG, "resumeTopActivityLocked: Restarting " + next);
            mStackSupervisor.startSpecificActivityLocked(next, true, true, resumeAnimOptions);
            mStackSupervisor.startSpecificActivityLocked(next, true, true);
        }

        if (DEBUG_STACK) mStackSupervisor.validateTopActivitiesLocked();
+7 −5
Original line number Diff line number Diff line
@@ -411,7 +411,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
                    if (hr.app == null && app.uid == hr.info.applicationInfo.uid
                            && processName.equals(hr.processName)) {
                        try {
                            if (realStartActivityLocked(hr, app, true, true, null)) {
                            if (realStartActivityLocked(hr, app, true, true)) {
                                didSomething = true;
                            }
                        } catch (Exception e) {
@@ -935,7 +935,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
    }

    final boolean realStartActivityLocked(ActivityRecord r,
            ProcessRecord app, boolean andResume, boolean checkConfig, Bundle resumeArgs)
            ProcessRecord app, boolean andResume, boolean checkConfig)
            throws RemoteException {

        r.startFreezingScreenLocked(app, 0);
@@ -1029,12 +1029,14 @@ public final class ActivityStackSupervisor implements DisplayListener {
            }

            app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_TOP);
            Bundle options = (r.pendingOptions == null) ? null : r.pendingOptions.toBundle();
            r.clearOptionsLocked();
            app.thread.scheduleLaunchActivity(new Intent(r.intent), r.appToken,
                    System.identityHashCode(r), r.info,
                    new Configuration(mService.mConfiguration), r.compat,
                    app.repProcState, r.icicle, results, newIntents, !andResume,
                    mService.isNextTransitionForward(), profileFile, profileFd,
                    profileAutoStop, resumeArgs);
                    profileAutoStop, options);

            if ((app.info.flags&ApplicationInfo.FLAG_CANT_SAVE_STATE) != 0) {
                // This may be a heavy-weight process!  Note that the package
@@ -1108,7 +1110,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
    }

    void startSpecificActivityLocked(ActivityRecord r,
            boolean andResume, boolean checkConfig, Bundle resumeArgs) {
            boolean andResume, boolean checkConfig) {
        // Is this activity's application already running?
        ProcessRecord app = mService.getProcessRecordLocked(r.processName,
                r.info.applicationInfo.uid, true);
@@ -1125,7 +1127,7 @@ public final class ActivityStackSupervisor implements DisplayListener {
                    // separate apk in the process.
                    app.addPackage(r.info.packageName, mService.mProcessStats);
                }
                realStartActivityLocked(r, app, andResume, checkConfig, resumeArgs);
                realStartActivityLocked(r, app, andResume, checkConfig);
                return;
            } catch (RemoteException e) {
                Slog.w(TAG, "Exception when starting activity "