Skip to content

Commit d23502b

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Add a feature flag for (#54777)
Summary: Pull Request resolved: #54777 This will be needed so we can properly experiment around #54721 Changelog: [Internal] [Changed] - Reviewed By: javache Differential Revision: D88286589 fbshipit-source-id: e0ebc454798388f55f3c68f80a4c92d55791a74b
1 parent 5634e8a commit d23502b

20 files changed

+169
-52
lines changed

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

Lines changed: 7 additions & 1 deletion
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<<5685f79f9b08afe94f5b3e8ec8ff6748>>
7+
* @generated SignedSource<<adc6b24ae04487d2b82a2bac35f027a7>>
88
*/
99

1010
/**
@@ -372,6 +372,12 @@ public object ReactNativeFeatureFlags {
372372
@JvmStatic
373373
public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = accessor.fixMappingOfEventPrioritiesBetweenFabricAndReact()
374374

375+
/**
376+
* Fix text clipping starting in Android 15 due to usage of useBoundsForWidth
377+
*/
378+
@JvmStatic
379+
public fun fixTextClippingAndroid15useBoundsForWidth(): Boolean = accessor.fixTextClippingAndroid15useBoundsForWidth()
380+
375381
/**
376382
* Enable system assertion validating that Fusebox is configured with a single host. When set, the CDP backend will dynamically disable features (Perf and Network) in the event that multiple hosts are registered (undefined behaviour), and broadcast this over `ReactNativeApplication.systemStateChanged`.
377383
*/

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

Lines changed: 11 additions & 1 deletion
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<<6645323047d21e58469de0d385954eab>>
7+
* @generated SignedSource<<3ebb3c265193b4f61e5bf43082c5be54>>
88
*/
99

1010
/**
@@ -77,6 +77,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
7777
private var enableVirtualViewWindowFocusDetectionCache: Boolean? = null
7878
private var enableWebPerformanceAPIsByDefaultCache: Boolean? = null
7979
private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
80+
private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null
8081
private var fuseboxAssertSingleHostStateCache: Boolean? = null
8182
private var fuseboxEnabledReleaseCache: Boolean? = null
8283
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
@@ -623,6 +624,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
623624
return cached
624625
}
625626

627+
override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean {
628+
var cached = fixTextClippingAndroid15useBoundsForWidthCache
629+
if (cached == null) {
630+
cached = ReactNativeFeatureFlagsCxxInterop.fixTextClippingAndroid15useBoundsForWidth()
631+
fixTextClippingAndroid15useBoundsForWidthCache = cached
632+
}
633+
return cached
634+
}
635+
626636
override fun fuseboxAssertSingleHostState(): Boolean {
627637
var cached = fuseboxAssertSingleHostStateCache
628638
if (cached == null) {

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

Lines changed: 3 additions & 1 deletion
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<<3da42d9ffdbba52e9e1d11a4e4dac8c4>>
7+
* @generated SignedSource<<eb11cf643c4e94eddc5d7985a8a7a03a>>
88
*/
99

1010
/**
@@ -142,6 +142,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
142142

143143
@DoNotStrip @JvmStatic public external fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean
144144

145+
@DoNotStrip @JvmStatic public external fun fixTextClippingAndroid15useBoundsForWidth(): Boolean
146+
145147
@DoNotStrip @JvmStatic public external fun fuseboxAssertSingleHostState(): Boolean
146148

147149
@DoNotStrip @JvmStatic public external fun fuseboxEnabledRelease(): Boolean

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

Lines changed: 3 additions & 1 deletion
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<<46e1f708d91d5ec45c866b8192192e72>>
7+
* @generated SignedSource<<58cb08dbd188ec64d3738f548567bcde>>
88
*/
99

1010
/**
@@ -137,6 +137,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
137137

138138
override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = false
139139

140+
override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean = false
141+
140142
override fun fuseboxAssertSingleHostState(): Boolean = true
141143

142144
override fun fuseboxEnabledRelease(): Boolean = false

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

Lines changed: 12 additions & 1 deletion
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<<c19ea5e9ad6435b1f8587287cacf020b>>
7+
* @generated SignedSource<<f9ee0d1f23024b026d065ffc3d48cfcf>>
88
*/
99

1010
/**
@@ -81,6 +81,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
8181
private var enableVirtualViewWindowFocusDetectionCache: Boolean? = null
8282
private var enableWebPerformanceAPIsByDefaultCache: Boolean? = null
8383
private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
84+
private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null
8485
private var fuseboxAssertSingleHostStateCache: Boolean? = null
8586
private var fuseboxEnabledReleaseCache: Boolean? = null
8687
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
@@ -684,6 +685,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
684685
return cached
685686
}
686687

688+
override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean {
689+
var cached = fixTextClippingAndroid15useBoundsForWidthCache
690+
if (cached == null) {
691+
cached = currentProvider.fixTextClippingAndroid15useBoundsForWidth()
692+
accessedFeatureFlags.add("fixTextClippingAndroid15useBoundsForWidth")
693+
fixTextClippingAndroid15useBoundsForWidthCache = cached
694+
}
695+
return cached
696+
}
697+
687698
override fun fuseboxAssertSingleHostState(): Boolean {
688699
var cached = fuseboxAssertSingleHostStateCache
689700
if (cached == null) {

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

Lines changed: 3 additions & 1 deletion
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<<17400be6ee20befd9eafb094455dfb63>>
7+
* @generated SignedSource<<09cef8cedd515f477a32c2ed77d86fc4>>
88
*/
99

1010
/**
@@ -137,6 +137,8 @@ public interface ReactNativeFeatureFlagsProvider {
137137

138138
@DoNotStrip public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean
139139

140+
@DoNotStrip public fun fixTextClippingAndroid15useBoundsForWidth(): Boolean
141+
140142
@DoNotStrip public fun fuseboxAssertSingleHostState(): Boolean
141143

142144
@DoNotStrip public fun fuseboxEnabledRelease(): Boolean

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

Lines changed: 15 additions & 1 deletion
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<<66f2c701d95db2fbeefb2705ae326e08>>
7+
* @generated SignedSource<<b9af351de972ddff807bd25f98f3ff42>>
88
*/
99

1010
/**
@@ -381,6 +381,12 @@ class ReactNativeFeatureFlagsJavaProvider
381381
return method(javaProvider_);
382382
}
383383

384+
bool fixTextClippingAndroid15useBoundsForWidth() override {
385+
static const auto method =
386+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fixTextClippingAndroid15useBoundsForWidth");
387+
return method(javaProvider_);
388+
}
389+
384390
bool fuseboxAssertSingleHostState() override {
385391
static const auto method =
386392
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxAssertSingleHostState");
@@ -862,6 +868,11 @@ bool JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabri
862868
return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact();
863869
}
864870

871+
bool JReactNativeFeatureFlagsCxxInterop::fixTextClippingAndroid15useBoundsForWidth(
872+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
873+
return ReactNativeFeatureFlags::fixTextClippingAndroid15useBoundsForWidth();
874+
}
875+
865876
bool JReactNativeFeatureFlagsCxxInterop::fuseboxAssertSingleHostState(
866877
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
867878
return ReactNativeFeatureFlags::fuseboxAssertSingleHostState();
@@ -1224,6 +1235,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
12241235
makeNativeMethod(
12251236
"fixMappingOfEventPrioritiesBetweenFabricAndReact",
12261237
JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact),
1238+
makeNativeMethod(
1239+
"fixTextClippingAndroid15useBoundsForWidth",
1240+
JReactNativeFeatureFlagsCxxInterop::fixTextClippingAndroid15useBoundsForWidth),
12271241
makeNativeMethod(
12281242
"fuseboxAssertSingleHostState",
12291243
JReactNativeFeatureFlagsCxxInterop::fuseboxAssertSingleHostState),

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

Lines changed: 4 additions & 1 deletion
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<<f14600a85cec20388ba1a5bc63010a68>>
7+
* @generated SignedSource<<c89b15dbb7d1cec571eed1551e1b7162>>
88
*/
99

1010
/**
@@ -201,6 +201,9 @@ class JReactNativeFeatureFlagsCxxInterop
201201
static bool fixMappingOfEventPrioritiesBetweenFabricAndReact(
202202
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
203203

204+
static bool fixTextClippingAndroid15useBoundsForWidth(
205+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
206+
204207
static bool fuseboxAssertSingleHostState(
205208
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
206209

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

Lines changed: 5 additions & 1 deletion
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<<34d260e51b2f70825c4867c98bbcf3de>>
7+
* @generated SignedSource<<08d50062a88a227aa8800e549b6dfe57>>
88
*/
99

1010
/**
@@ -254,6 +254,10 @@ bool ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact()
254254
return getAccessor().fixMappingOfEventPrioritiesBetweenFabricAndReact();
255255
}
256256

257+
bool ReactNativeFeatureFlags::fixTextClippingAndroid15useBoundsForWidth() {
258+
return getAccessor().fixTextClippingAndroid15useBoundsForWidth();
259+
}
260+
257261
bool ReactNativeFeatureFlags::fuseboxAssertSingleHostState() {
258262
return getAccessor().fuseboxAssertSingleHostState();
259263
}

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

Lines changed: 6 additions & 1 deletion
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<<502fa8935abd547231be7980d768b817>>
7+
* @generated SignedSource<<4f6913d92515fd817a167ef2a505c777>>
88
*/
99

1010
/**
@@ -324,6 +324,11 @@ class ReactNativeFeatureFlags {
324324
*/
325325
RN_EXPORT static bool fixMappingOfEventPrioritiesBetweenFabricAndReact();
326326

327+
/**
328+
* Fix text clipping starting in Android 15 due to usage of useBoundsForWidth
329+
*/
330+
RN_EXPORT static bool fixTextClippingAndroid15useBoundsForWidth();
331+
327332
/**
328333
* Enable system assertion validating that Fusebox is configured with a single host. When set, the CDP backend will dynamically disable features (Perf and Network) in the event that multiple hosts are registered (undefined behaviour), and broadcast this over `ReactNativeApplication.systemStateChanged`.
329334
*/

0 commit comments

Comments
 (0)