Repository navigation
Migrate to Android Contact Picker and remove READ_CONTACTS - #102928
Conversation
|
|
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@mkhutornyi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
🚧 AndrewGable has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppnewdot.movnewdot-lower.mp4Android: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@codex review |
|
@MelvinBot review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewI found no blocking bugs. The Android flow holds together: the soft-prompt modal stays hidden because
Also checked, no change needed
I reviewed the code only. I didn't run the Android flows because this run only has a web environment. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 580d3617b4
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
On Android 17 the picker is handled by a system app, per the
By design, picking only adds the contact to the list, like the bulk import on iOS. I'll look at clearing the search together with point 3 in a follow-up if needed.
Not in this PR. Selection works differently on each screen: single-select expense flows go straight to the next step, and New chat has its own group selection.
The new logic is mostly native picker code that Jest can't exercise. A |
|
Thanks for the review. All comments were addressed. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 AndrewGable has triggered a test Expensify/App build. You can view the workflow run here. |
|
🚀 Deployed to staging by https://github.com/AndrewGable in version: 9.5.8-0 🚀
|
|
No help site update needed. This PR changes how Android brings in device contacts (the system Contact Picker instead of the contacts permission), and no article under What I checked
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.5.8-5 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Google Play's Contacts Permission policy takes effect on January 27, 2027. It covers apps targeting SDK 37+ that use
READ_CONTACTSwithout a declaration. This PR removes the permission from Android and switches to the system Contact Picker, so the user picks contacts instead of the app reading the whole address book.Android
READ_CONTACTSfrom the manifest. Atools:node="remove"entry stops any dependency from adding it back.pick()to the Nitro contacts module.ACTION_PICK_CONTACTS, the new system picker. It returns emails, phone numbers and names, and allows several contacts. Because we still target SDK 36, the intent setsEXTRA_USE_SYSTEM_CONTACTS_PICKER. Without it, the picker forwards the request to a contacts app and the user sees "No apps can perform this action".ACTION_PICKon email rows. One contact per pick. This is the only picker that works without a permission on these versions.content://0@com.android.contacts.picker.sessions/...), so the reader is chosen by API level, not by URI authority.getAll()now returns an empty list on Android. The bulk import, the focus and foreground refreshes, and the permission soft-prompt are gone on Android.compileSdkis now 37, whichContactsPickerSessionContractneeds.targetSdkstays at 36.iOS: no change. It still imports the address book after the user grants permission.
HybridApp: Mobile-Expensify also declared
READ_CONTACTSand has its own contact flows. Both are handled in Expensify/Mobile-Expensify#14154. Both PRs must ship together, or the shipped app still declares the permission.Behavior vs production
READ_CONTACTSrequested, with a soft-prompt firstFixed Issues
$ #102920
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/14154
Tests
Setup: add these device contacts.
Android 17+ (API 37)
Android 16 or lower
Known limitations
Phone-only contacts can't be picked on Android 16 and lower.
On Android 17+, contacts with only a name are listed in the picker and nothing happens when one is picked.
Picked contacts aren't kept after leaving the screen. Production re-reads the address book each time, so its contacts are always listed.
Verify that no errors appear in the JS console
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android.mov
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari