/* Ċ Ġ* ĠCopyright ĠÂ© Ġ 2 0 2 0 ĠN HS X . ĠAll Ġrights Ġreserved . Ċ Ġ*/ Ċ Ċ package Ġuk . n hs . n hs x . covid 1 9 . android . app . test helpers Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . content . res . Configuration Ċ import Ġandroid . content . res . Resources Ċ import Ġandroidx . annotation . String Res Ċ import Ġandroidx . core . app . Notification Manager Compat Ċ import Ġandroidx . core . content . edit Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . Transform ations . distinct Until Changed Ċ import Ġandroidx . test . core . app . Application Provider Ċ import Ġandroidx . test . platform . app . Instrumentation Registry Ċ import Ġandroidx . test . uia utom ator . Ui Device Ċ import Ġandroidx . work . Work Manager Ċ import Ġcom . google . android . gms . near by . ex posure notification . Exposure Notification Client Ċ import Ġcom . j ero en m ols . feature flag . framework . Feature Flag TestHelper Ċ import Ġcom . t inder . StateMachine Ċ import Ġkotlinx . coroutines . test . Test Coroutine Scope Ċ import Ġuk . n hs . covid 1 9 . config . Configurations Ċ import Ġuk . n hs . covid 1 9 . config . Signature Key Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . Exposure Application Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . Mock ApiResponse Type . ALWAYS _ FAIL Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . Mock ApiResponse Type . ALWAYS _ SU CCE ED Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . battery . Battery Optimization Checker Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . common . Periodic Task Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . common . Periodic Tasks Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . di . Mock Api Module Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . di . module . App Module Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . di . module . Network Module Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . ex posure . Mock Exposure Notification Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . ex posure . en counter . Exposure Notification Broadcast Receiver Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . ex posure . en counter . Mock Random Non R is ky Exposure Windows Limiter Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . flow . analytics . await Success Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . package manager . Mock PackageManager Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . payment . Isolation Payment Token State Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . permissions . Mock Permissions Manager Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . qrcode . Mock Barcode Detector Builder Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . qrcode . ris ky ven ues . Download And Process R is ky Ven ues Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . qrcode . ris ky ven ues . Vis ited Ven ues Storage Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . receiver . Availability State Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . receiver . Availability State . DISABLED Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . receiver . Availability State . ENABLED Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . receiver . Availability State Provider Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . Mock Analytics Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . Mock Ep ide mio logy Data Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . Mock Isolation Payment Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . Mock Keys Submission Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . Mock Local Messages Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . Mock Questionnaire Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . Mock R is ky Ven ues Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . Mock V iro logy Testing Api Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . additional Intercept ors Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . remote . data . App Availability Response Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . state . Event Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . state . Isolation Logical State Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . state . Isolation State Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . state . Isolation StateMachine Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . state . Migrate Isolation State Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . state . Side Effect Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . status . Date Change Broadcast Receiver Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . test ordering . Download V iro logy TestResult Work Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Android Strong Box Support Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Encrypted SharedPreferences Utils Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Encrypted Storage Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Encryption Utils Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Mock UUID Generator Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Shared Prefs Delegate Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Single Live Event Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Strong Box Migration Retry Checker Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . Strong Box Migration Retry Storage Ċ import Ġuk . n hs . n hs x . covid 1 9 . android . app . util . get Private Property Ċ import Ġjava . time . Clock Ċ import Ġjava . time . Instant Ċ import Ġjava . time . LocalDate Ċ import Ġjava . time . Zone Id Ċ import Ġjava . time . Zone Offset Ċ import Ġjava . util . Locale Ċ import Ġjava . util . concurrent . atomic . Atomic Reference Ċ Ċ const Ġval ĠA WAIT _ AT _ MO ST _ SECONDS : ĠLong Ġ= Ġ 1 0 Ċ Ċ class ĠTest ApplicationContext Ġ{ ĊĊĠĠĠ Ġval Ġapp : ĠEx posure Application Ġ= ĠApplication Provider . getApplicationContext () ĊĠĠĠ Ġval Ġris ky Ven ues Api Ġ= ĠMock R is ky Ven ues Api () ĊĊĠĠĠ Ġval Ġclock Ġ= ĠMock Clock () ĊĊĠĠĠ Ġval Ġvi ro logy Testing Api Ġ= ĠMock V iro logy Testing Api ( clock ) ĊĊĠĠĠ Ġval Ġisolation Payment Api Ġ= ĠMock Isolation Payment Api () ĊĊĠĠĠ Ġval Ġquestion naire Api Ġ= ĠMock Questionnaire Api () ĊĊĠĠĠ Ġval Ġkeys Submission Api Ġ= ĠMock Keys Submission Api () ĊĊĠĠĠ Ġval Ġanalytics Api Ġ= ĠMock Analytics Api () ĊĊĠĠĠ Ġval Ġlocal Messages Api Ġ= ĠMock Local Messages Api () ĊĊĠĠĠ Ġval Ġupdate Manager Ġ= ĠTest Update Manager () ĊĊĠĠĠ Ġval Ġpermissions Manager Ġ= ĠMock Permissions Manager () ĊĊĠĠĠ Ġval Ġpackage Manager Ġ= ĠMock PackageManager () ĊĊĠĠĠ Ġval Ġbarcode Detector Provider Ġ= ĠMock Barcode Detector Builder () ĊĊĠĠĠ Ġval Ġep ide mio logy Data Api Ġ= ĠMock Ep ide mio logy Data Api () ĊĊĠĠĠ Ġval Ġrandom Non R is ky Exposure Windows Limiter Ġ= ĠMock Random Non R is ky Exposure Windows Limiter () ĊĊĠĠĠ Ġval Ġuuid Generator Ġ= ĠMock UUID Generator () ĊĊĠĠĠ Ġinternal Ġval Ġdevice Ġ= ĠUi Device . getInstance ( Instrumentation Registry . get Instrumentation ()) ĊĊĠĠĠ Ġprivate Ġval Ġexposure Notification Api Ġ= ĠMock Exposure Notification Api ( app , Ġclock , Ġsimulate Google EN Ġ= Ġfalse ) ĊĊĠĠĠ Ġprivate Ġval Ġbluetooth State Provider Ġ= ĠTest Bluetooth State Provider () ĊĊĠĠĠ Ġprivate Ġval Ġlocation State Provider Ġ= ĠTest Location State Provider () ĊĊĠĠĠ Ġprivate Ġval Ġbattery Optimization Checker Ġ= ĠTest Battery Optimization Checker () ĊĊĠĠĠ Ġprivate Ġval Ġencryption Utils Ġ= ĠEncryption Utils ( Android Strong Box Support ) ĊĠĠĠ Ġprivate Ġval Ġencrypted SharedPreferences Utils Ġ= ĠEn crypted SharedPreferences Utils ( encryption Utils ) ĊĠĠĠ Ġinternal Ġval Ġencrypted Storage Ġ= ĠEn crypted Storage . from ( ĊĠĠĠĠĠĠĠ Ġapp , ĊĠĠĠĠĠĠĠ ĠStr ong Box Migration Retry Checker ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStr ong Box Migration Retry Storage ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġencrypted SharedPreferences Utils . create Generic Encrypted SharedPreferences ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġapp , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġencryption Utils . getDefault Master Key (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠShared Prefs Delegate . migration SharedPreferences FileName ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ), ĊĠĠĠĠĠĠĠ Ġencryption Utils ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġval Ġsignature Key Ġ= ĠSignature Key ( ĊĠĠĠĠĠĠĠ Ġid Ġ= Ġ" 3 ", ĊĠĠĠĠĠĠĠ Ġpem Representation Ġ= ĊĠĠĠĠĠĠĠ Ġ""" ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ----- BEGIN ĠPUBLIC ĠKEY ----- ĊĠĠĠĠĠĠĠĠĠĠĠ ĠMF kw E wY HK o Z Iz j 0 CA QY IK o Z Iz j 0 DA Qc DQ g A EE Vs / o 5 + u Qb T j L 3 ch yn L 4 w Xg Ug 2 R 9 ĊĠĠĠĠĠĠĠĠĠĠĠ Ġq 9 UU 8 I 5 m E ov Uf 8 6 Q Z 7 k OB Ij J wq nz D 1 om age E HW w Hd BO 6 B + d Fab md T 9 PO xg == ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ----- END ĠPUBLIC ĠKEY ----- ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ""" . trim Indent () ĊĠĠĠ Ġ) ĊĊĠĠĠ Ġprivate Ġval Ġcomponent : ĠTest App Component Ġ= ĠD agger Test App Component . builder () ĊĠĠĠĠĠĠĠ Ġ. app Module ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠApp Module ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġapp , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġapplication Scope Ġ= ĠTest Coroutine Scope (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġexposure Notification Api , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġbluetooth State Provider , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlocation State Provider , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġencrypted Storage . shared Preferences , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġencrypted Storage . encrypted File , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsignature Key , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġupdate Manager , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġbattery Optimization Checker , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpermissions Manager , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpackage Manager , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġbarcode Detector Provider , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġrandom Non R is ky Exposure Windows Limiter , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuuid Generator , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclock , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠDate Change Broadcast Receiver () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. network Module ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠNetwork Module ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠConfigur ations . qa , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġadditional Intercept ors ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. managed Api Module ( ĊĠĠĠĠĠĠĠĠĠĠĠ ĠManaged Api Module ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġris ky Ven ues Api , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġvi ro logy Testing Api , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġquestion naire Api , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġisolation Payment Api , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġkeys Submission Api , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġanalytics Api , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġep ide mio logy Data Api , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġlocal Messages Api ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġapp . app Component Ġ= Ġcomponent ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġclose Notification Panel () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġit Ġ= ĠIntent ( Intent . ACTION _ CLOSE _ SYSTEM _ DI AL O GS ) ĊĠĠĠĠĠĠĠ Ġapp . base Context . send Broadcast ( it ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġreset ( reset Locale : ĠBoolean Ġ= Ġtrue ) Ġ{ ĊĠĠĠĠĠĠĠ ĠWork Manager . getInstance ( app ). cancel All Work () ĊĊĠĠĠĠĠĠĠ Ġencrypted Storage . shared Preferences . edit ( commit Ġ= Ġtrue ) Ġ{ Ġclear () Ġ} ĊĊĠĠĠĠĠĠĠ Ġset Exposure Notifications Enabled ( true ) ĊĠĠĠĠĠĠĠ Ġexposure Notification Api . set Device Supports Location less Sc anning ( false ) ĊĠĠĠĠĠĠĠ Ġset On boarding Completed ( true ) ĊĠĠĠĠĠĠĠ Ġset Bluetooth Enabled ( true ) ĊĠĠĠĠĠĠĠ Ġset Location Enabled ( true ) ĊĠĠĠĠĠĠĠ Ġset Policy Update Accepted ( true ) ĊĠĠĠĠĠĠĠ ĠFeature Flag TestHelper . clear Feature Flags () ĊĠĠĠĠĠĠĠ Ġhide Notifications () ĊĠĠĠĠĠĠĠ Ġclose Notification Panel () ĊĊĠĠĠĠĠĠĠ Ġif Ġ( reset Locale ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Locale (" en ") ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġcomponent . provide Isolation StateMachine (). reset () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġhide Notifications () Ġ{ ĊĠĠĠĠĠĠĠ ĠNotification Manager Compat . from ( app ). cancel All () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Bluetooth Enabled ( isEnabled : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbluetooth State Provider . bluetooth State Mutable . post Value ( if Ġ( isEnabled ) ĠENABLE D Ġelse ĠDISABLE D ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Location Enabled ( isEnabled : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlocation State Provider . location State Mutable . post Value ( if Ġ( isEnabled ) ĠENABLE D Ġelse ĠDISABLE D ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Exposure Notifications Enabled ( isEnabled : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġexposure Notification Api . setEnabled ( isEnabled ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Exposure Notification Api (): ĠMock Exposure Notification Api Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġexposure Notification Api ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset PostCode ( post Code : ĠString ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġcomponent . getPost Code Provider (). value Ġ= Ġpost Code ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Local Authority ( local Authority : ĠString ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġcomponent . getLocal Authority Provider (). value Ġ= Ġlocal Authority ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Isolation Payment Token ( token : ĠString ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġcomponent . get Isolation Payment Token State Provider (). token State Ġ= Ġif Ġ( token Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠI sol ation Payment Token State . Token ( token ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠI sol ation Payment Token State . Un resolved ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Animations ( isEnabled : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcomponent . get Animations Provider (). in App Animation Enabled Ġ= Ġis Enabled ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Submit Analytics Alarm Controller () Ġ= Ġcomponent . get Submit Analytics Alarm Controller () ĊĊĠĠĠ Ġfun ĠgetUser Inbox () Ġ= Ġcomponent . getUser Inbox () ĊĊĠĠĠ Ġfun Ġget Un ack nowled ged Test Results Provider () Ġ= Ġcomponent . getUn ack nowled ged Test Results Provider () ĊĊĠĠĠ Ġfun Ġget Received Unknown TestResult Provider () Ġ= Ġcomponent . get Received Unknown TestResult Provider () ĊĊĠĠĠ Ġfun Ġget Re levant TestResult Provider () Ġ= Ġcomponent . get Re levant TestResult Provider () ĊĊĠĠĠ Ġfun Ġget Test Ordering Tokens Provider () Ġ= Ġcomponent . getTest Ordering Tokens Provider () ĊĊĠĠĠ Ġfun ĠgetKey Sharing Info Provider () Ġ= Ġcomponent . getKey Sharing Info Provider () ĊĊĠĠĠ Ġfun ĠsetState ( state : ĠI sol ation State ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġref Ġ= Ġget Isolation StateMachine () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. state Machine ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. get Private Property < StateMachine < Isolation State , ĠEvent , ĠSide Effect >, ĠAtomic Reference < Isolation State >>( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ" state Ref " ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġref ?. set ( state ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Remaining Days In Isolation (): ĠInt Ġ= ĊĠĠĠĠĠĠĠ Ġget Isolation StateMachine (). remaining Days In Isolation (). toInt () ĊĊĠĠĠ Ġfun Ġget Isolation StateMachine (): ĠI sol ation StateMachine Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . provide Isolation StateMachine () ĊĊĠĠĠ Ġfun ĠgetCurrent State (): ĠI sol ation State Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . provide Isolation StateMachine (). read State () ĊĊĠĠĠ Ġfun ĠgetCurrent Logical State (): ĠI sol ation Logical State Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . provide Isolation StateMachine (). read Logical State () ĊĊĠĠĠ Ġfun Ġget Migrate Isolation State (): ĠMigrate Isolation State Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . provide Migrate Isolation State () ĊĊĠĠĠ Ġfun Ġget Exposure Circuit Breaker Info Provider () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . get Exposure Circuit Breaker Info Provider () ĊĊĠĠĠ Ġfun Ġget Vis ited Ven ues Storage (): ĠVis ited Ven ues Storage Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcomponent . provide Vis ited Ven ues Storage () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Download And Process R is ky Ven ues (): ĠDownload And Process R is ky Ven ues Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcomponent . get Download And Process R is ky Ven ues () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Download V iro logy TestResult Work (): ĠDownload V iro logy TestResult Work Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcomponent . get Download V iro logy TestResult Work () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġtemporary Exposure Key History Was Called () Ġ= ĊĠĠĠĠĠĠĠ Ġexposure Notification Api . temporary Exposure Key History Was Called () ĊĊĠĠĠ Ġfun Ġget Periodic Tasks (): ĠPeriod ic Tasks Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġcomponent . provide Periodic Tasks () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Display State Expiration Notification () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . provide Display State Expiration Notification () ĊĊĠĠĠ Ġfun Ġget Isolation Configuration Provider () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . get Isolation Configuration Provider () ĊĊĠĠĠ Ġfun Ġset Policy Update Accepted ( accepted : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcomponent . get Policy Update Storage (). value Ġ= Ġif Ġ( accepted ) ĠInt . MAX _ VALUE . toString () Ġelse Ġnull ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Locale ( language Code : ĠString ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġcomponent . provide Application Locale Provider (). language Code Ġ= Ġlanguage Code ĊĠĠĠĠĠĠĠ Ġupdate Resources () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Application Locale Provider () Ġ= Ġcomponent . provide Application Locale Provider () ĊĊĠĠĠ Ġprivate Ġfun Ġupdate Resources () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġlocale Ġ= Ġcomponent . provide Application Locale Provider (). getLocale () ĊĠĠĠĠĠĠĠ ĠLocale . setDefault ( locale ) ĊĠĠĠĠĠĠĠ Ġval Ġres : ĠResources Ġ= Ġapp . base Context . resources ĊĠĠĠĠĠĠĠ Ġval Ġconfig Ġ= ĠConfiguration ( res . configuration ) ĊĠĠĠĠĠĠĠ Ġconfig . locale Ġ= Ġlocale ĊĠĠĠĠĠĠĠ Ġres . update Configuration ( config , Ġres . display Metrics ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset On boarding Completed ( completed : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcomponent . provide On boarding Completed (). value Ġ= Ġcompleted ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset App Availability ( app Availability : ĠApp Availability Response ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcomponent . getApp Availability Provider (). app Availability Ġ= Ġapp Availability ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Ign oring Battery Optim izations ( ign oring Battery Optim izations : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbattery Optimization Checker . ign oring Battery Optim izations Ġ= Ġignoring Battery Optim izations ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Isolation Payment Token State Provider () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . get Isolation Payment Token State Provider () ĊĊĠĠĠ Ġfun ĠgetLast Vis ited Book Test Type Venue Date Provider () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . getLast Vis ited Book Test Type Venue Date Provider () ĊĊĠĠĠ Ġfun Ġget Alarm Manager () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . get Alarm Manager () ĊĊĠĠĠ Ġfun Ġget R is ky Venue Alert Provider () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . getR is ky Venue Alert Provider () ĊĊĠĠĠ Ġfun Ġget Should Show Encounter Detection Activity Provider () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . get Should Show Encounter Detection Activity Provider () ĊĊĠĠĠ Ġfun Ġget Local Messages Provider () Ġ= ĊĠĠĠĠĠĠĠ Ġcomponent . getLocal Messages Provider () ĊĊĠĠĠ Ġfun Ġexecute While Offline ( action : Ġ() Ġ-> ĠUnit ) Ġ{ ĊĠĠĠĠĠĠĠ ĠMock Api Module . be haviour . response Type Ġ= ĠAL WAYS _ FAIL ĊĠĠĠĠĠĠĠ Ġaction () ĊĠĠĠĠĠĠĠ ĠMock Api Module . be haviour . response Type Ġ= ĠAL WAYS _ SU CCE ED ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġrun Background Tasks () Ġ{ ĊĠĠĠĠĠĠĠ Ġget Periodic Tasks (). schedule () ĊĠĠĠĠĠĠĠ ĠWork Manager . getInstance ( app ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. get Work Infos For Unique Work LiveData ( Periodic Task . PERIOD IC _ TASK S . work Name ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. await Success () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsend Exposure State Updated Broadcast () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġintent Ġ= ĠIntent ( Exposure Notification Client . ACTION _ EX POS URE _ STATE _ UPDATED ) ĊĠĠĠĠĠĠĠ Ġval Ġbroadcast Receiver Ġ= ĠEx posure Notification Broadcast Receiver () ĊĠĠĠĠĠĠĠ Ġbroadcast Receiver . on Receive ( app , Ġintent ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġadvance Clock ( seconds To Advance : ĠLong ) Ġ{ ĊĠĠĠĠĠĠĠ Ġclock . current Instant Ġ= Ġclock . instant (). plus Seconds ( seconds To Advance ) ĊĠĠĠĠĠĠĠ ĠgetCurrent State () ĊĠĠĠĠĠĠĠ Ġrun Background Tasks () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġget Age Limit Before Encounter (): ĠLocalDate ? Ġ= Ġcomponent . get Age Limit Before Encounter (). invoke () ĊĊĠĠĠ Ġfun ĠgetLast D ose Date Limit (): ĠLocalDate ? Ġ= Ġcomponent . getLast D ose Date Limit (). invoke () ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠEN GL ISH _ LOCAL _ AUTH ORITY Ġ= Ġ" E 0 7 0 0 0 0 6 3 " ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠW EL SH _ LOCAL _ AUTH ORITY Ġ= Ġ" W 0 6 0 0 0 0 0 8 " ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠMock Clock ( var Ġcurrent Instant : ĠInstant ? Ġ= Ġnull ) Ġ: ĠClock () Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġinstant (): ĠInstant Ġ= Ġcurrent Instant Ġ?: ĠInstant . now () ĊĊĠĠĠ Ġoverride Ġfun Ġwith Zone ( zone : ĠZone Id ?): ĠClock Ġ= Ġthis ĊĊĠĠĠ Ġoverride Ġfun Ġget Zone (): ĠZone Id Ġ= ĠZone Offset . UTC ĊĊĠĠĠ Ġfun Ġreset () Ġ{ ĊĠĠĠĠĠĠĠ Ġcurrent Instant Ġ= Ġnull ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun Ġstring From Res Id (@ String Res Ġstring Res : ĠInt ): ĠString Ġ{ ĊĠĠĠ Ġval Ġresources Ġ= ĠApplication Provider . getApplicationContext < Exposure Application >(). resources ĊĠĠĠ Ġreturn Ġresources . getString ( string Res ) Ċ } Ċ Ċ class ĠTest Bluetooth State Provider Ġ: ĠAvailability State Provider Ġ{ ĊĠĠĠ Ġval Ġbluetooth State Mutable Ġ= ĠSingle Live Event < Availability State >() ĊĠĠĠ Ġoverride Ġval Ġavailability State : ĠLive Data < Availability State > Ġ= ĊĠĠĠĠĠĠĠ Ġdistinct Until Changed ( bluetooth State Mutable ) ĊĊĠĠĠ Ġoverride Ġfun Ġstart ( context : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbluetooth State Mutable . post Value ( bluetooth State Mutable . value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġstop ( context : ĠContext ) Ġ{ ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetState ( isDebug : ĠBoolean ): ĠAvailability State Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġbluetooth State Mutable . value !! ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠTest Location State Provider Ġ: ĠAvailability State Provider Ġ{ ĊĠĠĠ Ġval Ġlocation State Mutable Ġ= ĠMutable LiveData < Availability State >() ĊĠĠĠ Ġoverride Ġval Ġavailability State : ĠLive Data < Availability State > Ġ= ĊĠĠĠĠĠĠĠ Ġdistinct Until Changed ( location State Mutable ) ĊĊĠĠĠ Ġoverride Ġfun Ġstart ( context : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠ Ġlocation State Mutable . post Value ( location State Mutable . value ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġstop ( context : ĠContext ) Ġ{ ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetState ( isDebug : ĠBoolean ): ĠAvailability State Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġlocation State Mutable . value !! ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠTest Battery Optimization Checker Ġ: ĠB attery Optimization Checker Ġ{ ĊĊĠĠĠ Ġvar Ġignoring Battery Optim izations Ġ= Ġfalse ĊĊĠĠĠ Ġoverride Ġfun Ġis Ign oring Battery Optim izations (): ĠBoolean Ġ= ĊĠĠĠĠĠĠĠ Ġignoring Battery Optim izations Ċ } Ċ