From a0995ab8212a26945fe377346e110fa9a6e663dd Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Thu, 31 Jul 2014 16:42:47 +0100 Subject: [PATCH] Always show error dialog for other profiles Apps running on another profile of the same user were previously considered to be running in the background, so their error dialogs would not show unless ANR_SHOW_BACKGROUND was set. @bug 15665024 Change-Id: I7e559c6b7f8befc1553bc0ec06e89e5d7906d198 --- .../com/android/server/am/ActivityManagerService.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 9a58c56674715..f3ac0f59b0c34 100755 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -1206,9 +1206,13 @@ public final class ActivityManagerService extends ActivityManagerNative } return; } - if (!showBackground && UserHandle.getAppId(proc.uid) - >= Process.FIRST_APPLICATION_UID && proc.userId != mCurrentUserId - && proc.pid != MY_PID) { + boolean isBackground = (UserHandle.getAppId(proc.uid) + >= Process.FIRST_APPLICATION_UID + && proc.pid != MY_PID); + for (int userId : mCurrentProfileIds) { + isBackground &= (proc.userId != userId); + } + if (isBackground && !showBackground) { Slog.w(TAG, "Skipping crash dialog of " + proc + ": background"); if (res != null) { res.set(0);