diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesMemoryDumper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesMemoryDumper.kt similarity index 54% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesMemoryDumper.java rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesMemoryDumper.kt index 518d2aa6f084ec..ddce11e5ceebaa 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesMemoryDumper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesMemoryDumper.kt @@ -5,14 +5,14 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.hermes.instrumentation; +package com.facebook.hermes.instrumentation public interface HermesMemoryDumper { - boolean shouldSaveSnapshot(); + public fun shouldSaveSnapshot(): Boolean - String getInternalStorage(); + public fun getInternalStorage(): String - String getId(); + public fun getId(): String - void setMetaData(String crashId); + public fun setMetaData(crashId: String) } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.kt similarity index 54% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.java rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.kt index c02700a6bcb723..9fef00ed214a12 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/HermesSamplingProfiler.kt @@ -5,28 +5,26 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.hermes.instrumentation; +package com.facebook.hermes.instrumentation -import com.facebook.soloader.SoLoader; +import com.facebook.soloader.SoLoader /** Hermes sampling profiler static JSI API. */ -public class HermesSamplingProfiler { - static { - SoLoader.loadLibrary("jsijniprofiler"); +public object HermesSamplingProfiler { + init { + SoLoader.loadLibrary("jsijniprofiler") } /** Start sample profiling. */ - public static native void enable(); + @JvmStatic public external fun enable() /** Stop sample profiling. */ - public static native void disable(); + @JvmStatic public external fun disable() /** * Dump sampled stack traces to file. * * @param filename the file to dump sampling trace to. */ - public static native void dumpSampledTraceToFile(String filename); - - private HermesSamplingProfiler() {} + @JvmStatic public external fun dumpSampledTraceToFile(filename: String) }