From f83068248c5f4e7092e443b8d83be1acc840d937 Mon Sep 17 00:00:00 2001 From: zhanghaidong Date: Sun, 27 Sep 2020 11:07:44 +0800 Subject: [PATCH] ANR: show anr dialog show anr and crash dialog --- services/core/java/com/android/server/am/AppErrors.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/am/AppErrors.java b/services/core/java/com/android/server/am/AppErrors.java index 0c67c75d..f8e31a53 100644 --- a/services/core/java/com/android/server/am/AppErrors.java +++ b/services/core/java/com/android/server/am/AppErrors.java @@ -572,6 +572,7 @@ class AppErrors { long now = SystemClock.uptimeMillis(); boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0; + showBackground = true; Long crashTime; Long crashTimePersistent; @@ -679,6 +680,7 @@ class AppErrors { AppErrorDialog.Data data = (AppErrorDialog.Data) msg.obj; boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0; + showBackground = true; synchronized (mService) { ProcessRecord proc = data.proc; AppErrorResult res = data.result; @@ -702,8 +704,9 @@ class AppErrors { } return; } - final boolean crashSilenced = mAppsNotReportingCrashes != null && + boolean crashSilenced = mAppsNotReportingCrashes != null && mAppsNotReportingCrashes.contains(proc.info.packageName); + crashSilenced = false; if ((mService.canShowErrorDialogs() || showBackground) && !crashSilenced) { proc.crashDialog = new AppErrorDialog(mContext, mService, data); } else { @@ -943,6 +946,7 @@ class AppErrors { boolean showBackground = Settings.Secure.getInt(mContext.getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0; + showBackground = true; if (mService.canShowErrorDialogs() || showBackground) { d = new AppNotRespondingDialog(mService, mContext, proc, (ActivityRecord)data.get("activity"), -- Gitee