use of android.location.CountryListener in project android_frameworks_base by AOSPA.
the class ComprehensiveCountryDetector method setCountryListener.
@Override
public void setCountryListener(CountryListener listener) {
CountryListener prevListener = mListener;
mListener = listener;
if (mListener == null) {
// Stop listening all services
removePhoneStateListener();
stopLocationBasedDetector();
cancelLocationRefresh();
mStopTime = SystemClock.elapsedRealtime();
mTotalTime += mStopTime;
} else if (prevListener == null) {
addPhoneStateListener();
detectCountry(false, true);
mStartTime = SystemClock.elapsedRealtime();
mStopTime = 0;
mCountServiceStateChanges = 0;
}
}
use of android.location.CountryListener in project android_frameworks_base by crdroidandroid.
the class ComprehensiveCountryDetector method setCountryListener.
@Override
public void setCountryListener(CountryListener listener) {
CountryListener prevListener = mListener;
mListener = listener;
if (mListener == null) {
// Stop listening all services
removePhoneStateListener();
stopLocationBasedDetector();
cancelLocationRefresh();
mStopTime = SystemClock.elapsedRealtime();
mTotalTime += mStopTime;
} else if (prevListener == null) {
addPhoneStateListener();
detectCountry(false, true);
mStartTime = SystemClock.elapsedRealtime();
mStopTime = 0;
mCountServiceStateChanges = 0;
}
}
Aggregations