Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -34518,6 +34518,7 @@ package android.provider { method public android.provider.FontsContract.FontInfo[] getFonts(); method public int getStatusCode(); field public static final int STATUS_OK = 0; // 0x0 field public static final int STATUS_REJECTED = 3; // 0x3 field public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; // 0x2 field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1 } api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -37507,6 +37507,7 @@ package android.provider { method public android.provider.FontsContract.FontInfo[] getFonts(); method public int getStatusCode(); field public static final int STATUS_OK = 0; // 0x0 field public static final int STATUS_REJECTED = 3; // 0x3 field public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; // 0x2 field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1 } api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -34653,6 +34653,7 @@ package android.provider { method public android.provider.FontsContract.FontInfo[] getFonts(); method public int getStatusCode(); field public static final int STATUS_OK = 0; // 0x0 field public static final int STATUS_REJECTED = 3; // 0x3 field public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; // 0x2 field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1 } core/java/android/provider/FontsContract.java +18 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,12 @@ public class FontsContract { */ public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; /** * Constant represents that the fetching font data was rejected by system. This happens if * the passed context is restricted. */ public static final int STATUS_REJECTED = 3; /** @hide */ @IntDef({STATUS_OK, STATUS_WRONG_CERTIFICATES, STATUS_UNEXPECTED_DATA_PROVIDED}) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -559,6 +565,10 @@ public class FontsContract { public static @NonNull FontFamilyResult fetchFonts( @NonNull Context context, @Nullable CancellationSignal cancellationSignal, @NonNull FontRequest request) throws NameNotFoundException { if (context.isRestricted()) { // TODO: Should we allow if the peer process is system or myself? return new FontFamilyResult(FontFamilyResult.STATUS_REJECTED, null); } ProviderInfo providerInfo = getProvider(context.getPackageManager(), request); if (providerInfo == null) { return new FontFamilyResult(FontFamilyResult.STATUS_WRONG_CERTIFICATES, null); Loading Loading @@ -594,6 +604,10 @@ public class FontsContract { 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); return new Typeface.Builder(fonts, uriBuffer) Loading @@ -617,6 +631,10 @@ public class FontsContract { */ public static Typeface buildTypeface(@NonNull Context context, @Nullable CancellationSignal cancellationSignal, @NonNull FontInfo[] fonts) { 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); return new Typeface.Builder(fonts, uriBuffer).build(); Loading Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -34518,6 +34518,7 @@ package android.provider { method public android.provider.FontsContract.FontInfo[] getFonts(); method public int getStatusCode(); field public static final int STATUS_OK = 0; // 0x0 field public static final int STATUS_REJECTED = 3; // 0x3 field public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; // 0x2 field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1 }
api/system-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -37507,6 +37507,7 @@ package android.provider { method public android.provider.FontsContract.FontInfo[] getFonts(); method public int getStatusCode(); field public static final int STATUS_OK = 0; // 0x0 field public static final int STATUS_REJECTED = 3; // 0x3 field public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; // 0x2 field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1 }
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -34653,6 +34653,7 @@ package android.provider { method public android.provider.FontsContract.FontInfo[] getFonts(); method public int getStatusCode(); field public static final int STATUS_OK = 0; // 0x0 field public static final int STATUS_REJECTED = 3; // 0x3 field public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; // 0x2 field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1 }
core/java/android/provider/FontsContract.java +18 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,12 @@ public class FontsContract { */ public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2; /** * Constant represents that the fetching font data was rejected by system. This happens if * the passed context is restricted. */ public static final int STATUS_REJECTED = 3; /** @hide */ @IntDef({STATUS_OK, STATUS_WRONG_CERTIFICATES, STATUS_UNEXPECTED_DATA_PROVIDED}) @Retention(RetentionPolicy.SOURCE) Loading Loading @@ -559,6 +565,10 @@ public class FontsContract { public static @NonNull FontFamilyResult fetchFonts( @NonNull Context context, @Nullable CancellationSignal cancellationSignal, @NonNull FontRequest request) throws NameNotFoundException { if (context.isRestricted()) { // TODO: Should we allow if the peer process is system or myself? return new FontFamilyResult(FontFamilyResult.STATUS_REJECTED, null); } ProviderInfo providerInfo = getProvider(context.getPackageManager(), request); if (providerInfo == null) { return new FontFamilyResult(FontFamilyResult.STATUS_WRONG_CERTIFICATES, null); Loading Loading @@ -594,6 +604,10 @@ public class FontsContract { 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); return new Typeface.Builder(fonts, uriBuffer) Loading @@ -617,6 +631,10 @@ public class FontsContract { */ public static Typeface buildTypeface(@NonNull Context context, @Nullable CancellationSignal cancellationSignal, @NonNull FontInfo[] fonts) { 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); return new Typeface.Builder(fonts, uriBuffer).build(); Loading