package Ġcom . ray w ender lich . android . run tracking Ċ Ċ import Ġandroidx . annotation . Worker Thread Ċ import Ġandroidx . lifecycle . as LiveData Ċ Ċ class ĠTracking Repository ( private Ġval Ġtracking Dao : ĠTracking Dao ) Ġ{ ĊĠ Ġval Ġall Tracking Entities Ġ= Ġtracking Dao . getAll Tracking Entities () ĊĠ Ġval Ġlast Tracking Entity Ġ= Ġtracking Dao . getLast Tracking Entity () ĊĠ Ġval Ġtotal Distance Travel led Ġ= Ġtracking Dao . getTotal Distance Travel led () ĊĊĠ Ġ@ Suppress (" Red undant Suspend Modifier ") ĊĠ Ġ@ Worker Thread ĊĠ Ġsuspend Ġfun ĠgetLast Tracking Entity Record () Ġ= Ġtracking Dao . getLast Tracking Entity Record () ĊĊĠ Ġ@ Suppress (" Red undant Suspend Modifier ") ĊĠ Ġ@ Worker Thread ĊĠ Ġsuspend Ġfun Ġinsert ( tracking Entity : ĠTracking Entity ) Ġ{ ĊĠĠĠ Ġtracking Dao . insert ( tracking Entity ) ĊĠ Ġ} ĊĊĠ Ġ@ Suppress (" Red undant Suspend Modifier ") ĊĠ Ġ@ Worker Thread ĊĠ Ġsuspend Ġfun Ġdelete All () Ġ{ ĊĠĠĠ Ġtracking Dao . delete All () ĊĠ Ġ} Ċ }