package Ġcom . cer ist . summer . virtual assistant . ViewModels Ċ Ċ import Ġai . api . model . AI Context Ċ import Ġcom . cer ist . summer . virtual assistant . Utils . Data . Status Ċ import Ġandroid . arch . lifecycle . LiveData Ċ import Ġandroid . arch . lifecycle . Mutable LiveData Ċ import Ġandroid . arch . lifecycle . ViewModel Ċ import Ġandroid . util . Log Ċ import Ġcom . cer ist . summer . virtual assistant . Repositories . Dialog Repository Ċ import Ġcom . cer ist . summer . virtual assistant . Utils . Data . Response Parameters Listing Ċ import Ġio . reactivex . dis pos ables . Composite Disposable Ċ Ċ class ĠDialog ViewModel ( private Ġval Ġm Dialog Repository : ĠDialog Repository ): ViewModel (){ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġval ĠTAG Ġ= Ġ" Dialog ViewModel " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġm Dialog Contexts : ĠMutable LiveData < List < AI Context >> Ġ= ĠMutable LiveData () ĊĠĠĠ Ġprivate Ġval Ġm Text Response : ĠMutable LiveData < String > Ġ= ĠMutable LiveData () ĊĠĠĠ Ġprivate Ġval Ġm Dialog Error Status : Mutable LiveData < String > Ġ= ĠMutable LiveData () ĊĊĊĠĠĠ Ġprivate Ġval Ġm Device Power State Set Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĠĠĠ Ġprivate Ġval Ġm Device Power State Check Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĊĠĠĠ Ġprivate Ġval Ġm Device Brightness Set Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĠĠĠ Ġprivate Ġval Ġm Device Brightness Check Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĊĠĠĠ Ġprivate Ġval Ġm Device Mode Set Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĠĠĠ Ġprivate Ġval Ġm Device Mode Check Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĊĠĠĠ Ġprivate Ġval Ġm Device Volume Set Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĠĠĠ Ġprivate Ġval Ġm Device Volume Check Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĊĠĠĠ Ġprivate Ġval Ġm Device Timer Set Action : Mutable LiveData < Response Parameters Listing > Ġ= ĠMutable LiveData () ĊĊĊĊĊĠĠĠ Ġprivate Ġval Ġcomposite Disposable Ġ= ĠComposite Disposable () ĊĊĠĠĠ Ġinit Ġ{ ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . dialog Text Response . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Text Response :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . dialog Contexts . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Contexts :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . dialog Status . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ{}, { ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ})) ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Power State Set Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Power State Set Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Power State Check Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Power State Check Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Brightness Set Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Brightness Set Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Brightness Check Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Brightness Check Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Mode Set Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Mode Set Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Mode Check Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Mode Check Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Volume Set Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Volume Set Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Volume Check Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Volume Check Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Timer Set Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Timer Set Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcomposite Disposable . add ( m Dialog Repository . device Timer Disable Action . subscribe ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Device Timer Set Action :: post Value ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Dialog Error Status . post Value ( Status . OPERATION _ ERROR ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun ĠgetText Response (): LiveData < String > Ġ= Ġm Text Response ĊĠĠĠ Ġfun Ġget Dialog Context (): LiveData < List < AI Context >> Ġ= Ġm Dialog Contexts ĊĠĠĠ Ġfun Ġget Dialog Error Status (): LiveData < String > Ġ= Ġm Dialog Error Status ĊĊĠĠĠ Ġfun Ġget Device Power State Set Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Power State Set Action ĊĠĠĠ Ġfun Ġget Device Power State Check Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Power State Check Action ĊĊĠĠĠ Ġfun Ġget Device Brightness Set Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Brightness Set Action ĊĠĠĠ Ġfun Ġget Device Brightness Check Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Brightness Check Action ĊĊĠĠĠ Ġfun Ġget Device Mode Set Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Mode Set Action ĊĠĠĠ Ġfun Ġget Device Mode Check Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Mode Check Action ĊĊĠĠĠ Ġfun Ġget Device Volume Set Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Volume Set Action ĊĠĠĠ Ġfun Ġget Device Volume Check Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Volume Check Action ĊĊĠĠĠ Ġfun Ġget Device Timer Set Action (): LiveData < Response Parameters Listing > Ġ= Ġm Device Timer Set Action ĊĊĊĊĠĠĠ Ġfun Ġset Dialog Text Request ( text : String ){ ĊĠĠĠĠĠĠĠ ĠLog . d ( TAG ," set Dialog Text Request Ġ$ text ") ĊĠĠĠĠĠĠĠ Ġm Dialog Repository . dialog Text Request . onNext ( text ) ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Cle ared () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Cle ared () ĊĠĠĠĠĠĠĠ Ġcomposite Disposable . clear () ĊĠĠĠ Ġ} ĊĊ Ċ }