From 06417a2a6db2cc8157bfba10cfeb34a54e33fcdd Mon Sep 17 00:00:00 2001 From: David Vacca Date: Fri, 11 Oct 2024 19:25:32 -0700 Subject: [PATCH] Refactor Systrace.traceSection() to unblock CI (#46994) Summary: This diff makes a small refactor on Systrace.traceSection() to unblock CI, which was broken by D64141515 changelog: [internal] internal Reviewed By: Abbondanzo Differential Revision: D64276651 --- .../src/main/java/com/facebook/systrace/Systrace.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.kt index 9226997df02bd9..13a4607d2864d5 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/systrace/Systrace.kt @@ -32,12 +32,12 @@ public object Systrace { @JvmStatic public fun traceInstant(tag: Long, title: String?, scope: EventScope?): Unit = Unit @JvmStatic - public fun traceSection(tag: Long, sectionName: String, block: () -> T) { - beginSection(sectionName) + public fun traceSection(tag: Long, sectionName: String, block: () -> T): T { + beginSection(tag, sectionName) try { return block() } finally { - endSection(sectionName) + endSection(tag) } }