Skip to content

Commit

Permalink
Deprecate EventBeatManager constructor (#36905)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
mdvacca authored and facebook-github-bot committed Apr 21, 2023
1 parent 4ae77c0 commit 363224e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public Collection<String> getViewManagerNames() {
}
});

EventBeatManager eventBeatManager = new EventBeatManager(mBridgelessReactContext);
EventBeatManager eventBeatManager = new EventBeatManager();
mFabricUIManager =
new FabricUIManager(mBridgelessReactContext, viewManagerRegistry, eventBeatManager);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public FabricJSIModuleProvider(
@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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,25 @@
* 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
Expand Down

0 comments on commit 363224e

Please sign in to comment.