package Ġde . r ki . cor on aw arn app . app config Ċ Ċ import Ġandroid . content . Context Ċ import Ġdagger . Module Ċ import Ġdagger . Provides Ċ import Ġde . r ki . cor on aw arn app . app config . download . AppConfig Api V 2 Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . Analytics Config Mapper Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . C WA Config Mapper Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . Cor ona Test Config Mapper Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . Exposure Detection Config Mapper Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . Exposure Window Risk Calculation Config Mapper Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . Key Download Parameters Mapper Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . Log Upload Config Mapper Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . Presence Tracing Config Mapper Ċ import Ġde . r ki . cor on aw arn app . app config . mapping . Survey Config Mapper Ċ import Ġde . r ki . cor on aw arn app . environment . download . Download CD N HttpClient Ċ import Ġde . r ki . cor on aw arn app . environment . download . Download CD N Server Url Ċ import Ġde . r ki . cor on aw arn app . util . di . AppContext Ċ import Ġokhttp 3 . Cache Ċ import Ġokhttp 3 . Ok HttpClient Ċ import Ġorg . joda . time . Duration Ċ import Ġretrofit 2 . Ret rofit Ċ import Ġretrofit 2 . converter . gson . Gson Converter Factory Ċ import Ġjava . io . File Ċ import Ġjava . util . concurrent . TimeUnit Ċ import Ġjavax . inject . Singleton Ċ Ċ @ Module Ċ class ĠApp Config Module Ġ{ ĊĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġprovide AppConfig Api ( ĊĠĠĠĠĠĠĠ Ġ@ Remote AppConfig Cache Ġcache : ĠCache , ĊĠĠĠĠĠĠĠ Ġ@ Download CD N HttpClient Ġclient : ĠOk HttpClient , ĊĠĠĠĠĠĠĠ Ġ@ Download CD N Server Url Ġurl : ĠString , ĊĠĠĠĠĠĠĠ Ġgson Converter Factory : ĠGson Converter Factory ĊĠĠĠ Ġ): ĠApp Config Api V 2 Ġ{ ĊĊĠĠĠĠĠĠĠ Ġval Ġconfig HttpClient Ġ= Ġclient . newBuilder (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcache ( cache ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconnect Timeout ( HTTP _ TIMEOUT _ APP CONFIG . millis , ĠTimeUnit . MILLISECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġread Timeout ( HTTP _ TIMEOUT _ APP CONFIG . millis , ĠTimeUnit . MILLISECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġwrite Timeout ( HTTP _ TIMEOUT _ APP CONFIG . millis , ĠTimeUnit . MILLISECONDS ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcall Timeout ( HTTP _ TIMEOUT _ APP CONFIG . millis , ĠTimeUnit . MILLISECONDS ) ĊĠĠĠĠĠĠĠ Ġ}. build () ĊĊĠĠĠĠĠĠĠ Ġreturn ĠRet rofit . Builder () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. client ( config HttpClient ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. baseUrl ( url ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. add Converter Factory ( gson Converter Factory ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create ( AppConfig Api V 2 :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Remote AppConfig Cache ĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġ@ Singleton ĊĠĠĠ Ġfun Ġremote AppConfig Http Cache (@ AppContext Ġcontext : ĠContext ): ĠCache Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcache Dir Ġ= ĠFile ( context . cacheDir , Ġ" http _ app - config ") ĊĠĠĠĠĠĠĠ Ġreturn ĠCache ( cacheDir , ĠDEFAULT _ CACHE _ SIZE ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġc wa Mapper ( mapper : ĠC WA Config Mapper ): ĊĠĠĠĠĠĠĠ ĠC WA Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġdownload Mapper ( mapper : ĠKey Download Parameters Mapper ): ĠKey Download Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġexposure Mapper ( mapper : ĠEx posure Detection Config Mapper ): ĊĠĠĠĠĠĠĠ ĠEx posure Detection Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġwindow Risk Mapper ( mapper : ĠEx posure Window Risk Calculation Config Mapper ): ĊĠĠĠĠĠĠĠ ĠEx posure Window Risk Calculation Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġsurvey Mapper ( mapper : ĠSurvey Config Mapper ): ĊĠĠĠĠĠĠĠ ĠSurvey Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġanalytics Mapper ( mapper : ĠAnalytics Config Mapper ): ĊĠĠĠĠĠĠĠ ĠAnalytics Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġlog Upload Mapper ( mapper : ĠLog Upload Config Mapper ): ĊĠĠĠĠĠĠĠ ĠLog Upload Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġpresence Tracing Mapper ( mapper : ĠPres ence Tracing Config Mapper ): ĊĠĠĠĠĠĠĠ ĠPres ence Tracing Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġ@ Provides ĊĠĠĠ Ġfun Ġcor ona Test Config Mapper ( mapper : ĠCor ona Test Config Mapper ): ĊĠĠĠĠĠĠĠ ĠCor ona Test Config . Mapper Ġ= Ġmapper ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval ĠHTTP _ TIMEOUT _ APP CONFIG Ġ= ĠDuration . standard Seconds ( 1 0 ) ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠDEFAULT _ CACHE _ SIZE Ġ= Ġ 2 Ġ* Ġ 1 0 2 4 Ġ* Ġ 1 0 2 4 L Ġ// Ġ 5 MB ĊĠĠĠ Ġ} Ċ } Ċ