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

Commit cb6c1095 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

Log bundle entries in shadelistbuilder

Test: adb bugreport
Flag: com.android.systemui.notification_bundle_ui
Bug: 420896193
Change-Id: I8afad04c25e02b6eaab5679e4a0748c5c1a49f5d
parent cce1ef45
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." })