From 7f149b0f876c04ef0aea02fee4f7cde2176cff26 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Wed, 4 Oct 2017 15:58:55 -0700 Subject: [PATCH] Logs UID that requested a bugreport. Test: manual verification Fixes: 67348120 Change-Id: I340e40e9aed689c317116a4b3845108336dec71f --- .../java/com/android/server/am/ActivityManagerService.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index 30ecbcf80ea7b..6fa3ef76fda8b 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -12925,6 +12925,10 @@ public class ActivityManagerService extends IActivityManager.Stub throw new IllegalArgumentException("Provided bugreport type is not correct, value: " + bugreportType); } + // Always log caller, even if it does not have permission to dump. + String type = extraOptions == null ? "bugreport" : extraOptions; + Slog.i(TAG, type + " requested by UID " + Binder.getCallingUid()); + enforceCallingPermission(android.Manifest.permission.DUMP, "requestBugReport"); if (extraOptions != null) { SystemProperties.set("dumpstate.options", extraOptions);