Skip to content

Commit 2ed6a08

Browse files
javachefacebook-github-bot
authored andcommitted
Mark JavaTimerManager idle callback methods as @LegacyArchitecture (#53570)
Summary: Pull Request resolved: #53570 Idle callbacks are implemented as a C++ module in the new architecture, this code should not be used. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D81485912 fbshipit-source-id: 18103bb96441880ff3de423aa6c03a176f6ff5de
1 parent dc54eae commit 2ed6a08

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/modules/core/JavaTimerManager.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import com.facebook.react.bridge.WritableArray
1818
import com.facebook.react.common.SystemClock.currentTimeMillis
1919
import com.facebook.react.common.SystemClock.nanoTime
2020
import com.facebook.react.common.SystemClock.uptimeMillis
21+
import com.facebook.react.common.annotations.internal.LegacyArchitecture
2122
import com.facebook.react.devsupport.interfaces.DevSupportManager
2223
import com.facebook.react.jstasks.HeadlessJsTaskContext
2324
import com.facebook.react.jstasks.HeadlessJsTaskEventListener
@@ -110,6 +111,7 @@ public open class JavaTimerManager(
110111
clearChoreographerIdleCallback()
111112
}
112113

114+
@LegacyArchitecture
113115
private fun maybeSetChoreographerIdleCallback() {
114116
synchronized(idleCallbackGuard) {
115117
if (sendIdleEvents) {
@@ -118,6 +120,7 @@ public open class JavaTimerManager(
118120
}
119121
}
120122

123+
@LegacyArchitecture
121124
private fun maybeIdleCallback() {
122125
if (isPaused.get() && !isRunningTasks.get()) {
123126
clearFrameCallback()
@@ -145,6 +148,7 @@ public open class JavaTimerManager(
145148
}
146149
}
147150

151+
@LegacyArchitecture
148152
private fun setChoreographerIdleCallback() {
149153
if (!frameIdleCallbackPosted) {
150154
reactChoreographer.postFrameCallback(
@@ -155,6 +159,7 @@ public open class JavaTimerManager(
155159
}
156160
}
157161

162+
@LegacyArchitecture
158163
private fun clearChoreographerIdleCallback() {
159164
if (frameIdleCallbackPosted) {
160165
reactChoreographer.removeFrameCallback(
@@ -235,6 +240,7 @@ public open class JavaTimerManager(
235240
}
236241

237242
@DoNotStrip
243+
@LegacyArchitecture
238244
public open fun setSendIdleEvents(sendIdleEvents: Boolean) {
239245
synchronized(idleCallbackGuard) { this.sendIdleEvents = sendIdleEvents }
240246
UiThreadUtil.runOnUiThread {
@@ -328,6 +334,7 @@ public open class JavaTimerManager(
328334
}
329335
}
330336

337+
@LegacyArchitecture
331338
private inner class IdleCallbackRunnable(private val frameStartTime: Long) : Runnable {
332339
@Volatile private var isCancelled = false
333340

0 commit comments

Comments
 (0)