Title: Clean up the remaining AndroidCurrentDateProvider usages · Issue #6104 · getsentry/sentry-java · GitHub
Open Graph Title: Clean up the remaining AndroidCurrentDateProvider usages · Issue #6104 · getsentry/sentry-java
X Title: Clean up the remaining AndroidCurrentDateProvider usages · Issue #6104 · getsentry/sentry-java
Description: Follow-up to #6102, which deprecates AndroidCurrentDateProvider but migrates nothing. Five internal call sites still use it, each carrying a @SuppressWarnings("deprecation") that points here. Why they should move AndroidCurrentDateProvid...
Open Graph Description: Follow-up to #6102, which deprecates AndroidCurrentDateProvider but migrates nothing. Five internal call sites still use it, each carrying a @SuppressWarnings("deprecation") that points here. Why t...
X Description: Follow-up to #6102, which deprecates AndroidCurrentDateProvider but migrates nothing. Five internal call sites still use it, each carrying a @SuppressWarnings("deprecation") that points h...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6104
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Clean up the remaining AndroidCurrentDateProvider usages","articleBody":"Follow-up to getsentry/sentry-java#6102, which deprecates `AndroidCurrentDateProvider` but migrates nothing. Five internal call sites still use it, each carrying a `@SuppressWarnings(\"deprecation\")` that points here.\n\n## Why they should move\n\n`AndroidCurrentDateProvider.getCurrentTimeMillis()` is `SystemClock.uptimeMillis()`, which stops advancing while the device is in deep sleep. Any interval measured with it under-reports real elapsed time, so a window looks un-expired long after it actually expired. `MonotonicTicker` is `CLOCK_BOOTTIME` via `SystemClock.elapsedRealtimeNanos()` and keeps counting through deep sleep.\n\n## Call sites\n\n`Debouncer` — `internal/util/Debouncer.java` reads the provider for its window check. Four constructions pass the uptime provider:\n\n* `ViewHierarchyEventProcessor` (2 s window)\n* `ScreenshotEventProcessor` (2 s window)\n* `SystemEventsBreadcrumbsIntegration` (60 s window)\n* `AppComponentsBreadcrumbsIntegration` (60 s window)\n\nThe two 60 s breadcrumb debouncers are the ones that can swallow a real breadcrumb: a trim-memory or connectivity event right after a long Doze can land inside a window that expired hours ago in wall time. The 2 s screenshot and view-hierarchy windows are much harder to hit. Note this is a behavior change, not a rename — the debounce interval starts counting deep sleep.\n\n`AndroidEnvelopeCache` — `currentDateProvider.getCurrentTimeMillis() - sdkInitTimeSpan.getStartUptimeMs()`, the startup-crash detection threshold. Same deep-sleep skew: a crash long after init, with sleep in between, can fall under `startupCrashDurationThresholdMillis` and be written as a startup crash.\n\n### `AndroidEnvelopeCache` cannot move in isolation\n\n`TimeSpan` is documented and implemented on `SystemClock.uptimeMillis()` (`performance/TimeSpan.java:14`, `:45`, `:51`). Moving only the left operand to a `MonotonicTicker` tick would subtract two different clock bases — worse than what is there today. Either move `TimeSpan`'s base along with it, or split this call site into its own issue.\n\n## Out of scope\n\n* `sentry-android-replay`'s `ICurrentDateProvider` consumers — getsentry/sentry-java#5578 / PR #6090.\n* Deleting `AndroidCurrentDateProvider`. The class is `@ApiStatus.Internal` and absent from `sentry-android-core.api`, so removal is not a binary-compat break, but per the project plan removal lands on v9.\n\n## Done when\n\n* No production code references `AndroidCurrentDateProvider`, or the only remaining reference is `AndroidEnvelopeCache` with the `TimeSpan` coupling tracked separately.\n* Every `@SuppressWarnings(\"deprecation\")` added by getsentry/sentry-java#6102, and its comment, is gone.\n* Tests cover a deep-sleep-style jump: real time advances well past the window while the old uptime source would not have.","author":{"url":"https://github.com/runningcode","@type":"Person","name":"runningcode"},"datePublished":"2026-09-11T15:37:53Z","url":"https://github.com/getsentry/sentry-java/issues/6104"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ee3d60e3-c0d3-1d39-0ffe-93887ad1c174 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95AE:DB710:5DF2D:7FCD4:6B0451CB |
| html-safe-nonce | 4ffe94768e5fc389e8f90611d5e92250708be2e63b062c3d61cee2e5617f34fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUFFOkRCNzEwOjVERjJEOjdGQ0Q0OjZCMDQ1MUNCIiwidmlzaXRvcl9pZCI6IjEwNDk2NTcwMTkyOTQwNDQ2MTkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 74a34a8b8507758c7c711ad12f156e45c6a6fb2e1fda969364531c4b409a8399 |
| hovercard-subject-tag | issue:5426171632 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6104/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4d493cff6e78d419df1fafe68caef01ae33936369b27dd744f6fd6d57c32499c/getsentry/sentry-java/issues/6104 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4d493cff6e78d419df1fafe68caef01ae33936369b27dd744f6fd6d57c32499c/getsentry/sentry-java/issues/6104 |
| og:image:alt | Follow-up to #6102, which deprecates AndroidCurrentDateProvider but migrates nothing. Five internal call sites still use it, each carrying a @SuppressWarnings("deprecation") that points here. Why t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | runningcode |
| hostname | github.com |
| expected-hostname | github.com |
| None | 910ca0e260cfec6aff11407d8dc6a0d3a4cd381a2ec9ada56627b063426892a0 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e086f9b7e88322eb2b41885a6ad425b215737fa5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width