Skip to content

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

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

feat(android): Add ApplicationStartInfo API support for Android 15+#5056
markushi wants to merge 9 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 installGroupsOverride parameter by runningcode in #5066
  • (replay) Track custom masking usage via integration by markushi in #5070

Bug Fixes 🐛

  • (android) Merge tombstone and Native SDK event message. by supervacuus in #5095
  • (logs,metrics) Attach user attributes to logs and metrics regardless of sendDefaultPii by romtsn in #5099

Internal Changes 🔧

Deps

  • Update Native SDK to v0.12.7 by github-actions in #5098
  • Bump getsentry/craft from 2.20.1 to 2.21.2 by dependabot in #5083
  • Bump github/codeql-action from 4.32.0 to 4.32.2 by dependabot in #5082
  • Update Native SDK to v0.12.6 by github-actions in #5071

Other

  • Session Replay: Add PreviewView to default masked view classes by szijpeter in #5097
  • No longer log a warning if a logging integration cannot initialize Sentry due to missing DSN. by adinauer in #5075
  • Fix thread leak caused by eager creation of SentryExecutorService in SentryOptions by adinauer in #5093

🤖 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 f4afb12

@github-actions
Copy link
Contributor

github-actions bot commented Jan 23, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 311.92 ms 360.08 ms 48.16 ms
Size 1.58 MiB 2.29 MiB 725.53 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
9ea89e8 308.06 ms 358.16 ms 50.10 ms
d15471f 310.26 ms 377.04 ms 66.78 ms
d364ace 382.77 ms 443.21 ms 60.44 ms
806307f 357.85 ms 424.64 ms 66.79 ms
17a0955 372.53 ms 446.70 ms 74.17 ms
6edfca2 316.43 ms 398.90 ms 82.46 ms
d15471f 343.13 ms 361.47 ms 18.34 ms
319f256 317.53 ms 370.83 ms 53.29 ms
9fbb112 359.71 ms 421.85 ms 62.14 ms
539ca63 313.51 ms 355.43 ms 41.92 ms

App size

Revision Plain With Sentry Diff
9ea89e8 1.58 MiB 2.28 MiB 716.23 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
d364ace 1.58 MiB 2.11 MiB 539.75 KiB
806307f 1.58 MiB 2.10 MiB 533.42 KiB
17a0955 1.58 MiB 2.10 MiB 533.20 KiB
6edfca2 1.58 MiB 2.13 MiB 559.07 KiB
d15471f 1.58 MiB 2.13 MiB 559.54 KiB
319f256 1.58 MiB 2.19 MiB 619.79 KiB
9fbb112 1.58 MiB 2.11 MiB 539.18 KiB
539ca63 1.58 MiB 2.12 MiB 551.41 KiB

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

Startup times

Revision Plain With Sentry Diff
61d1981 316.47 ms 359.62 ms 43.15 ms
b29238f 300.43 ms 350.22 ms 49.79 ms
1c0ae59 307.57 ms 360.40 ms 52.83 ms

App size

Revision Plain With Sentry Diff
61d1981 1.58 MiB 2.19 MiB 621.66 KiB
b29238f 1.58 MiB 2.19 MiB 622.37 KiB
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