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

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17039165

Change-Id: Ic14d593a1a8210a9c03732a47f4217dffd5fe146
This commit is contained in:
Jing Ji
2022-03-01 23:41:00 +00:00
committed by Automerger Merge Worker

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);
}
}