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

Commit 0af5c445 authored by Yining Liu's avatar Yining Liu
Browse files

Add traces for notification inflation performance improvement targets

Add traces to ShadeNode#addChildAt, ShadeNode#moveChildTo, and
ShadeNode#removeChild to track the runnings of
ShadeListBuilder.buildList with Node modifications.
Add traces to updateNotificationsOnUiModeChanged.
The additional traces provide a means to monitor the progress of our
improvement goals, specifically aimed at reducing main-thread inflation
caused by notifications.

Test: Manual with Perfetto
Bug: 303300622
Change-Id: I72d929bb751c8437c58f9cf2f86e1c94ec0fbfdd
parent 6f76201e
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@ import com.android.systemui.statusbar.notification.collection.coordinator.dagger
import com.android.systemui.statusbar.notification.row.NotificationGutsManager
import com.android.systemui.statusbar.notification.row.NotificationGutsManager
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.Compile
import com.android.systemui.util.Compile
import com.android.systemui.util.traceSection
import javax.inject.Inject
import javax.inject.Inject


/**
/**
@@ -122,10 +123,12 @@ class ViewConfigCoordinator @Inject internal constructor(


    private fun updateNotificationsOnUiModeChanged() {
    private fun updateNotificationsOnUiModeChanged() {
        log { "ViewConfigCoordinator.updateNotificationsOnUiModeChanged()" }
        log { "ViewConfigCoordinator.updateNotificationsOnUiModeChanged()" }
        traceSection("updateNotifOnUiModeChanged") {
            mPipeline?.allNotifs?.forEach { entry ->
            mPipeline?.allNotifs?.forEach { entry ->
                entry.row?.onUiModeChanged()
                entry.row?.onUiModeChanged()
            }
            }
        }
        }
    }


    private fun updateNotificationsOnDensityOrFontScaleChanged() {
    private fun updateNotificationsOnDensityOrFontScaleChanged() {
        mPipeline?.allNotifs?.forEach { entry ->
        mPipeline?.allNotifs?.forEach { entry ->
+12 −6
Original line number Original line Diff line number Diff line
@@ -231,19 +231,25 @@ private class ShadeNode(val controller: NodeController) {
    fun getChildCount(): Int = controller.getChildCount()
    fun getChildCount(): Int = controller.getChildCount()


    fun addChildAt(child: ShadeNode, index: Int) {
    fun addChildAt(child: ShadeNode, index: Int) {
        traceSection("ShadeNode#addChildAt") {
            controller.addChildAt(child.controller, index)
            controller.addChildAt(child.controller, index)
            child.controller.onViewAdded()
            child.controller.onViewAdded()
        }
        }
    }


    fun moveChildTo(child: ShadeNode, index: Int) {
    fun moveChildTo(child: ShadeNode, index: Int) {
        traceSection("ShadeNode#moveChildTo") {
            controller.moveChildTo(child.controller, index)
            controller.moveChildTo(child.controller, index)
            child.controller.onViewMoved()
            child.controller.onViewMoved()
        }
        }
    }


    fun removeChild(child: ShadeNode, isTransfer: Boolean) {
    fun removeChild(child: ShadeNode, isTransfer: Boolean) {
        traceSection("ShadeNode#removeChild") {
            controller.removeChild(child.controller, isTransfer)
            controller.removeChild(child.controller, isTransfer)
            child.controller.onViewRemoved()
            child.controller.onViewRemoved()
        }
        }
    }


    fun offerToKeepInParentForAnimation(): Boolean {
    fun offerToKeepInParentForAnimation(): Boolean {
        return controller.offerToKeepInParentForAnimation()
        return controller.offerToKeepInParentForAnimation()