android.provider.MediaStore.Video.VideoColumns Java Examples

The following examples show how to use android.provider.MediaStore.Video.VideoColumns. 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: StorageProvider.java    From FireFiles with Apache License 2.0 6 votes vote down vote up
protected long getVideoForBucketCleared(long bucketId)
        throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    Cursor cursor = null;
    try {
        cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                VideosBucketThumbnailQuery.PROJECTION, VideoColumns.BUCKET_ID + "=" + bucketId,
                null, VideoColumns.DATE_MODIFIED + " DESC");
        if (cursor.moveToFirst()) {
            return cursor.getLong(VideosBucketThumbnailQuery._ID);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
    }
    throw new FileNotFoundException("No video found for bucket");
}
 
Example #2
Source File: StorageProvider.java    From FireFiles with Apache License 2.0 6 votes vote down vote up
protected long getVideoForBucketCleared(long bucketId)
        throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    Cursor cursor = null;
    try {
        cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                VideosBucketThumbnailQuery.PROJECTION, VideoColumns.BUCKET_ID + "=" + bucketId,
                null, VideoColumns.DATE_MODIFIED + " DESC");
        if (cursor.moveToFirst()) {
            return cursor.getLong(VideosBucketThumbnailQuery._ID);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
    }
    throw new FileNotFoundException("No video found for bucket");
}
 
Example #3
Source File: StorageProvider.java    From FireFiles with Apache License 2.0 6 votes vote down vote up
protected long getVideoForBucketCleared(long bucketId)
        throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    Cursor cursor = null;
    try {
        cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                VideosBucketThumbnailQuery.PROJECTION, VideoColumns.BUCKET_ID + "=" + bucketId,
                null, VideoColumns.DATE_MODIFIED + " DESC");
        if (cursor.moveToFirst()) {
            return cursor.getLong(VideosBucketThumbnailQuery._ID);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
    }
    throw new FileNotFoundException("No video found for bucket");
}
 
Example #4
Source File: VideoCaptureIntentTest.java    From Camera2 with Apache License 2.0 5 votes vote down vote up
@Override
protected void tearDown() throws Exception
{
    if (mVideoUri != null)
    {
        ContentResolver resolver = getActivity().getContentResolver();
        Uri query = mVideoUri.buildUpon().build();
        String[] projection = new String[]{VideoColumns.DATA};

        Cursor cursor = null;
        try
        {
            cursor = resolver.query(query, projection, null, null, null);
            if (cursor != null && cursor.moveToFirst())
            {
                new File(cursor.getString(0)).delete();
            }
        } finally
        {
            if (cursor != null)
            {
                cursor.close();
            }
        }

        resolver.delete(mVideoUri, null, null);
    }
    if (mFile != null)
    {
        mFile.delete();
    }
    if (mFile2 != null)
    {
        mFile2.delete();
    }
    super.tearDown();
}
 
Example #5
Source File: LocalAlbum.java    From medialibrary with Apache License 2.0 5 votes vote down vote up
public LocalAlbum(Path path, MediaDataContext application, int bucketId,
                  boolean isImage, String name) {
    super(path, nextVersionNumber());
    mApplication = application;
    mResolver = application.getContentResolver();
    mBucketId = bucketId;
    mName = name;
    mIsImage = isImage;

    if (isImage) {
        mWhereClause = ImageColumns.BUCKET_ID + " = ?";
        mOrderClause = ImageColumns.DATE_TAKEN + " DESC, "
                + ImageColumns._ID + " DESC";
        mBaseUri = Images.Media.EXTERNAL_CONTENT_URI;
        mProjection = LocalImage.PROJECTION;
        mItemPath = LocalImage.ITEM_PATH;
    } else {
        mWhereClause = VideoColumns.BUCKET_ID + " = ?";
        mOrderClause = VideoColumns.DATE_TAKEN + " DESC, "
                + VideoColumns._ID + " DESC";
        mBaseUri = Video.Media.EXTERNAL_CONTENT_URI;
        mProjection = LocalVideo.PROJECTION;
        mItemPath = LocalVideo.ITEM_PATH;
    }

    mNotifier = new ChangeNotifier(this, mBaseUri, application);
}
 
