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

Commit 2b6bf2f2 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove FontsContract.buildTypeface with weight/italic argument." into oc-dev

parents f5162514 9610c695
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -34421,7 +34421,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);
+0 −1
Original line number Diff line number Diff line
@@ -37412,7 +37412,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);
+0 −1
Original line number Diff line number Diff line
@@ -34557,7 +34557,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);
+0 −37
Original line number Diff line number Diff line
@@ -606,43 +606,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}
     *