package Ġcom . va ib hav . task ify . util Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . net . Connectivity Manager Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠNetwork Utils Ġ@ Inject Ġconstructor ( private Ġval Ġcontext : ĠContext ) Ġ{ ĊĊĠĠĠ Ġfun Ġcheck Internet Connection (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġconnection Manager Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcontext . getSystem Service ( Context . CONNECT IVITY _ SERVICE ) Ġas ĠConnect ivity Manager ĊĠĠĠĠĠĠĠ Ġval Ġnetwork Info Ġ= Ġconnection Manager . active Network Info ĊĠĠĠĠĠĠĠ Ġreturn Ġnetwork Info Ġ!= Ġnull Ġ&& Ġnetwork Info . isConnected ĊĠĠĠ Ġ} Ċ } Ċ