當前位置: 首頁>>代碼示例>>Java>>正文


Java WarningUtils類代碼示例

本文整理匯總了Java中com.csipsimple.ui.warnings.WarningUtils的典型用法代碼示例。如果您正苦於以下問題:Java WarningUtils類的具體用法?Java WarningUtils怎麽用?Java WarningUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


WarningUtils類屬於com.csipsimple.ui.warnings包,在下文中一共展示了WarningUtils類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: asyncSanityCheck

import com.csipsimple.ui.warnings.WarningUtils; //導入依賴的package包/類
private void asyncSanityCheck() {
    // if(Compatibility.isCompatible(9)) {
    // // We check now if something is wrong with the gingerbread dialer
    // integration
    // Compatibility.getDialerIntegrationState(SipHome.this);
    // }
    
    // Nightly build check
    if(NightlyUpdater.isNightlyBuild(this)) {
        Log.d(THIS_FILE, "Sanity check : we have a nightly build here");
        ConnectivityManager connectivityService = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
        NetworkInfo ni = connectivityService.getActiveNetworkInfo();
        // Only do the process if we are on wifi
        if (ni != null && ni.isConnected() && ni.getType() == ConnectivityManager.TYPE_WIFI) {
            // Only do the process if we didn't dismissed previously
            NightlyUpdater nu = new NightlyUpdater(this);

            if (!nu.ignoreCheckByUser()) {
                long lastCheck = nu.lastCheck();
                long current = System.currentTimeMillis();
                long oneDay = 43200000; // 12 hours
                if (current - oneDay > lastCheck) {
                    if (onForeground) {
                        // We have to check for an update
                        UpdaterPopupLauncher ru = nu.getUpdaterPopup(false);
                        if (ru != null && asyncSanityChecker != null) {
                            runOnUiThread(ru);
                        }
                    }
                }
            }
        }
    }
    
    applyWarning(WarningUtils.WARNING_PRIVILEGED_INTENT, WarningUtils.shouldWarnPrivilegedIntent(this, prefProviderWrapper));
    applyWarning(WarningUtils.WARNING_NO_STUN, WarningUtils.shouldWarnNoStun(prefProviderWrapper));
    applyWarning(WarningUtils.WARNING_VPN_ICS, WarningUtils.shouldWarnVpnIcs(prefProviderWrapper));
    applyWarning(WarningUtils.WARNING_SDCARD, WarningUtils.shouldWarnSDCard(this, prefProviderWrapper));
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:40,代碼來源:SipHome.java


注:本文中的com.csipsimple.ui.warnings.WarningUtils類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。