From b8f1a7f6235cb3bd415d70cdabdb128a74934ad8 Mon Sep 17 00:00:00 2001 From: Bjarte bore Date: Wed, 9 Jun 2021 10:13:43 +0200 Subject: [PATCH] contentResolver with Bunlde() should only be used after sdk 30 if QUERY_ARG_LIMIT is used --- .../kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt b/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt index 6ee3ef5..d3d17b4 100644 --- a/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt +++ b/android/src/main/kotlin/com/morbit/photogallery/PhotoGalleryPlugin.kt @@ -292,7 +292,7 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler { this.context?.run { val imageCursor: Cursor? - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) { imageCursor = this.contentResolver.query( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, imageMetadataProjection, @@ -357,7 +357,7 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler { this.context?.run { val videoCursor: Cursor? - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) { videoCursor = this.contentResolver.query( MediaStore.Video.Media.EXTERNAL_CONTENT_URI, videoMetadataProjection, @@ -573,7 +573,7 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler { return this.context?.run { val imageCursor: Cursor? - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) { imageCursor = this.contentResolver.query( MediaStore.Images.Media.EXTERNAL_CONTENT_URI, arrayOf(MediaStore.Images.Media._ID), @@ -626,7 +626,7 @@ class PhotoGalleryPlugin : FlutterPlugin, MethodCallHandler { return this.context?.run { val videoCursor: Cursor? - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) { videoCursor = this.contentResolver.query( MediaStore.Video.Media.EXTERNAL_CONTENT_URI, arrayOf(MediaStore.Video.Media._ID),