Are there any viable approaches to dealing with data coming from devices with unreliable clocks?
We have a database system running on a central server. The latest addition to the system is a bunch of mobile barcode scanners running Android. We are creating a specific app and the devices will be completely locked down so the user may only interact with this app (so no access to any settings).
Overall it's very simple, the devices will connect using an ethernet dock and download a list of items to move along with their destinations. The user scans the items at the destination and collects a signature for delivery. Once connected to the dock, the location of any delivered items will be updated, along with the signature and timestamp of the move.
The plan was that the app would set the device clock from the server time whenever it was connected to the dock. Unfortunately, Android does not allow apps to set the time (the SET_TIME
permission is only allowed for system apps). Additionally, the network is incredibly locked down, so we can't rely on the built-in synchronisation, and the devices only have a network connection when docked in the ethernet cradle anyway.
So, given that the devices may have arbitrarily incorrect clocks, is there any way we can correct for this when the data is uploaded? It would be possible to keep a log on the server of the clock for each device whenever it is connected.
In many ways this problem could apply to any offline-capable application. What do you do with time-related data from a device with an unreliable or untrusted clock?
It's not too difficult to correct a consistently-incorrect time, but it seems completely impossible if you consider that the device may lose time completely if the battery goes flat. A similar problem arises for an untrusted device - if the user may change the clock arbitrarily.
Has any research been done on this problem?