本文整理匯總了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));
}