refactor(settings): improve compile-time type safety for QR scanner quick tile - #72
Balajitechlabs wants to merge 1 commit into
Conversation
👋 Welcome @Balajitechlabs! Thank you for contributing to QuickDash! ⚡We really appreciate your time and effort to improve QuickDash. Before maintainers review this PR, please double-check the following:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe QR scanner tile registration now uses typed Android service and component references. API 33+ handling and the pre-33 fallback toast remain unchanged. ChangesQR tile registration
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The refactor preserves the QR tile registration behavior while replacing fragile string and cast usage with typed references. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
This comment was marked as outdated.
This comment was marked as outdated.
Balajitechlabs
left a comment
There was a problem hiding this comment.
@Balajitechlabs please review the changes
Recommendation
The type-safe refactoring for the QR Scanner quick tile is a solid addition. Before merging into master, consider:
- Validating that
QrScannerTileServiceis declared withandroid.permission.BIND_QUICK_SETTINGS_TILEinAndroidManifest.xml. - Verifying that proguard keep rules protect
QrScannerTileServiceif custom reflection is used elsewhere. - Adding debug logging in the catch block to log system tile request rejections.
| val componentName = ComponentName( | ||
| context, | ||
| "com.balajitechlabs.quickdash.core.quicktile.QrScannerTileService" | ||
| QrScannerTileService::class.java |
There was a problem hiding this comment.
[suggestion] Type-safe class reference prevents R8/ProGuard obfuscation breakage.
| QrScannerTileService::class.java | |
| val componentName = ComponentName( | |
| context, | |
| QrScannerTileService::class.java | |
| ) |
Description
This PR refactors the Quick Settings QR Scanner tile request in
SettingsFloatingWindowSection.ktto use compile-time type-safe class references instead of raw package string literals, preventing runtime failures under code minification or future package refactorings.Changes Made
"com.balajitechlabs.quickdash.core.quicktile.QrScannerTileService"withQrScannerTileService::class.java.getSystemService(Context.STATUS_BAR_SERVICE) as StatusBarManagerto idiomaticgetSystemService(StatusBarManager::class.java).Screencast / Verification
w:) and zero errors (e:).Checklist
Summary by CodeRabbit