Skip to content

Commit

Permalink
Get rid of old APIs in FabricUIManagerProvider (#42059)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #42059

Getting rid of old APIs in FabricUIManagerProvider and also clearing it of the inheritance dependency it has on JSIModule post it's references have been cleared.

Reviewed By: christophpurrer

Differential Revision: D51001239

fbshipit-source-id: c3d4650c292e957e9f939304662932c11af7a24f
  • Loading branch information
arushikesarwani94 authored and facebook-github-bot committed Dec 27, 2023
1 parent cd5f6aa commit c2c346c
Showing 1 changed file with 1 addition and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@

package com.facebook.react.fabric;

import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.react.bridge.CatalystInstance;
import com.facebook.react.bridge.JSIModuleProvider;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.UIManager;
import com.facebook.react.bridge.UIManagerProvider;
Expand All @@ -19,45 +17,21 @@
import com.facebook.systrace.Systrace;

@Nullsafe(Nullsafe.Mode.LOCAL)
public class FabricUIManagerProviderImpl
implements JSIModuleProvider<UIManager>, UIManagerProvider {
public class FabricUIManagerProviderImpl implements UIManagerProvider {

private final @Nullable ReactApplicationContext mReactApplicationContext;
private final ComponentFactory mComponentFactory;
private final ReactNativeConfig mConfig;
private final ViewManagerRegistry mViewManagerRegistry;

public FabricUIManagerProviderImpl(
ReactApplicationContext reactApplicationContext,
ComponentFactory componentFactory,
ReactNativeConfig config,
ViewManagerRegistry viewManagerRegistry) {
mReactApplicationContext = reactApplicationContext;
mComponentFactory = componentFactory;
mConfig = config;
mViewManagerRegistry = viewManagerRegistry;
}

public FabricUIManagerProviderImpl(
ComponentFactory componentFactory,
ReactNativeConfig config,
ViewManagerRegistry viewManagerRegistry) {
mReactApplicationContext = null;
mComponentFactory = componentFactory;
mConfig = config;
mViewManagerRegistry = viewManagerRegistry;
}

@Override
public UIManager get() {
if (mReactApplicationContext != null) {
return createUIManager(mReactApplicationContext);
}
throw new IllegalStateException(
"This method shoulndn't be called without ReactContext initialized");
}

@Override
public UIManager createUIManager(ReactApplicationContext reactApplicationContext) {
Systrace.beginSection(
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricUIManagerProviderImpl.create");
Expand Down

0 comments on commit c2c346c

Please sign in to comment.