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

Commit e1be1dfb authored by Clara Bayarri's avatar Clara Bayarri Committed by Android (Google) Code Review
Browse files

Merge "Ignore non-font resource references in TextView constructor"

parents 1363ab3d d134b892
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -877,7 +877,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                    case com.android.internal.R.styleable.TextAppearance_fontFamily:
                        try {
                            fontTypeface = appearance.getFont(attr);
                        } catch (UnsupportedOperationException e) {
                        } catch (UnsupportedOperationException | Resources.NotFoundException e) {
                            // Expected if it is not a font resource.
                        }
                        if (fontTypeface == null) {
@@ -1194,8 +1194,9 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
                case com.android.internal.R.styleable.TextView_fontFamily:
                    try {
                        fontTypeface = a.getFont(attr);
                    } catch (UnsupportedOperationException e) {
                        // Expected if it is not a font resource.
                    } catch (UnsupportedOperationException | Resources.NotFoundException e) {
                        // Expected if it is not a resource reference or if it is a reference to
                        // another resource type.
                    }
                    if (fontTypeface == null) {
                        fontFamily = a.getString(attr);
@@ -3325,7 +3326,7 @@ public class TextView extends View implements ViewTreeObserver.OnPreDrawListener
        String fontFamily = null;
        try {
            fontTypeface = ta.getFont(R.styleable.TextAppearance_fontFamily);
        } catch (UnsupportedOperationException e) {
        } catch (UnsupportedOperationException | Resources.NotFoundException e) {
            // Expected if it is not a font resource.
        }
        if (fontTypeface == null) {