Skip to content

Commit de5141a

Browse files
sbuggaymeta-codesync[bot]
authored andcommitted
Clean up stale QE rn_arch_android:use_optimized_event_batching_android (#54417)
Summary: Pull Request resolved: #54417 Remove feature rn_arch_android:use_optimized_event_batching_android flag. Changelog: [internal] Reviewed By: javache Differential Revision: D86131089 fbshipit-source-id: 8ac81bc97a97071fc9fbf1f32ebda081d76db575
1 parent 1033dbd commit de5141a

21 files changed

+32
-182
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<66a87f8b82a1b3497eb9181a4ac6bab7>>
7+
* @generated SignedSource<<9646ebeba75ec903be5ade7e2333f0c8>>
88
*/
99

1010
/**
@@ -468,12 +468,6 @@ public object ReactNativeFeatureFlags {
468468
@JvmStatic
469469
public fun useNativeViewConfigsInBridgelessMode(): Boolean = accessor.useNativeViewConfigsInBridgelessMode()
470470

471-
/**
472-
* Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback.
473-
*/
474-
@JvmStatic
475-
public fun useOptimizedEventBatchingOnAndroid(): Boolean = accessor.useOptimizedEventBatchingOnAndroid()
476-
477471
/**
478472
* Instead of using folly::dynamic as internal representation in RawProps and RawValue, use jsi::Value
479473
*/

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<5112bb2a180751673d4197088af9fdd1>>
7+
* @generated SignedSource<<9d6ccbe6d02608901fc18ad88baab176>>
88
*/
99

1010
/**
@@ -93,7 +93,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
9393
private var useNativeEqualsInNativeReadableArrayAndroidCache: Boolean? = null
9494
private var useNativeTransformHelperAndroidCache: Boolean? = null
9595
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
96-
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
9796
private var useRawPropsJsiValueCache: Boolean? = null
9897
private var useShadowNodeStateOnCloneCache: Boolean? = null
9998
private var useSharedAnimatedBackendCache: Boolean? = null
@@ -761,15 +760,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
761760
return cached
762761
}
763762

764-
override fun useOptimizedEventBatchingOnAndroid(): Boolean {
765-
var cached = useOptimizedEventBatchingOnAndroidCache
766-
if (cached == null) {
767-
cached = ReactNativeFeatureFlagsCxxInterop.useOptimizedEventBatchingOnAndroid()
768-
useOptimizedEventBatchingOnAndroidCache = cached
769-
}
770-
return cached
771-
}
772-
773763
override fun useRawPropsJsiValue(): Boolean {
774764
var cached = useRawPropsJsiValueCache
775765
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<d98233be82b913d6327c29a897d09eb7>>
7+
* @generated SignedSource<<fbc551ca005a7d8abcd2cf2e5d29a3a6>>
88
*/
99

1010
/**
@@ -174,8 +174,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
174174

175175
@DoNotStrip @JvmStatic public external fun useNativeViewConfigsInBridgelessMode(): Boolean
176176

177-
@DoNotStrip @JvmStatic public external fun useOptimizedEventBatchingOnAndroid(): Boolean
178-
179177
@DoNotStrip @JvmStatic public external fun useRawPropsJsiValue(): Boolean
180178

181179
@DoNotStrip @JvmStatic public external fun useShadowNodeStateOnClone(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<32ad8dfa8f1c1d662ff0ea7b424eb070>>
7+
* @generated SignedSource<<7b8a5ad9a3353ea32a39bd139e9174f7>>
88
*/
99

1010
/**
@@ -169,8 +169,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
169169

170170
override fun useNativeViewConfigsInBridgelessMode(): Boolean = false
171171

172-
override fun useOptimizedEventBatchingOnAndroid(): Boolean = false
173-
174172
override fun useRawPropsJsiValue(): Boolean = true
175173

176174
override fun useShadowNodeStateOnClone(): Boolean = false

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<b10ff10cb0d389a563da50c75a49c746>>
7+
* @generated SignedSource<<9bb9a7cf89c92f5a397b2328fa983dc6>>
88
*/
99

1010
/**
@@ -97,7 +97,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
9797
private var useNativeEqualsInNativeReadableArrayAndroidCache: Boolean? = null
9898
private var useNativeTransformHelperAndroidCache: Boolean? = null
9999
private var useNativeViewConfigsInBridgelessModeCache: Boolean? = null
100-
private var useOptimizedEventBatchingOnAndroidCache: Boolean? = null
101100
private var useRawPropsJsiValueCache: Boolean? = null
102101
private var useShadowNodeStateOnCloneCache: Boolean? = null
103102
private var useSharedAnimatedBackendCache: Boolean? = null
@@ -838,16 +837,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
838837
return cached
839838
}
840839

841-
override fun useOptimizedEventBatchingOnAndroid(): Boolean {
842-
var cached = useOptimizedEventBatchingOnAndroidCache
843-
if (cached == null) {
844-
cached = currentProvider.useOptimizedEventBatchingOnAndroid()
845-
accessedFeatureFlags.add("useOptimizedEventBatchingOnAndroid")
846-
useOptimizedEventBatchingOnAndroidCache = cached
847-
}
848-
return cached
849-
}
850-
851840
override fun useRawPropsJsiValue(): Boolean {
852841
var cached = useRawPropsJsiValueCache
853842
if (cached == null) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<c4917c92012d904810ef7d832adf124c>>
7+
* @generated SignedSource<<eeb5d70e45eecdef0d9307cbe8ff17c2>>
88
*/
99

1010
/**
@@ -169,8 +169,6 @@ public interface ReactNativeFeatureFlagsProvider {
169169

170170
@DoNotStrip public fun useNativeViewConfigsInBridgelessMode(): Boolean
171171

172-
@DoNotStrip public fun useOptimizedEventBatchingOnAndroid(): Boolean
173-
174172
@DoNotStrip public fun useRawPropsJsiValue(): Boolean
175173

176174
@DoNotStrip public fun useShadowNodeStateOnClone(): Boolean

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.kt

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,12 @@
77

88
package com.facebook.react.uimanager.events
99

10-
import android.os.Handler
1110
import android.view.Choreographer
1211
import com.facebook.react.bridge.LifecycleEventListener
1312
import com.facebook.react.bridge.ReactApplicationContext
1413
import com.facebook.react.bridge.ReactSoftExceptionLogger
1514
import com.facebook.react.bridge.UiThreadUtil
1615
import com.facebook.react.common.annotations.UnstableReactNativeAPI
17-
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
1816
import com.facebook.react.modules.core.ReactChoreographer
1917
import com.facebook.react.uimanager.UIManagerHelper
2018
import com.facebook.react.uimanager.common.UIManagerType
@@ -41,19 +39,6 @@ internal class FabricEventDispatcher(
4139
private val postEventDispatchListeners = CopyOnWriteArrayList<BatchEventDispatchedListener>()
4240
private val currentFrameCallback = ScheduleDispatchFrameCallback()
4341

44-
private var isDispatchScheduled = false
45-
private val dispatchEventsRunnable = Runnable {
46-
isDispatchScheduled = false
47-
Systrace.beginSection(Systrace.TRACE_TAG_REACT, "BatchEventDispatchedListeners")
48-
try {
49-
for (listener in postEventDispatchListeners) {
50-
listener.onBatchEventDispatched()
51-
}
52-
} finally {
53-
Systrace.endSection(Systrace.TRACE_TAG_REACT)
54-
}
55-
}
56-
5742
init {
5843
reactContext.addLifecycleEventListener(this)
5944
eventEmitter.registerFabricEventEmitter(fabricEventEmitter)
@@ -109,14 +94,7 @@ internal class FabricEventDispatcher(
10994
}
11095

11196
private fun scheduleDispatchOfBatchedEvents() {
112-
if (ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) {
113-
if (!isDispatchScheduled) {
114-
isDispatchScheduled = true
115-
uiThreadHandler.postAtFrontOfQueue(dispatchEventsRunnable)
116-
}
117-
} else {
118-
currentFrameCallback.maybeScheduleDispatchOfBatchedEvents()
119-
}
97+
currentFrameCallback.maybeScheduleDispatchOfBatchedEvents()
12098
}
12199

122100
/** Add a listener to this EventDispatcher. */
@@ -139,9 +117,7 @@ internal class FabricEventDispatcher(
139117

140118
override fun onHostResume() {
141119
scheduleDispatchOfBatchedEvents()
142-
if (!ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) {
143-
currentFrameCallback.resume()
144-
}
120+
currentFrameCallback.resume()
145121
}
146122

147123
override fun onHostPause() {
@@ -165,12 +141,7 @@ internal class FabricEventDispatcher(
165141

166142
private fun cancelDispatchOfBatchedEvents() {
167143
UiThreadUtil.assertOnUiThread()
168-
if (ReactNativeFeatureFlags.useOptimizedEventBatchingOnAndroid()) {
169-
isDispatchScheduled = false
170-
uiThreadHandler.removeCallbacks(dispatchEventsRunnable)
171-
} else {
172-
currentFrameCallback.stop()
173-
}
144+
currentFrameCallback.stop()
174145
}
175146

176147
private inner class ScheduleDispatchFrameCallback : Choreographer.FrameCallback {
@@ -229,8 +200,4 @@ internal class FabricEventDispatcher(
229200
}
230201
}
231202
}
232-
233-
private companion object {
234-
private val uiThreadHandler: Handler = UiThreadUtil.getUiThreadHandler()
235-
}
236203
}

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<ddcb4ebb0a1e5e80364d081650286b96>>
7+
* @generated SignedSource<<0527dbb4a838be34b80d76b11d18cea0>>
88
*/
99

1010
/**
@@ -477,12 +477,6 @@ class ReactNativeFeatureFlagsJavaProvider
477477
return method(javaProvider_);
478478
}
479479

480-
bool useOptimizedEventBatchingOnAndroid() override {
481-
static const auto method =
482-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useOptimizedEventBatchingOnAndroid");
483-
return method(javaProvider_);
484-
}
485-
486480
bool useRawPropsJsiValue() override {
487481
static const auto method =
488482
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("useRawPropsJsiValue");
@@ -906,11 +900,6 @@ bool JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode(
906900
return ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode();
907901
}
908902

909-
bool JReactNativeFeatureFlagsCxxInterop::useOptimizedEventBatchingOnAndroid(
910-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
911-
return ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid();
912-
}
913-
914903
bool JReactNativeFeatureFlagsCxxInterop::useRawPropsJsiValue(
915904
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
916905
return ReactNativeFeatureFlags::useRawPropsJsiValue();
@@ -1206,9 +1195,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
12061195
makeNativeMethod(
12071196
"useNativeViewConfigsInBridgelessMode",
12081197
JReactNativeFeatureFlagsCxxInterop::useNativeViewConfigsInBridgelessMode),
1209-
makeNativeMethod(
1210-
"useOptimizedEventBatchingOnAndroid",
1211-
JReactNativeFeatureFlagsCxxInterop::useOptimizedEventBatchingOnAndroid),
12121198
makeNativeMethod(
12131199
"useRawPropsJsiValue",
12141200
JReactNativeFeatureFlagsCxxInterop::useRawPropsJsiValue),

packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<1e735f99b2d275f5065fb7959e45adc5>>
7+
* @generated SignedSource<<a1deb0145d8c51d608903e1704e96b8d>>
88
*/
99

1010
/**
@@ -249,9 +249,6 @@ class JReactNativeFeatureFlagsCxxInterop
249249
static bool useNativeViewConfigsInBridgelessMode(
250250
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
251251

252-
static bool useOptimizedEventBatchingOnAndroid(
253-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
254-
255252
static bool useRawPropsJsiValue(
256253
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
257254

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<5a7c80b50fda63afb95e8c6f4651eebc>>
7+
* @generated SignedSource<<a2224b72c2e27abf6a158aa1b4fe9ed0>>
88
*/
99

1010
/**
@@ -318,10 +318,6 @@ bool ReactNativeFeatureFlags::useNativeViewConfigsInBridgelessMode() {
318318
return getAccessor().useNativeViewConfigsInBridgelessMode();
319319
}
320320

321-
bool ReactNativeFeatureFlags::useOptimizedEventBatchingOnAndroid() {
322-
return getAccessor().useOptimizedEventBatchingOnAndroid();
323-
}
324-
325321
bool ReactNativeFeatureFlags::useRawPropsJsiValue() {
326322
return getAccessor().useRawPropsJsiValue();
327323
}

0 commit comments

Comments
 (0)