Fix receipt capture produces mostly black/blank image on Android - #90645
NicolasBonet merged 2 commits into
Conversation
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
|
|
🚧 @mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
|
ASKED QA for testing https://expensify.slack.com/archives/C09V78U42D8/p1779212959251789 |
584d2fc to
e96bee6
Compare
|
@jayeshmangwani 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] |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for product
|
Regression has been completed. No issues were found. |
|
Kind bump @jayeshmangwani |
|
Reviewing now. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid.mp4Android: mWeb Chromemweb-chrome.mp4iOS: HybridAppiOS: mWeb Safarimweb-safari.mp4MacOS: Chrome / Safariweb.mov |
|
We did not find an internal engineer to review this PR, trying to assign a random engineer to #90556 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
|
🚧 @NicolasBonet has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/NicolasBonet in version: 9.3.80-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR. The only modification is adding No help site changes are required. |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.81-2 🚀
|
Explanation of Change
On Android, captured receipt images were sometimes returning mostly or entirely black/blank. This is because the receipt capture path uses VisionCamera's
takeSnapshot(), which performs a screenshot of the camera preview view. By default, VisionCamera renders its preview usingSurfaceView, which lives outside the regular Android View hierarchy — its pixels are drawn directly on a dedicated GPU surface and are therefore not visible to the View.draw()- based snapshot path thattakeSnapshot()relies on. As a result, the snapshot returns a black image.Switching the preview to
TextureView(via androidPreviewViewType="texture-view") makes the preview part of the regular View hierarchy, so its pixels are accessible to the snapshot mechanism andtakeSnapshot()can capture real frames.Fixed Issues
$ #90556
PROPOSAL: N/A
Tests
Offline tests
Same, as in Tests section
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same, as in Tests section
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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.mp4