Java Code Examples for android.provider.DocumentsContract#isDocumentUri()

The following examples show how to use android.provider.DocumentsContract#isDocumentUri() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ImageUtil.java    From XposedNavigationBar with GNU General Public License v3.0 10 votes vote down vote up
/**
 * @param data
 * @return 图片路径
 */
public static String handleImageOnKitKat(Intent data) {
    String imagePath = "";
    Log.i(TAG, "handleImageOnKitKat: ");

    Uri uri = data.getData();
    if (DocumentsContract.isDocumentUri(MyApplication.getContext(), uri)) {
        //如果是document类型的uri,则通过document id处理
        String docId = DocumentsContract.getDocumentId(uri);
        if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
            String id = docId.split(":")[1];//解析出数字格式的ID
            String selection = MediaStore.Images.Media._ID + "=" + id;
            imagePath = getImagePath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection);
        } else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) {
            Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(docId));
            imagePath = getImagePath(contentUri, null);
        }
    } else if ("content".equalsIgnoreCase(uri.getScheme())) {
        //如果是content类型的uri,则使用普通的方式处理
        imagePath = getImagePath(uri, null);
    } else if ("file".equalsIgnoreCase(uri.getScheme())) {
        //如果是file类型的uri,直接获取图片路径即可
        imagePath = uri.getPath();
    }
    return imagePath;
}
 
Example 2
Source File: ZipStorageDocumentFile.java    From ToGoZip with GNU General Public License v3.0 10 votes vote down vote up
public static String getPath(final Context context, final Uri uri) {
    // DocumentProvider
    if (DocumentsContract.isDocumentUri(context, uri)) {
        // ExternalStorageProvider
        if (isExternalStorageDocument(uri)) {
            final String docId = DocumentsContract.getDocumentId(uri);
            final String[] split = docId.split(":");
            final String type = split[0];

            if ("primary".equalsIgnoreCase(type)) {
                final File externalStorageDirectory = Environment.getExternalStorageDirectory();

                // split[1] results in index out of bound exception in storage root dir
                if (split.length == 1) return externalStorageDirectory.toString();
                return externalStorageDirectory + "/" + split[1];
            }

            // TODO handle non-primary volumes
        }
    }
    if ("file".equalsIgnoreCase(uri.getScheme())) {
        return uri.getPath();
    }
    return null;
}
 
Example 3
Source File: FileUtils.java    From HeartBeat with Apache License 2.0 9 votes vote down vote up
@SuppressLint("NewApi")
public static String uriToPath(Context context, Uri uri) {
    boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
    if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
        final String docId = DocumentsContract.getDocumentId(uri);
        Log.d("maxiee", "docID:" + docId);
        final String[] split = docId.split(":");
        final String type = split[0];
        Uri contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
        final String selection = "_id=?";
        final String[] selectionArgs = new String[] {split[1]};
        return getDataColumn(context, contentUri, selection, selectionArgs);
    } else if ("content".equalsIgnoreCase(uri.getScheme())){
        return getDataColumn(context, uri, null, null);
    } else if ("file".equalsIgnoreCase(uri.getScheme())) {
        return uri.getPath();
    }
    return null;
}
 
Example 4
Source File: SettingPresenterImpel.java    From BetterWay with Apache License 2.0 8 votes vote down vote up
@Override
    public String handleImageOnKitKat(Intent data) {
        LogUtil.d(TAG, "handleImageOnkitKat");
        String imagePath = null;
        Uri uri = data.getData();
        if (DocumentsContract.isDocumentUri(mSettingView.getSettingActivity().getApplicationContext(), uri)) {
        //如果是document类型的Uri,则通过documentid处理
        String docId = DocumentsContract.getDocumentId(uri);
        if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
            String id = docId.split(":")[1]; //解析出数字格式的id
            String selection = MediaStore.Images.Media._ID + '=' + id;
            imagePath = getImagePath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection);
        } else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) {
            Uri contenUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"),
                    Long.valueOf(docId));
            imagePath = getImagePath(contenUri, null);
        }
    } else if ("content".equalsIgnoreCase(uri.getScheme())) {
            imagePath = getImagePath(uri, null);
    } else if ("file".equalsIgnoreCase(uri.getScheme())) {
            imagePath = uri.getPath();
    }
        return imagePath;
}
 
