Send BUGREPORT_REQUESTED broadcast to system user

This broadcast should have a qualified user since
it is being sent from the system. This broadcast
is being sent to the shell, so we should use
UserHandle.SYSTEM.

Test: atest CtsBugreportTestCases, check logcat
      for warnings
Bug: 180769102
Change-Id: I3bebc886cf9931ea79fa0e91312d8720e5bd0e7d
This commit is contained in:
Gavin Corkery
2021-04-19 23:37:14 +01:00
parent 2363862360
commit 6a67dd5bff

View File

@@ -6487,7 +6487,7 @@ public class ActivityManagerService extends IActivityManager.Stub
final long identity = Binder.clearCallingIdentity();
try {
// Send broadcast to shell to trigger bugreport using Bugreport API
mContext.sendBroadcast(triggerShellBugreport);
mContext.sendBroadcastAsUser(triggerShellBugreport, UserHandle.SYSTEM);
} finally {
Binder.restoreCallingIdentity(identity);
}