Loading aconfig/systemui.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -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" } tracinglib/src/com/android/app/tracing/TraceUtils.kt +16 −18 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading
aconfig/systemui.aconfig +0 −7 Original line number Diff line number Diff line Loading @@ -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" }
tracinglib/src/com/android/app/tracing/TraceUtils.kt +16 −18 Original line number Diff line number Diff line Loading @@ -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 { Loading