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

Commit e2b0480f authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Fix not saving state when restarting an activity.

Change-Id: I4c9e93e9523c9c62e3a15e6e4587ffad06280545
parent d2112306
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -2415,8 +2415,6 @@ public final class ActivityThread {
                state = new Bundle();
                mInstrumentation.callActivityOnSaveInstanceState(r.activity, state);
                r.state = state;
            } else {
                r.state = null;
            }
            // Now we are idle.
            r.activity.mCalled = false;
@@ -2956,9 +2954,13 @@ public final class ActivityThread {

        r.activity.mChangingConfigurations = true;

        Bundle savedState = null;
        // Need to ensure state is saved.
        if (!r.paused) {
            savedState = performPauseActivity(r.token, false, r.isPreHoneycomb());
            performPauseActivity(r.token, false, r.isPreHoneycomb());
        }
        if (r.state == null && !r.stopped && !r.isPreHoneycomb()) {
            r.state = new Bundle();
            mInstrumentation.callActivityOnSaveInstanceState(r.activity, r.state);
        }

        handleDestroyActivity(r.token, false, configChanges, true);
@@ -2983,9 +2985,6 @@ public final class ActivityThread {
            }
        }
        r.startsNotResumed = tmp.startsNotResumed;
        if (savedState != null) {
            r.state = savedState;
        }

        handleLaunchActivity(r, currentIntent);
    }