Merge "Log bindService call and its service name in trace slices" into tm-dev

This commit is contained in:
Jing Ji
2022-03-01 23:24:47 +00:00
committed by Android (Google) Code Review

View File

@@ -12426,10 +12426,19 @@ public class ActivityManagerService extends IActivityManager.Stub
}
}
synchronized(this) {
return mServices.bindServiceLocked(caller, token, service, resolvedType, connection,
flags, instanceName, isSdkSandboxService, sdkSandboxClientdAppUid,
callingPackage, userId);
try {
if (Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) {
final ComponentName cn = service.getComponent();
Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "bindService:"
+ (cn != null ? cn.toShortString() : service.getAction()));
}
synchronized (this) {
return mServices.bindServiceLocked(caller, token, service, resolvedType, connection,
flags, instanceName, isSdkSandboxService, sdkSandboxClientdAppUid,
callingPackage, userId);
}
} finally {
Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
}
}