You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clock.getDefault() effectively hardwires System.nanoTime(). On Android this ignores deep sleep, leading to incorrect elapsed-time semantics for features like timeouts and background durations. There’s no easy global way to swap the default clock per platform.
Expected behavior
The SDK should choose a platform-appropriate default clock and allow an explicit override:
JVM/server:System.nanoTime() is fine for monotonic elapsed durations.
Android: prefer SystemClock.elapsedRealtimeNanos() (includes deep sleep).
Actual behavior
Users cannot globally configure the default clock. Each component must be hand-wired (if possible), which is fragile and easy to miss.
Proposed change
Introduce a lightweight, platform-aware ClockProvider SPI with discovery (optimized for Android, similar in spirit to kotlinx.coroutines’ FastServiceLoader):