package Ġru . end road . arena . view layer . extension Ċ Ċ import Ġandroid . Manifest . permission .* Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . pm . PackageManager Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . core . app . Activity Compat Ċ import Ġandroidx . core . app . Activity Compat . check Self Permission Ċ import Ġandroidx . core . content . Permission Checker .* Ċ Ċ // TODO ĠÑģ ÐºÐ¸ Ð½ Ñĥ Ð» ĠÑģ Ñİ Ð´Ð° ĠÐ¿ÑĢ Ð¸Ð¼ÐµÑĢ Ñĭ ĠÐº Ð¾Ð´Ð° . ĠÐł Ð°Ð· Ð¾Ð± ÑĢ Ð°ÑĤÑĮÑģÑı Ċ /** Ċ Ġ* Ġreturn Ġtrue , ĠÐµÑģÐ»Ð¸ ĠÐµ ÑģÑĤÑĮ ĠÑħ Ð¾ÑĤ ÑĮ ĠÐ¾Ð´ Ð½Ð¾ ĠÑĢÐ°Ð· ÑĢ ÐµÑĪ ÐµÐ½Ð¸Ðµ Ċ Ġ*/ Ċ Ċ fun ĠContext . is Location Permission (): ĠBoolean Ġ{ Ċ ĉ return Ġcheck Self Permission ( this , ĠACCESS _ F INE _ LOCATION ) Ġ== ĠPackage Manager . PERMISSION _ GRAN TED Ċĉ ĉ || Ġcheck Self Permission ( this , ĠACCESS _ CO AR SE _ LOCATION ) Ġ== ĠPackage Manager . PERMISSION _ GRAN TED Ċ } Ċ Ċ private Ġconst Ġval ĠREQUEST _ CODE _ PERMISSION S Ġ= Ġ 1 0 1 Ċ Ċ private Ġval ĠREQUIRED _ PERMISSION S Ġ= ĠarrayOf ( ACCESS _ F INE _ LOCATION , ĠACCESS _ CO AR SE _ LOCATION ) Ċ Ċ internal Ġval ĠAppCompatActivity . all Permissions Granted : ĠBoolean Ċ ĉ get () Ġ{ Ċĉ ĉ REQUIRED _ PERMISSION S . forEach Ġ{ Ġif Ġ(! it . permission Granted ( this )) Ġreturn Ġfalse Ġ} Ċĉ ĉ return Ġtrue Ċ ĉ } Ċ Ċ internal Ġfun ĠAppCompatActivity . request Permissions () Ġ{ Ċ ĉ Activity Compat . request Permissions ( this , ĠREQUIRED _ PERMISSION S , ĠREQUEST _ CODE _ PERMISSION S ) Ċ } Ċ Ċ private Ġfun ĠString . permission Granted ( context : ĠContext ): ĠBoolean Ġ= Ċ ĉ check Self Permission ( context , Ġthis ) Ġ== ĠPER MISSION _ GRAN TED Ċ Ċ // /** Ċ // Ġ* ĠÐŁ ÑĢÐ¾Ð² ÐµÑĢ ÐºÐ° , ĠÐ² ÐºÐ»ÑİÑĩ ÐµÐ½Ð° ĠÐ» Ð¸ ĠÐ¿ÐµÑĢ ÐµÐ´ Ð°Ñĩ Ð° ĠÐ´Ð°Ð½Ð½ÑĭÑħ / Wifi Ċ // Ġ*/ Ċ // fun Ġis Connected To Network ( context : ĠContext ): ĠBoolean Ġ{ Ċ // ĉ val Ġconnectivity Manager Ġ= Ġcontext . getSystem Service ( Context . CONNECT IVITY _ SERVICE ) Ġas ĠConnect ivity Manager Ċ // ĉ val Ġactive Network Ġ= Ġconnectivity Manager . active Network Info Ċ // Ċ // ĉ return Ġactive Network Ġ!= Ġnull Ġ&& Ġactive Network . isConnected Ċ //}