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

Commit 69754bf6 authored by Seigo Nonaka's avatar Seigo Nonaka
Browse files

Introduce FontsContract.fetchFonts and expose URI for watching.

FontsContract.fetchFonts provides a low level font access with fonts
provider.
This CL also includes:
- Introduce new class FontFamilyResult/Font as the inner static class
of FontsContract which are used to for result value of fetchFont..
- Introduce a functionality to FontsContract to be able to create
Typeface from an array of FontResult.
- Expose URI of each file entries to be able to register ContentObserver

Bug: 36494487
Bug: 36085028
Test: android.provider.FontsContract passes
Test: android.graphics.cts.TypefaceTest passes
Test: android.graphics.fonts.cts.FontResultTest passes

Change-Id: Id6f85039d0e86be063ef099d7ec6bfd97e4424c5
parent 1e924df6
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -34491,6 +34491,9 @@ 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.graphics.fonts.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
  }
  public static final class FontsContract.Columns implements android.provider.BaseColumns {
@@ -34507,6 +34510,23 @@ package android.provider {
    field public static final java.lang.String WEIGHT = "font_weight";
  }
  public static class FontsContract.FontFamilyResult {
    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_UNEXPECTED_DATA_PROVIDED = 2; // 0x2
    field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1
  }
  public static class FontsContract.FontInfo {
    method public android.graphics.fonts.FontVariationAxis[] getAxes();
    method public int getResultCode();
    method public int getTtcIndex();
    method public android.net.Uri getUri();
    method public int getWeight();
    method public boolean isItalic();
  }
  public final deprecated class LiveFolders implements android.provider.BaseColumns {
    field public static final java.lang.String ACTION_CREATE_LIVE_FOLDER = "android.intent.action.CREATE_LIVE_FOLDER";
    field public static final java.lang.String DESCRIPTION = "description";
+20 −0
Original line number Diff line number Diff line
@@ -37467,6 +37467,9 @@ 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.graphics.fonts.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
  }
  public static final class FontsContract.Columns implements android.provider.BaseColumns {
@@ -37483,6 +37486,23 @@ package android.provider {
    field public static final java.lang.String WEIGHT = "font_weight";
  }
  public static class FontsContract.FontFamilyResult {
    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_UNEXPECTED_DATA_PROVIDED = 2; // 0x2
    field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1
  }
  public static class FontsContract.FontInfo {
    method public android.graphics.fonts.FontVariationAxis[] getAxes();
    method public int getResultCode();
    method public int getTtcIndex();
    method public android.net.Uri getUri();
    method public int getWeight();
    method public boolean isItalic();
  }
  public final deprecated class LiveFolders implements android.provider.BaseColumns {
    field public static final java.lang.String ACTION_CREATE_LIVE_FOLDER = "android.intent.action.CREATE_LIVE_FOLDER";
    field public static final java.lang.String DESCRIPTION = "description";
+20 −0
Original line number Diff line number Diff line
@@ -34632,6 +34632,9 @@ 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.graphics.fonts.FontRequest) throws android.content.pm.PackageManager.NameNotFoundException;
  }
  public static final class FontsContract.Columns implements android.provider.BaseColumns {
@@ -34648,6 +34651,23 @@ package android.provider {
    field public static final java.lang.String WEIGHT = "font_weight";
  }
  public static class FontsContract.FontFamilyResult {
    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_UNEXPECTED_DATA_PROVIDED = 2; // 0x2
    field public static final int STATUS_WRONG_CERTIFICATES = 1; // 0x1
  }
  public static class FontsContract.FontInfo {
    method public android.graphics.fonts.FontVariationAxis[] getAxes();
    method public int getResultCode();
    method public int getTtcIndex();
    method public android.net.Uri getUri();
    method public int getWeight();
    method public boolean isItalic();
  }
  public final deprecated class LiveFolders implements android.provider.BaseColumns {
    field public static final java.lang.String ACTION_CREATE_LIVE_FOLDER = "android.intent.action.CREATE_LIVE_FOLDER";
    field public static final java.lang.String DESCRIPTION = "description";
+367 −87

File changed.

Preview size limit exceeded, changes collapsed.

+167 −130

File changed.

Preview size limit exceeded, changes collapsed.

Loading