Repository navigation
Open
Labels
Description
Several internal call sites use CurrentDateProvider only to read the current epoch time. options.getEpochClock() gives the same value. Moving them now changes nothing that is sent, and it shrinks what v9 has to change when it removes ICurrentDateProvider (#6506).
Call sites
AnrV2IntegrationandTombstoneIntegrationpass the provider toApplicationExitInfoHistoryDispatcher, which computes the 90-day cutoff forApplicationExitInfotimestamps.MemoryLimiterIntegrationpasses it to the same dispatcher.SentryOkHttpInterceptorandSentryOkHttpEventstampHTTP_START_TIMESTAMPandHTTP_END_TIMESTAMPfor replay network details.
Each one compares against or sends an epoch instant, so each has to stay on the wall clock. EpochClock is the wall clock. On Android it reads System.currentTimeMillis(). On Java 9+ it reads Instant, which gives the same millisecond.
None of this is public API. The integrations' constructors that take an ICurrentDateProvider are package-private and only used by tests.
Out of scope
LifecycleWatcher: already moved on9.x.xby fix(android): Decide session rotation on a monotonic clock (JAVA-573) #6096. Changing it on main would only cause a conflict.RateLimiterandReplayIntegration: theirICurrentDateProviderconstructors are public API, so they change in v9 (Breaking clock changes for v9: span timing and ICurrentDateProvider removal #6506).DebouncerandAndroidEnvelopeCache: Clean up the remaining AndroidCurrentDateProvider usages #6104.- The replay capture strategies: Session Replay segment, buffer and gesture timestamps read the wall clock #6522.
Done when
- None of the call sites above references
CurrentDateProvider. - Tests inject a fake
EpochClock. - No
.apidiff and no changelog entry, because nothing users can see changes.
Agent notes
Verified on main at 812682636b (2026-11-12).
AnrV2Integration.java:56(default ctor),:59-60(test ctor),:91(dispatcher).TombstoneIntegration.java:60,:63-64,:100.MemoryLimiterIntegration.java:96,:100-102,:152.ApplicationExitInfoHistoryDispatcher.java:60(ctor param),:66(threshold = now - NINETY_DAYS_THRESHOLD).sentry-okhttp:SentryOkHttpEvent.kt:54,:180;SentryOkHttpInterceptor.kt:112(breadcrumb start),:272.EpochClock.now()returns aTimestamp; convert withTimeUnit.NANOSECONDS.toMillis(now.epochNanos()), the wayLifecycleWatcherdoes on9.x.x.- Reduces the
@SuppressWarnings("deprecation")count for the deprecation ticket in this project, so land this first if both are in flight.
Activity
linear-code commentedon Nov 12, 2026
JAVA-836