Loading core/java/android/app/ApplicationErrorReport.java +9 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.SystemProperties; import android.provider.Settings; import android.util.Printer; import android.util.Slog; import com.android.internal.util.FastPrintWriter; import java.io.PrintWriter; Loading Loading @@ -332,6 +333,12 @@ public class ApplicationErrorReport implements Parcelable { */ public String stackTrace; /** * Crash tag for some context. * @hide */ public String crashTag; /** * Create an uninitialized instance of CrashInfo. */ Loading Loading @@ -416,6 +423,7 @@ public class ApplicationErrorReport implements Parcelable { throwMethodName = in.readString(); throwLineNumber = in.readInt(); stackTrace = in.readString(); crashTag = in.readString(); } /** Loading @@ -430,6 +438,7 @@ public class ApplicationErrorReport implements Parcelable { dest.writeString(throwMethodName); dest.writeInt(throwLineNumber); dest.writeString(stackTrace); dest.writeString(crashTag); int total = dest.dataPosition()-start; if (Binder.CHECK_PARCEL_SIZE && total > 20*1024) { Slog.d("Error", "ERR: exClass=" + exceptionClassName); Loading services/core/java/com/android/server/am/ActivityManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -10578,6 +10578,15 @@ public class ActivityManagerService extends IActivityManager.Stub StatsLog.write(StatsLog.WTF_OCCURRED, callingUid, tag, processName, callingPid); final int relaunchReason = r == null ? ActivityRecord.RELAUNCH_REASON_NONE : r.getWindowProcessController().computeRelaunchReason(); final String relaunchReasonString = ActivityRecord.relaunchReasonToString(relaunchReason); if (crashInfo.crashTag == null) { crashInfo.crashTag = relaunchReasonString; } else { crashInfo.crashTag = crashInfo.crashTag + " " + relaunchReasonString; } addErrorToDropBox("wtf", r, processName, null, null, tag, null, null, crashInfo); return r; Loading Loading @@ -10732,6 +10741,9 @@ public class ActivityManagerService extends IActivityManager.Stub if (Debug.isDebuggerConnected()) { sb.append("Debugger: Connected\n"); } if (crashInfo != null && crashInfo.crashTag != null && !crashInfo.crashTag.isEmpty()) { sb.append("Crash-Tag: ").append(crashInfo.crashTag).append("\n"); } sb.append("\n"); // Do the rest in a worker thread to avoid blocking the caller on I/O Loading services/core/java/com/android/server/am/ActivityRecord.java +36 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,17 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo int mStartingWindowState = STARTING_WINDOW_NOT_SHOWN; boolean mTaskOverlay = false; // Task is always on-top of other activities in the task. // This activity is not being relaunched, or being relaunched for a non-resize reason. static final int RELAUNCH_REASON_NONE = 0; // This activity is being relaunched due to windowing mode change. static final int RELAUNCH_REASON_WINDOWING_MODE_RESIZE = 1; // This activity is being relaunched due to a free-resize operation. static final int RELAUNCH_REASON_FREE_RESIZE = 2; // Marking the reason why this activity is being relaunched. Mainly used to track that this // activity is being relaunched to fulfill a resize request due to compatibility issues, e.g. in // pre-NYC apps that don't have a sense of being resized. int mRelaunchReason = RELAUNCH_REASON_NONE; TaskDescription taskDescription; // the recents information for this activity boolean mLaunchTaskBehind; // this activity is actively being launched with // ActivityOptions.setLaunchTaskBehind, will be cleared once launch is completed. Loading Loading @@ -2617,6 +2628,15 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo startFreezingScreenLocked(app, globalChanges); forceNewConfig = false; preserveWindow &= isResizeOnlyChange(changes); final boolean hasResizeChange = hasResizeChange(changes & ~info.getRealConfigChanged()); if (hasResizeChange) { final boolean isDragResizing = getTask().getWindowContainerController().isDragResizing(); mRelaunchReason = isDragResizing ? RELAUNCH_REASON_FREE_RESIZE : RELAUNCH_REASON_WINDOWING_MODE_RESIZE; } else { mRelaunchReason = RELAUNCH_REASON_NONE; } if (!attachedToProcess()) { if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION, "Config is destroying non-running " + this); Loading Loading @@ -2738,6 +2758,11 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo | CONFIG_SCREEN_LAYOUT)) == 0; } private static boolean hasResizeChange(int change) { return (change & (CONFIG_SCREEN_SIZE | CONFIG_SMALLEST_SCREEN_SIZE | CONFIG_ORIENTATION | CONFIG_SCREEN_LAYOUT)) != 0; } void relaunchActivityLocked(boolean andResume, boolean preserveWindow) { if (service.mSuppressResizeConfigChanges && preserveWindow) { configChangeFlags = 0; Loading Loading @@ -3017,6 +3042,17 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo mWindowContainerController.registerRemoteAnimations(definition); } static String relaunchReasonToString(int relaunchReason) { switch (relaunchReason) { case RELAUNCH_REASON_WINDOWING_MODE_RESIZE: return "window_resize"; case RELAUNCH_REASON_FREE_RESIZE: return "free_resize"; default: return null; } } @Override public String toString() { if (stringName != null) { Loading services/core/java/com/android/server/am/ActivityStack.java +10 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,8 @@ import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_USER_LEAV import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_VISIBILITY; import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM; import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.am.ActivityRecord.RELAUNCH_REASON_FREE_RESIZE; import static com.android.server.am.ActivityRecord.RELAUNCH_REASON_WINDOWING_MODE_RESIZE; import static com.android.server.am.ActivityStack.ActivityState.DESTROYED; import static com.android.server.am.ActivityStack.ActivityState.DESTROYING; import static com.android.server.am.ActivityStack.ActivityState.FINISHING; Loading Loading @@ -4483,7 +4485,14 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai hasVisibleActivities = true; } final boolean remove; if ((!r.haveState && !r.stateNotNeeded) || r.finishing) { if ((r.mRelaunchReason == RELAUNCH_REASON_WINDOWING_MODE_RESIZE || r.mRelaunchReason == RELAUNCH_REASON_FREE_RESIZE) && r.launchCount < 3 && !r.finishing) { // If the process crashed during a resize, always try to relaunch it, unless // it has failed more than twice. Skip activities that's already finishing // cleanly by itself. remove = false; } else if ((!r.haveState && !r.stateNotNeeded) || r.finishing) { // Don't currently have state for the activity, or // it is finishing -- always remove it. remove = true; Loading services/core/java/com/android/server/am/ActivityStackSupervisor.java +5 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM; import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.am.ActivityManagerService.ANIMATE; import static com.android.server.am.ActivityManagerService.FIRST_SUPERVISOR_STACK_MSG; import static com.android.server.am.ActivityRecord.RELAUNCH_REASON_NONE; import static com.android.server.am.ActivityStack.ActivityState.DESTROYED; import static com.android.server.am.ActivityStack.ActivityState.DESTROYING; import static com.android.server.am.ActivityStack.ActivityState.INITIALIZING; Loading Loading @@ -2100,6 +2101,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D if (isTopDisplayFocusedStack(r.getStack()) || fromTimeout) { booting = checkFinishBootingLocked(); } // When activity is idle, we consider the relaunch must be successful, so let's clear // the flag. r.mRelaunchReason = RELAUNCH_REASON_NONE; } if (allResumedActivitiesIdle()) { Loading Loading
core/java/android/app/ApplicationErrorReport.java +9 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.os.SystemProperties; import android.provider.Settings; import android.util.Printer; import android.util.Slog; import com.android.internal.util.FastPrintWriter; import java.io.PrintWriter; Loading Loading @@ -332,6 +333,12 @@ public class ApplicationErrorReport implements Parcelable { */ public String stackTrace; /** * Crash tag for some context. * @hide */ public String crashTag; /** * Create an uninitialized instance of CrashInfo. */ Loading Loading @@ -416,6 +423,7 @@ public class ApplicationErrorReport implements Parcelable { throwMethodName = in.readString(); throwLineNumber = in.readInt(); stackTrace = in.readString(); crashTag = in.readString(); } /** Loading @@ -430,6 +438,7 @@ public class ApplicationErrorReport implements Parcelable { dest.writeString(throwMethodName); dest.writeInt(throwLineNumber); dest.writeString(stackTrace); dest.writeString(crashTag); int total = dest.dataPosition()-start; if (Binder.CHECK_PARCEL_SIZE && total > 20*1024) { Slog.d("Error", "ERR: exClass=" + exceptionClassName); Loading
services/core/java/com/android/server/am/ActivityManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -10578,6 +10578,15 @@ public class ActivityManagerService extends IActivityManager.Stub StatsLog.write(StatsLog.WTF_OCCURRED, callingUid, tag, processName, callingPid); final int relaunchReason = r == null ? ActivityRecord.RELAUNCH_REASON_NONE : r.getWindowProcessController().computeRelaunchReason(); final String relaunchReasonString = ActivityRecord.relaunchReasonToString(relaunchReason); if (crashInfo.crashTag == null) { crashInfo.crashTag = relaunchReasonString; } else { crashInfo.crashTag = crashInfo.crashTag + " " + relaunchReasonString; } addErrorToDropBox("wtf", r, processName, null, null, tag, null, null, crashInfo); return r; Loading Loading @@ -10732,6 +10741,9 @@ public class ActivityManagerService extends IActivityManager.Stub if (Debug.isDebuggerConnected()) { sb.append("Debugger: Connected\n"); } if (crashInfo != null && crashInfo.crashTag != null && !crashInfo.crashTag.isEmpty()) { sb.append("Crash-Tag: ").append(crashInfo.crashTag).append("\n"); } sb.append("\n"); // Do the rest in a worker thread to avoid blocking the caller on I/O Loading
services/core/java/com/android/server/am/ActivityRecord.java +36 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,17 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo int mStartingWindowState = STARTING_WINDOW_NOT_SHOWN; boolean mTaskOverlay = false; // Task is always on-top of other activities in the task. // This activity is not being relaunched, or being relaunched for a non-resize reason. static final int RELAUNCH_REASON_NONE = 0; // This activity is being relaunched due to windowing mode change. static final int RELAUNCH_REASON_WINDOWING_MODE_RESIZE = 1; // This activity is being relaunched due to a free-resize operation. static final int RELAUNCH_REASON_FREE_RESIZE = 2; // Marking the reason why this activity is being relaunched. Mainly used to track that this // activity is being relaunched to fulfill a resize request due to compatibility issues, e.g. in // pre-NYC apps that don't have a sense of being resized. int mRelaunchReason = RELAUNCH_REASON_NONE; TaskDescription taskDescription; // the recents information for this activity boolean mLaunchTaskBehind; // this activity is actively being launched with // ActivityOptions.setLaunchTaskBehind, will be cleared once launch is completed. Loading Loading @@ -2617,6 +2628,15 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo startFreezingScreenLocked(app, globalChanges); forceNewConfig = false; preserveWindow &= isResizeOnlyChange(changes); final boolean hasResizeChange = hasResizeChange(changes & ~info.getRealConfigChanged()); if (hasResizeChange) { final boolean isDragResizing = getTask().getWindowContainerController().isDragResizing(); mRelaunchReason = isDragResizing ? RELAUNCH_REASON_FREE_RESIZE : RELAUNCH_REASON_WINDOWING_MODE_RESIZE; } else { mRelaunchReason = RELAUNCH_REASON_NONE; } if (!attachedToProcess()) { if (DEBUG_SWITCH || DEBUG_CONFIGURATION) Slog.v(TAG_CONFIGURATION, "Config is destroying non-running " + this); Loading Loading @@ -2738,6 +2758,11 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo | CONFIG_SCREEN_LAYOUT)) == 0; } private static boolean hasResizeChange(int change) { return (change & (CONFIG_SCREEN_SIZE | CONFIG_SMALLEST_SCREEN_SIZE | CONFIG_ORIENTATION | CONFIG_SCREEN_LAYOUT)) != 0; } void relaunchActivityLocked(boolean andResume, boolean preserveWindow) { if (service.mSuppressResizeConfigChanges && preserveWindow) { configChangeFlags = 0; Loading Loading @@ -3017,6 +3042,17 @@ final class ActivityRecord extends ConfigurationContainer implements AppWindowCo mWindowContainerController.registerRemoteAnimations(definition); } static String relaunchReasonToString(int relaunchReason) { switch (relaunchReason) { case RELAUNCH_REASON_WINDOWING_MODE_RESIZE: return "window_resize"; case RELAUNCH_REASON_FREE_RESIZE: return "free_resize"; default: return null; } } @Override public String toString() { if (stringName != null) { Loading
services/core/java/com/android/server/am/ActivityStack.java +10 −1 Original line number Diff line number Diff line Loading @@ -72,6 +72,8 @@ import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_USER_LEAV import static com.android.server.am.ActivityManagerDebugConfig.POSTFIX_VISIBILITY; import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM; import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.am.ActivityRecord.RELAUNCH_REASON_FREE_RESIZE; import static com.android.server.am.ActivityRecord.RELAUNCH_REASON_WINDOWING_MODE_RESIZE; import static com.android.server.am.ActivityStack.ActivityState.DESTROYED; import static com.android.server.am.ActivityStack.ActivityState.DESTROYING; import static com.android.server.am.ActivityStack.ActivityState.FINISHING; Loading Loading @@ -4483,7 +4485,14 @@ class ActivityStack<T extends StackWindowController> extends ConfigurationContai hasVisibleActivities = true; } final boolean remove; if ((!r.haveState && !r.stateNotNeeded) || r.finishing) { if ((r.mRelaunchReason == RELAUNCH_REASON_WINDOWING_MODE_RESIZE || r.mRelaunchReason == RELAUNCH_REASON_FREE_RESIZE) && r.launchCount < 3 && !r.finishing) { // If the process crashed during a resize, always try to relaunch it, unless // it has failed more than twice. Skip activities that's already finishing // cleanly by itself. remove = false; } else if ((!r.haveState && !r.stateNotNeeded) || r.finishing) { // Don't currently have state for the activity, or // it is finishing -- always remove it. remove = true; Loading
services/core/java/com/android/server/am/ActivityStackSupervisor.java +5 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import static com.android.server.am.ActivityManagerDebugConfig.TAG_AM; import static com.android.server.am.ActivityManagerDebugConfig.TAG_WITH_CLASS_NAME; import static com.android.server.am.ActivityManagerService.ANIMATE; import static com.android.server.am.ActivityManagerService.FIRST_SUPERVISOR_STACK_MSG; import static com.android.server.am.ActivityRecord.RELAUNCH_REASON_NONE; import static com.android.server.am.ActivityStack.ActivityState.DESTROYED; import static com.android.server.am.ActivityStack.ActivityState.DESTROYING; import static com.android.server.am.ActivityStack.ActivityState.INITIALIZING; Loading Loading @@ -2100,6 +2101,10 @@ public class ActivityStackSupervisor extends ConfigurationContainer implements D if (isTopDisplayFocusedStack(r.getStack()) || fromTimeout) { booting = checkFinishBootingLocked(); } // When activity is idle, we consider the relaunch must be successful, so let's clear // the flag. r.mRelaunchReason = RELAUNCH_REASON_NONE; } if (allResumedActivitiesIdle()) { Loading