package Ġcom . k yle cor ry . health sense . steps . infrastructure Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . hardware . Sensor Ċ import Ġandroid . hardware . Sensor Event Ċ import Ġandroid . hardware . Sensor Manager Ċ import Ġcom . k yle cor ry . tr ails ense core . infrastructure . sensors . Base Sensor Ċ Ċ class ĠPed ometer ( context : ĠContext ): ĠBase Sensor ( context , ĠSensor . TYPE _ STEP _ COUNTER , ĠSensor Manager . SENSOR _ DELAY _ FAST EST ) Ġ{ ĊĊĠĠĠ Ġval Ġsteps : ĠInt ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ steps ĊĠĠĠ Ġprivate Ġvar Ġ_ steps Ġ= Ġ 0 ĊĊĠĠĠ Ġprivate Ġvar Ġ_ has Reading Ġ= Ġfalse ĊĊĠĠĠ Ġoverride Ġval Ġhas Valid Reading : ĠBoolean ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġ_ has Reading ĊĊĠĠĠ Ġoverride Ġfun Ġhandle Sensor Event ( event : ĠSensor Event ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ steps Ġ= Ġevent . values [ 0 ]. toInt () ĊĠĠĠĠĠĠĠ Ġ_ has Reading Ġ= Ġtrue ĊĠĠĠ Ġ} Ċ }