[Android] Timers do not run when using HeadlessJsTaskService
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- android, react-native
- Ambito
- mobile-dev
Direzione di ricerca
Inizia dal punto di ingresso HeadlessJsTaskService e dal percorso di pianificazione dei timer Android che utilizza Choreographer. Riproduci il problema con il reproducer obbligatorio osservando Logcat, quindi verifica che i timer continuino a essere eseguiti in background senza alterare il comportamento esistente in foreground.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description
Hello!
I noticed that when using HeadlessJsTaskService, the timers do not run as expected. I did some investigations and I found out that React Native uses Android's Choreographer to schedule the timers.
I am testing the app on a real device: Samsung Galaxy S22 Ultra.
Apparently, Samsung's OneUI pauses the Choreographer when the app goes into background.
In order to fix this, React Native should use another technique to get "ticks", like a Handler or something, at least for the timers (I saw UI events are also processed using Choreographer).
Steps to reproduce
- Install the application using "yarn android"
- Open up Android Studio with Logcat open
- Wait for the background service to start
- Put the app in foreground by going on the home screen
- Look in the logs and wait for the line with "CoreRune.SYSPERF_ACTIVE_APP_BBA_ENABLE : stop animation in background states"
React Native Version
0.84.1
Affected Platforms
Runtime - Android
Output of npx @react-native-community/cli info
System:
OS: macOS 26.3.1
CPU: (14) arm64 Apple M3 Max
Memory: 160.17 MB / 36.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 22.13.1
path: /Users/george/.nvm/versions/node/v22.13.1/bin/node
Yarn:
version: 3.6.4
path: /Users/george/.nvm/versions/node/v22.13.1/bin/yarn
npm:
version: 10.9.2
path: /Users/george/.nvm/versions/node/v22.13.1/bin/npm
Watchman:
version: 2025.05.26.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.16.2
path: /Users/george/.rvm/gems/ruby-3.0.0/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 25.0
- iOS 26.0
- macOS 26.0
- tvOS 26.0
- visionOS 26.0
- watchOS 26.0
Android SDK:
API Levels:
- "30"
- "31"
- "33"
- "34"
- "35"
- "36"
- "36"
Build Tools:
- 30.0.2
- 30.0.3
- 33.0.0
- 34.0.0
- 35.0.0
- 36.0.0
- 36.0.0
System Images:
- android-34 | Android TV ARM 64 v8a
- android-35 | ARM 64 v8a
- android-35 | Google Play ARM 64 v8a
- android-35 | Google Play Tablet ARM 64 v8a
- android-36 | Google Play ARM 64 v8a
- android-36 | Pre-Release 16 KB Page Size Google Play ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2025.3 AI-253.30387.90.2532.14935130
Xcode:
version: 26.0.1/17A400
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.13
path: /usr/bin/javac
Ruby:
version: 3.0.0
path: /Users/george/.rvm/rubies/ruby-3.0.0/bin/ruby
npmPackages:
"@react-native-community/cli":
installed: 20.1.0
wanted: 20.1.0
react:
installed: 19.2.3
wanted: 19.2.3
react-native:
installed: 0.84.1
wanted: 0.84.1
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: true
iOS:
hermesEnabled: Not found
newArchEnabled: false
Stacktrace or Logs
2026-04-04 17:31:59.258 11074-11128 ReactNativeJS com.choreographerissue I Hello from service!
2026-04-04 17:32:00.260 11074-11128 ReactNativeJS com.choreographerissue I Hello from service!
2026-04-04 17:32:01.264 11074-11128 ReactNativeJS com.choreographerissue I Hello from service!
2026-04-04 17:32:02.267 11074-11128 ReactNativeJS com.choreographerissue I Hello from service!
2026-04-04 17:32:02.526 11074-11074 Choreographer com.choreographerissue D CoreRune.SYSPERF_ACTIVE_APP_BBA_ENABLE : stop animation in background states
MANDATORY Reproducer
https://github.com/gmanole01/react-native-choreographer-issue
Screenshots and Videos
No response
- Lingua principale
- C++
- Stelle
- 127k
- Fork
- 25.3k
- Merge medio
- 1g 23h
- PR unite (30g)
- 4
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di react/react-native
-
Needs: Triage :mag:
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
react/react-native#58565 · 1 commento · 2 reazioni ·
-
Needs: Author Feedback Needs: Repro
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
react/react-native#58555 · 4 commenti · 1 reazione ·
-
Needs: Attention Needs: Repro
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
react/react-native#58526 · 2 commenti ·
-
Needs: Author Feedback Needs: Repro
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
react/react-native#58448 · 1 commento ·
-
Needs: Attention Needs: Repro
Difficoltà 2/5 Mezza giornata Idoneità per principianti 82/100
react/react-native#58441 · 2 commenti ·
Tutte le issue di react/react-native
Issue simili
-
Website Doc Typo Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 92/100
autowarefoundation/autoware_universe#13413 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
-
automated-analysis bug memory-safety
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100