Example 5
Source File: ContentUriUtils.java    From 365browser with Apache License 2.0 6 votes vote down vote up
/**
 * Checks whether the passed Uri represents a virtual document.
 *
 * @param uri the content URI to be resolved.
 * @return True for virtual file, false for any other file.
 */
private static boolean isVirtualDocument(Uri uri) {
    if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return false;
    if (uri == null) return false;
    if (!DocumentsContract.isDocumentUri(ContextUtils.getApplicationContext(), uri)) {
        return false;
    }
    ContentResolver contentResolver = ContextUtils.getApplicationContext().getContentResolver();
    Cursor cursor = null;
    try {
        cursor = contentResolver.query(uri, null, null, null, null);

        if (cursor != null && cursor.getCount() >= 1) {
            cursor.moveToFirst();
            return hasVirtualFlag(cursor);
        }
    } catch (NullPointerException e) {
        // Some android models don't handle the provider call correctly.
        // see crbug.com/345393
        return false;
    } finally {
        StreamUtil.closeQuietly(cursor);
    }
    return false;
}
 
Example 6
Source File: EditNotePresenter.java    From SuperNote with GNU General Public License v3.0 6 votes vote down vote up
@TargetApi(19)
    private void handleImageOnKitKat(Intent data) {
        String imagePath = null;
        Uri uri = data.getData();
        if (DocumentsContract.isDocumentUri(mView.getActivity(), uri)) {
//            如果是documentlent类型的URI,则通过docment id处理
            String docId = DocumentsContract.getDocumentId(uri);
            if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
                String id = docId.split(":")[1];
                String selection = MediaStore.Images.Media._ID + "=" + id;
                imagePath = getImagePatch(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection);
            } else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) {
                Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(docId));
                imagePath = getImagePatch(contentUri, null);
            }
        } else if ("content".equalsIgnoreCase(uri.getScheme())) {
//            如果是content类型的uri的话,则使用普通方式处理
            imagePath = getImagePatch(uri, null);
        } else if ("file".equalsIgnoreCase(uri.getScheme())) {
//            若果是file类型的uri,则直接获取图片路径
            imagePath = uri.getPath();
        }
        copyFileInOtherThread(imagePath);
    }
 
Example 7
Source File: FilePathHelper.java    From qcloud-sdk-android-samples with MIT License 6 votes vote down vote up
@RequiresApi(api = Build.VERSION_CODES.KITKAT)
private static String getKitKatPathFromMediaUri(Context context, Uri uri) {

    String imagePath = "";
    if (DocumentsContract.isDocumentUri(context, uri)) {
        String docId = DocumentsContract.getDocumentId(uri);
        if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
            //Log.d(TAG, uri.toString());
            String id = docId.split(":")[1];
            String selection = MediaStore.Images.Media._ID + "=" + id;

            imagePath = getImagePathFromMediaUri(context, MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection);
        } else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) {
            //Log.d(TAG, uri.toString());
            Uri contentUri = ContentUris.withAppendedId(
                    Uri.parse("content://downloads/public_downloads"),
                    Long.valueOf(docId));
            imagePath = getImagePathFromMediaUri(context, contentUri, null);
        }
    } else if ("content".equalsIgnoreCase(uri.getScheme())) {
        //Log.d(TAG, "content: " + uri.toString());
        imagePath = getImagePathFromMediaUri(context, uri, null);
    }
    return imagePath;
}
 
Example 8
Source File: CameraUtils.java    From BaseProject with Apache License 2.0 6 votes vote down vote up
@TargetApi(19)
public static void handleImageOnKitKat(Activity activity, Intent data) {
    Uri uri = data.getData();
    if (DocumentsContract.isDocumentUri(activity, uri)) {
        // 如果是document类型的Uri,则通过document id进行处理
        String docId = DocumentsContract.getDocumentId(uri);
        if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
            String id = docId.split(":")[1]; // 解析出数字格式的id
            String selection = MediaStore.Images.Media._ID + "=" + id;
            albumPhotonUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
        } else if ("com.android.provides.downloads.documents".equals(uri.getAuthority())) {
            Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"),
                    Long.valueOf(docId));
            albumPhotonUri = contentUri;
        }
    } else if ("content".equalsIgnoreCase(uri.getScheme())) {
        // 如果不是document类型的uri,则使用普通方式处理
        albumPhotonUri = uri;
    }

    albumChooseZoom(activity, uri);
}
 
Example 9
Source File: MainActivity.java    From GenerateQRCode with Apache License 2.0 6 votes vote down vote up
/**
 * 4.4以后
 *
 * @param data
 */
