[QR Scanner]: Fix the logic to initialize intent with default activity
- When the QR Scanner tile is not among active/enabled tiles and no QR scanner shortcut on lockscreen, then there won't be any observers registered for QRCodeScannerController, in that case, the Intent would be set to null
- Now, when user tries to set the QR scanner for lockscreen shortcut, it checks if intent is callable or not, and it returns false, as intent is set to null
- Also, enable QR scanner in lockscreen shortcut only when the configured activity is callable
Bug: 290862496, 289446172
Test: atest QRCodeScannerControllerTest, QRCodeScannerTileTest, QrCodeScannerKeyguardQuickAffordanceConfigTest
Test: Manual test by flashing on device and checking the capability of adding QR scanner as lockscreen shortcut even when the QRScanner tile is not among active/enabled tiles
Change-Id: I7c86fa5e8bbf79cc0e94807105e518136de4b206
7 files changed