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);
}
});
}
};
}
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);
}
});
}
};
}
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;
}
}
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;
}
}
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);
}
});
}
};
}
Aggregations