| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
📲 Install BuildsAndroid
|
Sorry, something went wrong.
Performance metrics 🚀
Baseline results on branch: mainStartup times
App size
Previous results on branch: markushi/fix-foreground-detectionStartup times
App size
|
Sorry, something went wrong.
There was a problem hiding this comment.
Nice!
Approving pending addition of the CHANGELOG entry 👍
Sorry, something went wrong.
…rmance/AppStartMetrics.java Co-authored-by: arb <adam.brown@sentry.io>
| Back | FazBrowse Home | New Git URL |
Description
Pre Android 15, AppStartMetrics.appLaunchedInForeground uses a LazyEvaluator<Boolean> that only
evaluated ContextUtils.isForegroundImportance() on the first read. Since the read can happen at a later point in time, e.g. during Activity.onCreate() the process importance might have changed by now, and we incorrectly detect foreground / background starts - causing long app starts.
This PR changes the behavior, and we now immediately evaluate the foreground flag. This will make foreground/background app starts pre Android 15 more correct, at the cost of an extra binder call via ContextUtils.isForegroundImportance().
💡 Motivation and Context
Fixes #4693 (pre Android 15)
💚 How did you test it?
Unit Tests.
📝 Checklist