Deprecate EventBeatManager constructor (#36905)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36905

In this diff I'm deprecating EventBeatManager constructor that receives a Context as a parameter.

bypass-github-export-checks

changelog: [Android][Deprecated] deprecating EventBeatManager constructor that receives a Context as a parameter.

Reviewed By: fkgozali

Differential Revision: D44759827

fbshipit-source-id: cb117c26af0a43fe245f8778a55dfbea756b3ce6
This commit is contained in:
David Vacca
2023-04-20 19:43:33 -07:00
committed by Facebook GitHub Bot
parent 4ae77c0ad4
commit 363224ea62
3 changed files with 8 additions and 5 deletions
@@ -221,7 +221,7 @@ public final class ReactInstance {
}
});
EventBeatManager eventBeatManager = new EventBeatManager(mBridgelessReactContext);
EventBeatManager eventBeatManager = new EventBeatManager();
mFabricUIManager =
new FabricUIManager(mBridgelessReactContext, viewManagerRegistry, eventBeatManager);
@@ -36,7 +36,7 @@ public class FabricJSIModuleProvider implements JSIModuleProvider<UIManager> {
@Override
public UIManager get() {
Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricJSIModuleProvider.get");
final EventBeatManager eventBeatManager = new EventBeatManager(mReactApplicationContext);
final EventBeatManager eventBeatManager = new EventBeatManager();
final FabricUIManager uiManager = createUIManager(eventBeatManager);
Systrace.beginSection(
@@ -19,22 +19,25 @@ import com.facebook.react.uimanager.events.BatchEventDispatchedListener;
* Class that acts as a proxy between the list of EventBeats registered in C++ and the Android side.
*/
@SuppressLint("MissingNativeLoadLibrary")
public class EventBeatManager implements BatchEventDispatchedListener {
public final class EventBeatManager implements BatchEventDispatchedListener {
static {
FabricSoLoader.staticInit();
}
@DoNotStrip private final HybridData mHybridData;
private final ReactApplicationContext mReactApplicationContext;
private static native HybridData initHybrid();
private native void tick();
@Deprecated(forRemoval = true, since = "Deprecated on v0.72.0 Use EventBeatManager() instead")
public EventBeatManager(@NonNull ReactApplicationContext reactApplicationContext) {
this();
}
public EventBeatManager() {
mHybridData = initHybrid();
mReactApplicationContext = reactApplicationContext;
}
@Override