Add additional logging for incorrect activity stop
Print ActivityClientRecord state when ActivityThread#performStopActivityInner is called for already stopped activity. Bug: 25267624 Change-Id: I2b044e42d0188ef9eaf15422b6a05617ade802e2
This commit is contained in:
@@ -744,7 +744,7 @@ public class Activity extends ContextThemeWrapper
|
||||
Activity mParent;
|
||||
boolean mCalled;
|
||||
/*package*/ boolean mResumed;
|
||||
private boolean mStopped;
|
||||
/*package*/ boolean mStopped;
|
||||
boolean mFinished;
|
||||
boolean mStartedActivity;
|
||||
private boolean mDestroyed;
|
||||
|
||||
@@ -379,6 +379,33 @@ public final class ActivityThread {
|
||||
? "no component name" : componentName.toShortString())
|
||||
+ "}";
|
||||
}
|
||||
|
||||
public String getStateString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("ActivityClientRecord{");
|
||||
sb.append("paused=").append(paused);
|
||||
sb.append(", stopped=").append(stopped);
|
||||
sb.append(", hideForNow=").append(hideForNow);
|
||||
sb.append(", startsNotResumed=").append(startsNotResumed);
|
||||
sb.append(", isForward=").append(isForward);
|
||||
sb.append(", pendingConfigChanges=").append(pendingConfigChanges);
|
||||
sb.append(", onlyLocalRequest=").append(onlyLocalRequest);
|
||||
sb.append(", preserveWindow=").append(mPreserveWindow);
|
||||
if (activity != null) {
|
||||
sb.append(", Activity{");
|
||||
sb.append("resumed=").append(activity.mResumed);
|
||||
sb.append(", stopped=").append(activity.mStopped);
|
||||
sb.append(", finished=").append(activity.isFinishing());
|
||||
sb.append(", destroyed=").append(activity.isDestroyed());
|
||||
sb.append(", startedActivity=").append(activity.mStartedActivity);
|
||||
sb.append(", temporaryPause=").append(activity.mTemporaryPause);
|
||||
sb.append(", changingConfigurations=").append(activity.mChangingConfigurations);
|
||||
sb.append(", visibleBehind=").append(activity.mVisibleBehind);
|
||||
sb.append("}");
|
||||
}
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
final class ProviderClientRecord {
|
||||
@@ -3752,9 +3779,10 @@ public final class ActivityThread {
|
||||
return;
|
||||
}
|
||||
RuntimeException e = new RuntimeException(
|
||||
"Performing stop of activity that is not resumed: "
|
||||
"Performing stop of activity that is already stopped: "
|
||||
+ r.intent.getComponent().toShortString());
|
||||
Slog.e(TAG, e.getMessage(), e);
|
||||
Slog.e(TAG, r.getStateString());
|
||||
}
|
||||
|
||||
if (info != null) {
|
||||
|
||||
Reference in New Issue
Block a user