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

Commit 99d0d393 authored by Craig Mautner's avatar Craig Mautner Committed by The Android Automerger
Browse files

Do not set visibility of unstarted activities.

If an activity is started in the stopped state then it shouldn't have
its window manager visibility set to visible. It also should not have
its screen frozen.

Fixes bug 19823482.

Change-Id: I74637a8eefcc97d1ef4d8ea3c661dc7c0c322f59
parent 2d858a48
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -3896,8 +3896,7 @@ final class ActivityStack {
        return true;
    }

    private boolean relaunchActivityLocked(ActivityRecord r,
            int changes, boolean andResume) {
    private boolean relaunchActivityLocked(ActivityRecord r, int changes, boolean andResume) {
        List<ResultInfo> results = null;
        List<ReferrerIntent> newIntents = null;
        if (andResume) {
+31 −27
Original line number Diff line number Diff line
@@ -273,8 +273,8 @@ public final class ActivityStackSupervisor implements DisplayListener {
     * until the task exits or #stopLockTaskMode() is called. */
    TaskRecord mLockTaskModeTask;
    /** Store the current lock task mode. Possible values:
     * {@link ActivityManager#LOCK_TASK_MODE_NONE}, {@link ActicityManager#LOCK_TASK_MODE_LOCKED},
     * {@link ActicityManager#LOCK_TASK_MODE_PINNED}
     * {@link ActivityManager#LOCK_TASK_MODE_NONE}, {@link ActivityManager#LOCK_TASK_MODE_LOCKED},
     * {@link ActivityManager#LOCK_TASK_MODE_PINNED}
     */
    private int mLockTaskModeState;
    /**
@@ -1132,12 +1132,13 @@ public final class ActivityStackSupervisor implements DisplayListener {
            ProcessRecord app, boolean andResume, boolean checkConfig)
            throws RemoteException {

        if (andResume) {
            r.startFreezingScreenLocked(app, 0);
        if (false) Slog.d(TAG, "realStartActivity: setting app visibility true");
            mWindowManager.setAppVisibility(r.appToken, true);

            // schedule launch ticks to collect information about slow apps.
            r.startLaunchTickingLocked();
        }

        // Have the window manager re-evaluate the orientation of
        // the screen based on the new activity order.  Note that
@@ -1195,17 +1196,13 @@ public final class ActivityStackSupervisor implements DisplayListener {
            r.forceNewConfig = false;
            mService.showAskCompatModeDialogLocked(r);
            r.compat = mService.compatibilityInfoForPackageLocked(r.info.applicationInfo);
            String profileFile = null;
            ParcelFileDescriptor profileFd = null;
            ProfilerInfo profilerInfo = null;
            if (mService.mProfileApp != null && mService.mProfileApp.equals(app.processName)) {
                if (mService.mProfileProc == null || mService.mProfileProc == app) {
                    mService.mProfileProc = app;
                    profileFile = mService.mProfileFile;
                    profileFd = mService.mProfileFd;
                }
            }
            app.hasShownUi = true;
            app.pendingUiClean = true;
                    final String profileFile = mService.mProfileFile;
                    if (profileFile != null) {
                        ParcelFileDescriptor profileFd = mService.mProfileFd;
                        if (profileFd != null) {
                            try {
                                profileFd = profileFd.dup();
@@ -1220,9 +1217,16 @@ public final class ActivityStackSupervisor implements DisplayListener {
                            }
                        }

            ProfilerInfo profilerInfo = profileFile != null
                    ? new ProfilerInfo(profileFile, profileFd, mService.mSamplingInterval,
                    mService.mAutoStopProfiler) : null;
                        profilerInfo = new ProfilerInfo(profileFile, profileFd,
                                mService.mSamplingInterval, mService.mAutoStopProfiler);
                    }
                }
            }

            if (andResume) {
                app.hasShownUi = true;
                app.pendingUiClean = true;
            }
            app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_TOP);
            app.thread.scheduleLaunchActivity(new Intent(r.intent), r.appToken,
                    System.identityHashCode(r), r.info, new Configuration(mService.mConfiguration),
+3 −3
Original line number Diff line number Diff line
@@ -3056,7 +3056,7 @@ public class WindowManagerService extends IWindowManager.Stub
                }
            }

            if (DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": viewVisibility=" + viewVisibility
            if (true || DEBUG_LAYOUT) Slog.v(TAG, "Relayout " + win + ": viewVisibility=" + viewVisibility
                    + " req=" + requestedWidth + "x" + requestedHeight + " " + win.mAttrs);

            win.mEnforceSizeCompat =
@@ -4171,8 +4171,8 @@ public class WindowManagerService extends IWindowManager.Stub
        }

        synchronized(mWindowMap) {
            if (DEBUG_APP_TRANSITIONS) Slog.w(TAG, "Execute app transition: " + mAppTransition,
                    new RuntimeException("here").fillInStackTrace());
            if (DEBUG_APP_TRANSITIONS) Slog.w(TAG, "Execute app transition: " + mAppTransition
                    + " Callers=" + Debug.getCallers(5));
            if (mAppTransition.isTransitionSet()) {
                mAppTransition.setReady();
                final long origId = Binder.clearCallingIdentity();