content: package androidx.core.provider;
  
  import android.content.Context;
  import android.content.pm.PackageManager;
  import android.content.pm.ProviderInfo;
  import android.content.res.Resources;
  import android.graphics.Typeface;
  import android.net.Uri;
  import android.os.CancellationSignal;
  import android.os.Handler;
  import android.provider.BaseColumns;
  import androidx.core.content.res.ResourcesCompat;
  import androidx.core.graphics.TypefaceCompat;
  import androidx.core.graphics.TypefaceCompatUtil;
  import androidx.core.util.Preconditions;
  import java.lang.annotation.Retention;
  import java.lang.annotation.RetentionPolicy;
  import java.nio.ByteBuffer;
  import java.util.Map;
  import java.util.concurrent.Executor;
  
  public class FontsContractCompat {
      @Deprecated
      public static final String PARCEL_FONT_RESULTS = "font_results";
      @Deprecated
      static final int RESULT_CODE_PROVIDER_NOT_FOUND = -1;
      @Deprecated
      static final int RESULT_CODE_WRONG_CERTIFICATES = -2;
  
      public static final class Columns implements BaseColumns {
          public static final String FILE_ID = "file_id";
          public static final String ITALIC = "font_italic";
          public static final String RESULT_CODE = "result_code";
          public static final int RESULT_CODE_FONT_NOT_FOUND = 1;
          public static final int RESULT_CODE_FONT_UNAVAILABLE = 2;
          public static final int RESULT_CODE_MALFORMED_QUERY = 3;
          public static final int RESULT_CODE_OK = 0;
          public static final String TTC_INDEX = "font_ttc_index";
          public static final String VARIATION_SETTINGS = "font_variation_settings";
          public static final String WEIGHT = "font_weight";
      }
  
      public static class FontFamilyResult {
          public static final int STATUS_OK = 0;
          public static final int STATUS_UNEXPECTED_DATA_PROVIDED = 2;
          public static final int STATUS_WRONG_CERTIFICATES = 1;
          private final FontInfo[] mFonts;
          private final int mStatusCode;
  
          @Deprecated
          public FontFamilyResult(int statusCode, FontInfo[] fonts) {
              this.mStatusCode = statusCode;
              this.mFonts = fonts;
          }
  
          static FontFamilyResult create(int statusCode, FontInfo[] fonts) {
              return new FontFamilyResult(statusCode, fonts);
          }
  
          public FontInfo[] getFonts() {
              return this.mFonts;
          }
  
          public int getStatusCode() {
              return this.mStatusCode;
          }
      }
  
      public static class FontInfo {
          private final boolean mItalic;
          private final int mResultCode;
          private final int mTtcIndex;
          private final Uri mUri;
          private final int mWeight;
  
          @Deprecated
          public FontInfo(Uri uri, int ttcIndex, int weight, boolean italic, int resultCode) {
              this.mUri = (Uri) Preconditions.checkNotNull(uri);
              this.mTtcIndex = ttcIndex;
              this.mWeight = weight;
              this.mItalic = italic;
              this.mResultCode = resultCode;
          }
  
          static FontInfo create(Uri uri, int ttcIndex, int weight, boolean italic, int resultCode) {
              return new FontInfo(uri, ttcIndex, weight, italic, resultCode);
          }
  
          public int getResultCode() {
              return this.mResultCode;
          }
  
          public int getTtcIndex() {
              return this.mTtcIndex;
          }
  
          public Uri getUri() {
              return this.mUri;
          }
  
          public int getWeight() {
              return this.mWeight;
          }
  
          public boolean isItalic() {
              return this.mItalic;
          }
      }
  
      public static class FontRequestCallback {
          public static final int FAIL_REASON_FONT_LOAD_ERROR = -3;
          public static final int FAIL_REASON_FONT_NOT_FOUND = 1;
          public static final int FAIL_REASON_FONT_UNAVAILABLE = 2;
          public static final int FAIL_REASON_MALFORMED_QUERY = 3;
          public static final int FAIL_REASON_PROVIDER_NOT_FOUND = -1;
          public static final int FAIL_REASON_SECURITY_VIOLATION = -4;
          public static final int FAIL_REASON_WRONG_CERTIFICATES = -2;
          @Deprecated
          public static final int RESULT_OK = 0;
          static final int RESULT_SUCCESS = 0;
  
          @Retention(RetentionPolicy.SOURCE)
          public @interface FontRequestFailReason {
          }
  
          public void onTypefaceRequestFailed(int reason) {
          }
  
          public void onTypefaceRetrieved(Typeface typeface) {
          }
      }
  
      private FontsContractCompat() {
      }
  
      public static Typeface buildTypeface(Context context, CancellationSignal cancellationSignal, FontInfo[] fonts) {
          return TypefaceCompat.createFromFontInfo(context, cancellationSignal, fonts, 0);
      }
  
      public static FontFamilyResult fetchFonts(Context context, CancellationSignal cancellationSignal, FontRequest request) throws PackageManager.NameNotFoundException {
          return FontProvider.getFontFamilyResult(context, request, cancellationSignal);
      }
  
      @Deprecated
      public static Typeface getFontSync(Context context, FontRequest request, ResourcesCompat.FontCallback fontCallback, Handler handler, boolean isBlockingFetch, int timeout, int style) {
          return requestFont(context, request, style, isBlockingFetch, timeout, ResourcesCompat.FontCallback.getHandler(handler), new TypefaceCompat.ResourcesCallbackAdapter(fontCallback));
      }
  
      @Deprecated
      public static ProviderInfo getProvider(PackageManager packageManager, FontRequest request, Resources resources) throws PackageManager.NameNotFoundException {
          return FontProvider.getProvider(packageManager, request, resources);
      }
  
      @Deprecated
      public static Map<Uri, ByteBuffer> prepareFontData(Context context, FontInfo[] fonts, CancellationSignal cancellationSignal) {
          return TypefaceCompatUtil.readFontInfoIntoByteBuffer(context, fonts, cancellationSignal);
      }
  
      public static Typeface requestFont(Context context, FontRequest request, int style, boolean isBlockingFetch, int timeout, Handler handler, FontRequestCallback callback) {
          CallbackWithHandler callbackWithHandler = new CallbackWithHandler(callback, handler);
          return isBlockingFetch ? FontRequestWorker.requestFontSync(context, request, callbackWithHandler, style, timeout) : FontRequestWorker.requestFontAsync(context, request, style, (Executor) null, callbackWithHandler);
      }
  
      public static void requestFont(Context context, FontRequest request, FontRequestCallback callback, Handler handler) {
          CallbackWithHandler callbackWithHandler = new CallbackWithHandler(callback);
          FontRequestWorker.requestFontAsync(context.getApplicationContext(), request, 0, RequestExecutor.createHandlerExecutor(handler), callbackWithHandler);
      }
  
      @Deprecated
      public static void resetCache() {
          FontRequestWorker.resetTypefaceCache();
      }
  
      public static void resetTypefaceCache() {
          FontRequestWorker.resetTypefaceCache();
      }
  }
  