firebase-perf: document why the importance signal is gated to API 34+ - #8532
firebase-perf: document why the importance signal is gated to API 34+#8532jrodiz wants to merge 1 commit into
Conversation
AppStartCause.capture reads RunningAppProcessInfo.importance on every API level but classifies on it only from 34 up, and the comment at the gate said what happened without saying why. Records the rationale in place. Documentation only; no behavior change. Answers firebase#8509.
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. |
Answers #8509 (follow-up question to #8103 / PR #8326). Documentation only: no behavior change, no API change, no CHANGELOG entry.
Why
AppStartCause.capture()readsRunningAppProcessInfo.importanceon every API level but classifies on it only from API 34 up. The comment at the gate said what happened (// API < 34: legacy AppStartTrace logic owns the decision.) and not why, leaving the reasoning only in the PR body for #8326. This moves it to the gate.Changes
AppStartCause.java: class javadoc notes that the importance read isn't version-gated (getMyMemoryStateis API 16+) and only the classification is;capture()'s javadoc records the rationale; the inline comment notes thatimportanceis recorded below 34 so the two signals can be compared before any future tier flip.AppStartTrace.java:resolveIsStartedFromBackground()points atAppStartCause#captureand references #8509 alongside #8103.The rationale recorded
activity.resumed84 ms, runnable 101 ms).PROCESS_STATE_BOUND_TOPmaps toIMPORTANCE_FOREGROUND, so a process forked by a foreground app binding one of its services samples FOREGROUND, and a warm start that follows would be admitted as_app_start, which the pre-34 path suppresses today.procStateToImportanceForTargetSdkreturns the*_PRE_26/*_PRE_28constants below targetSdk 26, and minSdk here is 23.