From 87313e3af873aa4fcc8a47e4bef8c28bacde7e74 Mon Sep 17 00:00:00 2001 From: Peter Kalauskas Date: Wed, 8 Mar 2023 16:26:10 -0800 Subject: [PATCH] New trace sections for eEarly Add a new BlurUtils track to sysui for showing when eEarlyWakeup is set (go/sysui-eearly-track) Test: Capture trace, open shade, look for new BlurUtils track Bug: 237729326 Bug: 270035295 Change-Id: I8b594f84143fcc1dfacb2715c07226cac9d22e4f --- .../src/com/android/systemui/statusbar/BlurUtils.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BlurUtils.kt b/packages/SystemUI/src/com/android/systemui/statusbar/BlurUtils.kt index fbb51aef06f0d..07b686948d7ff 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BlurUtils.kt +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BlurUtils.kt @@ -19,6 +19,7 @@ package com.android.systemui.statusbar import android.app.ActivityManager import android.content.res.Resources import android.os.SystemProperties +import android.os.Trace import android.util.IndentingPrintWriter import android.util.MathUtils import android.view.CrossWindowBlurListeners @@ -42,7 +43,7 @@ open class BlurUtils @Inject constructor( ) : Dumpable { val minBlurRadius = resources.getDimensionPixelSize(R.dimen.min_window_blur_radius) val maxBlurRadius = resources.getDimensionPixelSize(R.dimen.max_window_blur_radius) - + private val traceCookie = System.identityHashCode(this) private var lastAppliedBlur = 0 init { @@ -85,10 +86,13 @@ open class BlurUtils @Inject constructor( if (supportsBlursOnWindows()) { it.setBackgroundBlurRadius(viewRootImpl.surfaceControl, radius) if (lastAppliedBlur == 0 && radius != 0) { + Trace.asyncTraceForTrackBegin(Trace.TRACE_TAG_APP, TRACK_NAME, + EARLY_WAKEUP_SLICE_NAME, traceCookie) it.setEarlyWakeupStart() } if (lastAppliedBlur != 0 && radius == 0) { it.setEarlyWakeupEnd() + Trace.asyncTraceForTrackEnd(Trace.TRACE_TAG_APP, TRACK_NAME, traceCookie) } lastAppliedBlur = radius } @@ -125,4 +129,9 @@ open class BlurUtils @Inject constructor( it.println("isHighEndGfx: ${ActivityManager.isHighEndGfx()}") } } + + companion object { + const val TRACK_NAME = "BlurUtils" + const val EARLY_WAKEUP_SLICE_NAME = "eEarlyWakeup" + } }