diff options
| author | 2018-09-26 10:55:41 -0700 | |
|---|---|---|
| committer | 2018-09-26 11:11:27 -0700 | |
| commit | aaa85d6818f6e26f3e924157415d50457073eb87 (patch) | |
| tree | e254f03a631e0e981681c4dafcbc38a4faab7eaf | |
| parent | 043a3a713de8864afb04b3fc029bfc1155c334b3 (diff) | |
Address comments from API council
This CL includes:
- Fix typo
- Make SystemFonts final
- Storing readonly buffer in Font
Bug: 116224077
Bug: 116224515
Test: m update-api && m docs
Change-Id: Ib7442bac6d2d8efea4deff1fd309940794c20a88
| -rwxr-xr-x | api/current.txt | 2 | ||||
| -rw-r--r-- | graphics/java/android/graphics/fonts/Font.java | 9 | ||||
| -rw-r--r-- | graphics/java/android/graphics/fonts/SystemFonts.java | 5 |
3 files changed, 8 insertions, 8 deletions
diff --git a/api/current.txt b/api/current.txt index 63555b97759b..67e2b497576c 100755 --- a/api/current.txt +++ b/api/current.txt @@ -15310,7 +15310,7 @@ package android.graphics.fonts { method public static java.lang.String toFontVariationSettings(android.graphics.fonts.FontVariationAxis[]); } - public class SystemFonts { + public final class SystemFonts { method public static java.util.Set<android.graphics.fonts.Font> getAvailableFonts(); } diff --git a/graphics/java/android/graphics/fonts/Font.java b/graphics/java/android/graphics/fonts/Font.java index 1458c66a2c54..bd1ac25bf8df 100644 --- a/graphics/java/android/graphics/fonts/Font.java +++ b/graphics/java/android/graphics/fonts/Font.java @@ -422,9 +422,10 @@ public final class Font { nAddAxis(builderPtr, axis.getOpenTypeTagValue(), axis.getStyleValue()); } } - final long ptr = nBuild(builderPtr, mBuffer, mWeight, italic, mTtcIndex); - final Font font = new Font(ptr, mBuffer, mFile, mWeight, italic, mTtcIndex, mAxes, - mLocaleList); + final ByteBuffer readonlyBuffer = mBuffer.asReadOnlyBuffer(); + final long ptr = nBuild(builderPtr, readonlyBuffer, mWeight, italic, mTtcIndex); + final Font font = new Font(ptr, readonlyBuffer, mFile, mWeight, italic, mTtcIndex, + mAxes, mLocaleList); sFontRegistory.registerNativeAllocation(font, ptr); return font; } @@ -477,7 +478,7 @@ public final class Font { } /** - * Retuns a font file buffer. + * Returns a font file buffer. * * @return a font buffer */ diff --git a/graphics/java/android/graphics/fonts/SystemFonts.java b/graphics/java/android/graphics/fonts/SystemFonts.java index f4a2199a6688..5e80749e9233 100644 --- a/graphics/java/android/graphics/fonts/SystemFonts.java +++ b/graphics/java/android/graphics/fonts/SystemFonts.java @@ -45,7 +45,7 @@ import java.util.Set; /** * Provides the system font configurations. */ -public class SystemFonts { +public final class SystemFonts { private static final String TAG = "SystemFonts"; private static final String DEFAULT_FAMILY = "sans-serif"; @@ -58,8 +58,7 @@ public class SystemFonts { /** * Returns all available font files in the system. * - * Note: The order of this font doesn't indicates anything. - * @return an array of system fonts + * @return a set of system fonts */ public static @NonNull Set<Font> getAvailableFonts() { HashSet<Font> set = new HashSet<>(); |