private void buildAlbumCover(ContentResolver cr, String buckId, AlbumEntity album) {
        String[] photoColumn = new String[]{Media._ID, Media.DATA};
        boolean isNeedGif = mPickerConfig != null && mPickerConfig.isNeedGif();
        String selectionId = isNeedGif ? SELECTION_ID : SELECTION_ID_WITHOUT_GIF;
        String[] args = isNeedGif ? SELECTION_ARGS_IMAGE_MIME_TYPE : SELECTION_ARGS_IMAGE_MIME_TYPE_WITHOUT_GIF;
        String[] selectionArgs = new String[args.length + 1];
        selectionArgs[0] = buckId;
        for (int i = 1; i < selectionArgs.length; i++) {
            selectionArgs[i] = args[i-1];
        }
        Cursor coverCursor = cr.query(Media.EXTERNAL_CONTENT_URI, photoColumn, selectionId,
                selectionArgs, Media.DATE_MODIFIED + " desc");
        try {
            if (coverCursor != null && coverCursor.moveToFirst()) {
                String picPath = coverCursor.getString(coverCursor.getColumnIndex(Media.DATA));
                String id = coverCursor.getString(coverCursor.getColumnIndex(Media._ID));
                album.mCount = coverCursor.getCount();
                album.mImageList.add(new ImageMedia(id, picPath));
                if (album.mImageList.size() > 0) {
                    mBucketMap.put(buckId, album);
                }
            }
        } finally {
            if (coverCursor != null) {
                coverCursor.close();
            }
        }
    }
get the cover and count

@param buckId album id
boxing/src/main/java/com/bilibili/boxing/model/task/impl/AlbumTask.java