[MS-1493] Image injection in Debug versions for E2E tests - #1780
Open
alexandr-simprints wants to merge 7 commits into
Open
[MS-1493] Image injection in Debug versions for E2E tests#1780alexandr-simprints wants to merge 7 commits into
alexandr-simprints wants to merge 7 commits into
Conversation
…mera preview size, and is displayed on the UI
alexandr-simprints
requested review from
BurningAXE,
alex-vt,
luhmirin-s and
meladRaouf
and
a lite review from Copilot
August 12, 2026 08:32
There was a problem hiding this comment.
Pull request overview
Adds a debug-only “image injection” pathway to the shared camera infrastructure so E2E tests can override camera frames by pushing an image to device storage and sending a broadcast, while keeping release behavior unchanged.
Changes:
- Introduces a debug-only
ImageInjectionReceiver+InjectedImageCacheand a debugFramePreProcessUseCasethat composites the injected image into the preview frame. - Adds
isInjectedtoFrameand updatesCameraFrameProviderto pre-process frames and show an overlay when frames are injected. - Replaces
PreviewViewusage in affected screens with a newCameraPreviewViewwrapper so the overlay can be displayed.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| infra/camera/src/testDebug/java/com/simprints/infra/camera/usecase/FramePreProcessUseCaseTest.kt | Adds debug-variant tests for injected-frame preprocessing behavior. |
| infra/camera/src/release/java/com/simprints/infra/camera/usecase/FramePreProcessUseCase.kt | Adds release-variant no-op wrapper use case to keep API consistent across build types. |
| infra/camera/src/main/java/com/simprints/infra/camera/Frame.kt | Extends Frame with isInjected flag (default false). |
| infra/camera/src/main/java/com/simprints/infra/camera/CameraPreviewView.kt | Introduces wrapper view containing PreviewView plus injection overlay ImageView. |
| infra/camera/src/main/java/com/simprints/infra/camera/CameraFrameProvider.kt | Routes frames through FramePreProcessUseCase and toggles overlay display based on isInjected. |
| infra/camera/src/debug/java/com/simprints/infra/camera/usecase/FramePreProcessUseCase.kt | Implements injected-image compositing/scaling for debug builds. |
| infra/camera/src/debug/java/com/simprints/infra/camera/repository/InjectedImageCache.kt | Adds debug-only singleton cache to hold a single injected bitmap. |
| infra/camera/src/debug/java/com/simprints/infra/camera/ImageInjectionReceiver.kt | Adds exported debug receiver to load injected image from external files dir. |
| infra/camera/src/debug/AndroidManifest.xml | Registers the debug-only broadcast receiver and action filter. |
| feature/login/src/main/res/layout/fragment_qr_scanner.xml | Switches camera preview widget to CameraPreviewView. |
| feature/login/src/main/java/com/simprints/feature/login/screens/qrscanner/QrScannerFragment.kt | Updates camera initialization call for CameraPreviewView. |
| feature/external-credential/src/main/res/layout/fragment_external_credential_scan_qr.xml | Switches camera preview widget to CameraPreviewView. |
| feature/external-credential/src/main/res/layout/fragment_external_credential_scan_ocr.xml | Switches camera preview widget to CameraPreviewView. |
| feature/external-credential/src/main/res/layout-sw600dp-land/fragment_external_credential_scan_qr.xml | Switches camera preview widget to CameraPreviewView (sw600dp-land). |
| feature/external-credential/src/main/res/layout-sw600dp-land/fragment_external_credential_scan_ocr.xml | Switches camera preview widget to CameraPreviewView (sw600dp-land). |
| feature/external-credential/src/main/res/layout-land/fragment_external_credential_scan_qr.xml | Switches camera preview widget to CameraPreviewView (land). |
| feature/external-credential/src/main/res/layout-land/fragment_external_credential_scan_ocr.xml | Switches camera preview widget to CameraPreviewView (land). |
| feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanqr/ExternalCredentialScanQrFragment.kt | Updates camera initialization call for CameraPreviewView. |
| feature/external-credential/src/main/java/com/simprints/feature/externalcredential/screens/scanocr/ExternalCredentialScanOcrFragment.kt | Updates camera initialization call for CameraPreviewView. |
| face/capture/src/main/res/layout/fragment_live_feedback.xml | Switches camera preview widget to CameraPreviewView. |
| face/capture/src/main/res/layout-land/fragment_live_feedback.xml | Switches camera preview widget to CameraPreviewView (land). |
| face/capture/src/main/java/com/simprints/face/capture/screens/livefeedback/LiveFeedbackFragment.kt | Updates camera initialization call for CameraPreviewView. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
alexandr-simprints
marked this pull request as ready for review
August 12, 2026 11:15
luhmirin-s
approved these changes
Aug 12, 2026
|
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.


JIRA ticket
Will be released in: 2026.3.0
Notable changes
We can now easily inject images in Debug builds for any screen that uses camera. The images are injected by uploading the image to the device using
adb pushand notifying the app about the injection via the broadcast. Once an image is injected it overrides the image output from the camera until cleared.InjectedImageCache- in-memory cache that keeps a single injected imageImageInjectionReceiver- a broadcast receiver that listens for thecom.simprints.automation.INJECT_FRAMEbroadcast with aframeattribute containing path to the image on the device.FramePreProcessUseCase- once image is injected, we pre-process it to place it exactly in the middle of the area of interest. For instance, during the MFID document scan, the app only looks for the text in a certain rectangular area of the screen. This pre-processor scales the image to the area-of-interest size, and places the image in the middle of it.image-injection.mp4
Testing guidance
There are two steps for image injection:
Example:
Uploading the
face.jpgimage from your laptop to device usingadbSending broadcast:
After this, all screens will have this image injected on processed.
Additional work checklist