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

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

Merge "Enable ShadeViewDiffer systrace logs" into udc-dev am: c7515ae3

parents d7dec345 c7515ae3
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -271,12 +271,14 @@ constructor(
    }
    }


    private fun echoToSystrace(message: LogMessage, strMessage: String) {
    private fun echoToSystrace(message: LogMessage, strMessage: String) {
        if (Trace.isTagEnabled(Trace.TRACE_TAG_APP)) {
            Trace.instantForTrack(
            Trace.instantForTrack(
                Trace.TRACE_TAG_APP,
                Trace.TRACE_TAG_APP,
                "UI Events",
                "UI Events",
                "$name - ${message.level.shortString} ${message.tag}: $strMessage"
                "$name - ${message.level.shortString} ${message.tag}: $strMessage"
            )
            )
        }
        }
    }


    private fun echoToLogcat(message: LogMessage, strMessage: String) {
    private fun echoToLogcat(message: LogMessage, strMessage: String) {
        when (message.level) {
        when (message.level) {
+1 −1
Original line number Original line Diff line number Diff line
@@ -60,7 +60,7 @@ public class LogModule {
        if (Compile.IS_DEBUG && notifPipelineFlags.isDevLoggingEnabled()) {
        if (Compile.IS_DEBUG && notifPipelineFlags.isDevLoggingEnabled()) {
            maxSize *= 10;
            maxSize *= 10;
        }
        }
        return factory.create("NotifLog", maxSize, false /* systrace */);
        return factory.create("NotifLog", maxSize, Compile.IS_DEBUG /* systrace */);
    }
    }


    /** Provides a logging buffer for all logs related to notifications on the lockscreen. */
    /** Provides a logging buffer for all logs related to notifications on the lockscreen. */
+8 −2
Original line number Original line Diff line number Diff line
@@ -67,7 +67,10 @@ class ShadeViewDiffer(
    fun getViewLabel(view: View): String =
    fun getViewLabel(view: View): String =
            nodes.values.firstOrNull { node -> node.view === view }?.label ?: view.toString()
            nodes.values.firstOrNull { node -> node.view === view }?.label ?: view.toString()


    private fun detachChildren(parentNode: ShadeNode, specMap: Map<NodeController, NodeSpec>) {
    private fun detachChildren(
        parentNode: ShadeNode,
        specMap: Map<NodeController, NodeSpec>
    ) = traceSection("detachChildren") {
        val views = nodes.values.associateBy { it.view }
        val views = nodes.values.associateBy { it.view }
        fun detachRecursively(parentNode: ShadeNode, specMap: Map<NodeController, NodeSpec>) {
        fun detachRecursively(parentNode: ShadeNode, specMap: Map<NodeController, NodeSpec>) {
            val parentSpec = specMap[parentNode.controller]
            val parentSpec = specMap[parentNode.controller]
@@ -124,7 +127,10 @@ class ShadeViewDiffer(
        }
        }
    }
    }


    private fun attachChildren(parentNode: ShadeNode, specMap: Map<NodeController, NodeSpec>) {
    private fun attachChildren(
        parentNode: ShadeNode,
        specMap: Map<NodeController, NodeSpec>
    ): Unit = traceSection("attachChildren") {
        val parentSpec = checkNotNull(specMap[parentNode.controller])
        val parentSpec = checkNotNull(specMap[parentNode.controller])


        for ((index, childSpec) in parentSpec.children.withIndex()) {
        for ((index, childSpec) in parentSpec.children.withIndex()) {