content: package androidx.core.provider;
  
  import android.content.ContentResolver;
  import android.content.Context;
  import android.net.Uri;
  import android.os.Build;
  import android.provider.DocumentsContract;
  import java.io.FileNotFoundException;
  import java.util.List;
  import mt.Log1F380D;
  
  /* compiled from: 004E */
  public final class DocumentsContractCompat {
      private static final String PATH_TREE = "tree";
  
      public static final class DocumentCompat {
          public static final int FLAG_VIRTUAL_DOCUMENT = 512;
  
          private DocumentCompat() {
          }
      }
  
      /* compiled from: 004C */
      private static class DocumentsContractApi19Impl {
          private DocumentsContractApi19Impl() {
          }
  
          public static Uri buildDocumentUri(String authority, String documentId) {
              return DocumentsContract.buildDocumentUri(authority, documentId);
          }
  
          static boolean deleteDocument(ContentResolver content, Uri documentUri) throws FileNotFoundException {
              return DocumentsContract.deleteDocument(content, documentUri);
          }
  
          static String getDocumentId(Uri documentUri) {
              String documentId = DocumentsContract.getDocumentId(documentUri);
              Log1F380D.a((Object) documentId);
              return documentId;
          }
  
          static boolean isDocumentUri(Context context, Uri uri) {
              return DocumentsContract.isDocumentUri(context, uri);
          }
      }
  
      /* compiled from: 004D */
      private static class DocumentsContractApi21Impl {
          private DocumentsContractApi21Impl() {
          }
  
          static Uri buildChildDocumentsUri(String authority, String parentDocumentId) {
              return DocumentsContract.buildChildDocumentsUri(authority, parentDocumentId);
          }
  
          static Uri buildChildDocumentsUriUsingTree(Uri treeUri, String parentDocumentId) {
              return DocumentsContract.buildChildDocumentsUriUsingTree(treeUri, parentDocumentId);
          }
  
          static Uri buildDocumentUriUsingTree(Uri treeUri, String documentId) {
              return DocumentsContract.buildDocumentUriUsingTree(treeUri, documentId);
          }
  
          public static Uri buildTreeDocumentUri(String authority, String documentId) {
              return DocumentsContract.buildTreeDocumentUri(authority, documentId);
          }
  
          static Uri createDocument(ContentResolver content, Uri parentDocumentUri, String mimeType, String displayName) throws FileNotFoundException {
              return DocumentsContract.createDocument(content, parentDocumentUri, mimeType, displayName);
          }
  
          static String getTreeDocumentId(Uri documentUri) {
              String treeDocumentId = DocumentsContract.getTreeDocumentId(documentUri);
              Log1F380D.a((Object) treeDocumentId);
              return treeDocumentId;
          }
  
          static Uri renameDocument(ContentResolver content, Uri documentUri, String displayName) throws FileNotFoundException {
              return DocumentsContract.renameDocument(content, documentUri, displayName);
          }
      }
  
      private static class DocumentsContractApi24Impl {
          private DocumentsContractApi24Impl() {
          }
  
          static boolean isTreeUri(Uri uri) {
              return DocumentsContract.isTreeUri(uri);
          }
  
          static boolean removeDocument(ContentResolver content, Uri documentUri, Uri parentDocumentUri) throws FileNotFoundException {
              return DocumentsContract.removeDocument(content, documentUri, parentDocumentUri);
          }
      }
  
      private DocumentsContractCompat() {
      }
  
      public static Uri buildChildDocumentsUri(String authority, String parentDocumentId) {
          if (Build.VERSION.SDK_INT >= 21) {
              return DocumentsContractApi21Impl.buildChildDocumentsUri(authority, parentDocumentId);
          }
          return null;
      }
  
      public static Uri buildChildDocumentsUriUsingTree(Uri treeUri, String parentDocumentId) {
          if (Build.VERSION.SDK_INT >= 21) {
              return DocumentsContractApi21Impl.buildChildDocumentsUriUsingTree(treeUri, parentDocumentId);
          }
          return null;
      }
  
      public static Uri buildDocumentUri(String authority, String documentId) {
          if (Build.VERSION.SDK_INT >= 19) {
              return DocumentsContractApi19Impl.buildDocumentUri(authority, documentId);
          }
          return null;
      }
  
      public static Uri buildDocumentUriUsingTree(Uri treeUri, String documentId) {
          if (Build.VERSION.SDK_INT >= 21) {
              return DocumentsContractApi21Impl.buildDocumentUriUsingTree(treeUri, documentId);
          }
          return null;
      }
  
      public static Uri buildTreeDocumentUri(String authority, String documentId) {
          if (Build.VERSION.SDK_INT >= 21) {
              return DocumentsContractApi21Impl.buildTreeDocumentUri(authority, documentId);
          }
          return null;
      }
  
      public static Uri createDocument(ContentResolver content, Uri parentDocumentUri, String mimeType, String displayName) throws FileNotFoundException {
          if (Build.VERSION.SDK_INT >= 21) {
              return DocumentsContractApi21Impl.createDocument(content, parentDocumentUri, mimeType, displayName);
          }
          return null;
      }
  
      public static String getDocumentId(Uri documentUri) {
          if (Build.VERSION.SDK_INT < 19) {
              return null;
          }
          String documentId = DocumentsContractApi19Impl.getDocumentId(documentUri);
          Log1F380D.a((Object) documentId);
          return documentId;
      }
  
      public static boolean isDocumentUri(Context context, Uri uri) {
          if (Build.VERSION.SDK_INT >= 19) {
              return DocumentsContractApi19Impl.isDocumentUri(context, uri);
          }
          return false;
      }
  
      public static boolean isTreeUri(Uri uri) {
          if (Build.VERSION.SDK_INT < 21) {
              return false;
          }
          if (Build.VERSION.SDK_INT >= 24) {
              return DocumentsContractApi24Impl.isTreeUri(uri);
          }
          List<String> pathSegments = uri.getPathSegments();
          return pathSegments.size() >= 2 && PATH_TREE.equals(pathSegments.get(0));
      }
  
      public static boolean removeDocument(ContentResolver content, Uri documentUri, Uri parentDocumentUri) throws FileNotFoundException {
          if (Build.VERSION.SDK_INT >= 24) {
              return DocumentsContractApi24Impl.removeDocument(content, documentUri, parentDocumentUri);
          }
          if (Build.VERSION.SDK_INT >= 19) {
              return DocumentsContractApi19Impl.deleteDocument(content, documentUri);
          }
          return false;
      }
  
      public static Uri renameDocument(ContentResolver content, Uri documentUri, String displayName) throws FileNotFoundException {
          if (Build.VERSION.SDK_INT >= 21) {
              return DocumentsContractApi21Impl.renameDocument(content, documentUri, displayName);
          }
          return null;
      }
  
      public static String getTreeDocumentId(Uri documentUri) {
          if (Build.VERSION.SDK_INT < 21) {
              return null;
          }
          String treeDocumentId = DocumentsContractApi21Impl.getTreeDocumentId(documentUri);
          Log1F380D.a((Object) treeDocumentId);
          return treeDocumentId;
      }
  }
  