Loading core/java/android/provider/Settings.java +2 −0 Original line number Diff line number Diff line Loading @@ -5839,6 +5839,8 @@ public final class Settings { /** * If nonzero, ANRs in invisible background processes bring up a dialog. * Otherwise, the process will be silently killed. * * Also prevents ANRs and crash dialogs from being suppressed. * @hide */ public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; Loading services/core/java/com/android/server/am/AppErrors.java +9 −3 Original line number Diff line number Diff line Loading @@ -575,6 +575,8 @@ class AppErrors { boolean handleAppCrashLocked(ProcessRecord app, String reason, String shortMsg, String longMsg, String stackTrace, AppErrorDialog.Data data) { long now = SystemClock.uptimeMillis(); boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0; Long crashTime; Long crashTimePersistent; Loading Loading @@ -612,8 +614,10 @@ class AppErrors { // processes run critical code. mService.removeProcessLocked(app, false, false, "crash"); mService.mStackSupervisor.resumeFocusedStackTopActivityLocked(); if (!showBackground) { return false; } } mService.mStackSupervisor.resumeFocusedStackTopActivityLocked(); } else { TaskRecord affectedTask = Loading Loading @@ -705,7 +709,7 @@ class AppErrors { } final boolean crashSilenced = mAppsNotReportingCrashes != null && mAppsNotReportingCrashes.contains(proc.info.packageName); if (mService.canShowErrorDialogs() && !crashSilenced) { if ((mService.canShowErrorDialogs() || showBackground) && !crashSilenced) { proc.crashDialog = new AppErrorDialog(mContext, mService, data); } else { // The device is asleep, so just pretend that the user Loading Loading @@ -942,7 +946,9 @@ class AppErrors { null, null, 0, null, null, null, AppOpsManager.OP_NONE, null, false, false, MY_PID, Process.SYSTEM_UID, 0 /* TODO: Verify */); if (mService.canShowErrorDialogs()) { boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0; if (mService.canShowErrorDialogs() || showBackground) { d = new AppNotRespondingDialog(mService, mContext, proc, (ActivityRecord)data.get("activity"), msg.arg1 != 0); Loading Loading
core/java/android/provider/Settings.java +2 −0 Original line number Diff line number Diff line Loading @@ -5839,6 +5839,8 @@ public final class Settings { /** * If nonzero, ANRs in invisible background processes bring up a dialog. * Otherwise, the process will be silently killed. * * Also prevents ANRs and crash dialogs from being suppressed. * @hide */ public static final String ANR_SHOW_BACKGROUND = "anr_show_background"; Loading
services/core/java/com/android/server/am/AppErrors.java +9 −3 Original line number Diff line number Diff line Loading @@ -575,6 +575,8 @@ class AppErrors { boolean handleAppCrashLocked(ProcessRecord app, String reason, String shortMsg, String longMsg, String stackTrace, AppErrorDialog.Data data) { long now = SystemClock.uptimeMillis(); boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0; Long crashTime; Long crashTimePersistent; Loading Loading @@ -612,8 +614,10 @@ class AppErrors { // processes run critical code. mService.removeProcessLocked(app, false, false, "crash"); mService.mStackSupervisor.resumeFocusedStackTopActivityLocked(); if (!showBackground) { return false; } } mService.mStackSupervisor.resumeFocusedStackTopActivityLocked(); } else { TaskRecord affectedTask = Loading Loading @@ -705,7 +709,7 @@ class AppErrors { } final boolean crashSilenced = mAppsNotReportingCrashes != null && mAppsNotReportingCrashes.contains(proc.info.packageName); if (mService.canShowErrorDialogs() && !crashSilenced) { if ((mService.canShowErrorDialogs() || showBackground) && !crashSilenced) { proc.crashDialog = new AppErrorDialog(mContext, mService, data); } else { // The device is asleep, so just pretend that the user Loading Loading @@ -942,7 +946,9 @@ class AppErrors { null, null, 0, null, null, null, AppOpsManager.OP_NONE, null, false, false, MY_PID, Process.SYSTEM_UID, 0 /* TODO: Verify */); if (mService.canShowErrorDialogs()) { boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0; if (mService.canShowErrorDialogs() || showBackground) { d = new AppNotRespondingDialog(mService, mContext, proc, (ActivityRecord)data.get("activity"), msg.arg1 != 0); Loading