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

Commit 5ac78dc7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11157599 from 72c50814 to 24Q1-release

Change-Id: Id40dfd7736d265ded8799ddcccc65915511c571a
parents 04db8c85 72c50814
Loading
Loading
Loading
Loading
+0 −7
Original line number Diff line number Diff line
@@ -6,10 +6,3 @@ flag {
    description: "An Example Flag"
    bug: "308482106"
}

flag {
    name: "home_panel_dream"
    namespace: "systemui"
    description: "Enables the home controls dream feature"
    bug: "298025023"
}
+16 −18
Original line number Diff line number Diff line
@@ -39,32 +39,30 @@ import kotlinx.coroutines.withContext
 * Run a block within a [Trace] section. Calls [Trace.beginSection] before and [Trace.endSection]
 * after the passed block.
 */
inline fun <T> traceSection(tag: String, block: () -> T): T =
    if (Trace.isTagEnabled(Trace.TRACE_TAG_APP)) {
        Trace.traceBegin(Trace.TRACE_TAG_APP, tag)
        try {
inline fun <T> traceSection(tag: String, block: () -> T): T {
    val tracingEnabled = Trace.isTagEnabled(Trace.TRACE_TAG_APP)
    if (tracingEnabled) Trace.traceBegin(Trace.TRACE_TAG_APP, tag)
    return try {
        // Note that as this is inline, the block section would be duplicated if it is called
        // several times. For this reason, we're using the try/finally even if tracing is disabled.
        block()
    } finally {
            Trace.traceEnd(Trace.TRACE_TAG_APP)
        if (tracingEnabled) Trace.traceEnd(Trace.TRACE_TAG_APP)
    }
    } else {
        block()
}

/**
 * Same as [traceSection], but the tag is provided as a lambda to help avoiding creating expensive
 * strings when not needed.
 */
inline fun <T> traceSection(tag: () -> String, block: () -> T): T =
    if (Trace.isTagEnabled(Trace.TRACE_TAG_APP)) {
        Trace.traceBegin(Trace.TRACE_TAG_APP, tag())
        try {
inline fun <T> traceSection(tag: () -> String, block: () -> T): T {
    val tracingEnabled = Trace.isTagEnabled(Trace.TRACE_TAG_APP)
    if (tracingEnabled) Trace.traceBegin(Trace.TRACE_TAG_APP, tag())
    return try {
        block()
    } finally {
            Trace.traceEnd(Trace.TRACE_TAG_APP)
        if (tracingEnabled) Trace.traceEnd(Trace.TRACE_TAG_APP)
    }
    } else {
        block()
}

class TraceUtils {