Skip to content
Commit 7d3d2aa2 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Revive the old behavior of unsupported filed in public APIs

The behavior of the Typeface creating function when unsuppoted font
files are passed has changed unexpectedly. This CL revives the old
behaviors. Here is the list of public APIs and expected behaviors.

Resources#getFont for unsupported font
  Exception: Resources#NotFoundException
Resources#getFont for unsupported font in XML
  Exception: Resources#NotFoundException
Resources#getFont for unsupported font from provider
  No Exception: Typeface.DEFAULT is returned

Typeface#Builder for unsupported font
  No Exception: null is returned
Typeface#Builder for unavailable font
  No Exception: null is returned

Typeface#createFromAsset for unsupported font
  Not Exception: Typeface.DEFAULT is returned
Typeface#createFromAsset for unavailable font
  Exception: RuntimeExcetpion

FontsContract#buildTypeface for unspported font
  No Exception: null is returned
FontsContract#buildTypeface for unspported font in XML
  No Exception: null is returned
FontsContract#buildTypeface for unspported font from provider
  No Exception: null is returned

TextView inflation for unsupported font
  No Exception: Typeface.DEFAULT is set
TextView inflation for unsupported font in XML
  No Exception: Typeface.DEFAULT is set
TextView inflation for unsupported font from provider
  No Exception: Typeface.DEFAULT is set

Bug: 127714175
Test: Manually done
Change-Id: Iaab037f4168546409ead67ed8eee7340418418ed
parent 3d0a536e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment