summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index ef7d5ae43396..8139495c522e 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -368,7 +368,6 @@ import android.util.FeatureFlagUtils;
import android.util.IndentingPrintWriter;
import android.util.IntArray;
import android.util.Log;
-import android.util.LogWriter;
import android.util.Pair;
import android.util.PrintWriterPrinter;
import android.util.Slog;
@@ -7308,7 +7307,14 @@ public class ActivityManagerService extends IActivityManager.Stub
// Send broadcast to shell to trigger bugreport using Bugreport API
// Always start the shell process on the current user to ensure that
// the foreground user can see all bugreport notifications.
- mContext.sendBroadcastAsUser(triggerShellBugreport, getCurrentUser().getUserHandle());
+ // In case of BUGREPORT_MODE_REMOTE send the broadcast to SYSTEM user as the device
+ // owner apps are running on the SYSTEM user.
+ if (bugreportType == BugreportParams.BUGREPORT_MODE_REMOTE) {
+ mContext.sendBroadcastAsUser(triggerShellBugreport, UserHandle.SYSTEM);
+ } else {
+ mContext.sendBroadcastAsUser(triggerShellBugreport,
+ getCurrentUser().getUserHandle());
+ }
} finally {
Binder.restoreCallingIdentity(identity);
}