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
Merged-In: I77a662d17237246d8c9f2c06b38b5bfa64d5c69d
This commit is contained in:
Nicolo' Mazzucato
2023-06-30 10:23:03 +00:00
committed by Nicolò Mazzucato
parent 3620213c62
commit 2b0f6886a1

View File

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