Problem
AppStartMetrics.registerLifecycleCallbacks performs an ActivityManager.getHistoricalProcessStartReasons(1) binder call synchronously on the main thread on API 35+ (sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java:467-475). Under auto-init this runs at ContentProvider time via SentryPerformanceProvider.onAppLaunched. #5275 already restricted it to API 35+, but on those devices it still blocks the main thread on a system_server round-trip during the coldest part of startup.
Proposal
The result (appStartType / cachedStartInfo) is only consumed later when app-start spans are assembled — investigate moving the lookup to a background thread/executor with the consumer reading a Future or volatile, or deferring until first frame.
Risks
registerLifecycleCallbacks runs very early (ContentProvider), before the Sentry executor exists — may need a lazy or Handler-based defer rather than options.getExecutorService().
Problem
AppStartMetrics.registerLifecycleCallbacksperforms anActivityManager.getHistoricalProcessStartReasons(1)binder call synchronously on the main thread on API 35+ (sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java:467-475). Under auto-init this runs at ContentProvider time viaSentryPerformanceProvider.onAppLaunched. #5275 already restricted it to API 35+, but on those devices it still blocks the main thread on a system_server round-trip during the coldest part of startup.Proposal
The result (
appStartType/cachedStartInfo) is only consumed later when app-start spans are assembled — investigate moving the lookup to a background thread/executor with the consumer reading a Future or volatile, or deferring until first frame.Risks
registerLifecycleCallbacksruns very early (ContentProvider), before the Sentry executor exists — may need a lazy or Handler-based defer rather thanoptions.getExecutorService().