diff options
| author | 2017-04-27 14:15:52 -0700 | |
|---|---|---|
| committer | 2017-04-27 14:15:52 -0700 | |
| commit | 9610c695318c7e0128a22784e5faeba3b25565fb (patch) | |
| tree | 0c877e2b987545ec342ee5b3df5fed0437f4ed16 | |
| parent | 04225787d827ab487d3742e0f0237a3b6cd5dd11 (diff) | |
Remove FontsContract.buildTypeface with weight/italic argument.
Passing weight/italic to the family does not make sense.
Bug: 37750436
Test: N/A
Change-Id: I43a624179338c1f98aad36cfd08daa152e83944c
| -rw-r--r-- | api/current.txt | 1 | ||||
| -rw-r--r-- | api/system-current.txt | 1 | ||||
| -rw-r--r-- | api/test-current.txt | 1 | ||||
| -rw-r--r-- | core/java/android/provider/FontsContract.java | 37 |
4 files changed, 0 insertions, 40 deletions
diff --git a/api/current.txt b/api/current.txt index bd666d5120be..6ce72287b5d4 100644 --- a/api/current.txt +++ b/api/current.txt @@ -34438,7 +34438,6 @@ package android.provider { } public class FontsContract { - method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[], int, boolean, java.lang.String); method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[]); method public static android.provider.FontsContract.FontFamilyResult fetchFonts(android.content.Context, android.os.CancellationSignal, android.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException; method public static void requestFonts(android.content.Context, android.provider.FontRequest, android.os.Handler, android.os.CancellationSignal, android.provider.FontsContract.FontRequestCallback); diff --git a/api/system-current.txt b/api/system-current.txt index bb7c4d2d7c5f..be402a4691ba 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -37428,7 +37428,6 @@ package android.provider { } public class FontsContract { - method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[], int, boolean, java.lang.String); method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[]); method public static android.provider.FontsContract.FontFamilyResult fetchFonts(android.content.Context, android.os.CancellationSignal, android.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException; method public static void requestFonts(android.content.Context, android.provider.FontRequest, android.os.Handler, android.os.CancellationSignal, android.provider.FontsContract.FontRequestCallback); diff --git a/api/test-current.txt b/api/test-current.txt index d1d9cb839c5e..5cc2a2d5341a 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -34574,7 +34574,6 @@ package android.provider { } public class FontsContract { - method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[], int, boolean, java.lang.String); method public static android.graphics.Typeface buildTypeface(android.content.Context, android.os.CancellationSignal, android.provider.FontsContract.FontInfo[]); method public static android.provider.FontsContract.FontFamilyResult fetchFonts(android.content.Context, android.os.CancellationSignal, android.provider.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException; method public static void requestFonts(android.content.Context, android.provider.FontRequest, android.os.Handler, android.os.CancellationSignal, android.provider.FontsContract.FontRequestCallback); diff --git a/core/java/android/provider/FontsContract.java b/core/java/android/provider/FontsContract.java index 6c038c787d59..1013b0f0af23 100644 --- a/core/java/android/provider/FontsContract.java +++ b/core/java/android/provider/FontsContract.java @@ -607,43 +607,6 @@ public class FontsContract { } /** - * Build a Typeface from an array of {@link FontInfo}. Results that are marked as not ready - * will be skipped. - * - * @param context A {@link Context} that will be used to fetch the font contents. - * @param cancellationSignal A signal to cancel the operation in progress, or null if none. If - * the operation is canceled, then {@link - * android.os.OperationCanceledException} will be thrown. - * @param fonts An array of {@link FontInfo} to be used to create a Typeface. - * @param weight A weight value to be used for selecting a font from a font family. - * @param italic {@code true} if this font is of italic style. This will be used for font - * selection from a font family. - * @param fallbackFontName A fallback font name used if this method fails to create the - * Typeface. By passing {@code null}, this method returns {@code null} - * if typeface creation fails. - * @return A Typeface object. May return {@code null} if that is the value passed to {@code - * fallBackFontName}. - */ - public static Typeface buildTypeface(@NonNull Context context, - @Nullable CancellationSignal cancellationSignal, @NonNull FontInfo[] fonts, - int weight, boolean italic, @Nullable String fallbackFontName) { - if (context.isRestricted()) { - // TODO: Should we allow if the peer process is system or myself? - return null; - } - final Map<Uri, ByteBuffer> uriBuffer = - prepareFontData(context, fonts, cancellationSignal); - if (uriBuffer.isEmpty()) { - return null; - } - return new Typeface.Builder(fonts, uriBuffer) - .setFallback(fallbackFontName) - .setWeight(weight) - .setItalic(italic) - .build(); - } - - /** * Build a Typeface from an array of {@link FontInfo} * * Results that are marked as not ready will be skipped. |