summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWale Ogunwale <ogunwale@google.com>2017-06-22 16:43:53 -0700
committerWale Ogunwale <ogunwale@google.com>2017-06-22 16:43:53 -0700
commit454117fe071e262328c72e73ef432a33da7e1a12 (patch)
tree40d048b91a879ad852dbaac57b5ee237aadc1244
parentbe7657b03898fd04bb69b6d33064f927d0641958 (diff)
downloadbase-454117fe071e262328c72e73ef432a33da7e1a12.tar.gz
Dump user id in dumpsys activity starter
To help with ANR debugging. Test: adb shell dumpsys activity starter Bug: 38121026 Change-Id: I96d530662e6a362b817df3ca8410cb173a2c0dd4
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java6
-rw-r--r--services/core/java/com/android/server/am/ActivityStarter.java1
2 files changed, 6 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index 6c3a8a48656d..607b84c4658e 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -4064,7 +4064,11 @@ public class ActivityManagerService extends IActivityManager.Stub
aInfo.applicationInfo.uid, true);
if (app == null || app.instr == null) {
intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_NEW_TASK);
- mActivityStarter.startHomeActivityLocked(intent, aInfo, reason);
+ final int resolvedUserId = UserHandle.getUserId(aInfo.applicationInfo.uid);
+ // For ANR debugging to verify if the user activity is the one that actually
+ // launched.
+ final String myReason = reason + ":" + userId + ":" + resolvedUserId;
+ mActivityStarter.startHomeActivityLocked(intent, aInfo, myReason);
}
} else {
Slog.wtf(TAG, "No home screen found for " + intent, new Throwable());
diff --git a/services/core/java/com/android/server/am/ActivityStarter.java b/services/core/java/com/android/server/am/ActivityStarter.java
index be30d5aaeab9..a145435976fa 100644
--- a/services/core/java/com/android/server/am/ActivityStarter.java
+++ b/services/core/java/com/android/server/am/ActivityStarter.java
@@ -2308,6 +2308,7 @@ class ActivityStarter {
pw.println(prefix + "ActivityStarter:");
prefix = prefix + " ";
+ pw.println(prefix + "mCurrentUser=" + mSupervisor.mCurrentUser);
pw.println(prefix + "mLastStartReason=" + mLastStartReason);
pw.println(prefix + "mLastStartActivityTimeMs="
+ DateFormat.getDateTimeInstance().format(new Date(mLastStartActivityTimeMs)));