Search in sources :

Example 6 with CountryListener

use of android.location.CountryListener in project android_frameworks_base by crdroidandroid.

the class CountryDetectorService method initialize.

private void initialize() {
    mCountryDetector = new ComprehensiveCountryDetector(mContext);
    mLocationBasedDetectorListener = new CountryListener() {

        public void onCountryDetected(final Country country) {
            mHandler.post(new Runnable() {

                public void run() {
                    notifyReceivers(country);
                }
            });
        }
    };
}
Also used : ComprehensiveCountryDetector(com.android.server.location.ComprehensiveCountryDetector) ICountryListener(android.location.ICountryListener) CountryListener(android.location.CountryListener) Country(android.location.Country)

Example 7 with CountryListener

use of android.location.CountryListener in project android_frameworks_base by ParanoidAndroid.

the class CountryDetectorService method initialize.

private void initialize() {
    mCountryDetector = new ComprehensiveCountryDetector(mContext);
    mLocationBasedDetectorListener = new CountryListener() {

        public void onCountryDetected(final Country country) {
            mHandler.post(new Runnable() {

                public void run() {
                    notifyReceivers(country);
                }
            });
        }
    };
}
Also used : ComprehensiveCountryDetector(com.android.server.location.ComprehensiveCountryDetector) ICountryListener(android.location.ICountryListener) CountryListener(android.location.CountryListener) Country(android.location.Country)

Example 8 with CountryListener

use of android.location.CountryListener in project android_frameworks_base by ParanoidAndroid.

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 9 with CountryListener

use of android.location.CountryListener in project platform_frameworks_base by android.

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 10 with CountryListener

use of android.location.CountryListener in project android_frameworks_base by DirtyUnicorns.

the class CountryDetectorService method initialize.

private void initialize() {
    mCountryDetector = new ComprehensiveCountryDetector(mContext);
    mLocationBasedDetectorListener = new CountryListener() {

        public void onCountryDetected(final Country country) {
            mHandler.post(new Runnable() {

                public void run() {
                    notifyReceivers(country);
                }
            });
        }
    };
}
Also used : ComprehensiveCountryDetector(com.android.server.location.ComprehensiveCountryDetector) ICountryListener(android.location.ICountryListener) CountryListener(android.location.CountryListener) Country(android.location.Country)

Aggregations

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