@Override
    void stopListening() {
        if (listening) {
            try {
                Log.v(
                    DOMAIN,
                    "%s: stopListening() unregistering %s with context %s", this, receiver, context);
                context.unregisterReceiver(receiver);
            }
            catch (Exception e) {
                Log.e(
                    DOMAIN,
                    "%s: stopListening() exception unregistering %s with context %s",
                    e,
                    this,
                    receiver,
                    context);
            }
            listening = false;
        }
    }
@ Override void stopListening ( ) { if ( listening ) { try { Log . v ( DOMAIN , "%s: stopListening() unregistering %s with context %s" , this , receiver , context ) ; context . unregisterReceiver ( receiver ) ; } catch ( Exception e ) { Log . e ( DOMAIN , "%s: stopListening() exception unregistering %s with context %s" , e , this , receiver , context ) ; } listening = false ; } }
NOTE: stopListening() method is called from removeNetworkReachabilityListener() which is
synchronized. So this method is not necessary to be synchronized.