Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2c745b5 authored by Peter Kalauskas's avatar Peter Kalauskas Committed by Automerger Merge Worker
Browse files

Merge "New trace sections for eEarly" into udc-dev am: 1f29c2d3 am: eb47cea6

parents dfab09de eb47cea6
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -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"
    }
}