Commit Graph

527 Commits

Author SHA1 Message Date
Eric Biggers
50f93771bc RESTRICT AUTOMERGE: Catch exceptions from setLockCredential()
When LockPatternUtils#setLockCredential() fails, it can either return
false or throw an exception.  Catch the exception and treat it the same
way as a false return value, to prevent crashing com.android.settings.

Bug: 253043065
Test: Tried setting lockscreen credential while in secure FRP mode using
      smartlock setup activity launched by intent via adb.  Verified
      that com.android.settings no longer crashes due to the exception
      from LockPatternUtils#setLockCredential().
Change-Id: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
(cherry picked from commit 05f1eff1c9)
Merged-In: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
2023-08-02 23:45:19 +00:00
Eric Biggers
a75824cf37 Merge "Catch exceptions from setLockCredential()" into main 2023-08-02 19:40:27 +00:00
Austin Delgado
fefbdc7922 Merge "Announce requirements when setting PIN/Pass" into udc-d1-dev am: c6e7b93f28 am: 0abddc88bc am: 2f1b844997
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24270037

Change-Id: I7929ac906d7661635604fcd7de5225db49ad6ae3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-02 00:32:39 +00:00
Austin Delgado
2f1b844997 Merge "Announce requirements when setting PIN/Pass" into udc-d1-dev am: c6e7b93f28 am: 0abddc88bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24270037

Change-Id: I0d3fcbf3af5b717b76b9b07974b687ba770d89db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 23:47:08 +00:00
Austin Delgado
35579efcaf Merge "Announce requirements when setting PIN/Pass" into udc-d1-dev am: c6e7b93f28
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24270037

Change-Id: I5ffe93b5c0fe5a52ad841e5e5942363cf0a0d6dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 23:06:10 +00:00
Wenhui Yang
cf8ba456bb Add bp subtitle for WiFi sharing
Move the screen lock message selection logic to Utils and update the
related strings as suzannechen@ suggested.

Test: manual (see bug)
Test: atest UtilsTest
Fixes: 291307701
Change-Id: I346c25426395eea1320edc07ce2d962efeb8daa6
2023-08-01 21:11:33 +00:00
Oli Thompson
70a610ea39 Merge "Remove subtext on the password work challenge screen" into udc-qpr-dev am: 04854b1c65 am: ea18752f4a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23782668

Change-Id: Ibb0f3930aecd2a12fa54124ccc1f1a7df8f4eb07
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 17:59:43 +00:00
Oli Thompson
04854b1c65 Merge "Remove subtext on the password work challenge screen" into udc-qpr-dev 2023-08-01 16:31:03 +00:00
Austin Delgado
035b661ea4 Announce requirements when setting PIN/Pass
Test: Manual, verify requirement is read
Fixes: 281955512
Change-Id: I6d963d545c68c4ec891d9ad8a7da8c0a0f6e9d6b
2023-07-31 17:50:39 -07:00
Eric Biggers
05f1eff1c9 Catch exceptions from setLockCredential()
When LockPatternUtils#setLockCredential() fails, it can either return
false or throw an exception.  Catch the exception and treat it the same
way as a false return value, to prevent crashing com.android.settings.

Bug: 253043065
Test: Tried setting lockscreen credential while in secure FRP mode using
      smartlock setup activity launched by intent via adb.  Verified
      that com.android.settings no longer crashes due to the exception
      from LockPatternUtils#setLockCredential().
Change-Id: I48b9119c19fb6378b1f88d36433ee4f4c8501d76
2023-07-29 00:07:39 +00:00
Shawn Lin
b30887fff4 Merge "Revert "Fix lock pattern is truncated during SUW in folded state"" into udc-qpr-dev am: c23c6164bb am: 0e404ee882
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/24100906

Change-Id: I8603c84920403b90f46e63ce0bd6d6a23a90a7df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-18 04:28:31 +00:00
Shawn Lin
c23c6164bb Merge "Revert "Fix lock pattern is truncated during SUW in folded state"" into udc-qpr-dev 2023-07-18 03:18:12 +00:00
Chun-Wei Wang
56d26ff56c Merge changes from topic "simplify_pw" into udc-qpr-dev am: e414d40e60 am: 3f4b3fdce8
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23840849

Change-Id: I3e2974a91c86aecf459ce51f9afdbf6175b8faed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-18 02:36:44 +00:00
Chun-Wei Wang
e414d40e60 Merge changes from topic "simplify_pw" into udc-qpr-dev
* changes:
  Handle EXTRA_KEY_REQUEST_WRITE_REPAIR_MODE_PW
  Extract common code to SaveChosenLockWorkerBase
