/* Ċ Ġ* ĠCopyright Ġ 2 0 2 0 ĠSh rey as ĠPat il Ċ Ġ* Ċ Ġ* ĠLicensed Ġunder Ġthe ĠApache ĠLicense , ĠVersion Ġ 2 . 0 Ġ( the Ġ" License "); Ċ Ġ* Ġyou Ġmay Ġnot Ġuse Ġthis Ġfile Ġexcept Ġin Ġcompliance Ġwith Ġthe ĠLicense . Ċ Ġ* ĠYou Ġmay Ġobtain Ġa Ġcopy Ġof Ġthe ĠLicense Ġat Ċ Ġ* Ċ Ġ* ĠĠĠĠ Ġhttp :// www . apache . org / licenses / LICENSE - 2 . 0 Ċ Ġ* Ċ Ġ* ĠUnless Ġrequired Ġby Ġapplicable Ġlaw Ġor Ġagreed Ġto Ġin Ġwriting , Ġsoftware Ċ Ġ* Ġdistributed Ġunder Ġthe ĠLicense Ġis Ġdistributed Ġon Ġan Ġ" AS ĠIS " ĠBASIS , Ċ Ġ* ĠWITHOUT ĠWARRANTIES ĠOR ĠCONDITIONS ĠOF ĠANY ĠKIND , Ġeither Ġexpress Ġor Ġimplied . Ċ Ġ* ĠSee Ġthe ĠLicense Ġfor Ġthe Ġspecific Ġlanguage Ġgoverning Ġpermissions Ġand Ċ Ġ* Ġlimitations Ġunder Ġthe ĠLicense . Ċ Ġ*/ Ċ Ċ package Ġdev . sh rey as pat il . not y . connectivity Ċ Ċ import Ġandroid . net . Connectivity Manager Ċ import Ġdev . sh rey as pat il . not y . core . connectivity . Connection State Ċ import Ġdev . sh rey as pat il . not y . core . connectivity . Connectivity Observer Ċ import Ġdev . sh rey as pat il . not y . utils . current Connectivity State Ċ import Ġdev . sh rey as pat il . not y . utils . observe Connectivity As Flow Ċ import Ġkotlinx . coroutines . Experimental Cor outines Api Ċ import Ġkotlinx . coroutines . flow . Flow Ċ Ċ @ Opt In ( Experimental Cor outines Api :: class ) Ċ class ĠConnect ivity Observer Impl ( ĊĠĠĠ Ġprivate Ġval Ġconnectivity Manager : ĠConnect ivity Manager Ċ ) Ġ: ĠConnect ivity Observer Ġ{ ĊĊĠĠĠ Ġoverride Ġval Ġconnection State : ĠFlow < Connection State > ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġconnectivity Manager . observe Connectivity As Flow () ĊĊĠĠĠ Ġoverride Ġval Ġcurrent Connection State : ĠConnection State ĊĠĠĠĠĠĠĠ Ġget () Ġ= Ġconnectivity Manager . current Connectivity State Ċ } Ċ