diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/channel/streams/ImageByteStreamHandler.kt b/android/app/src/main/kotlin/deckers/thibault/aves/channel/streams/ImageByteStreamHandler.kt index 84742cb21..72f5f8017 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/channel/streams/ImageByteStreamHandler.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/channel/streams/ImageByteStreamHandler.kt @@ -109,7 +109,7 @@ class ImageByteStreamHandler(private val activity: Activity, private val argumen private fun streamImageAsIs(uri: Uri, mimeType: String) { try { StorageUtils.openInputStream(activity, uri)?.use { input -> streamBytes(input) } - } catch (e: IOException) { + } catch (e: Exception) { error("streamImage-image-read-exception", "failed to get image for mimeType=$mimeType uri=$uri", e.message) } } diff --git a/android/app/src/main/kotlin/deckers/thibault/aves/utils/StorageUtils.kt b/android/app/src/main/kotlin/deckers/thibault/aves/utils/StorageUtils.kt index a5f2f3f29..74dcf728a 100644 --- a/android/app/src/main/kotlin/deckers/thibault/aves/utils/StorageUtils.kt +++ b/android/app/src/main/kotlin/deckers/thibault/aves/utils/StorageUtils.kt @@ -448,10 +448,9 @@ object StorageUtils { val effectiveUri = getOriginalUri(context, uri) return try { context.contentResolver.openInputStream(effectiveUri) - } catch (e: FileNotFoundException) { - Log.w(LOG_TAG, "failed to find file at uri=$effectiveUri") - null - } catch (e: SecurityException) { + } catch (e: Exception) { + // among various other exceptions, + // opening a file marked pending and owned by another package throws an `IllegalStateException` Log.w(LOG_TAG, "failed to open file at uri=$effectiveUri", e) null } diff --git a/lib/widgets/home_page.dart b/lib/widgets/home_page.dart index 0f079f8cb..7c4c4e0a9 100644 --- a/lib/widgets/home_page.dart +++ b/lib/widgets/home_page.dart @@ -72,6 +72,7 @@ class _HomePageState extends State { final intentData = widget.intentData ?? await ViewerService.getIntentData(); if (intentData.isNotEmpty) { final action = intentData['action']; + await reportService.log('Intent action=$action'); switch (action) { case 'view': _viewerEntry = await _initViewerEntry(