Example #6
Source File: MediaDocumentsProvider.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
@Override
public Cursor queryRecentDocuments(String rootId, String[] projection)
        throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));

    final long token = Binder.clearCallingIdentity();
    Cursor cursor = null;
    try {
        if (TYPE_IMAGES_ROOT.equals(rootId)) {
            // include all unique buckets
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImageQuery.PROJECTION, null, null, ImageColumns.DATE_MODIFIED + " DESC");
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            while (cursor.moveToNext() && result.getCount() < 64) {
                includeImage(result, cursor);
            }
        } else if (TYPE_VIDEOS_ROOT.equals(rootId)) {
            // include all unique buckets
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideoQuery.PROJECTION, null, null, VideoColumns.DATE_MODIFIED + " DESC");
            copyNotificationUri(result, Video.Media.EXTERNAL_CONTENT_URI);
            while (cursor.moveToNext() && result.getCount() < 64) {
                includeVideo(result, cursor);
            }
        } else {
            throw new UnsupportedOperationException("Unsupported root " + rootId);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
        Binder.restoreCallingIdentity(token);
    }
    return result;
}
 
Example #7
Source File: StorageProvider.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
protected long getVideoForPathCleared(String path)throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    Cursor cursor = null;
    try {
        cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                VideosBucketThumbnailQuery.PROJECTION, VideoColumns.DATA + "=? ",
                new String[] { path.replaceAll("'", "''") }, VideoColumns.DATE_MODIFIED + " DESC");
        if (cursor.moveToFirst()) {
            return cursor.getLong(VideosBucketThumbnailQuery._ID);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
    }
    throw new FileNotFoundException("No video found for bucket");
}
 
Example #8
Source File: MediaDocumentsProvider.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
@Override
public Cursor queryRecentDocuments(String rootId, String[] projection)
        throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));

    final long token = Binder.clearCallingIdentity();
    Cursor cursor = null;
    try {
        if (TYPE_IMAGES_ROOT.equals(rootId)) {
            // include all unique buckets
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImageQuery.PROJECTION, null, null, ImageColumns.DATE_MODIFIED + " DESC");
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            while (cursor.moveToNext() && result.getCount() < 64) {
                includeImage(result, cursor);
            }
        } else if (TYPE_VIDEOS_ROOT.equals(rootId)) {
            // include all unique buckets
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideoQuery.PROJECTION, null, null, VideoColumns.DATE_MODIFIED + " DESC");
            copyNotificationUri(result, Video.Media.EXTERNAL_CONTENT_URI);
            while (cursor.moveToNext() && result.getCount() < 64) {
                includeVideo(result, cursor);
            }
        } else {
            throw new UnsupportedOperationException("Unsupported root " + rootId);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
        Binder.restoreCallingIdentity(token);
    }
    return result;
}
 
Example #9
Source File: StorageProvider.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
protected long getVideoForPathCleared(String path)throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    Cursor cursor = null;
    try {
        cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                VideosBucketThumbnailQuery.PROJECTION, VideoColumns.DATA + "=? ",
                new String[] { path.replaceAll("'", "''") }, VideoColumns.DATE_MODIFIED + " DESC");
        if (cursor.moveToFirst()) {
            return cursor.getLong(VideosBucketThumbnailQuery._ID);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
    }
    throw new FileNotFoundException("No video found for bucket");
}
 
Example #10
Source File: MediaDocumentsProvider.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
@Override
public Cursor queryRecentDocuments(String rootId, String[] projection)
        throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));

    final long token = Binder.clearCallingIdentity();
    Cursor cursor = null;
    try {
        if (TYPE_IMAGES_ROOT.equals(rootId)) {
            // include all unique buckets
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImageQuery.PROJECTION, null, null, ImageColumns.DATE_MODIFIED + " DESC");
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            while (cursor.moveToNext() && result.getCount() < 64) {
                includeImage(result, cursor);
            }
        } else if (TYPE_VIDEOS_ROOT.equals(rootId)) {
            // include all unique buckets
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideoQuery.PROJECTION, null, null, VideoColumns.DATE_MODIFIED + " DESC");
            copyNotificationUri(result, Video.Media.EXTERNAL_CONTENT_URI);
            while (cursor.moveToNext() && result.getCount() < 64) {
                includeVideo(result, cursor);
            }
        } else {
            throw new UnsupportedOperationException("Unsupported root " + rootId);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
        Binder.restoreCallingIdentity(token);
    }
    return result;
}
 
