Add traces around updateZenModeConfig

From field traces, it seems it often requires a lot of time (>190ms during LOCKSCREEN_TO_AOD CUJ) due to lock contention in the binder calls happening inside.

Adding a slice to make it more recognizable

Bug: 289485377
Test: Record Perfetto trace - check the new slice is visible
Change-Id: I77a662d17237246d8c9f2c06b38b5bfa64d5c69d
This commit is contained in:
Nicolo' Mazzucato
2023-06-30 10:23:03 +00:00
parent 1748418e24
commit f5fbefdda0

View File

@@ -28,6 +28,7 @@ import android.database.ContentObserver;
import android.net.Uri; import android.net.Uri;
import android.os.Handler; import android.os.Handler;
import android.os.HandlerExecutor; import android.os.HandlerExecutor;
import android.os.Trace;
import android.os.UserHandle; import android.os.UserHandle;
import android.os.UserManager; import android.os.UserManager;
import android.provider.Settings.Global; import android.provider.Settings.Global;
@@ -122,7 +123,12 @@ public class ZenModeControllerImpl implements ZenModeController, Dumpable {
userTracker.getUserId()) { userTracker.getUserId()) {
@Override @Override
protected void handleValueChanged(int value, boolean observedChange) { protected void handleValueChanged(int value, boolean observedChange) {
try {
Trace.beginSection("updateZenModeConfig");
updateZenModeConfig(); updateZenModeConfig();
} finally {
Trace.endSection();
}
} }
}; };
mNoMan = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); mNoMan = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);