本文整理匯總了Java中org.thoughtcrime.securesms.util.TextSecurePreferences.isInterceptAllSmsEnabled方法的典型用法代碼示例。如果您正苦於以下問題:Java TextSecurePreferences.isInterceptAllSmsEnabled方法的具體用法?Java TextSecurePreferences.isInterceptAllSmsEnabled怎麽用?Java TextSecurePreferences.isInterceptAllSmsEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.thoughtcrime.securesms.util.TextSecurePreferences
的用法示例。
在下文中一共展示了TextSecurePreferences.isInterceptAllSmsEnabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSummary
import org.thoughtcrime.securesms.util.TextSecurePreferences; //導入方法依賴的package包/類
public static CharSequence getSummary(Context context) {
final String on = context.getString(R.string.ApplicationPreferencesActivity_on);
final String onCaps = context.getString(R.string.ApplicationPreferencesActivity_On);
final String off = context.getString(R.string.ApplicationPreferencesActivity_off);
final String offCaps = context.getString(R.string.ApplicationPreferencesActivity_Off);
final int smsMmsSummaryResId = R.string.ApplicationPreferencesActivity_sms_mms_summary;
boolean postKitkatSMS = Util.isDefaultSmsProvider(context);
boolean preKitkatSMS = TextSecurePreferences.isInterceptAllSmsEnabled(context);
boolean preKitkatMMS = TextSecurePreferences.isInterceptAllMmsEnabled(context);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (postKitkatSMS) return onCaps;
else return offCaps;
} else {
if (preKitkatSMS && preKitkatMMS) return onCaps;
else if (preKitkatSMS && !preKitkatMMS) return context.getString(smsMmsSummaryResId, on, off);
else if (!preKitkatSMS && preKitkatMMS) return context.getString(smsMmsSummaryResId, off, on);
else return offCaps;
}
}
示例2: isRelevant
import org.thoughtcrime.securesms.util.TextSecurePreferences; //導入方法依賴的package包/類
private boolean isRelevant(Context context, Intent intent) {
SmsMessage message = getSmsMessageFromIntent(intent);
String messageBody = getSmsMessageBodyFromIntent(intent);
if (message == null && messageBody == null)
return false;
if (isExemption(message, messageBody))
return false;
if (!ApplicationMigrationService.isDatabaseImported(context))
return false;
if (isChallenge(context, messageBody))
return false;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
SMS_RECEIVED_ACTION.equals(intent.getAction()) &&
Util.isDefaultSmsProvider(context))
{
return false;
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT &&
TextSecurePreferences.isInterceptAllSmsEnabled(context))
{
return true;
}
return false;
}