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

Commit 886e7fed authored by Bryce Lee's avatar Bryce Lee
Browse files

Perform Activity#onStart when launching in LocalActivityManager.

We move to the start state when launching a tabbed activity through
LocalActivityManager, but currently do not inform the activity
thread due to changes in how ActivityThread is updated through the
ActivityLifecycler. This changelist addresses this issue.

Change-Id: Ibc2bda39617e1741bb3ee8637a182dc9f14dd61d
Fixes: 70813462
Fixes: 70812753
Test: atest CtsAppTestCases:android.app.cts.LifecycleTest
Test: atest LocalActivityManagerTest
Test: atest ActivityGroupTest
parent 7b9a2c76
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.app;

import android.app.ActivityThread.ActivityClientRecord;
import android.app.servertransaction.PendingTransactionActions;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Binder;
@@ -141,6 +143,21 @@ public class LocalActivityManager {
            }
            r.window = r.activity.getWindow();
            r.instanceState = null;

            final ActivityClientRecord clientRecord = mActivityThread.getActivityClient(r);
            final PendingTransactionActions pendingActions;

            if (!r.activity.mFinished) {
                // This matches pending actions set in ActivityThread#handleLaunchActivity
                pendingActions = new PendingTransactionActions();
                pendingActions.setOldState(clientRecord.state);
                pendingActions.setRestoreInstanceState(true);
                pendingActions.setCallOnPostCreate(true);
            } else {
                pendingActions = null;
            }

            mActivityThread.handleStartActivity(clientRecord, pendingActions);
            r.curState = STARTED;
            
            if (desiredState == RESUMED) {