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

Commit f598710a authored by Abhijeet Kaur's avatar Abhijeet Kaur
Browse files

Clear calling identity as broadcast needs permission

The intent BUGREPORT_REQUESTED is permission protected by the permission
"android.permission.TRIGGER_SHELL_BUGREPORT"

Test: manually trigger interactive bugreport from power button and
Settings
Bug: 140158937

Change-Id: Ic82d4a63359c8c2f252fe631d3eb91648c23768e
parent a5369e31
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -8285,8 +8285,13 @@ public class ActivityManagerService extends IActivityManager.Stub
            if (shareDescription != null) {
                triggerShellBugreport.putExtra(EXTRA_DESCRIPTION, shareDescription);
            }
            final long identity = Binder.clearCallingIdentity();
            try {
                // Send broadcast to shell to trigger bugreport using Bugreport API
                mContext.sendBroadcast(triggerShellBugreport);
            } finally {
                Binder.restoreCallingIdentity(identity);
            }
        } else {
            SystemProperties.set("dumpstate.options", type);
            SystemProperties.set("ctl.start", "bugreport");