Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 398a937c authored by Nikhil Kumar's avatar Nikhil Kumar
Browse files

Send REMOTE_BUGREPORT request to the SYSTEM user.

Remote bugreports are triggered from device owner apps which are on
user 0, to kee everything on the same user the bugreport generation
should be handled by user 0.

Test: manually tested remote bugreport flow in retail demo mode
Bug: 274543518
Change-Id: Ied7072e5cd82a0afda148951dcd9d01c2355d957
parent 3def94e8
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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);
        }