Example #11
Source File: StorageProvider.java    From FireFiles with Apache License 2.0 5 votes vote down vote up
protected long getVideoForPathCleared(String path)throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    Cursor cursor = null;
    try {
        cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                VideosBucketThumbnailQuery.PROJECTION, VideoColumns.DATA + "=? ",
                new String[] { path.replaceAll("'", "''") }, VideoColumns.DATE_MODIFIED + " DESC");
        if (cursor.moveToFirst()) {
            return cursor.getLong(VideosBucketThumbnailQuery._ID);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
    }
    throw new FileNotFoundException("No video found for bucket");
}
 
Example #12
Source File: MediaDocumentsProvider.java    From FireFiles with Apache License 2.0 4 votes vote down vote up
@Override
public Cursor queryDocument(String docId, String[] projection) throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
    final Ident ident = getIdentForDocId(docId);

    final long token = Binder.clearCallingIdentity();
    Cursor cursor = null;
    try {
        if (TYPE_IMAGES_ROOT.equals(ident.type)) {
            // single root
            includeImagesRootDocument(result);
        } else if (TYPE_IMAGES_BUCKET.equals(ident.type)) {
            // single bucket
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImagesBucketQuery.PROJECTION, ImageColumns.BUCKET_ID + "=" + ident.id,
                    null, ImagesBucketQuery.SORT_ORDER);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeImagesBucket(result, cursor);
            }
        } else if (TYPE_IMAGE.equals(ident.type)) {
            // single image
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImageQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeImage(result, cursor);
            }
        } else if (TYPE_VIDEOS_ROOT.equals(ident.type)) {
            // single root
            includeVideosRootDocument(result);
        } else if (TYPE_VIDEOS_BUCKET.equals(ident.type)) {
            // single bucket
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideosBucketQuery.PROJECTION, VideoColumns.BUCKET_ID + "=" + ident.id,
                    null, VideosBucketQuery.SORT_ORDER);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeVideosBucket(result, cursor);
            }
        } else if (TYPE_VIDEO.equals(ident.type)) {
            // single video
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideoQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Video.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeVideo(result, cursor);
            }
        } else if (TYPE_AUDIO_ROOT.equals(ident.type)) {
            // single root
            includeAudioRootDocument(result);
        } else if (TYPE_ARTIST.equals(ident.type)) {
            // single artist
            cursor = resolver.query(Artists.EXTERNAL_CONTENT_URI,
                    ArtistQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Artists.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeArtist(result, cursor);
            }
        } else if (TYPE_ALBUM.equals(ident.type)) {
            // single album
            cursor = resolver.query(Albums.EXTERNAL_CONTENT_URI,
                    AlbumQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Albums.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeAlbum(result, cursor);
            }
        } else if (TYPE_AUDIO.equals(ident.type)) {
            // single song
            cursor = resolver.query(Audio.Media.EXTERNAL_CONTENT_URI,
                    SongQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Audio.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeAudio(result, cursor);
            }
        } else {
            throw new UnsupportedOperationException("Unsupported document " + docId);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
        Binder.restoreCallingIdentity(token);
    }
    return result;
}
 
Example #13
Source File: MediaDocumentsProvider.java    From FireFiles with Apache License 2.0 4 votes vote down vote up
@Override
public Cursor queryDocument(String docId, String[] projection) throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
    final Ident ident = getIdentForDocId(docId);

    final long token = Binder.clearCallingIdentity();
    Cursor cursor = null;
    try {
        if (TYPE_IMAGES_ROOT.equals(ident.type)) {
            // single root
            includeImagesRootDocument(result);
        } else if (TYPE_IMAGES_BUCKET.equals(ident.type)) {
            // single bucket
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImagesBucketQuery.PROJECTION, ImageColumns.BUCKET_ID + "=" + ident.id,
                    null, ImagesBucketQuery.SORT_ORDER);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeImagesBucket(result, cursor);
            }
        } else if (TYPE_IMAGE.equals(ident.type)) {
            // single image
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImageQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeImage(result, cursor);
            }
        } else if (TYPE_VIDEOS_ROOT.equals(ident.type)) {
            // single root
            includeVideosRootDocument(result);
        } else if (TYPE_VIDEOS_BUCKET.equals(ident.type)) {
            // single bucket
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideosBucketQuery.PROJECTION, VideoColumns.BUCKET_ID + "=" + ident.id,
                    null, VideosBucketQuery.SORT_ORDER);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeVideosBucket(result, cursor);
            }
        } else if (TYPE_VIDEO.equals(ident.type)) {
            // single video
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideoQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Video.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeVideo(result, cursor);
            }
        } else if (TYPE_AUDIO_ROOT.equals(ident.type)) {
            // single root
            includeAudioRootDocument(result);
        } else if (TYPE_ARTIST.equals(ident.type)) {
            // single artist
            cursor = resolver.query(Artists.EXTERNAL_CONTENT_URI,
                    ArtistQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Artists.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeArtist(result, cursor);
            }
        } else if (TYPE_ALBUM.equals(ident.type)) {
            // single album
            cursor = resolver.query(Albums.EXTERNAL_CONTENT_URI,
                    AlbumQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Albums.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeAlbum(result, cursor);
            }
        } else if (TYPE_AUDIO.equals(ident.type)) {
            // single song
            cursor = resolver.query(Audio.Media.EXTERNAL_CONTENT_URI,
                    SongQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Audio.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeAudio(result, cursor);
            }
        } else {
            throw new UnsupportedOperationException("Unsupported document " + docId);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
        Binder.restoreCallingIdentity(token);
    }
    return result;
}
 
