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

Commit 6c288c24 authored by Julia Reynolds's avatar Julia Reynolds Committed by Android (Google) Code Review
Browse files

Merge "Log bundle entries in shadelistbuilder" into main

parents 994b2fa5 cb6c1095
Loading
Loading
Loading
Loading
+48 −33
Original line number Diff line number Diff line
@@ -372,6 +372,22 @@ constructor(
        }
        for (i in entries.indices) {
            val entry = entries[i]
            logPipelineEntry(entry, i, "")
            if (entry is BundleEntry) {
                for ((j, bundleChild) in entry.children.withIndex()) {
                    logPipelineEntry(bundleChild, j, "  ")
                    if (bundleChild is GroupEntry) {
                        logGroupEntry(bundleChild, "  ")
                    }
                }
            }
            if (entry is GroupEntry) {
                logGroupEntry(entry, "")
            }
        }
    }

    private fun logPipelineEntry(entry: PipelineEntry, i : Int, indent: String) {
        buffer.log(
            TAG,
            DEBUG,
@@ -381,10 +397,11 @@ constructor(
                bool1 = logRankInFinalList
                str2 = getRankString(entry)
            },
                { "[$int1] $str1".let { if (bool1) "$it rank=$str2" else it } },
            { "$indent[$int1] $str1".let { if (bool1) "$it rank=$str2" else it } },
        )
            // TODO(b/399736937) rank bundles as -1 and log bundle children rankings
            if (entry is GroupEntry) {
    }

    private fun logGroupEntry(entry: GroupEntry, indent: String) {
        entry.summary?.let {
            buffer.log(
                TAG,
@@ -394,7 +411,7 @@ constructor(
                    bool1 = logRankInFinalList
                    int2 = it.ranking.rank
                },
                        { "  [*] $str1 (summary)".let { if (bool1) "$it rank=$int2" else it } },
                { "$indent  [*] $str1 (summary)".let { if (bool1) "$it rank=$int2" else it } },
            )
        }
        for (j in entry.children.indices) {
@@ -408,12 +425,10 @@ constructor(
                    bool1 = logRankInFinalList
                    int2 = child.ranking.rank
                },
                        { "  [$int1] $str1".let { if (bool1) "$it rank=$int2" else it } },
                { "$indent  [$int1] $str1".let { if (bool1) "$it rank=$int2" else it } },
            )
        }
    }
        }
    }

    fun logPipelineRunSuppressed() =
        buffer.log(TAG, INFO, {}, { "Suppressing pipeline run during animation." })