Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ public class NativeModuleRegistry(
) // This is needed till there are Java Consumer of this API inside React
// Native
internal fun registerModules(newRegister: NativeModuleRegistry) {
check(reactApplicationContext == newRegister.reactApplicationContext) {
val ownContext = reactApplicationContext
val otherContext = newRegister.reactApplicationContext
check(ownContext == otherContext) {
"Extending native modules with non-matching application contexts."
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ package com.facebook.react.bridge

import com.facebook.react.common.annotations.internal.InteropLegacyArchitecture
import com.facebook.soloader.SoLoader
import com.facebook.soloader.annotation.SoLoaderLibrary

@InteropLegacyArchitecture
@SoLoaderLibrary("reactnativejni")
internal object ReactNativeJNISoLoader {

@JvmStatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ public class FabricUIManager

// The IS_DEVELOPMENT_ENVIRONMENT variable is used to log extra data when running fabric in a
// development environment. DO NOT ENABLE THIS ON PRODUCTION OR YOU WILL BE FIRED!
@SuppressLint("ClownyBooleanExpression")
public static final boolean IS_DEVELOPMENT_ENVIRONMENT = false && ReactBuildConfig.DEBUG;

public @Nullable DevToolsReactPerfLogger mDevToolsReactPerfLogger;

private static final DevToolsReactPerfLogger.DevToolsReactPerfLoggerListener FABRIC_PERF_LOGGER =
Expand Down Expand Up @@ -818,6 +820,7 @@ public void synchronouslyUpdateViewOnUIThread(final int reactTag, final Readable
ReactMarkerConstants.FABRIC_UPDATE_UI_MAIN_THREAD_END, null, commitNumber);
}

@SuppressLint("NotInvokedPrivateMethod")
@SuppressWarnings("unused")
@AnyThread
@ThreadConfined(ANY)
Expand Down Expand Up @@ -1050,11 +1053,11 @@ public void receiveEvent(
}

/**
* receiveEvent API that emits an event to C++. If `canCoalesceEvent` is true, that signals that
* C++ may coalesce the event optionally. Otherwise, coalescing can happen in Java before
* receiveEvent API that emits an event to C++. If {@code canCoalesceEvent} is true, that signals
* that C++ may coalesce the event optionally. Otherwise, coalescing can happen in Java before
* emitting.
*
* <p>`customCoalesceKey` is currently unused.
* <p>{@code customCoalesceKey} is currently unused.
*
* @param surfaceId
* @param reactTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ package com.facebook.react.fabric

import android.annotation.SuppressLint
import com.facebook.jni.HybridClassBase
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.proguard.annotations.DoNotStripAny
import com.facebook.react.bridge.NativeMap
import com.facebook.react.bridge.RuntimeExecutor
import com.facebook.react.bridge.RuntimeScheduler
import com.facebook.react.fabric.events.EventBeatManager
import com.facebook.react.uimanager.PixelUtil.getDisplayMetricDensity

@DoNotStrip
@DoNotStripAny
@SuppressLint("MissingNativeLoadLibrary")
internal class FabricUIManagerBinding : HybridClassBase() {
init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ internal class LongStreamingStats {

val median: Double
get() {
if (minHeap.size == 0 && maxHeap.size == 0) {
if (minHeap.isEmpty() && maxHeap.isEmpty()) {
return 0.0
}
val median =
if (minHeap.size > maxHeap.size) {
minHeap.peek()
} else {
(minHeap.peek() ?: 0 + maxHeap.peek()!!) / 2
((minHeap.peek() ?: 0L) + (maxHeap.peek() ?: 0L)) / 2
}
return median.toDouble()
}
Expand Down
Loading