2023-07-18 01:17:13 +00:00
Chun-Wei Wang
c726bd48b4 Handle EXTRA_KEY_REQUEST_WRITE_REPAIR_MODE_PW
So the new password can be saved per caller's request.

This will remove the additional step to ask the user
to enter the new credential again and thus simplifying
the UI flow.

Bug: 271968977
Bug: 277561275
Test: atest SettingsUnitTests:SaveAndFinishWorkerTest
Test: atest ChooseLockPasswordTest
Change-Id: I20232619225b17edda0a72dad43b120d5a249203
2023-07-17 23:04:45 +00:00
Oli Thompson
830a507382 Remove subtext on the password work challenge screen
Test: manually tested
Bug: 286391641
Change-Id: Ib6d6ff89da1e943aea2a3b668eeb9429009805a2
2023-07-17 12:44:05 +00:00
Shawn Lin
072a0e0068 Revert "Fix lock pattern is truncated during SUW in folded state"
This reverts commit a2e032bb8e.

Reason for revert: b/290721507 

Change-Id: Ifaaecde6c168ebe22d3b2245df1fd5b0a9c1b8c2
2023-07-17 12:20:42 +00:00
JW Wang
73dcb47ecb Extract common code to SaveChosenLockWorkerBase
* Extract common code of ChooseLockPassword.SaveAndFinishWorker and
ChooseLockPattern.SaveAndFinishWorker to the parent class.

* Make setters return this to make it easy to chain setter calls.

* Rename SaveChosenLockWorkerBase to SaveAndFinishWorker.

This will make the code changes in the next CL much easier.

Bug: 271968977
Bug: 277561275
Test: 1. Add screen lock (password/PIN/pattern) using Settings
      2. check screen lock works correctly
Change-Id: I98acd25f2dd81ab4608cc6943e4f238070003c17
2023-07-12 05:33:15 +00:00
Chun-Wei Wang
c680da15c3 Merge "ChooseLockPattern: remove redundant setting of visible pattern default" into udc-qpr-dev 2023-07-11 03:24:17 +00:00
Jason Chang
c805b2e163 Merge "Fix the “screen lock option” and password restriction view are in the wrong position on PIN/Password/Pattern in the landscape mode." into udc-qpr-dev am: 5a0d4d1cc3 am: 17d1e70930
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23712165

Change-Id: Ic73f5be63e2d9de3ede40fcfdb63357cab867634
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-10 04:19:00 +00:00
Jason Chang
5a0d4d1cc3 Merge "Fix the “screen lock option” and password restriction view are in the wrong position on PIN/Password/Pattern in the landscape mode." into udc-qpr-dev 2023-07-10 03:06:07 +00:00
Eric Biggers
250f2727b0 ChooseLockPattern: remove redundant setting of visible pattern default
Remove the code that set LOCK_PATTERN_VISIBLE to true the first time a
pattern was set, since LOCK_PATTERN_VISIBLE now defaults to true when
unset (ag/22912136).  The explicit defaulting to true was only needed
before because the low-level default value was wrong.

Bug: 270013005
Test: Set a pattern.  Verified that Keyguard uses visible pattern.
      Disabled the "Make pattern visible" option in Settings.  Verified
      that Keyguard doesn't use visible pattern.
Change-Id: I63f29c68f9a508fee0ee2f03f2cca33317fb8a32
Merged-In: I63f29c68f9a508fee0ee2f03f2cca33317fb8a32
(cherry picked from commit 6c3de30086)
2023-07-08 04:04:01 +00:00
Jason Chang
c0f0b0ca1a Fix the “screen lock option” and password restriction view are
in the wrong position on PIN/Password/Pattern in the landscape mode.

1. Move the description position under the GlifLayout header
2. Move the position "Screen lock options" button under the
GlifLayout header

Bug: 272676038
Bug: 285271342

Test: manully test with reproducible steps:
STEPS TO REPRODUCE:
1. Go through the setup flow
2. Continue steps until “set pin” page
3. The “screen lock option” is in the wrong position

Test: make RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings
.password.SetupChooseLockPasswordTest"

Change-Id: I24464e6b7e93f20abbeb59426919ed7fec5c7cbb
2023-06-29 07:11:42 +00:00
Shawn Lin
1c112249f3 Merge "Fix lock pattern is truncated during SUW in folded state" into udc-qpr-dev am: f733b7b0ff am: de251cc896
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23737990

Change-Id: Id6bc8a4b0545fb21f339d1eccf1c131c375de82d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 05:04:44 +00:00
Oli Thompson
abb4fbd596 Fix theming on Forgot your password work challegne screen
Test: manually tested, screenshots in bug
Bug: 286397998
Change-Id: Iaa9d83fb5c8a2f7df7bf43d224420b767e6c75fc
2023-06-28 12:18:37 +00:00
Shawn Lin
a2e032bb8e Fix lock pattern is truncated during SUW in folded state
Remove the bottom margin of the header view.

