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

Commit 2618484c authored by Lydia Tse's avatar Lydia Tse
Browse files

Added trace event to broadcastIntentWithFeature.

Test: follow the steps below to test
1. Collect a boot trace using the trace config from company/teams/auto/embedded/framework/performance/tools/src/perfetto_trace_config.textproto.
2. Open the trace in Perfetto and query for a slice name with 'broadcastIntent' using
SELECT * FROM slice WHERE name glob '%broadcastIntent:%';

Change-Id: Idce039d2b055f08a710e8f47ad90348cd9537b3a
parent 2a4e99a7
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -15770,6 +15770,7 @@ public class ActivityManagerService extends IActivityManager.Stub
            String[] excludedPackages, int appOp, Bundle bOptions,
            boolean serialized, boolean sticky, int userId) {
        enforceNotIsolatedCaller("broadcastIntent");
        synchronized(this) {
            intent = verifyBroadcastLocked(intent);
@@ -15783,6 +15784,12 @@ public class ActivityManagerService extends IActivityManager.Stub
            // Permission regimes around sender-supplied broadcast options.
            enforceBroadcastOptionPermissionsInternal(bOptions, callingUid);
            final ComponentName cn = intent.getComponent();
            Trace.traceBegin(
                    Trace.TRACE_TAG_ACTIVITY_MANAGER,
                    "broadcastIntent:" + (cn != null ? cn.toString() : intent.getAction()));
            final long origId = Binder.clearCallingIdentity();
            try {
                return broadcastIntentLocked(callerApp,
@@ -15793,6 +15800,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                        callingPid, userId, BackgroundStartPrivileges.NONE, null, null);
            } finally {
                Binder.restoreCallingIdentity(origId);
                Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
            }
        }
    }