package Ġcom . example . crypto assets . core . task Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . AsyncTask Ċ import Ġcom . example . crypto assets . R Ċ import Ġcom . example . crypto assets . core . model . ent idade . C ot acao Ċ import Ġcom . example . crypto assets . core . exception . Con ex ao Des abil it ada Exception Ċ import Ġcom . example . crypto assets . core . exception . F al ha Con ex ao Exception Ċ import Ġcom . example . crypto assets . core . repository . C ot acao Repository Ċ import Ġcom . example . crypto assets . core . inter actor . listener . On Bus car C ot acao Ċ import Ġcom . example . crypto assets . util . Resource Utils Ċ import Ġjava . util .* Ċ Ċ class ĠBus ca C ot acao AsyncTask ( private Ġval Ġcontext : ĠContext , Ġprivate Ġval Ġc ot acao Repository : ĠC ot acao Repository , Ġprivate Ġval Ġlistener : ĠOn Bus car C ot acao ) Ġ: ĠAsync Task < Void , ĠVoid , ĠList < C ot acao >>() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġon Pre Execute () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Pre Execute () ĊĠĠĠĠĠĠĠ Ġlistener . on Pre Execute () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Post Execute ( result : ĠList < C ot acao >) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Post Execute ( result ) ĊĠĠĠĠĠĠĠ Ġlistener . on Post Execute ( result ) ĊĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġoverride Ġfun Ġdo In Background ( var arg Ġparams : ĠVoid ?): ĠList < C ot acao > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtry { ĊĠĠĠĠĠĠĠĠĠĠĠ Ġc ot acao Repository . cot acoes (). to Mutable List () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġcatch ( cd : ĠCon ex ao Des abil it ada Exception ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlistener . onError Connection ( Resource Utils . getString ( context , ĠR . string . no Internet Permission Warning ) !! ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠCollections . emptyList < C ot acao >() ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġcatch ( fc : ĠF al ha Con ex ao Exception ){ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlistener . onError Bus car C ot acao ( Resource Utils . getString ( context , ĠR . string . cant Connect To Host ) !! ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠCollections . emptyList < C ot acao >() ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊ Ċ }