File tree Expand file tree Collapse file tree 3 files changed +18
-1
lines changed
packages/react-native/React Expand file tree Collapse file tree 3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ void RCTEnableTurboModuleSyncVoidMethods(BOOL enabled);
61
61
BOOL RCTTurboModuleSharedQueueEnabled (void );
62
62
void RCTEnableTurboModuleSharedQueue (BOOL enabled);
63
63
64
+ BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain (void );
65
+ void RCTUIManagerSetDispatchAccessibilityManagerInitOntoMain (BOOL enabled);
66
+
64
67
typedef enum {
65
68
kRCTBridgeProxyLoggingLevelNone ,
66
69
kRCTBridgeProxyLoggingLevelWarning ,
Original file line number Diff line number Diff line change @@ -162,6 +162,17 @@ void RCTEnableTurboModuleSharedQueue(BOOL enabled)
162
162
gTurboModuleEnableSharedQueue = enabled;
163
163
}
164
164
165
+ BOOL kDispatchAccessibilityManagerInitOntoMain = NO ;
166
+ BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain (void )
167
+ {
168
+ return kDispatchAccessibilityManagerInitOntoMain ;
169
+ }
170
+
171
+ void RCTUIManagerSetDispatchAccessibilityManagerInitOntoMain (BOOL enabled)
172
+ {
173
+ kDispatchAccessibilityManagerInitOntoMain = enabled;
174
+ }
175
+
165
176
@interface RCTBridge () <RCTReloadListener>
166
177
@end
167
178
Original file line number Diff line number Diff line change @@ -181,7 +181,10 @@ - (void)setBridge:(RCTBridge *)bridge
181
181
}
182
182
183
183
// This dispatch_async avoids a deadlock while configuring native modules
184
- dispatch_async (dispatch_get_global_queue (QOS_CLASS_USER_INTERACTIVE, 0 ), ^{
184
+ dispatch_queue_t accessibilityManagerInitQueue = RCTUIManagerDispatchAccessibilityManagerInitOntoMain ()
185
+ ? dispatch_get_main_queue ()
186
+ : dispatch_get_global_queue (QOS_CLASS_USER_INTERACTIVE, 0 );
187
+ dispatch_async (accessibilityManagerInitQueue, ^{
185
188
[[NSNotificationCenter defaultCenter ] addObserver: self
186
189
selector: @selector (didReceiveNewContentSizeMultiplier )
187
190
name: @" RCTAccessibilityManagerDidUpdateMultiplierNotification"
You can’t perform that action at this time.
0 commit comments