Skip to content

fix(chat): guard MediaStore.getPickImagesMaxLimit on older pickers (2026.10.2 hotfix) - #1742

Merged
bmc08gt merged 2 commits into
hotfix/2026.10.2from
fix/chat-photo-picker-max-limit-2026.10.2
Oct 9, 2026
Merged

bmc08gt merged 2 commits into
hotfix/2026.10.2from
fix/chat-photo-picker-max-limit-2026.10.2

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Cherry-picks #1741 onto the 2026.10.2 release (fcash/2026.10.2), since code/cash already carries 2026.10.3 work.

On Android 11–12 devices without the MediaProvider update for SDK extension R 2, opening any chat crashes with NoSuchMethodError from MediaStore.getPickImagesMaxLimit(). See #1741 for the cause and fix.

The version code comes from the commit count: the tag is at 4803, the build on the internal track, and these two commits bring it to 4805. That's above internal and below code/cash (4806), so no versionCodeOverride is needed. The version name stays 2026.10.2.

rememberChatPhotoPicker called getPickImagesMaxLimit() during composition
with no version check. The method exists only on API 33+, or on API 30-32
with SDK extension R 2+, so an Android 12 device without the MediaProvider
update threw NoSuchMethodError every time a chat opened (Bugsnag
6ac91865991833fd09984195, Samsung SM-N976V).

Only call it where the system picker provides it. Elsewhere androidx falls
back to a picker with no cap of its own, and the result callback already
trims the selection to the remaining slots.

(cherry picked from commit cac9aa7)
Int.MAX_VALUE never reached the picker, since the clamp came out to
remaining anyway, but it read as no cap. Fall back to remaining directly.

(cherry picked from commit 7f23f4f)
@bmc08gt bmc08gt self-assigned this Oct 9, 2026
@github-actions github-actions Bot added the type: fix Bug fix label Oct 9, 2026
@bmc08gt
bmc08gt merged commit 4264edb into hotfix/2026.10.2 Oct 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant