package Ġcom . k ier on qu inn . app . classic power menu . ui . screens . setup . accessibility Ċ Ċ import Ġandroid . content . Component Name Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . provider . Settings Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġandroidx . lifecycle . viewModel Scope Ċ import Ġcom . k ier on qu inn . app . classic power menu . Build Config Ċ import Ġcom . k ier on qu inn . app . classic power menu . components . navigation . Container Navigation Ċ import Ġcom . k ier on qu inn . app . classic power menu . components . x posed . X posed Self Hook Ċ import Ġcom . k ier on qu inn . app . classic power menu . service . accessibility . CP MA c cess ibility Service Ċ import Ġcom . k ier on qu inn . app . classic power menu . utils . extensions . EXTRA _ FRAGMENT _ ARG _ KEY Ċ import Ġcom . k ier on qu inn . app . classic power menu . utils . extensions . EXTRA _ SHOW _ FRAGMENT _ ARGUMENT S Ċ import Ġcom . k ier on qu inn . app . classic power menu . utils . extensions . get Secure Setting AsString Flow Ċ import Ġcom . k ier on qu inn . app . classic power menu . utils . extensions . is Accessibility Service Enabled Ċ import Ġkotlinx . coroutines . flow .* Ċ import Ġkotlinx . coroutines . launch Ċ Ċ abstract Ġclass ĠSetup Accessibility ViewModel : ĠViewModel () Ġ{ ĊĊĠĠĠ Ġabstract Ġval Ġaccessibility Enabled : ĠFlow < Boolean > ĊĠĠĠ Ġabstract Ġfun Ġon Resume () ĊĠĠĠ Ġabstract Ġfun Ġon Enable Clicked () ĊĠĠĠ Ġabstract Ġfun Ġon Skip Clicked () ĊĠĠĠ Ġabstract Ġfun Ġon Back Pressed () Ċ Ċ } Ċ Ċ class ĠSetup Accessibility ViewModel Impl ( context : ĠContext , Ġprivate Ġval Ġcontainer Navigation : ĠContainer Navigation ): ĠSetup Accessibility ViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġresume Bus Ġ= ĠMutable Shared Flow < Unit >() ĊĠĠĠ Ġprivate Ġval Ġaccessibility Change Bus Ġ= Ġcontext . get Secure Setting AsString Flow ( Settings . Secure . ENABLED _ ACC ES SI B ILITY _ SERVICES ) ĊĊĠĠĠ Ġoverride Ġval Ġaccessibility Enabled Ġ= Ġcombine ( resume Bus , Ġaccessibility Change Bus ) Ġ{ Ġ_, Ġ_ Ġ-> ĊĠĠĠĠĠĠĠ Ġif ( X posed Self Hook (). is X posed Hook ed ()) Ġreturn @ combine Ġtrue ĊĠĠĠĠĠĠĠ Ġis Accessibility Service Enabled ( context , ĠCP MA c cess ibility Service :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġaccessibility Enabled . collect Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġif ( it ){ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġmove To Next () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġaccessibility Intent Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠIntent ( Settings . ACTION _ ACC ES SI B ILITY _ SETTINGS ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadd Flags ( Intent . FLAG _ ACTIVITY _ NEW _ TASK ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġbundle Ġ= ĠBundle () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġcomponent Name Ġ= ĠComponent Name ( Build Config . APPLICATION _ ID , ĠCP MA c cess ibility Service :: class . java . name ). flatten ToString () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbundle . putString ( EXTRA _ FRAGMENT _ ARG _ KEY , Ġcomponent Name ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra ( EXTRA _ FRAGMENT _ ARG _ KEY , Ġcomponent Name ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġput Extra ( EXTRA _ SHOW _ FRAGMENT _ ARGUMENT S , Ġbundle ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Enable Clicked () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontainer Navigation . navigate ( accessibility Intent ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Back Pressed () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontainer Navigation . navigate Back () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Skip Clicked () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmove To Next () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Resume () Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġresume Bus . emit ( Unit ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġsuspend Ġfun Ġmove To Next (){ ĊĠĠĠĠĠĠĠ Ġcontainer Navigation . navigate ( Setup Accessibility Fragment Directions . action Setup Accessibility Fragment To Setup Wallet Fragment ()) ĊĠĠĠ Ġ} Ċ Ċ }