@SuppressLint("NewApi")
private void handleImageOnKitKat(Intent data) {
    String imagePath = null;
    Uri uri = data.getData();
    Log.d("TAG", "handleImageOnKitKat: uri is " + uri);
    if (DocumentsContract.isDocumentUri(this, uri)) {
        // 如果是document类型的Uri,则通过document id处理
        String docId = DocumentsContract.getDocumentId(uri);
        if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
            String id = docId.split(":")[1]; // 解析出数字格式的id
            String selection = MediaStore.Images.Media._ID + "=" + id;
            imagePath = getImagePath(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection);
        } else if ("com.android.providers.downloads.documents".equals(uri.getAuthority())) {
            Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(docId));
            imagePath = getImagePath(contentUri, null);
        }
    } else if ("content".equalsIgnoreCase(uri.getScheme())) {
        // 如果是content类型的Uri,则使用普通方式处理
        imagePath = getImagePath(uri, null);
    } else if ("file".equalsIgnoreCase(uri.getScheme())) {
        // 如果是file类型的Uri,直接获取图片路径即可
        imagePath = uri.getPath();
    }
    displayImage(imagePath); // 根据图片路径显示图片
}
 
Example 10
Source File: SelectAlbumUtils.java    From imsdk-android with MIT License 6 votes vote down vote up
/**
 * 4.4以上的处理
 *
 * @param data
 * @return
 */
@TargetApi(19)
private static String getPicOnKitKatAfter(Context context, Intent data) {
    String imagePath = null;
    Uri uri = data.getData();
    if (DocumentsContract.isDocumentUri(context, uri)) {
        String docId = DocumentsContract.getDocumentId(uri);
        if ("com.android.providers.media.documents".equals(uri.getAuthority())) {
            String id = docId.split(":")[1];
            String selection = MediaStore.Images.Media._ID + "=" + id;
            imagePath = getImagePath(context, MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection);
        } else if ("com.android.provider.downloads.documents".equals(uri.getAuthority())) {
            Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(docId));
            imagePath = getImagePath(context, contentUri, null);
        }
    } else if ("content".equalsIgnoreCase(uri.getScheme())) {
        imagePath = getImagePath(context, uri, null);
    } else if ("file".equalsIgnoreCase(uri.getScheme())) {
        imagePath = uri.getPath();
    }
    return imagePath;
}
 
Example 11
Source File: UploadWidgetActivity.java    From cloudinary_android with MIT License 6 votes vote down vote up
@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == MEDIA_CHOOSER_REQUEST_CODE) {
        if (resultCode == RESULT_OK && data != null) {
            ArrayList<Uri> uris = extractImageUris(data);

            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
                final int takeFlags = data.getFlags() & (Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
                for (Uri uri : uris) {
                    if (DocumentsContract.isDocumentUri(this, uri)) {
                        getContentResolver().takePersistableUriPermission(uri, takeFlags);
                    }
                }
            }

            showImages(uris);
        } else {
            setResult(RESULT_CANCELED);
            finish();
        }
    }
}
 
Example 12
Source File: ActionDialog.java    From Passbook with Apache License 2.0 5 votes vote down vote up
private String getFilePath(Activity context, Uri uri){
    String docId;
    Uri contentUri;
    if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT  &&
            DocumentsContract.isDocumentUri(context, uri)){
        if("com.android.externalstorage.documents".equals(uri.getAuthority())) {
            docId = DocumentsContract.getDocumentId(uri);
            final String split[] = docId.split(":");
            if("primary".equalsIgnoreCase(split[0])) {
                return Environment.getExternalStorageDirectory() + "/" + split[1];
            }
        }
        else if("com.android.providers.downloads.documents".equals(uri.getAuthority())) {
            docId = DocumentsContract.getDocumentId(uri);
            contentUri = ContentUris.withAppendedId(
                    Uri.parse("content://downloads//public_downloads"), Long.valueOf(docId));
            return getDataColumn(context, contentUri, null, null);
        }
    }
    else if(uri.getScheme().equalsIgnoreCase("content")) {
        return  getDataColumn(context, uri, null, null);
    }
    else if(uri.getScheme().equalsIgnoreCase("file")){
        return uri.getPath();
    }
    return null;
}
 
