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);
6161BOOL RCTTurboModuleSharedQueueEnabled (void );
6262void RCTEnableTurboModuleSharedQueue (BOOL enabled);
6363
64+ BOOL RCTUIManagerDispatchAccessibilityManagerInitOntoMain (void );
65+ void RCTUIManagerSetDispatchAccessibilityManagerInitOntoMain (BOOL enabled);
66+
6467typedef enum {
6568 kRCTBridgeProxyLoggingLevelNone ,
6669 kRCTBridgeProxyLoggingLevelWarning ,
Original file line number Diff line number Diff line change @@ -162,6 +162,17 @@ void RCTEnableTurboModuleSharedQueue(BOOL enabled)
162162 gTurboModuleEnableSharedQueue = enabled;
163163}
164164
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+
165176@interface RCTBridge () <RCTReloadListener>
166177@end
167178
Original file line number Diff line number Diff line change @@ -181,7 +181,10 @@ - (void)setBridge:(RCTBridge *)bridge
181181 }
182182
183183 // 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, ^{
185188 [[NSNotificationCenter defaultCenter ] addObserver: self
186189 selector: @selector (didReceiveNewContentSizeMultiplier )
187190 name: @" RCTAccessibilityManagerDidUpdateMultiplierNotification"
You can’t perform that action at this time.
0 commit comments