name = intent.getComponent().flattenToShortString();
}
- private static ActivityRecord tokenToActivityRecordLocked(Token token) {
+ private static @Nullable ActivityRecord tokenToActivityRecordLocked(Token token) {
if (token == null) {
return null;
}
}
}
- static ActivityRecord forTokenLocked(IBinder token) {
+ static @Nullable ActivityRecord forTokenLocked(IBinder token) {
try {
return Token.tokenToActivityRecordLocked((Token)token);
} catch (ClassCastException e) {
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) {
- r.icicle = null;
- r.haveState = false;
+ 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) {
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);