Background
app_start being suppressed on API 34+ (#8103). The old timing-window heuristic was replaced on API 34+ by a RunningAppProcessInfo.importance read at first capture. The changelog says "Pre-API-34 behavior is unchanged."
So today there are two different signals:
- Below 34 —
StartFromBackgroundRunnable is posted to the main Looper from FirebasePerfEarly (FirebasePerfEarly.java:55). If it runs before the first onActivityCreated, the start is treated as background (AppStartTrace.java:350-356).
- 34+ —
ActivityManager.getMyMemoryState() importance is read once during registerActivityLifecycleCallbacks. Only IMPORTANCE_FOREGROUND allows the trace (AppStartTrace.java:360).
Question
ActivityManager.getMyMemoryState() has been available since API 16, and AppStartCause.readImportance() already runs on every API level (AppStartCause.java:79). Only the classification is gated:
if (apiLevel >= 34) {
Cause cause = importance == IMPORTANCE_FOREGROUND
? Cause.FOREGROUND
: Cause.UNKNOWN;
return new AppStartCause(cause, importance, apiLevel);
}
// API < 34: legacy AppStartTrace logic owns the decision.
return new AppStartCause(Cause.UNKNOWN, importance, apiLevel);
What specifically blocks using the importance signal below API 34?
Background
app_startbeing suppressed on API 34+ (#8103). The old timing-window heuristic was replaced on API 34+ by aRunningAppProcessInfo.importanceread at first capture. The changelog says "Pre-API-34 behavior is unchanged."So today there are two different signals:
StartFromBackgroundRunnableis posted to the main Looper fromFirebasePerfEarly(FirebasePerfEarly.java:55). If it runs before the firstonActivityCreated, the start is treated as background (AppStartTrace.java:350-356).ActivityManager.getMyMemoryState()importance is read once duringregisterActivityLifecycleCallbacks. OnlyIMPORTANCE_FOREGROUNDallows the trace (AppStartTrace.java:360).Question
ActivityManager.getMyMemoryState()has been available since API 16, andAppStartCause.readImportance()already runs on every API level (AppStartCause.java:79). Only the classification is gated:What specifically blocks using the importance signal below API 34?