Java 类android.location.Country 实例源码

项目:qksms    文件:QKSMSAppBase.java   
public String getCurrentCountryIso() {
    if (mCountryIso == null) {
        Country country = new Country(Locale.getDefault().getCountry(), Country.COUNTRY_SOURCE_LOCALE);
        mCountryIso = country.getCountryIso();
    }
    return mCountryIso;
}
项目:android-aosp-mms    文件:MmsApp.java   
public String getCurrentCountryIso() {
    if (mCountryIso == null) {
        Country country = mCountryDetector.detectCountry();
        if (country != null) {
            mCountryIso = country.getCountryIso();
        }
    }
    return mCountryIso;
}
项目:qksms    文件:QKSMSAppBase.java   
@Override
public void onCreate() {
    super.onCreate();

    if (Log.isLoggable(LogTag.STRICT_MODE_TAG, Log.DEBUG)) {
        // Log tag for enabling/disabling StrictMode violation log. This will dump a stack
        // in the log that shows the StrictMode violator.
        // To enable: adb shell setprop log.tag.Mms:strictmode DEBUG
        StrictMode.setThreadPolicy(
                new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
    }

    sQKSMSApp = this;

    loadDefaultPreferenceValues();

    // Initialize analytics, leakcanary, and crittercism
    AnalyticsManager.getInstance().init(this);
    refWatcher = LeakCanary.install(this);

    // Figure out the country *before* loading contacts and formatting numbers
    Country country = new Country(Locale.getDefault().getCountry(), Country.COUNTRY_SOURCE_LOCALE);
    mCountryIso = country.getCountryIso();

    Context context = getApplicationContext();
    mPduLoaderManager = new PduLoaderManager(context);
    mThumbnailManager = new ThumbnailManager(context);

    registerActivityLifecycleCallbacks(new LifecycleHandler());

    ThemeManager.init(this);
    MmsConfig.init(this);
    Contact.init(this);
    DraftCache.init(this);
    Conversation.init(this);
    DownloadManager.init(this);
    RateController.init(this);
    LayoutManager.init(this);
    NotificationManager.init(this);
    LiveViewManager.init(this);
    QKPreferences.init(this);

    activePendingMessages();
}
项目:sms_DualCard    文件:MmsApp.java   
@Override
public void onCreate() {
    super.onCreate();

    if (Log.isLoggable(LogTag.STRICT_MODE_TAG, Log.DEBUG)) {
        // Log tag for enabling/disabling StrictMode violation log. This will dump a stack
        // in the log that shows the StrictMode violator.
        // To enable: adb shell setprop log.tag.Mms:strictmode DEBUG
        StrictMode.setThreadPolicy(
                new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
    }

    sMmsApp = this;

    // Load the default preference values
    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

    // Figure out the country *before* loading contacts and formatting numbers
    mCountryDetector = (CountryDetector) getSystemService(Context.COUNTRY_DETECTOR);
    mCountryListener = new CountryListener() {
        @Override
        public synchronized void onCountryDetected(Country country) {
            mCountryIso = country.getCountryIso();
        }
    };
    mCountryDetector.addCountryListener(mCountryListener, getMainLooper());
    mCountryIso = mCountryDetector.detectCountry().getCountryIso();

    Context context = getApplicationContext();
    mPduLoaderManager = new PduLoaderManager(context);
    mThumbnailManager = new ThumbnailManager(context);

    MmsConfig.init(this);
    Contact.init(this);
    DraftCache.init(this);
    Conversation.init(this);
    DownloadManager.init(this);
    RateController.init(this);
    LayoutManager.init(this);
    SmileyParser.init(this);
    MessagingNotification.init(this);

    /** zzz */
    // initialize cache for contacts
    initContactsCache();
}
项目:android-aosp-mms    文件:MmsApp.java   
@Override
public void onCreate() {
    super.onCreate();

    if (Log.isLoggable(LogTag.STRICT_MODE_TAG, Log.DEBUG)) {
        // Log tag for enabling/disabling StrictMode violation log. This will dump a stack
        // in the log that shows the StrictMode violator.
        // To enable: adb shell setprop log.tag.Mms:strictmode DEBUG
        StrictMode.setThreadPolicy(
                new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());
    }

    sMmsApp = this;

    // Load the default preference values
    PreferenceManager.setDefaultValues(this, R.xml.preferences, false);

    // Figure out the country *before* loading contacts and formatting numbers
    mCountryDetector = (CountryDetector) getSystemService(Context.COUNTRY_DETECTOR);
    mCountryListener = new CountryListener() {
        @Override
        public synchronized void onCountryDetected(Country country) {
            mCountryIso = country.getCountryIso();
        }
    };
    mCountryDetector.addCountryListener(mCountryListener, getMainLooper());

    Context context = getApplicationContext();
    mPduLoaderManager = new PduLoaderManager(context);
    mThumbnailManager = new ThumbnailManager(context);

    MmsConfig.init(this);
    Contact.init(this);
    DraftCache.init(this);
    Conversation.init(this);
    DownloadManager.init(this);
    RateController.init(this);
    LayoutManager.init(this);
    MessagingNotification.init(this);

    activePendingMessages();
}