package Ġcom . google . k pi er ud z ki . driver assistant . history . calendar . use case Ċ Ċ import Ġcom . google . k pi er ud z ki . driver assistant . eco _ d riving . connector . IE co D riving Observable Ċ import Ġcom . google . k pi er ud z ki . driver assistant . geo _ samples . connector . IG eo Sample Observable Ċ import Ġcom . google . k pi er ud z ki . driver assistant . ob d . read . connector . I Ob d Read Observable Ċ import Ġcom . google . k pi er ud z ki . driver assistant . service . helper . Background Work Based Helper Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠK amil Ġon Ġ 2 2 . 0 2 . 2 0 1 8 . Ċ Ġ*/ Ċ class ĠSync Buffer UseCase ( ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġeco D riving G ps Observable : ĠIE co D riving Observable ?, ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġeco D riving Ob d Observable : ĠIE co D riving Observable ?, ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġob d Read Observable : ĠI Ob d Read Observable ?, ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġgeo Samples Observable : ĠI Geo Sample Observable ?) ĊĠĠĠ Ġ: ĠBackground Work Based Helper () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy () ĊĠĠĠĠĠĠĠ Ġeco D riving G ps Observable Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġeco D riving Ob d Observable Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġob d Read Observable Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġgeo Samples Observable Ġ= Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġpersist Buffers Sync ( callback : ĠSync Buffer Callback ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġbackground Handler ?. post ({ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġgeo Samples Observable ?. force Persist Buffer ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeco D riving G ps Observable ?. force Persist Buffer ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġeco D riving Ob d Observable ?. force Persist Buffer ( false ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġob d Read Observable ?. force Persist Buffer ( false ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġcallback ?. on Persist Finished () ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ } Ċ Ċ interface ĠSync Buffer Callback Ġ{ ĊĠĠĠ Ġfun Ġon Persist Finished (); Ċ }