package Ġuk . n hs . n hs x . covid 1 9 . android . app . ex posure . en counter Ċ Ċ import Ġandroid . content . Broadcast Receiver Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġcom . google . android . gms . near by . ex posure notification . Exposure Notification Client Ċ import Ġtim ber . log . Tim ber Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . app Component Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . state . Isolation StateMachine Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠEx posure Notification Broadcast Receiver Ġ: ĠBroadcast Receiver () Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġexposure Notification Worker Scheduler : ĠEx posure Notification Worker Scheduler ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġisolation StateMachine : ĠI sol ation StateMachine ĊĊĠĠĠ Ġoverride Ġfun Ġon Receive ( context : ĠContext , Ġintent : ĠIntent ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcontext . app Component . inject ( this ) ĊĊĠĠĠĠĠĠĠ Ġval Ġaction Ġ= Ġintent . action ĊĠĠĠĠĠĠĠ ĠTim ber . d (" on Receive : Ġaction Ġ= Ġ$ action ") ĊĠĠĠĠĠĠĠ Ġval Ġinterested In Exposure Notifications Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġisolation StateMachine . is Inter ested In Exposure Notifications () ĊĠĠĠĠĠĠĠ Ġif Ġ( action Ġ== ĠEx posure Notification Client . ACTION _ EX POS URE _ STATE _ UPDATED ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ( inter ested In Exposure Notifications ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġexposure Notification Worker Scheduler . schedule Process New Exposure ( context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġexposure Notification Worker Scheduler . schedule No Matches Found ( context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġif Ġ( action Ġ== ĠEx posure Notification Client . ACTION _ EX POS URE _ NOT _ FOUND ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġexposure Notification Worker Scheduler . schedule No Matches Found ( context ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