| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…s on API 35+ When the OS spawns the process for background work (FCM push, job, service, broadcast, etc.) and the user opens the app later, the app start stayed anchored at background process creation, inflating the reported cold start by the whole idle gap. On API 35+ we now use ApplicationStartInfo.getReason() to detect background process starts and mark them as not launched in foreground, so the first created activity re-classifies them as a warm start anchored at activity creation.
Sorry, something went wrong.
📲 Install BuildsAndroid
|
Sorry, something went wrong.
Performance metrics 🚀
Baseline results on branch: mainStartup times
App size
Previous results on branch: alwx/fix/appstart-background-spawnStartup times
App size
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
📜 Description
On API 35+, use ApplicationStartInfo.getReason() to detect processes the OS spawned for background work (FCM push, job, service, broadcast, alarm, backup, boot_complete, content_provider) and mark them as not launched in foreground. The first created activity then re-classifies the launch as a warm start re-anchored at activity creation, instead of reporting the whole background idle gap as an inflated cold start.
Reported by a user of RN SDK: getsentry/sentry-react-native#6382
💡 Motivation and Context
When a process is spawned in the background (e.g. by an FCM push) and the user opens the app seconds later, appLaunchedInForeground was only evaluated lazily and the app start span stayed anchored at background process creation. On API 35+ the main-looper idle check that would otherwise mark the launch as headless is skipped once the start type is resolved from ApplicationStartInfo, so the inflated cold start (idle gap up to ~1 min) leaked through into app_start_cold.
Fixes getsentry/sentry-react-native#6382
Fixes #4693
💚 How did you test it?
📝 Checklist
🔮 Next steps
Follow-up: API < 35 has no reliable process start reason, so a narrow race in the main-looper idle check remains there; not addressed here.