Search in sources :

Example 11 with CountryListener

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;
    }
}
Also used : CountryListener(android.location.CountryListener)

Example 12 with CountryListener

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;
    }
}
Also used : CountryListener(android.location.CountryListener)

Aggregations

CountryListener (android.location.CountryListener)12 Country (android.location.Country)6 ICountryListener (android.location.ICountryListener)6 ComprehensiveCountryDetector (com.android.server.location.ComprehensiveCountryDetector)6