Skip to content

Commit 2b7eff2

Browse files
committed
chore: fix build error on react-native 0.80.x
1 parent 66a5c04 commit 2b7eff2

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import android.os.Handler;
77
import android.os.Looper;
88
import android.view.View;
9+
import android.view.Choreographer;
910

1011
import androidx.annotation.OptIn;
1112

@@ -25,7 +26,6 @@
2526
import com.facebook.react.bridge.ReadableMap;
2627
import com.facebook.react.bridge.WritableMap;
2728
import com.facebook.react.common.annotations.UnstableReactNativeAPI;
28-
import com.facebook.react.modules.core.ChoreographerCompat;
2929
import com.facebook.react.modules.core.DeviceEventManagerModule;
3030
import com.facebook.react.modules.core.ReactChoreographer;
3131
import com.facebook.react.runtime.ReactHostDelegate;
@@ -99,7 +99,7 @@ public String getName() {
9999
}
100100

101101
private void loadBundleLegacy() {
102-
final Activity currentActivity = getCurrentActivity();
102+
final Activity currentActivity = getReactApplicationContext().getCurrentActivity();
103103
if (currentActivity == null) {
104104
// The currentActivity can be null if it is backgrounded / destroyed, so we simply
105105
// no-op to prevent any null pointer exceptions.
@@ -223,7 +223,7 @@ public void run() {
223223
// React Native uses the id field to track react tags and will overwrite this field.
224224
// If that is fine, explicitly overwrite the id field to View.NO_ID before calling addRootView."
225225
private void resetReactRootViews(ReactDelegate reactDelegate) {
226-
ReactActivity currentActivity = (ReactActivity) getCurrentActivity();
226+
ReactActivity currentActivity = (ReactActivity) getReactApplicationContext().getCurrentActivity();
227227
if (currentActivity != null) {
228228
ReactRootView reactRootView = reactDelegate.getReactRootView();
229229
if (reactRootView != null) {
@@ -242,7 +242,7 @@ private void clearLifecycleEventListener() {
242242
}
243243

244244
private ReactDelegate resolveReactDelegate() {
245-
ReactActivity currentActivity = (ReactActivity) getCurrentActivity();
245+
ReactActivity currentActivity = (ReactActivity) getReactApplicationContext().getCurrentActivity();
246246
if (currentActivity == null) {
247247
return null;
248248
}
@@ -278,7 +278,7 @@ private ReactInstanceManager resolveInstanceManager() throws NoSuchFieldExceptio
278278
return instanceManager;
279279
}
280280

281-
final Activity currentActivity = getCurrentActivity();
281+
final Activity currentActivity = getReactApplicationContext().getCurrentActivity();
282282
if (currentActivity == null) {
283283
return null;
284284
}
@@ -390,7 +390,7 @@ public void call(DownloadProgress downloadProgress) {
390390
getReactApplicationContext().runOnUiQueueThread(new Runnable() {
391391
@Override
392392
public void run() {
393-
ReactChoreographer.getInstance().postFrameCallback(ReactChoreographer.CallbackType.TIMERS_EVENTS, new ChoreographerCompat.FrameCallback() {
393+
ReactChoreographer.getInstance().postFrameCallback(ReactChoreographer.CallbackType.TIMERS_EVENTS, new Choreographer.FrameCallback() {
394394
@Override
395395
public void doFrame(long frameTimeNanos) {
396396
if (!latestDownloadProgress.isCompleted()) {

0 commit comments

Comments
 (0)