Repository navigation
feat(mobile): draw the album grid when no system picker exists - #836
Merged
Merged
Conversation
A Mate XT on HarmonyOS 6.1 runs the APK inside 卓易通, an Android compatibility container that exposes neither a gallery app nor a photo picker. #829 turned that into an honest "album unavailable" message, but the phone reports the user's own files through shared storage, so the album can simply be drawn here. - future-file-handler gains listAlbumImages: MediaStore's image collection (newest first, bounded), falling back to walking the usual photo directories when the container maps storage without a media database. - The album router keeps every system route ahead of it and adds two: a gallery that only answers ACTION_GET_CONTENT, and the Play-services photo picker. Only when nothing can present an album does the app show AlbumPickerModal — a plain newest-first grid, no albums, editing or paging — and only that route asks for the media permission, saying so inside the grid when it is refused. - The chosen images go through the same pipeline as a gallery pick: copied into the cache while the read grant is live, then size/format/quota checked. - The probe's <queries> now name the scheme as well as the MIME type, and each picker action is declared with and without data. Package visibility hides a target whose filter declares android:scheme="content" from a rule that only names a type, and a filter that declares no data is matched only by a data-less intent — either way the router would have read the phone as "no album app".
huichen
enabled auto-merge (squash)
September 25, 2026 12:46
The full suite reported 128/128 suites passing and still exited non-zero: a live FlatList keeps its batching timer, which outlives the run. Unmount every tree the modal test renders.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The device report: HUAWEI Mate XT ULTIMATE DESIGN (GRL-AL10), HarmonyOS 6.1.0.135 SP8 — the APK runs inside 卓易通, which per its users exposes no system gallery to Android apps. After #829 the album therefore reported itself unavailable; this PR draws the album instead.
future-file-handlergainslistAlbumImages(limit): MediaStore's image collection, newest first and bounded, with a walk of the usual photo directories (DCIM / Pictures / Download / Screenshots / Movies / Documents / Android/media, depth- and budget-limited) when a container maps shared storage without a media database.ACTION_GET_CONTENT, and the Play-services photo picker (com.google.android.gms.provider.action.PICK_IMAGES). Only a device where nothing can present an album getsAlbumPickerModal— a plain newest-first grid (no albums, editing or paging) with multi-select capped by the remaining quota.prepareAlbumImages): copied into the cache while the grant is live, then size/format/quota checked, with the reported name kept. The grid is the only route that asks for the media permission, and it says so inside the sheet when refused; system pickers keep working without it.<queries>fix: the probe's declarations now nameandroid:scheme="content"as well as the MIME type, and each picker action is declared with and without data. Package visibility hides a target whose filter declares a scheme from a rule that only names a type, and a filter with no data is matched only by a data-less intent — either way the router would have read a real picker as absent.Validation
tsc --noEmit,eslintclean; 128 suites / 2035 tests pass, including new cases for: the grid appearing only when no system picker answers, selection order and the quota cap,albumSource()routing (gallery / photo picker / Play-services picker / GET_CONTENT gallery / file-manager-only → grid), album listing permission handling, and the pipeline keeping reported names.:future-file-handler:compileReleaseKotlinBUILD SUCCESSFUL;:app:processReleaseManifestmerged the new<queries>(verified in the merged release manifest).Two device outcomes to watch: the grid lists photos (container maps media — done), or the grid is empty / asks for a permission the container does not grant (then the container exposes nothing to the APK and only a HarmonyOS-native
photoAccessHelper.PhotoViewPickertarget could serve it). Both are recorded indocs/internals/mobile/harmonyos-compatibility.zh-CN.md.