Bug: 285290323
Test: 1. Go through SUW
      2. Select lock pattern
      3. Check if UI truncated
Test: m RunSettingsRoboTests ROBOTEST_FILTER=
      com.android.settings.password.SetupChooseLockPatternTest
Change-Id: I48ac3d897e6b876bd7a1c325cc4a5e797e140da2
2023-06-28 06:52:40 +00:00
Hao Dong
7b99d92464 Fix pattern rotation header text.
Bug: 278055194
Test: atest ChooseLockPatternTest
Change-Id: I36ec325b46d7a7f583d94dc26f9962cadc3874cd
Merged-In: I36ec325b46d7a7f583d94dc26f9962cadc3874cd
2023-06-27 17:50:15 +00:00
Eric Biggers
d419163ecd Merge "ChooseLockPassword: convert to use PasswordMetrics#validateCredential()" 2023-06-26 15:34:20 +00:00
Shawn Lin
5f17b1c9da Merge "Set the light status bar flag if not in dark mode" into udc-qpr-dev am: bf7b928f0c am: c7e8393778
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23726369

Change-Id: I2a7dbaa9f9078e47683a0ecfbba7a99892f9c8e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-26 07:46:51 +00:00
Shawn Lin
bf7b928f0c Merge "Set the light status bar flag if not in dark mode" into udc-qpr-dev 2023-06-26 06:43:36 +00:00
Hao Dong
af36dfb674 Merge "Fix pattern rotation header text." into udc-qpr-dev am: a7af958f4c am: f24edbfc3b
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23699586

Change-Id: I6e1cd3c3b1965db0da12bd4115fd2e1c20858435
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-23 19:41:57 +00:00
Hao Dong
35ebdefcd8 Fix pattern rotation header text.
Bug: 278055194
Test: atest ChooseLockPatternTest
Change-Id: I36ec325b46d7a7f583d94dc26f9962cadc3874cd
2023-06-23 02:37:22 +00:00
Eric Biggers
b547094366 ChooseLockPassword: convert to use PasswordMetrics#validateCredential()
Fix the check for invalid characters in new passwords by switching from
PasswordMetrics#validatePassword() to
PasswordMetrics#validateCredential().  For more information, see
frameworks/base change I5c3c55367c3a294578cd0f97ac0e315a11ed517e.

Bug: 219511761
Bug: 232900169
Bug: 243881358
Test: Verified no regressions in 'atest ChooseLockPasswordTest'.  Note,
      this test is currently @Ignored and has 2 failures.  I didn't
      attempt to address that.
Test: Set a password containing non-ASCII characters on a device running
      an older build.  Upgraded and verified unlocking still works.
      Tested that setting a new non-ASCII password is not allowed.
Change-Id: I5f1822a34688473cb103eb64dca56e4c19d4dd08
2023-06-22 20:59:22 +00:00
Shawn Lin
1c4eb9dc75 Set the light status bar flag if not in dark mode
To make the status bar content clearly visible we should set the light
status bar flag if the device is not in dark mode.

Bug: 241274551
Test: 1. Add an account and setup fingerprint unlock
      2. Go to "Settings>Passwords & accounts>add account" to add
         another account
      3. Wait for BiometricPrompt to pop up and check the status bar.
Change-Id: I7208b9c18c3734d150dfaaef6724948bd197066a
2023-06-19 06:20:53 +00:00
Rhed Jao
07f9d1ccbe Merge "[Settings] Add a verification flow for exiting repair mode" into udc-qpr-dev am: e1c9d65cda am: 721a7bacaa
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23629341

Change-Id: If01a1c5c13433e85f9b91790375dc2f297777dd7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15 07:19:57 +00:00
Rhed Jao
b7a4a7daa4 [Settings] Add a verification flow for exiting repair mode
Handles the ACTION_CONFIRM_REPAIR_MODE_DEVICE_CREDENTIAL
intent to launch the confirm device credential activity for
users to exiting repair mode. The activity passes a special
user id USER_REPAIR_MODE to the framework and verify credentials
that the user enrolled in normal mode.

Bug: 277561275
Test: am start -a android.app.action.PREPARE_REPAIR_MODE_DEVICE_CREDENTIAL
      settings put global repair_mode_active 1
      am start -a android.app.action.CONFIRM_REPAIR_MODE_DEVICE_CREDENTIAL
      The credential is verified successfully.
