From 682206480215b2875eaf5d5a336029c6f48f7c37 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Wed, 9 Mar 2022 13:53:50 -0800 Subject: [PATCH] Enable Looper tracing Sometimes work that SysUI is doing on the main thread is not visible on perfetto traces. We should enable the app tracing tag on our looper, to be able to properly visualize where the workload is coming from. Test: perfetto trace Fixes: 223615145 Change-Id: I99e11e986996b070288322f24ce68324e93d17b7 --- .../src/com/android/systemui/SystemUIApplication.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java index 3a6165c03e246..031e3781ae9dc 100644 --- a/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java +++ b/packages/SystemUI/src/com/android/systemui/SystemUIApplication.java @@ -27,6 +27,7 @@ import android.content.IntentFilter; import android.content.pm.ApplicationInfo; import android.content.res.Configuration; import android.os.Bundle; +import android.os.Looper; import android.os.Process; import android.os.RemoteException; import android.os.SystemProperties; @@ -105,6 +106,10 @@ public class SystemUIApplication extends Application implements mBootCompleteCache = mSysUIComponent.provideBootCacheImpl(); log.traceEnd(); + // Enable Looper trace points. + // This allows us to see Handler callbacks on traces. + Looper.getMainLooper().setTraceTag(Trace.TRACE_TAG_APP); + // Set the application theme that is inherited by all services. Note that setting the // application theme in the manifest does only work for activities. Keep this in sync with // the theme set there.