Search in sources :

Example 1 with CountryListener

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

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

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

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

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

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

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

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

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

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