From 41805a9beb7578f869b7a325ca8aee9fd7ce7a17 Mon Sep 17 00:00:00 2001 From: Avinash Vadlamudi Date: Thu, 13 Jul 2023 17:40:28 +0000 Subject: [PATCH] [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 --- packages/SystemUI/res/values/strings.xml | 7 --- ...odeScannerKeyguardQuickAffordanceConfig.kt | 15 +++--- .../controller/QRCodeScannerController.java | 14 +++--- .../systemui/qs/tiles/QRCodeScannerTile.java | 2 +- ...cannerKeyguardQuickAffordanceConfigTest.kt | 21 +++------ .../QRCodeScannerControllerTest.java | 47 ++++++++++--------- .../qs/tiles/QRCodeScannerTileTest.java | 4 +- 7 files changed, 45 insertions(+), 65 deletions(-) diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index ee9b132facbee..0befb3b821968 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -3052,13 +3052,6 @@ --> To add the Wallet app as a shortcut, make sure at least one card has been added - - To add the QR code scanner as a shortcut, make sure a camera app is installed -