Skip to content

feat(android): Add ApplicationStartInfo API support for Android 15+#5056

Draft
markushi wants to merge 6 commits intomainfrom
markushi/feat/app-start-info
Draft

feat(android): Add ApplicationStartInfo API support for Android 15+#5056
markushi wants to merge 6 commits intomainfrom
markushi/feat/app-start-info

Conversation

@markushi
Copy link
Member

📜 Description

Adds support for Android 15+ (API 35) ApplicationStartInfo API to collect detailed app startup timing data and create a custom transaction with enriched AppStartMetrics spans.

Key Features:

  • Uses ActivityManager.addApplicationStartInfoCompletionListener() to capture startup data when current launch completes
  • Creates transactions with op app.start.info and name app.start.{reason} (e.g., app.start.launcher)
  • Includes detailed timing spans:
    • app.start.bind_application - Time from fork to bind application
    • app.start.application_oncreate - Time from fork to Application.onCreate
    • app.start.ttid - Time to initial display (first frame)
    • app.start.ttfd - Time to full display (fully drawn)
  • Enriches with AppStartMetrics data:
    • Content provider onCreate spans with class names
    • Application.onCreate description with class name
  • Tags include: start.reason, start.type (cold/warm/hot), start.launch_mode

Implementation Details:

  • Opt-in feature via SentryAndroidOptions.setEnableApplicationStartInfo(boolean) (disabled by default)
  • Uses completion listener approach (no historical data collection)
  • All spans start from fork time showing cumulative timing

💡 Motivation and Context

Implements #6228

💚 How did you test it?

  • Added comprehensive unit tests (11 tests in ApplicationStartInfoIntegrationTest)
  • Added integration test in AndroidOptionsInitializerTest

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • May add additional tags when more data becomes available in future Android API levels

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

  • (android) Add ApplicationStartInfo API support for Android 15+ by markushi in #5056
  • (distribution) Add install_groups support by runningcode in #5062
  • (spotlight) Extract SpotlightIntegration to separate module by romtsn in #5064

Bug Fixes 🐛

  • Establish native exception mechanisms by supervacuus in #5052

Internal Changes 🔧

Deps

  • Bump github/codeql-action from 4.31.11 to 4.32.0 by dependabot in #5067
  • Bump gradle/actions from 5.0.0 to 5.0.1 by dependabot in #5068
  • Bump getsentry/craft from 2.20.0 to 2.20.1 by dependabot in #5069
  • Bump urllib3 from 2.6.0 to 2.6.3 in the pip group across 1 directory by dependabot in #5003
  • Update Native SDK to v0.12.4 by github-actions in #5061
  • Bump getsentry/github-workflows/.github/workflows/updater.yml from 2 to 3 by dependabot in #4884
  • Bump actions/cache from 4 to 5 by dependabot in #4997
  • Bump github/codeql-action from 4.31.10 to 4.31.11 by dependabot in #5057
  • Bump getsentry/craft from 2.19.0 to 2.20.0 by dependabot in #5058

Other

  • (android) Update targetSdk to API 36 (Android 16) by markushi in #5016
  • (ci) Write permission for statuses in changelog preview by supervacuus in #5053
  • (samples) Convert main screen to Jetpack Compose by markushi in #5017

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- Add ApplicationStartInfo API support for Android 15+ ([#5056](https://github.com/getsentry/sentry-java/pull/5056))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 0c847e6

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 316.47 ms 359.62 ms 43.15 ms
Size 1.58 MiB 2.19 MiB 621.66 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
27d7cf8 306.76 ms 366.66 ms 59.90 ms
f064536 327.04 ms 405.35 ms 78.31 ms
fc5ccaf 279.11 ms 353.34 ms 74.23 ms
b750b96 408.98 ms 480.32 ms 71.34 ms
e59e22a 329.74 ms 383.31 ms 53.57 ms
2124a46 319.19 ms 415.04 ms 95.85 ms
18c0bc2 306.73 ms 349.77 ms 43.03 ms
85d7417 347.21 ms 394.35 ms 47.15 ms
96449e8 361.30 ms 423.39 ms 62.09 ms
ce0a49e 532.00 ms 609.96 ms 77.96 ms

App size

Revision Plain With Sentry Diff
27d7cf8 1.58 MiB 2.12 MiB 549.42 KiB
f064536 1.58 MiB 2.20 MiB 633.90 KiB
fc5ccaf 1.58 MiB 2.13 MiB 557.54 KiB
b750b96 1.58 MiB 2.10 MiB 533.19 KiB
e59e22a 1.58 MiB 2.20 MiB 635.34 KiB
2124a46 1.58 MiB 2.12 MiB 551.51 KiB
18c0bc2 1.58 MiB 2.13 MiB 557.33 KiB
85d7417 1.58 MiB 2.10 MiB 533.44 KiB
96449e8 1.58 MiB 2.11 MiB 539.35 KiB
ce0a49e 1.58 MiB 2.10 MiB 532.94 KiB

Previous results on branch: markushi/feat/app-start-info

Startup times

Revision Plain With Sentry Diff
1c0ae59 307.57 ms 360.40 ms 52.83 ms

App size

Revision Plain With Sentry Diff
1c0ae59 1.58 MiB 2.19 MiB 622.66 KiB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant