Loading services/core/java/com/android/server/am/ForegroundServiceTypeLoggerModule.java +11 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.app.ActivityManager.ForegroundServiceApiType; import android.app.ForegroundServiceDelegationOptions; import android.content.ComponentName; import android.content.pm.ServiceInfo; import android.os.Trace; import android.util.ArrayMap; import android.util.IntArray; import android.util.LongArray; Loading Loading @@ -134,6 +135,11 @@ public class ForegroundServiceTypeLoggerModule { * call of the right type will also be associated and logged */ public void logForegroundServiceStart(int uid, int pid, ServiceRecord record) { if (record.getComponentName() != null) { final String traceTag = record.getComponentName().flattenToString() + ":" + uid; Trace.asyncTraceForTrackBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, traceTag, "foregroundService", record.foregroundServiceType); } // initialize the UID stack UidState uidState = mUids.get(uid); if (uidState == null) { Loading Loading @@ -205,6 +211,11 @@ public class ForegroundServiceTypeLoggerModule { // we need to log all the API end events and remove the start events // then we remove the FGS from the various stacks // and also clean up the start calls stack by UID if (record.getComponentName() != null) { final String traceTag = record.getComponentName().flattenToString() + ":" + uid; Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER, traceTag, record.hashCode()); } final IntArray apiTypes = convertFgsTypeToApiTypes(record.foregroundServiceType); final UidState uidState = mUids.get(uid); if (apiTypes.size() == 0) { Loading Loading
services/core/java/com/android/server/am/ForegroundServiceTypeLoggerModule.java +11 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import android.app.ActivityManager.ForegroundServiceApiType; import android.app.ForegroundServiceDelegationOptions; import android.content.ComponentName; import android.content.pm.ServiceInfo; import android.os.Trace; import android.util.ArrayMap; import android.util.IntArray; import android.util.LongArray; Loading Loading @@ -134,6 +135,11 @@ public class ForegroundServiceTypeLoggerModule { * call of the right type will also be associated and logged */ public void logForegroundServiceStart(int uid, int pid, ServiceRecord record) { if (record.getComponentName() != null) { final String traceTag = record.getComponentName().flattenToString() + ":" + uid; Trace.asyncTraceForTrackBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, traceTag, "foregroundService", record.foregroundServiceType); } // initialize the UID stack UidState uidState = mUids.get(uid); if (uidState == null) { Loading Loading @@ -205,6 +211,11 @@ public class ForegroundServiceTypeLoggerModule { // we need to log all the API end events and remove the start events // then we remove the FGS from the various stacks // and also clean up the start calls stack by UID if (record.getComponentName() != null) { final String traceTag = record.getComponentName().flattenToString() + ":" + uid; Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER, traceTag, record.hashCode()); } final IntArray apiTypes = convertFgsTypeToApiTypes(record.foregroundServiceType); final UidState uidState = mUids.get(uid); if (apiTypes.size() == 0) { Loading