A device can boot normally after months in storage and still fail every secure connection because its clock has returned to an old date. The display works, Ethernet has an address, and the server is reachable, yet certificates appear invalid.
Timekeeping is a system requirement for Android products. The RTC, backup supply, kernel driver, Android time policy, application timestamps, and service procedure all need to agree about what time means and how trustworthy it is.
Separate the clocks your software uses
Wall-clock time represents calendar time and can jump when corrected. Monotonic time measures elapsed duration and should be used for timeouts, retry intervals, and performance measurements.
An RTC preserves approximate calendar time while the main system is off. It does not guarantee that time is correct, and its output should be treated as uncertain after a depleted battery or oscillator fault.
Store timestamps with a clear convention, normally UTC, and apply time zones for display. Time zone changes and daylight-saving transitions should not reorder transactions or change elapsed-time calculations.
| Clock or value | Use | Main risk |
|---|---|---|
| RTC calendar time | Startup estimate after power loss | Drift or lost backup power |
| Android wall clock | Human dates and event timestamps | Correction can jump forward or backward |
| Monotonic elapsed time | Deadlines and durations | Does not provide calendar date |
| Server timestamp | Shared ordering and reconciliation | Requires connectivity and trusted server |
| Event sequence number | Local ordering across uncertain time | Must be persisted consistently |
Specify off-time and allowable drift
Define the longest expected unpowered period, storage temperature, service interval, and maximum acceptable clock error. A panel that is never off for more than a weekend differs from a spare unit stored for three years.
Oscillator error is often expressed in parts per million. As an illustration, 20 ppm corresponds to roughly 1.7 seconds per day before temperature, aging, and calibration effects are considered. That can accumulate into minutes during a long disconnected period.
Use the selected RTC’s specified behavior across temperature and voltage. A room-temperature nominal figure is not a field guarantee.
If precise timestamps are important, plan regular correction and record when the last trustworthy synchronization occurred. The application can then report both event time and confidence.
Choose the backup source deliberately
Coin cells, rechargeable cells, and supercapacitors have different life, leakage, service, and safety characteristics. Match the RTC’s backup input and charging circuit to the selected chemistry.
Do not connect a nonrechargeable cell to a charging path. Review the schematic, component options, and assembly instructions so a battery substitution cannot create an incompatible combination.
Calculate backup life using RTC current plus board leakage, protection components, contamination effects, and battery self-discharge. Very low RTC current does not help if another circuit leaks through the backup rail.
| Backup choice | Strength | Design concern |
|---|---|---|
| Primary coin cell | Long off-time with low load | Replacement access and no charging |
| Rechargeable cell | Repeated recharge capability | Correct charge profile and aging |
| Supercapacitor | Many charge cycles | Leakage and limited long off-time |
| No backup source | Lower BOM | Startup time depends on another source |
Measure backup current on populated boards. Flux residue, alternate components, and test equipment can change the result. Document the measurement method and instrument loading.
Validate the RTC hardware and driver
Confirm address, bus pull-ups, interrupt wiring, oscillator requirements, backup switchover, and register interpretation. Check whether the device exposes an oscillator-stop or invalid-time flag.
The driver should preserve useful validity information rather than presenting an obviously wrong date as trustworthy. Test reading and setting time across the supported calendar range.
Verify startup ordering. The kernel may initialize system time from an RTC before Android’s automatic time service applies another source. Record which RTC is selected when the platform exposes more than one.
Test alarm wake separately from basic time retention. A clock that keeps time does not prove its interrupt reaches the wake controller in the selected low-power state.
Review Android time-source policy
Android can receive time suggestions from supported network or telephony paths, depending on version and product configuration. The priority is configurable in the platform, so inspect the shipped BSP rather than assuming a universal order.
A network connection does not mean time has already synchronized. Applications that immediately open TLS sessions after boot must handle the period before trustworthy time is available.
Do not bypass certificate validation to work around a bad clock. Repair startup time acquisition and provide a controlled error state.
The network failover guide explains why connectivity and service readiness are separate states. Time readiness belongs in that same application model.
Handle clock corrections without corrupting records
Wall time can move backward. A database key based only on the current second can collide, and a retry timer based on calendar time can wait too long or fire repeatedly.
Use unique identifiers and monotonic deadlines. For audit records, retain local sequence, boot identifier, event timestamp, and synchronization status where the business requirement warrants it.
When the device reconnects, reconcile using stable identifiers rather than assuming the oldest timestamp is always the oldest event. A queue created with a wrong clock may otherwise be replayed in a misleading order.
Keep operator time changes restricted and logged. A service technician may need to correct the clock, but that action should not silently rewrite historical records.
Test the uncomfortable transitions
Remove main power while preserving backup, then remove both on a sacrificial unit. Test a weak battery, a disconnected holder, cold startup, long storage simulation, and network unavailability.
Verify that the product detects invalid time and returns to useful operation after synchronization. A prominent service warning is better than unexplained cloud failures.
| Test | Expected result | Record |
|---|---|---|
| Main power removed | RTC continues within drift limit | Before/after reference time |
| Backup depleted | Invalid time is detected | Status flags and UI behavior |
| Network unavailable | Defined offline operation | Time confidence and queue behavior |
| Large correction | No broken timeout or duplicate ID | Event ordering and timer behavior |
| Time zone changed | Display changes only as intended | Stored UTC and user display |
| Alarm wake | Correct wake and resume | Interrupt and power-state trace |
Include the shipping and warehouse process. An insulating battery tab can preserve shelf life, but the factory must verify its removal or activation at the intended stage.
Build a service policy
Specify battery replacement interval from evidence and environment, not just nominal capacity. Provide access, polarity marking, approved part number, and a post-replacement time check.
If the enclosure is sealed, decide whether battery life matches the product life or whether replacement requires a service procedure and seal renewal.
Monitor invalid-time events and repeated large corrections across the fleet. They can reveal battery problems, temperature sensitivity, or incorrect platform configuration.
Connect the record to lifecycle planning so an RTC or battery substitution triggers the relevant regression tests.
Frequently asked questions
Does Android need an RTC if it has Internet access?
Many products benefit from one because certificates, logs, and local operations begin before network time is available. The requirement depends on startup and offline behavior.
Can RTC time be used for retry deadlines?
Use a monotonic clock for elapsed-time deadlines. Calendar time can be corrected and can move backward or forward.
How long will a coin cell last?
That depends on capacity, self-discharge, temperature, RTC current, board leakage, and service conditions. Measure the complete backup circuit and apply conservative assumptions.
Release record
Keep the RTC part, oscillator, backup source, measured current, drift evidence, driver behavior, Android policy, and service procedure together. A reliable clock makes failures easier to diagnose and prevents time uncertainty from becoming a network or transaction fault.
