I want to design an offline payment method where the user can use the app for duration of the payment only. I want the payment duration to be reliable even though the user changes their phones time/date.
I've tried using AlarmManager to periodically update remaining payment counter. But this doesn't work when the user sets the date to the past, I've tried to listen to DATE_CHANGE broadcast. But that also doesn't get broadcast when the date is set to the past.
I want to know what is the right way of implementing this type of functionality. Any advice is highly appreciated.
edit 1
The app is designed for places that don't have reliable internet. So most of the time, the app is used offline. So, I can't assume there will be internet connection to check the correct time.
edit 2