Skip to content

Commit 5cea504

Browse files
authored
fix(android): file picker result processing (#1352)
The Android file picker result callback implementation is incorrectly checking the expected minimum result length. This only impacts usage on SDK 34+ because on older releases the `FileChooserParams.parseResult` properly resolves the response.
1 parent a67a818 commit 5cea504

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wry": patch
3+
---
4+
5+
Fixes Android file picker result processing.

src/android/kotlin/RustWebChromeClient.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,7 @@ class RustWebChromeClient(appActivity: WryActivity) : WebChromeClient() {
391391
override fun onActivityResult(result: ActivityResult?) {
392392
val res: Array<Uri?>?
393393
val resultIntent = result?.data
394-
if (result?.resultCode == Activity.RESULT_OK && resultIntent!!.clipData != null && resultIntent.clipData!!.itemCount > 1
395-
) {
394+
if (result?.resultCode == Activity.RESULT_OK && resultIntent!!.clipData != null) {
396395
val numFiles = resultIntent.clipData!!.itemCount
397396
res = arrayOfNulls(numFiles)
398397
for (i in 0 until numFiles) {

0 commit comments

Comments
 (0)