From 4c8ad8f91124a10e154bcf8cf8bbd6504222658e Mon Sep 17 00:00:00 2001 From: Avinash Vadlamudi Date: Fri, 20 Jan 2023 18:42:46 +0000 Subject: [PATCH] [Auto Pin Confirm]: Changes to allow PIN auto confirm feature to be controllable by the user - Add SwitchPreference to allow user to control the pin auto confirm feature - Add Checkbox option during the PIN setup in Security app - Disable the opt-in checkbox during SUW entry point for PIN setup - Update SwitchPreference availability appropriately according to current PIN length - Update the pin_auto_confirm setting appropriately according to state of switchPreference or checkbox state (in PIN setup) - Update the error-message when PIN Too short to let user know six digit is recommended Bug: 262926000 Bug: 262936383 Bug: 262934702 Bug: 262935305 Test: Manual Test Test: atest SettingsRoboTests Change-Id: Ib9e09bd5ce44652158e77f80e8be19c4dd50f3bf --- res/drawable/checkbox_circle_shape.xml | 24 +++ res/drawable/ic_check_circle_filled_24dp.xml | 27 ++++ res/drawable/ic_circle_outline_24dp.xml | 26 ++++ res/layout/choose_lock_password.xml | 23 +++ res/values/strings.xml | 15 ++ res/xml/screen_lock_settings.xml | 6 + .../settings/password/ChooseLockPassword.java | 70 ++++++++- .../password/SetupChooseLockPassword.java | 6 + .../AutoPinConfirmPreferenceController.java | 85 ++++++++++ .../screenlock/ScreenLockSettings.java | 2 + .../password/ChooseLockPasswordTest.java | 147 +++++++++++++++++- ...utoPinConfirmPreferenceControllerTest.java | 124 +++++++++++++++ 12 files changed, 551 insertions(+), 4 deletions(-) create mode 100644 res/drawable/checkbox_circle_shape.xml create mode 100644 res/drawable/ic_check_circle_filled_24dp.xml create mode 100644 res/drawable/ic_circle_outline_24dp.xml create mode 100644 src/com/android/settings/security/screenlock/AutoPinConfirmPreferenceController.java create mode 100644 tests/robotests/src/com/android/settings/security/screenlock/AutoPinConfirmPreferenceControllerTest.java diff --git a/res/drawable/checkbox_circle_shape.xml b/res/drawable/checkbox_circle_shape.xml new file mode 100644 index 00000000000..68c5a2ed359 --- /dev/null +++ b/res/drawable/checkbox_circle_shape.xml @@ -0,0 +1,24 @@ + + + + + + \ No newline at end of file diff --git a/res/drawable/ic_check_circle_filled_24dp.xml b/res/drawable/ic_check_circle_filled_24dp.xml new file mode 100644 index 00000000000..8e1f1e7f0dc --- /dev/null +++ b/res/drawable/ic_check_circle_filled_24dp.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/res/drawable/ic_circle_outline_24dp.xml b/res/drawable/ic_circle_outline_24dp.xml new file mode 100644 index 00000000000..b9ffca5f18f --- /dev/null +++ b/res/drawable/ic_circle_outline_24dp.xml @@ -0,0 +1,26 @@ + + + + + \ No newline at end of file diff --git a/res/layout/choose_lock_password.xml b/res/layout/choose_lock_password.xml index 70919a6fbce..b748f94e80a 100644 --- a/res/layout/choose_lock_password.xml +++ b/res/layout/choose_lock_password.xml @@ -67,8 +67,31 @@ android:layout_width="match_parent" android:layout_height="wrap_content"/> + + + +