This question already has an answer here:
I know Android has some sort of connectivity measurement, because when there's connectivity the wifi or phone network icons will turn either green or blue, depending on the Android version.
In my opinion, this measurement isn't perfect, because although it will indicate accurately the absence of connectivity (e.g., lost wifi connectivity), it is not so accurate when the phone is connected to the Internet: at work, my Defy running Cyanogen 9 (Android 4.0.4) has icons that are always gray, no matter what, even when the connection is obviously up (see image below).
I wonder how, exactly, Android measures the connectivity status. Is it by performing a ping or other sort of probing of a server? By listening to a port? By testing if some protocol is enabled? Or what? This accepted answer to a closely related question doesn't seem to answer it.