Example 13
Source File: PathUtil.java    From TextThing with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@SuppressLint("NewApi")
public static String getPath(Context context, Uri uri) throws URISyntaxException {
    final boolean needToCheckUri = Build.VERSION.SDK_INT >= 19;
    String selection = null;
    String[] selectionArgs = null;
    // Uri is different in versions after KITKAT (Android 4.4), we need to
    // deal with different Uris.
    if (needToCheckUri && DocumentsContract.isDocumentUri(context.getApplicationContext(), uri)) {
        if (isExternalStorageDocument(uri)) {
            final String docId = DocumentsContract.getDocumentId(uri);
            final String[] split = docId.split(":");

            Log.d(App.PACKAGE_NAME, "uri get path from: " + uri.toString());
            if (uri.toString().startsWith("content://com.android.externalstorage.documents/document/home%3A")) {
                return Environment.getExternalStorageDirectory() + "/Documents/" + split[1];
            } else {
                return Environment.getExternalStorageDirectory() + "/" + split[1];
            }
        } else if (isDownloadsDocument(uri)) {
            Log.w(App.PACKAGE_NAME, "files from magic downloads folder not supported");

            /*
            final String id = DocumentsContract.getDocumentId(uri);
            uri = ContentUris.withAppendedId(
                    Uri.parse("content://downloads/public_downloads"), Long.valueOf(id));
            */
        } else if (isMediaDocument(uri)) {
            Log.w(App.PACKAGE_NAME, "files from magic media folder not supported");
            /*
            final String docId = DocumentsContract.getDocumentId(uri);
            final String[] split = docId.split(":");
            final String type = split[0];
            if ("image".equals(type)) {
                uri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
            } else if ("video".equals(type)) {
                uri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
            } else if ("audio".equals(type)) {
                uri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
            }
            selection = "_id=?";
            selectionArgs = new String[]{ split[1] };
            */
        }
    }

    return uri.getPath();
}
 
Example 14
Source File: FileUtil.java    From RichEditor with MIT License 5 votes vote down vote up
/**
 * 适配api19及以上,根据uri获取图片的绝对路径
 *
 * @param context 上下文对象
 * @param uri     图片的Uri
 * @return 如果Uri对应的图片存在, 那么返回该图片的绝对路径, 否则返回null
 */
@SuppressLint("NewApi")
private static String getRealPathFromUriAboveApi19(Context context, Uri uri) {
    String filePath = null;
    if (DocumentsContract.isDocumentUri(context, uri)) {
        // 如果是document类型的 uri, 则通过document id来进行处理
        String documentId = DocumentsContract.getDocumentId(uri);
        if (isMediaDocument(uri)) { // MediaProvider
            // 使用':'分割
            String id = documentId.split(":")[1];

            String selection = MediaStore.Images.Media._ID + "=?";
            String[] selectionArgs = {id};
            filePath = getDataColumn(context, MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection, selectionArgs);
        } else if (isDownloadsDocument(uri)) { // DownloadsProvider
            Uri contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(documentId));
            filePath = getDataColumn(context, contentUri, null, null);
        }
    } else if ("content".equalsIgnoreCase(uri.getScheme())) {
        // 如果是 content 类型的 Uri
        filePath = getDataColumn(context, uri, null, null);
    } else if ("file".equals(uri.getScheme())) {
        // 如果是 file 类型的 Uri,直接获取图片对应的路径
        filePath = uri.getPath();
    }
    return filePath;
}
 
Example 15
Source File: ConvertUtils.java    From AndroidPicker with MIT License 4 votes vote down vote up
/**
 * 从第三方文件选择器获取路径。
 * 参见:http://blog.csdn.net/zbjdsbj/article/details/42387551
 */
