本文整理汇总了Java中org.thoughtcrime.securesms.util.TextSecurePreferences.isInterceptAllMmsEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java TextSecurePreferences.isInterceptAllMmsEnabled方法的具体用法?Java TextSecurePreferences.isInterceptAllMmsEnabled怎么用?Java TextSecurePreferences.isInterceptAllMmsEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.thoughtcrime.securesms.util.TextSecurePreferences
的用法示例。
在下文中一共展示了TextSecurePreferences.isInterceptAllMmsEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isRelevant
import org.thoughtcrime.securesms.util.TextSecurePreferences; //导入方法依赖的package包/类
private boolean isRelevant(Context context, Intent intent) {
if (!ApplicationMigrationService.isDatabaseImported(context)) {
return false;
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
Telephony.Sms.Intents.WAP_PUSH_RECEIVED_ACTION.equals(intent.getAction()) &&
Util.isDefaultSmsProvider(context))
{
return false;
}
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT &&
TextSecurePreferences.isInterceptAllMmsEnabled(context))
{
return true;
}
return false;
}
示例2: 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;
}
}