fix(android): apply CodeRabbit review on pure-ML Kit QR scanner - #4
Conversation
|
Warning Review limit reached
Next review available in: 32 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
- Restrict ML Kit scanning to QR format via BarcodeScannerOptions. - Add full teardown: disposed flag guards the async bind listener from post-disposal execution; onDispose clears the analyzer, unbinds CameraX, closes the scanner and shuts down the analysis executor. - Close the ImageProxy when InputImage creation or processing throws synchronously instead of leaking it.
Summary
Applies the actionable CodeRabbit comments from #3 to
QrScannerView.kt:BarcodeScannerOptions.Builder().setBarcodeFormats(Barcode.FORMAT_QR_CODE). Faster, matches the PiliPlus decoder/activity behavior.disposedflag guards the asynccameraProviderFuturelistener so binding never happens after disposal;onDisposenow clears the analyzer, unbinds CameraX, closes the scanner and shuts down the analysis executor (previously only the executor was shut down).InputImage.fromMediaImage/scanner.processare wrapped so an exception still closes theImageProxyinstead of leaking it.Note on release verification (CodeRabbit #1)
No device available in this environment. Unit tests + lint + release APK already pass on the merged head (
ac8da0a, run 31609960628 exit 0); a real-device camera smoke test remains a manual step.Test plan
flutter analyzeand the release APK build.