Example #14
Source File: MediaDocumentsProvider.java    From FireFiles with Apache License 2.0 4 votes vote down vote up
@Override
public Cursor queryDocument(String docId, String[] projection) throws FileNotFoundException {
    final ContentResolver resolver = getContext().getContentResolver();
    final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
    final Ident ident = getIdentForDocId(docId);

    final long token = Binder.clearCallingIdentity();
    Cursor cursor = null;
    try {
        if (TYPE_IMAGES_ROOT.equals(ident.type)) {
            // single root
            includeImagesRootDocument(result);
        } else if (TYPE_IMAGES_BUCKET.equals(ident.type)) {
            // single bucket
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImagesBucketQuery.PROJECTION, ImageColumns.BUCKET_ID + "=" + ident.id,
                    null, ImagesBucketQuery.SORT_ORDER);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeImagesBucket(result, cursor);
            }
        } else if (TYPE_IMAGE.equals(ident.type)) {
            // single image
            cursor = resolver.query(Images.Media.EXTERNAL_CONTENT_URI,
                    ImageQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeImage(result, cursor);
            }
        } else if (TYPE_VIDEOS_ROOT.equals(ident.type)) {
            // single root
            includeVideosRootDocument(result);
        } else if (TYPE_VIDEOS_BUCKET.equals(ident.type)) {
            // single bucket
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideosBucketQuery.PROJECTION, VideoColumns.BUCKET_ID + "=" + ident.id,
                    null, VideosBucketQuery.SORT_ORDER);
            copyNotificationUri(result, Images.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeVideosBucket(result, cursor);
            }
        } else if (TYPE_VIDEO.equals(ident.type)) {
            // single video
            cursor = resolver.query(Video.Media.EXTERNAL_CONTENT_URI,
                    VideoQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Video.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeVideo(result, cursor);
            }
        } else if (TYPE_AUDIO_ROOT.equals(ident.type)) {
            // single root
            includeAudioRootDocument(result);
        } else if (TYPE_ARTIST.equals(ident.type)) {
            // single artist
            cursor = resolver.query(Artists.EXTERNAL_CONTENT_URI,
                    ArtistQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Artists.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeArtist(result, cursor);
            }
        } else if (TYPE_ALBUM.equals(ident.type)) {
            // single album
            cursor = resolver.query(Albums.EXTERNAL_CONTENT_URI,
                    AlbumQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Albums.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeAlbum(result, cursor);
            }
        } else if (TYPE_AUDIO.equals(ident.type)) {
            // single song
            cursor = resolver.query(Audio.Media.EXTERNAL_CONTENT_URI,
                    SongQuery.PROJECTION, BaseColumns._ID + "=" + ident.id, null,
                    null);
            copyNotificationUri(result, Audio.Media.EXTERNAL_CONTENT_URI);
            if (cursor.moveToFirst()) {
                includeAudio(result, cursor);
            }
        } else {
            throw new UnsupportedOperationException("Unsupported document " + docId);
        }
    } finally {
        IoUtils.closeQuietly(cursor);
        Binder.restoreCallingIdentity(token);
    }
    return result;
}