add a minimum delay between two sync
When a Scan start. Register timestamp in pref. At each start of ScannerService. Get last timestamp saved in pref and check if a minimum time has passed. Gaël talk of around 5 minutes as minimum delay
- add minimum delay as static variable in ObserverService
- add sharedPref key for last sync time storing in AppConstants
- save last time (in ms) at end of last operation that should be performed.
- Load last time (from above) in onStartCommand of ObserverService to check if minimum delay is respected
also add a check that OMS isn't running.
send operation to OMS at end of ObserverService run.
- via Intent ? It will require to implement Parcelable interface in Operation and maybe in SyncedFileState [Yes]
via DB ? a db with just two column: id of sync file state and operation to perform. via file ?
- Remove binding of OMS in ObserverService
- Remove method to allow binding of OMS
Read operation to perform (in OMS)
- via Extra bundle send in intent ?
via DB ?
- send operation to OMS at end of ObserverService run.
- Save a pref key in OMS at start and remove it at end
- Correct method to get Timestamp ?
- Should I get Timestamp at end of ObserverService if nothing to sync has been found ?
- Should I transform OMS into intentService ?
in onStartCommand of ObserverService start by checking : if (diff between (current time & last sync end time) < mini delay) OR ObserverService is working OR OMS is working)
Then stop and return;