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

Commit 8da909ff authored by Charles Chen's avatar Charles Chen Committed by android-build-merger
Browse files

Merge "Fix NPE in ActivityRecord" into qt-dev

am: abb606c5

Change-Id: I9ed935316ba0427e4ee9372670f9c3b83c44c1c4
parents c7435671 abb606c5
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -863,7 +863,7 @@ final class ActivityRecord extends ConfigurationContainer {
            name = intent.getComponent().flattenToShortString();
        }

        private static ActivityRecord tokenToActivityRecordLocked(Token token) {
        private static @Nullable ActivityRecord tokenToActivityRecordLocked(Token token) {
            if (token == null) {
                return null;
            }
@@ -891,7 +891,7 @@ final class ActivityRecord extends ConfigurationContainer {
        }
    }

    static ActivityRecord forTokenLocked(IBinder token) {
    static @Nullable ActivityRecord forTokenLocked(IBinder token) {
        try {
            return Token.tokenToActivityRecordLocked((Token)token);
        } catch (ClassCastException e) {
@@ -2127,10 +2127,13 @@ final class ActivityRecord extends ConfigurationContainer {
    static void activityResumedLocked(IBinder token) {
        final ActivityRecord r = ActivityRecord.forTokenLocked(token);
        if (DEBUG_SAVED_STATE) Slog.i(TAG_STATES, "Resumed activity; dropping state of: " + r);
        if (r != null) {
        if (r == null) {
            // If an app reports resumed after a long delay, the record on server side might have
            // been removed (e.g. destroy timeout), so the token could be null.
            return;
        }
        r.icicle = null;
        r.haveState = false;
        }

        final ActivityDisplay display = r.getDisplay();
        if (display != null) {
+1 −1
Original line number Diff line number Diff line
@@ -1804,7 +1804,7 @@ class ActivityStack extends ConfigurationContainer {
            if (prev.finishing) {
                if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Executing finish of activity: " + prev);
                prev = finishCurrentActivityLocked(prev, FINISH_AFTER_VISIBLE, false,
                        "completedPausedLocked");
                        "completePausedLocked");
            } else if (prev.hasProcess()) {
                if (DEBUG_PAUSE) Slog.v(TAG_PAUSE, "Enqueue pending stop if needed: " + prev
                        + " wasStopping=" + wasStopping + " visible=" + prev.visible);