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

Commit 59bcba6b authored by Wale Ogunwale's avatar Wale Ogunwale
Browse files

Log last home activity and result we tried to start

To help debug ANR.

Bug: 38121026
Test: manual
Change-Id: I484301810d07dcf7330dfdbab7310eac14638b90
parent 892cd3e1
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -24015,6 +24015,13 @@ public class ActivityManagerService extends IActivityManager.Stub
                if (reason != null) {
                    pw.println("  Reason: " + reason);
                }
                pw.println("  mLastHomeActivityStartResult: "
                        + mActivityStarter.mLastHomeActivityStartResult);
                final ActivityRecord r = mActivityStarter.mLastHomeActivityStartRecord[0];
                if (r != null) {
                    pw.println("  mLastHomeActivityStartRecord:");
                    r.dump(pw, "   ");
                }
                pw.println();
                dumpActivitiesLocked(null /* fd */, pw, null /* args */, 0 /* opti */,
                        true /* dumpAll */, false /* dumpClient */, null /* dumpPackage */,
+12 −6
Original line number Diff line number Diff line
@@ -188,6 +188,11 @@ class ActivityStarter {

    private boolean mUsingVr2dDisplay;

    // Last home activity record we attempted to start
    final ActivityRecord[] mLastHomeActivityStartRecord = new ActivityRecord[1];
    // The result of the last home activity we attempted to start.
    int mLastHomeActivityStartResult;

    private void reset() {
        mStartActivity = null;
        mIntent = null;
@@ -592,12 +597,13 @@ class ActivityStarter {

    void startHomeActivityLocked(Intent intent, ActivityInfo aInfo, String reason) {
        mSupervisor.moveHomeStackTaskToTop(reason);
        startActivityLocked(null /*caller*/, intent, null /*ephemeralIntent*/,
                null /*resolvedType*/, aInfo, null /*rInfo*/, null /*voiceSession*/,
                null /*voiceInteractor*/, null /*resultTo*/, null /*resultWho*/,
                0 /*requestCode*/, 0 /*callingPid*/, 0 /*callingUid*/, null /*callingPackage*/,
                0 /*realCallingPid*/, 0 /*realCallingUid*/, 0 /*startFlags*/, null /*options*/,
                false /*ignoreTargetSecurity*/, false /*componentSpecified*/, null /*outActivity*/,
        mLastHomeActivityStartResult = startActivityLocked(null /*caller*/, intent,
                null /*ephemeralIntent*/, null /*resolvedType*/, aInfo, null /*rInfo*/,
                null /*voiceSession*/, null /*voiceInteractor*/, null /*resultTo*/,
                null /*resultWho*/, 0 /*requestCode*/, 0 /*callingPid*/, 0 /*callingUid*/,
                null /*callingPackage*/, 0 /*realCallingPid*/, 0 /*realCallingUid*/,
                0 /*startFlags*/, null /*options*/, false /*ignoreTargetSecurity*/,
                false /*componentSpecified*/, mLastHomeActivityStartRecord /*outActivity*/,
                null /*container*/, null /*inTask*/);
        if (mSupervisor.inResumeTopActivity) {
            // If we are in resume section already, home activity will be initialized, but not