Repository navigation
Fix the scanner torch on Android and keep its button clear of the navigation bar - #5972
Conversation
…igation bar FlashMode.TORCH was mapped onto ImageCapture's flash mode, which only decides whether the flash fires for a still, so the torch never lit. It now goes through CameraControl#enableTorch. setZoom had the same silent failure: it resolved getCameraControl on the bound camera's concrete class, which is not public, so Method#invoke refused it and the error was swallowed. Both now resolve on the public CameraX interfaces and log on failure. The scanner footer did not opt into the safe area, so on an edge-to-edge display the torch button sat under the system navigation bar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Developer Guide build artifacts are available for download from this workflow run:
Developer Guide quality checks: |
|
Compared 170 screenshots: 170 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Cloudflare Preview
|
|
@codex 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. |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Compared 206 screenshots: 206 matched. |
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
What was wrong
The torch button did nothing on Android.
AndroidCameraImpl.setFlashModeonly calledImageCapture.setFlashMode, which decides whether the flash fires for a still photo.FlashMode.TORCHfell through to "auto flash", so nothing lit and nothing was logged. iOS has a real torch path, which is why it worked there.The torch button sat under the system navigation bar. The footer
CodeScannerbuilds never opted into the safe area, so on an edge-to-edge display (Android 15 and later) it was drawn under the three-button bar and could not be tapped.The fix
TORCHnow goes through CameraX'sCameraControl.enableTorch. It needs no permission beyondCAMERA, so there is no builder change.setZoomhad the same kind of silent failure and is fixed with it: it resolvedgetCameraControlon the bound camera's concrete class,LifecycleCamera, which is package-private, soMethod.invokerefused the call and the error was swallowed. Both calls now resolve on the publicCamera/CameraControlinterfaces and log a warning on failure.setSafeArea(true), which also keeps it clear of the iOS home indicator.Verification
Compile-checked only. Not run on a device, and the SpotBugs gate and unit tests were not run locally.
🤖 Generated with Claude Code