/** * Determines if this version is compatible with multi-SIM and the phone account APIs. Can also * force the version to be lower through SdkVersionOverride. * * @return {@code true} if multi-SIM capability is available, {@code false} otherwise. */ public static boolean isMSIMCompatible() { return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP) >= Build.VERSION_CODES.LOLLIPOP_MR1; }
/** * Determines if this version has access to the * {@link android.provider.CallLog.Calls.CACHED_PHOTO_URI} column * * @return {@code true} if {@link android.provider.CallLog.Calls.CACHED_PHOTO_URI} is available, * {@code false} otherwise */ public static boolean isCallsCachedPhotoUriCompatible() { return CompatUtils.isMarshmallowCompatible(); } }
public static Uri getDirectoryUri(int mode) { if (mode == SEARCH_MODE_DATA_SHORTCUT || mode == SEARCH_MODE_CONTACT_SHORTCUT) { return Directory.CONTENT_URI; } else { return DirectoryCompat.getContentUri(); } } }
public static TtsSpan createTtsSpan(String phoneNumber) { if (CompatUtils.isMarshmallowCompatible()) { return PhoneNumberUtils.createTtsSpan(phoneNumber); } else if (CompatUtils.isLollipopCompatible()) { return createTtsSpanLollipop(phoneNumber); } else { return null; } }
public static CharSequence createTtsSpannable(CharSequence phoneNumber) { if (CompatUtils.isMarshmallowCompatible()) { return PhoneNumberUtils.createTtsSpannable(phoneNumber); } else { return createTtsSpannableInternal(phoneNumber); } }
/** * Compat method for addTtsSpan, see {@link PhoneNumberUtils#addTtsSpan} */ public static void addTtsSpan(Spannable s, int start, int endExclusive) { if (CompatUtils.isMarshmallowCompatible()) { PhoneNumberUtils.addTtsSpan(s, start, endExclusive); } else { addTtsSpanInternal(s, start, endExclusive); } }
public static long getOrCreateThreadId(Context context, String recipient) { if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M) { return Telephony.Threads.getOrCreateThreadId(context, recipient); } else { return getOrCreateThreadIdInternal(context, recipient); } }
public static String normalizeNumber(String phoneNumber) { if (CompatUtils.isLollipopCompatible()) { return PhoneNumberUtils.normalizeNumber(phoneNumber); } else { return normalizeNumberInternal(phoneNumber); } }
/** * Return a {@link CharSequence} that best describes the given type, possibly substituting * the given label value for TYPE_CUSTOM. */ public static CharSequence getTypeLabel(Resources res, int type, CharSequence label) { if (CompatUtils.isLollipopCompatible()) { return Event.getTypeLabel(res, type, label); } else { return getTypeLabelInternal(res, type, label); } }
public static boolean isEnterpriseDirectoryId(long directoryId) { return ContactsUtils.FLAG_N_FEATURE ? DirectorySdkCompat.isEnterpriseDirectoryId(directoryId) : false; } }
public static boolean isRemoteDirectoryId(long directoryId) { if (ContactsUtils.FLAG_N_FEATURE) { return DirectorySdkCompat.isRemoteDirectoryId(directoryId); } return !(directoryId == Directory.DEFAULT || directoryId == Directory.LOCAL_INVISIBLE); }
@Override protected PhoneNumberFormattingTextWatcher doInBackground(Void... params) { return PhoneNumberFormattingTextWatcherCompat.newInstance(mCountryCode); }
/** * Determines if this version is compatible with Marshmallow-specific APIs. Can also force the * version to be lower through SdkVersionOverride. * * @return {@code true} if runtime sdk is compatible with Marshmallow, {@code false} otherwise. */ public static boolean isMarshmallowCompatible() { return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP) >= Build.VERSION_CODES.M; }
/** * Determines if this version is compatible with a default dialer. Can also force the version to * be lower through {@link SdkVersionOverride}. * * @return {@code true} if default dialer is a feature on this device, {@code false} otherwise. */ public static boolean isDefaultDialerCompatible() { return isMarshmallowCompatible(); }
/** * Determines if this version is compatible with Lollipop-specific APIs. Can also force the * version to be lower through SdkVersionOverride. * * @return {@code true} if call subject is a feature on this device, {@code false} otherwise. */ public static boolean isLollipopCompatible() { return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP) >= Build.VERSION_CODES.LOLLIPOP; } }
/** * Determines if this version is capable of using presence checking for video calling. Support * for video call presence indication is added in SDK 24. * * @return {@code true} if video presence checking is allowed, {@code false} otherwise. */ public static boolean isVideoPresenceCompatible() { return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) > Build.VERSION_CODES.M; }
/** * Determines if this version is compatible with call subject. Can also force the version to be * lower through SdkVersionOverride. * * @return {@code true} if call subject is a feature on this device, {@code false} otherwise. */ public static boolean isCallSubjectCompatible() { return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP) >= Build.VERSION_CODES.M; }
/** * Determines if this version is compatible with Lollipop Mr1-specific APIs. Can also force the * version to be lower through SdkVersionOverride. * * @return {@code true} if runtime sdk is compatible with Lollipop MR1, {@code false} otherwise. */ public static boolean isLollipopMr1Compatible() { return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP_MR1) >= Build.VERSION_CODES.LOLLIPOP_MR1; }
/** * PrioritizedMimeType is added in API level 23. */ public static boolean hasPrioritizedMimeType() { return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.M) >= Build.VERSION_CODES.M; }
/** * Determines if this version is compatible with video calling. Can also force the version to be * lower through SdkVersionOverride. * * @return {@code true} if video calling is allowed, {@code false} otherwise. */ public static boolean isVideoCompatible() { return SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP) >= Build.VERSION_CODES.M; }