Repository navigation
fix(android): Detect startup crashes on the boottime clock - #6738
Open
runningcode wants to merge 2 commits into
Open
runningcode wants to merge 2 commits into
runningcode wants to merge 2 commits into
Conversation
Startup crash detection measured the time since SDK init with SystemClock.uptimeMillis(), which stops while the device is in deep sleep. A crash long after init, with sleep in between, could fall under the threshold and be marked as a startup crash. Both SDK init entry points now also start a Stopwatch on the MonotonicTicker, which counts deep sleep, and AndroidEnvelopeCache reads that. The TimeSpan stays on uptime because changing its base is a v9 decision. This removes the last production use of AndroidCurrentDateProvider; the class itself goes away in v9. Fixes JAVA-729 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
PR risk: mediumFor commit Main concerns: public contract, host performance, reach. Rules that block low also fired:
This label is a hint for reviewers, not an approval. |
📲 Install BuildsAndroid
|
runningcode
commented
Nov 23, 2026
|
|
||
| AndroidEnvelopeCache( | ||
| final @NotNull SentryAndroidOptions options, | ||
| final @NotNull ICurrentDateProvider currentDateProvider) { |
Contributor
Author
There was a problem hiding this comment.
last usage of AndroidCurrentDateProvider
runningcode
marked this pull request as ready for review
November 23, 2026 10:34
runningcode
requested review from
0xadam-brown and
romtsn
and removed request for
a team
November 23, 2026 10:34
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📜 Description
Startup crash detection now measures the time since SDK init on the
MonotonicTicker(CLOCK_BOOTTIME), notSystemClock.uptimeMillis().Both SDK init entry points (
SentryPerformanceProviderandSentryAndroid) now start aStopwatchwhen their class loads. This happens next to the existingsdkInitMillis, andAppStartMetricsstores theStopwatchwith the same "first one wins" rule assdkInitTimeSpan.AndroidEnvelopeCachereads it.TimeSpanstays on uptime because changing its base is a v9 decision (JAVA-827). This was the last production use ofAndroidCurrentDateProvider. The class itself is deleted in v9.💡 Motivation and Context
Uptime stops during deep sleep. So a crash long after init could fall under
startupCrashDurationThresholdMillisif the device slept in between, and it would be marked as a startup crash.💚 How did you test it?
Unit tests use
TestMonotonicTicker. They include a test where the ticker jumps 5 hours, which an uptime clock would have left out.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
Delete
AndroidCurrentDateProviderin v9 (JAVA-827).🤖 Generated with Claude Code