@TargetApi(Build.VERSION_CODES.KITKAT)
public static String toPath(Context context, Uri uri) {
    if (uri == null) {
        LogUtils.verbose("uri is null");
        return "";
    }
    LogUtils.verbose("uri: " + uri.toString());
    String path = uri.getPath();
    String scheme = uri.getScheme();
    String authority = uri.getAuthority();
    //是否是4.4及以上版本
    boolean isKitKat = Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT;
    // DocumentProvider
    if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
        String docId = DocumentsContract.getDocumentId(uri);
        String[] split = docId.split(":");
        String type = split[0];
        Uri contentUri = null;
        switch (authority) {
            // ExternalStorageProvider
            case "com.android.externalstorage.documents":
                if ("primary".equalsIgnoreCase(type)) {
                    return Environment.getExternalStorageDirectory() + "/" + split[1];
                }
                break;
            // DownloadsProvider
            case "com.android.providers.downloads.documents":
                contentUri = ContentUris.withAppendedId(
                        Uri.parse("content://downloads/public_downloads"), Long.valueOf(docId));
                return _queryPathFromMediaStore(context, contentUri, null, null);
            // MediaProvider
            case "com.android.providers.media.documents":
                if ("image".equals(type)) {
                    contentUri = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
                } else if ("video".equals(type)) {
                    contentUri = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
                } else if ("audio".equals(type)) {
                    contentUri = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
                }
                String selection = "_id=?";
                String[] selectionArgs = new String[]{split[1]};
                return _queryPathFromMediaStore(context, contentUri, selection, selectionArgs);
        }
    }
    // MediaStore (and general)
    else {
        if ("content".equalsIgnoreCase(scheme)) {
            // Return the remote address
            if (authority.equals("com.google.android.apps.photos.content")) {
                return uri.getLastPathSegment();
            }
            return _queryPathFromMediaStore(context, uri, null, null);
        }
        // File
        else if ("file".equalsIgnoreCase(scheme)) {
            return uri.getPath();
        }
    }
    LogUtils.verbose("uri to path: " + path);
    return path;
}
 
Example 16
Source File: FeedBackImageView.java    From letv with Apache License 2.0 4 votes vote down vote up
@SuppressLint({"NewApi"})
public String getPath(Context context, Uri uri) {
    boolean isKitKat;
    if (VERSION.SDK_INT >= 19) {
        isKitKat = true;
    } else {
        isKitKat = false;
    }
    if (isKitKat && DocumentsContract.isDocumentUri(context, uri)) {
        String[] split;
        if (isExternalStorageDocument(uri)) {
            split = DocumentsContract.getDocumentId(uri).split(NetworkUtils.DELIMITER_COLON);
            if ("primary".equalsIgnoreCase(split[0])) {
                return Environment.getExternalStorageDirectory() + "/" + split[1];
            }
            return null;
        } else if (isDownloadsDocument(uri)) {
            return getDataColumn(context, ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(DocumentsContract.getDocumentId(uri)).longValue()), null, null);
        } else if (!isMediaDocument(uri)) {
            return null;
        } else {
            String type = DocumentsContract.getDocumentId(uri).split(NetworkUtils.DELIMITER_COLON)[0];
            Uri contentUri = null;
            if ("image".equals(type)) {
                contentUri = Media.EXTERNAL_CONTENT_URI;
            } else if ("video".equals(type)) {
                contentUri = Video.Media.EXTERNAL_CONTENT_URI;
            } else if ("audio".equals(type)) {
                contentUri = Audio.Media.EXTERNAL_CONTENT_URI;
            }
            String selection = "_id=?";
            return getDataColumn(context, contentUri, "_id=?", new String[]{split[1]});
        }
    } else if (WidgetRequestParam.REQ_PARAM_COMMENT_CONTENT.equalsIgnoreCase(uri.getScheme())) {
        if (isGooglePhotosUri(uri)) {
            return uri.getLastPathSegment();
        }
        return getDataColumn(context, uri, null, null);
    } else if (IDataSource.SCHEME_FILE_TAG.equalsIgnoreCase(uri.getScheme())) {
        return uri.getPath();
    } else {
        return null;
    }
}
 
Example 17
Source File: UriUtils.java    From chat-window-android with MIT License 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.KITKAT)
private static boolean isDocumentUri(Context context, Uri uri) {
    return DocumentsContract.isDocumentUri(context, uri);
}
 
Example 18
Source File: CompatibilityImpl.java    From Overchan-Android with GNU General Public License v3.0 4 votes vote down vote up
@TargetApi(Build.VERSION_CODES.KITKAT)
public static boolean isDocumentUri(Context context, Uri uri) {
    return DocumentsContract.isDocumentUri(context, uri);
}
 
Example 19
Source File: DocumentsContractApi19.java    From FireFiles with Apache License 2.0 4 votes vote down vote up
public static boolean isDocumentUri(Context context, Uri self) {
    return DocumentsContract.isDocumentUri(context, self);
}
 
Example 20
Source File: DocumentsContractApi19.java    From adt-leanback-support with Apache License 2.0 4 votes vote down vote up
public static boolean isDocumentUri(Context context, Uri self) {
    return DocumentsContract.isDocumentUri(context, self);
}