summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Justin Koh <justinkoh@google.com> 2012-03-29 15:11:44 -0700
committer Justin Koh <justinkoh@google.com> 2012-03-29 15:37:11 -0700
commitbc52ca28148a9a8f2935c380d9e97d56a75be416 (patch)
treed108eb324db390897b736225dad2140f8f43eb6f
parentc7e56eff1b48b0b6e871bdd12027b6b3e80345de (diff)
Stop ANR dialogs from appearing when ActivityManager dialogs should not be shown
Stop ANR dialogs from appearing on devices where the ActivityManager dialogs should not be shown. Instead, kill the process. This is preferable because the user can't actually do anything on the device. TESTED = runs on device with that config, simulated ANR using test app. Change-Id: I6267000afd12ef929f0c625220184c6ab0139552
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index c21ba965b9e1..768456662910 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -933,11 +933,15 @@ public final class ActivityManagerService extends ActivityManagerNative
broadcastIntentLocked(null, null, intent,
null, null, 0, null, null, null,
false, false, MY_PID, Process.SYSTEM_UID);
-
- Dialog d = new AppNotRespondingDialog(ActivityManagerService.this,
- mContext, proc, (ActivityRecord)data.get("activity"));
- d.show();
- proc.anrDialog = d;
+ if (mShowDialogs) {
+ Dialog d = new AppNotRespondingDialog(ActivityManagerService.this,
+ mContext, proc, (ActivityRecord) data.get("activity"));
+ d.show();
+ proc.anrDialog = d;
+ } else {
+ // Just kill the app if there is no dialog to be shown.
+ killAppAtUsersRequest(proc, null);
+ }
}
ensureBootCompleted();