Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92c3c982 authored by Wenyi Wang's avatar Wenyi Wang
Browse files

Ignore class TtsSpan on pre-L SDKs

Null will be returned on pre-L when a TtsSpan instance should be returned.

Bug: 25629359
Change-Id: I947bae2e24aa340c89298dc59e2d752abddb7ebc
parent efa7268b
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -36,8 +36,7 @@ public class PhoneNumberUtilsCompat {
    private PhoneNumberUtilsCompat() {}

    public static CharSequence createTtsSpannable(CharSequence phoneNumber) {
        if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP)
                >= Build.VERSION_CODES.M) {
        if (CompatUtils.isMarshmallowCompatible()) {
            return PhoneNumberUtils.createTtsSpannable(phoneNumber);
        } else {
            return createTtsSpannableInternal(phoneNumber);
@@ -45,11 +44,12 @@ public class PhoneNumberUtilsCompat {
    }

    public static TtsSpan createTtsSpan(String phoneNumber) {
        if (SdkVersionOverride.getSdkVersion(Build.VERSION_CODES.LOLLIPOP)
                >= Build.VERSION_CODES.M) {
        if (CompatUtils.isMarshmallowCompatible()) {
            return PhoneNumberUtils.createTtsSpan(phoneNumber);
        } else if (CompatUtils.isLollipopCompatible()) {
            return createTtsSpanLollipop(phoneNumber);
        } else {
            return createTtsSpanInternal(phoneNumber);
            return null;
        }
    }

@@ -83,7 +83,7 @@ public class PhoneNumberUtilsCompat {
    /**
     * Copied from {@link PhoneNumberUtils#createTtsSpan}
     */
    private static TtsSpan createTtsSpanInternal(String phoneNumberString) {
    private static TtsSpan createTtsSpanLollipop(String phoneNumberString) {
        if (phoneNumberString == null) {
            return null;
        }