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

Commit ed9f50dd authored by Louis Chang's avatar Louis Chang
Browse files

Dump warning logs to prevent app crash while no top-resumed changes

Applications crashed due to duplicated top resumed activity change
events. Currently, the only possible scenario we know if that the
application invokes Looper#loop() and reverse the messages order.

Write warning logs vs. throwing exceptions to prevent application
crashes.

Bug: 140571893
Test: build and boot pass
Change-Id: If6f6c502b96ccc11b230ba075c61118f03e13d5c
parent e1e03666
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4602,6 +4602,10 @@ public final class ActivityThread extends ClientTransactionHandler {
        }

        if (r.isTopResumedActivity == onTop) {
            if (!Build.IS_DEBUGGABLE) {
                Slog.w(TAG, "Activity top position already set to onTop=" + onTop);
                return;
            }
            throw new IllegalStateException("Activity top position already set to onTop=" + onTop);
        }