Change-Id: I9ffe32f9925ee2b990c49d5674d27196a4c9edf7
2023-06-15 02:14:41 +00:00
Rhed Jao
1c7c01adb8 Merge "Passing the writing repair mode password flag to verify credential api" into udc-qpr-dev am: cc1fe61339 am: 6856e809b0
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23308384

Change-Id: I4e688e2034b1d33b141fb13a5383b7142b743901
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-13 03:00:36 +00:00
Rhed Jao
cc1fe61339 Merge "Passing the writing repair mode password flag to verify credential api" into udc-qpr-dev 2023-06-13 02:14:22 +00:00
Rhed Jao
f01b99e725 Passing the writing repair mode password flag to verify credential api
Handles the ACTION_PREPARE_REPAIR_MODE_DEVICE_CREDENTIAL intent to
prompt the user for device credentials. Passing the writing repair
mode password flag to the verify credential api when the user is
authenticating.

Bug: 277561275
Test: am start -a android.app.action.PREPARE_REPAIR_MODE_DEVICE_CREDENTIAL
Change-Id: Id018586b0ed535555c157b7516c9571b049978ad
2023-06-12 06:34:24 +00:00
Avinash Vadlamudi
c4c85c8d89 [Auto Pin Confirmation]: Add talkback capability for Auto-confirm correct PIN checkbox even if it is not in focus am: 01637b556e am: 3730239bd7
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23601571

Change-Id: I27b0bebd69fe6bdf344f434bae90b655540417ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-10 02:40:55 +00:00
Avinash Vadlamudi
01637b556e [Auto Pin Confirmation]: Add talkback capability for Auto-confirm correct PIN checkbox even if it is not in focus
- set accessibilityLiveRegion as Polite mode to allow talkback to announce the state of checkbox even if is not in focus

Bug: 281950677
Test: Manual test by flashing on device and checking in talkback mode
Change-Id: Ia1066e2df1f40e6c339a4cd63f92acf0858f8f3d
2023-06-10 01:25:18 +00:00
Oli Thompson
e20d5d34f8 Merge "Fix emergency button not visible on pattern work challenge screen" into udc-dev am: 01b382546e am: 03bd83270a
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23631338

Change-Id: I8f3631be2dc924fe8cf61278ccc6c2b9547c1629
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-09 16:59:57 +00:00
Oli Thompson
01b382546e Merge "Fix emergency button not visible on pattern work challenge screen" into udc-dev 2023-06-09 15:31:17 +00:00
Oli Thompson
dcce8fa662 Fix emergency button not visible on pattern work challenge screen
Hide the subtext for work challenge pattern,so everything fits and
adjust some spacing

Test: btest a.d.g.WorkTelephonyTest#workChallengePatternScreen_whenAllSubscriptionsManaged_hasEmergencyButton -nm
Bug: 283137301
Bug: 286391641
Change-Id: Ia6214b624f8d7328f7445f01a08166b8ab33fdec
2023-06-09 13:06:39 +00:00
Treehugger Robot
f575b51ce1 Merge "work challenge: allow backgroud biometric auth" into udc-dev am: 62193a6f56 am: 267a9a14bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23211177

Change-Id: Iad60145324234afaa488ca9328dcecfc493c1c52
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-15 09:09:13 +00:00
Rubin Xu
5b42447d29 work challenge: allow backgroud biometric auth
We observed a race condition that when work challenge is launched from
notification, the biometric prompt quickly dismisses itself because
it detects the launcher is now the foreground app. This change attempts
to workaround the issue by enabling the setAllowBackgroundAuthentication
optin in BiometricPrompt so it no longer dismisses itself even if the
foreground app is different.

Bug: 279766640
Test: manual
Change-Id: I453b7d603c6eb65f329afb38d8a190e21a7e4c01
2023-05-12 16:35:15 +01:00
Bill Lin
4caa3ece94 [conflict] Merge "Refine SkipDialog title and desc by device configs" into udc-dev am: 4d5063ffdc am: f6d23468b1 am: e5dfcc0270 am: 547f6d63a2
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/22779802

Change-Id: I61fed7e932c8dc476b689ca61bbf8ee919924bed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-10 16:29:52 +00:00
Bill Lin
4d5063ffdc Merge "Refine SkipDialog title and desc by device configs" into udc-dev 2023-05-09 23:09:38 +00:00
Nan Wu
00c3dabc48 Merge "Allow BAL for confirm device credential activity when work profile apps are protected by PIN prompt." into udc-dev am: 38b99012f4 am: 1671f75b46
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23087497

Change-Id: Ie3e738285db754e30aa447a501debaeaa72b6f57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-09 15:09:36 +00:00
Nan Wu
38b99012f4 Merge "Allow BAL for confirm device credential activity when work profile apps are protected by PIN prompt." into udc-dev 2023-05-09 13:49:06 +00:00