Commit Graph

79 Commits

Author SHA1 Message Date
Hao Dong
6b58dad5b5 Add dependency on BiometricsSharedLib.
Test: N/A

Change-Id: Icbd4df8e5bca638f385fa040496902797f38fdec
2023-09-11 19:00:14 +00:00
Colin Cross
87b870a090 Fix kotlin nullable errors in Settings
Fix kotlin nullable errors that were exposed by setting the retention
of android.annotation.NonNull and android.annotation.Nullable to
class retention.

Bug: 294110802
Test: builds
Change-Id: I6aa0516fa4f6443b6d4dff873baf3b08ff9189f0
2023-08-14 12:29:02 -07:00
Chaohui Wang
2cab62254c Use resource processor for Settings
Bug: 293810334
Test: m Settings
Test: robotests
Change-Id: Ie515e137648eddfdfcab5e8095f5be99721d9e1b
2023-08-11 22:39:08 +08:00
Milton Wu
b1ad3fa01b [BiometricsV2] Fix end-to-end enroll test fail
Fix end-to-end enrollment test fail because of using incorrect observer
type to observe finish page data

Bug: 295140687
Test: atest biometrics-enrollment-test
Change-Id: I9ca8d1c6383c2ecf3f94dc1e5cbb878e4328a900
2023-08-09 23:27:57 +08:00
Milton Wu
181538084d [BiometricsV2] Fix end-to-end enroll test fail
Fix end-to-end enrollment test fail because of using incorrect observer
type to observe data

Bug: 295140687
Test: atest biometrics-enrollment-test
Change-Id: Idfb95400c1462dac5a44731f46f67b22be93e0a6
2023-08-09 19:33:56 +08:00
Treehugger Robot
33d480ed56 Merge "[BiometricsV2] Refactor AutoCredentialViewModel" into main 2023-08-09 08:37:45 +00:00
Milton Wu
f8cdda45aa [BiometricsV2] Refactor AutoCredentialViewModel
Fix previous review comments on
I84bab0b46e023303c0046a6ae6886ab1cf9458b8

Bug: 286197659
Test: atest AutoCredentialViewModelTest
Test: atest biometrics-enrollment-test
Change-Id: I9b43a637439e941bdb884e3ae2f656d573364123
2023-08-09 06:39:48 +00:00
Chaohui Wang
8e2ae547d6 Clean up FeatureFactory.getFeature()
Bug: 286764889
Test: m Settings
Change-Id: I7e472e6b0ca6b7a735c1b92742ddf06c545176fc
2023-08-08 08:41:48 +00:00
Chaohui Wang
2541381259 Fix references to resources for Settings
Bug: 293810334
Test: m Settings
Change-Id: Ie140278f492ef7e1c062ec1ecae2866c521a86aa
2023-08-08 01:56:05 +00:00
Treehugger Robot
317bfca133 Merge "[BiometricsV2] Refactor EnrollIntroViewModel" into main 2023-08-07 05:22:36 +00:00
Treehugger Robot
538eafcbf2 Merge "[BiometricsV2] Refactor AutoCredentialViewModel" into main 2023-08-07 05:22:13 +00:00
Milton Wu
4362ad26e2 [BiometricsV2] Fix skip action for udfps enrolling
When user press "Do it later" in v2 enrolling page, it shall use
cancelEnrollment(true) to wait cancel event and notify activity.

Bug: 294336276
Test: manully test on udfps device
Change-Id: Id8631173fd8082d8a3b264bce46450018c2c1143
2023-08-03 16:41:53 +08:00
Milton Wu
804b76ebc3 [BiometricsV2] Refactor EnrollIntroViewModel
1. Refactor FingerprintEnrollIntroViewModel to kotlin and replace
   LiveData as Flow
2. Set importantForAccessibility to sud_scroll_view (porting solution of
   b/244595576 into fingerprint enrollment v2)

Bug: 286198097
Test: atest -m FingerprintEnrollIntroViewModelTest
Test: atest -m FingerprintEnrollmentActivityTest
Test: atest -m biometrics-enrollment-test
Change-Id: Idd4e9d77d040d7efd61342284d7b6a493a20a539
2023-08-02 04:42:36 +00:00
Milton Wu
acb8be5d25 [BiometricsV2] Refactor AutoCredentialViewModel
Refactor AutoCredentialViewModelTest and FingerprintEnrollmentViewModel
to kotlin and change LiveData to Flow

Bug: 286197659
Test: atest -m CredentialModelTest
Test: atest -m AutoCredentialViewModelTest
Test: atest -m FingerprintEnrollmentViewModelTest
Test: atest -m FingerprintEnrollmentActivityTest
Test: atest -m biometrics-enrollment-test
Change-Id: I84bab0b46e023303c0046a6ae6886ab1cf9458b8
2023-07-25 21:14:42 +08:00
Milton Wu
20fb5fc2b4 Merge "[BiometricsV2] Refactor EnrollmentViewModel" into main 2023-07-11 14:41:30 +00:00
Treehugger Robot
1e4b60db07 Merge "[BiometricsV2] Add retry button" into main 2023-07-11 14:40:15 +00:00
Milton Wu
9a7afc9216 [BiometricsV2] Refactor EnrollmentViewModel
Refactor FingerprintEnrollmentViewModel to kotlin

Bug: 286198096
Test: atest FingerprintEnrollmentViewModelTest
Test: atest FingerprintEnrollmentActivityTest
Test: atest biometrics-enrollment-test
Test: manually test enrollment
Change-Id: If1b87fa115db1c3fde853ac13fe6204879d34ca8
2023-07-11 17:30:57 +08:00
Milton Wu
f94932801a [BiometricsV2] Add retry button
Add retry button for FingerprintEnrollErrorDialog and make sure that
this button works well in the whole enrollment flow.

Bug: 287168522
Test: manually test this dialog with error and rotate devices
Test: atest FingerprintEnrollEnrollingViewModelTest
Test: atest FingerprintEnrollErrorDialogViewModelTest
Test: atest FingerprintEnrollProgressViewModelTest
Test: atest FingerprintEnrollmentActivityTest
Test: atest biometrics-enrollment-test

Change-Id: Ica1d91d077ca322caca5551068f2a3c23b544361
2023-07-11 17:25:26 +08:00
Milton Wu
4baccb32a9 [BiometricsV2] Refactor EnrollFinishFragment
Refactor FingerprintEnrollFinishFragment to kotlin and add bindView()
method for it

Bug: 286197658
Test: atest FingerprintEnrollmentActivityTest
Test: atest biometrics-enrollment-test
Test: Manually test enrollment
Change-Id: I59af5cc96369e63a4d755f5618f05dcf89cb0a50
2023-07-11 07:06:21 +00:00
Chaohui Wang
8f0b2d15c6 Clean up Kotlin FeatureFactory.getFactory(context)
Replace with featureFactory.

Bug: 286764889
Test: m Settings
Change-Id: I30bd2e9b25e1681d7694939dd8ec84fcd6fd7c08
2023-06-29 23:10:37 +08:00
Milton Wu
570b23e0a0 [BiometricsV2] Fix intro overlap enrolling page
Fix fragment overlapped if user rotates device on findSensor page, then
enter enrolling page and back again.

It is because the flag isFirstFragmentAdded is not saved and restored
after activity recreated

Bug: 288212767
Test: atest FingerprintEnrollmentActivityTest
Test: atest FingerprintEnrollmentViewModelTest
Test: atest biometrics-enrollment-test
Test: Manually test this scenario
Change-Id: I5b582582d97caac2488b787f551c50abec9f810c
2023-06-28 13:28:44 +08:00
Milton Wu
5f8620d571 [BiometricsV2] Refactor EnrollingUdfpsFragment
Refactor FingerprintEnrollEnrollingUdfpsFragment to kotlin and add
bindView() method for it

Bug: 286198032
Test: atest FingerprintEnrollmentActivityTest
Test: atest BiometricsMicrobenchmark:biometrics-enrollment-test
Test: Manually test enrollment as Udfps device
Change-Id: Ife1e14ffabc4716acc53b67f641ba9cf159319f2
2023-06-27 07:12:50 +00:00
Treehugger Robot
4ce984873e Merge "[BiometricsV2] Refactor FindUdfpsFragment" 2023-06-26 03:22:23 +00:00
TreeHugger Robot
dfe6fac149 Merge "[BiometricsV2] Refactor EnrollingSfpsFragment" 2023-06-21 08:03:37 +00:00
Milton Wu
e470a6ffd1 [BiometricsV2] Refactor FindUdfpsFragment
Refactor FingerprintEnrollFindUdfpsFragment to kotlin and add bindView()
method for it

Bug: 286197456
Test: atest FingerprintEnrollmentActivityTest
Test: Manually test enrollment as Udfps device
Change-Id: I2f201c6f57e2f2eb5120a6b8f05eea339090aa7e
2023-06-21 15:38:30 +08:00
Treehugger Robot
ef957eda5a Merge "[BiometricsV2] Refactor EnrollingRfpsFragment" 2023-06-21 04:55:47 +00:00
Treehugger Robot
2c75f0e207 Merge "[BiometricsV2] Refactor FindSfpsFragment" 2023-06-21 04:55:43 +00:00
Milton Wu
75450f7973 [BiometricsV2] Refactor FindSfpsFragment
Refactor FingerprintEnrollFindSfpsFragment to kotlin and add bindView()
method for it

Bug: 286197831
Test: atest FingerprintEnrollmentActivityTest
Test: Manually test enrollment as Side fingerpint device
Change-Id: If1c7d95e78c5be237f05209afa3ffc0b4c444c61
2023-06-21 09:56:32 +08:00
Milton Wu
00bafe9f64 [BiometricsV2] Refactor EnrollingRfpsFragment
Refactor FingerprintEnrollEnrollingRfpsFragment to kotlin and add
bindView() method for it.

Bug: 286198028
Test: atest FingerprintEnrollmentActivityTest
Test: Manually test enrollment as Rear fingerpint device
Change-Id: Ie271386f305003a89d7e545c289e47bbafb14a90
2023-06-21 09:54:55 +08:00
Milton Wu
ada229b409 [BiometricsV2] Refactor FindRfpsFragment
Refactor FingerprintEnrollFindRfpsFragment to kotlin and add bindView()
method for it

Bug: 286197313
Test: atest FingerprintEnrollmentActivityTest
Test: Manually test enrollment as Rear fingerpint device
Change-Id: Ifa11888f3e848fb7127e14ddcc41d02277163a1a
2023-06-21 09:52:35 +08:00
Milton Wu
1f2ef79fad [BiometricsV2] Refactor EnrollingSfpsFragment
Refactor FingerprintEnrollEnrollingSfpsFragment to kotlin and add
bindView() method for it

Bug: 286197400
Test: atest FingerprintEnrollmentActivityTest
Test: Manually test enrollment as Side fingerpint device
Change-Id: I57fe2b07f635e9558372d003b61c419d9447f12b
2023-06-21 09:49:57 +08:00
Milton Wu
8e42d7c85a [BiometricsV2] Refactor Fingerprint intro fragment
Refactor FingerprintEnrollIntroFragment to kotlin and add bindView()
method for it.

Bug: 286197823
Test: atest FingerprintEnrollmentActivityTest
Change-Id: I44157bf2c2bea6f49382335438b16aae3e3e5b4c
2023-06-17 18:16:17 +08:00
Milton Wu
940e5d04a6 [BiometricsV2] Rewrite Activity to Kotlin
Refactor FingerprintEnrollmentActivity as kotlin

Bug: 286197261
Test: atest FingerprintEnrollmentActivity
Test: atest biometrics-enrollment-test
Change-Id: I45d2db832b0111cb865b657aee56f84b0b295efa
2023-06-16 20:36:37 +08:00
Hao Dong
9e1435a0dc Merge "Wait for systemui udfps overlay ready to show settings udfps enroll view." into udc-qpr-dev am: 61659799de am: a9f1ed3501
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23595181

Change-Id: I88d843e5c1164e054d4cb48e3f953618e63e2e64
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-15 01:46:36 +00:00
Milton Wu
7a71b59ca3 [BiometricsV2] Refactor dialogs/helper to kotlin
1. Refactor Dialogs/GlifLayoutHelper to kotlin
2. Add bindView() for Dialogs

Bug: 286197243
Bug: 286197247
Test: atest FingerprintEnrollmentTest
Test: atest biometrics-enrollment-test
Test: Manully show these dialogs
Change-Id: If047f48f8380f03ad8ab3ba55c98c3e745be1eea
2023-06-14 18:53:16 +08:00
Milton Wu
aadecbaf34 [BiometricsV2] Refactor model code to kotlin
Bug: 286196884
Test: atest FingerprintEnrollmentActivityTest CredentialModelTest
      EnrollmentRequestTest FingerprintEnrollIntroViewModelTest
      FingerprintEnrollmentViewModelTest
Test: atest biometrics-enrollment-test
Change-Id: I2bdae4d2dd052d3664a790cd982edf51fcebec09
2023-06-13 10:29:16 +00:00
Hao Dong
c24e305fbf Wait for systemui udfps overlay ready to show settings udfps enroll view.
Previously, we show settings's udfps enroll animation view (the fingerprint icon and progress view) once the FingerprintEnrollEnrolling is shown.
However, touch events have to wait for systemui's udfps overlay to be valid. This CL lets settings's udfps enroll view wait for systemui's overlay.
1. Sets udfps enroll animation view's default visibility Gone.
2. Propagates FingerprintManager#onUdfpsOverlayShown to
   FingerprintEnrollEnrolling and when it's called, set the enroll view
   visible.

Besides, this CL renames onPointerDown() and onPointerUp() with Udfps.

Bug: 280718879
Test: atest FingerprintEnrollEnrollingTest
Change-Id: Ieed3e74c182828918785edcacb021f19a3665f2a
2023-06-07 17:59:11 +00:00
Milton Wu
bc2dbee762 [BiometricsV2] Refine fingerprint activities
Seperate FingerprintEnrollmentActivity to another InternalActivity and
SetupActivity. InternalActivity is used for FingerprintSettings.
SetupActivity is used for setupwizard flow.

Bug: 284248001
Test: atest FingerprintEnrollmentActivityTest
Test: atest for biometrics/biometrics2 in unit tests
Test: settingRoboTest for biometrics
Change-Id: I9fb5dc34300060b9ccf857a3335b81a5d4bf5c7b
2023-05-25 06:25:58 +00:00
Milton Wu
3e8a37f2c7 [BiometricsV2] Remove "Try again" button from errorDialog
Remove "Try again" button from fingerprint enrolling error dialog for
biometrics v2.

Test: Manual (Enable biometrics v2, Start enrollment and don't
      complete it for 10 minutes; observe the dialog)
Test: atest FingerprintEnrollEnrollingViewModelTest
      FingerprintEnrollmentActivityTest
Bug: 280546173
Change-Id: I844786719a41b1a3d0e86ab32b74ab9b5aeaa0a1
2023-05-08 13:50:03 +00:00
Milton Wu
8b0fc14f94 [BiometricsV2] Refine fingerprint ui and flow
1. Fix "No thanks" become 2 lines, and fix the status when new
   fingerprint enrolled.
2. Fix Finish page shows again after pressing back from a new Finish
   page
3. Fix FindSensor page shows again after max number of fingerprint
   has reached.
4. Add missing tests, and remove some bypass-only tests

Bug: 279134177
Bug: 279380583
Bug: 279386539
Bug: 279394069
Test: atest FingerprintEnrollIntroViewModelTest
    FingerprintEnrollFindSensorViewModelTest
    FingerprintEnrollEnrollingViewModelTest
    FingerprintEnrollmentViewModelTest FingerprintEnrollmentActivityTest
Test: manually test 1, 2, and 3
Change-Id: I3797ceed8e7d6c10a4b4711f8bff8d7f222f0923
2023-05-08 14:00:22 +08:00
Milton Wu
1205ba58de [BiometricsV2] Fix fingerprint 2nd enroll fail
Enrolling fragments wait cancelled msg then finish itself when user
presses skip button in this page

Bug: 279540275
Test: atest FingerprintEnrollmentActivityTest
Test: For udfps and sfps devices, manually click "Add fingerprint" from
      Fingerprint Settings, then quickly back, and quickly re-enter.
      Make sure the re-entered enrolling works well.
Change-Id: I99b67af31234f7332ad33e776e82d04ece117e5e
2023-04-27 10:52:01 +00:00
Milton Wu
3024352f85 [BiometricsV2] Fix fingerprint add another fail
Fix enrolling can't finished because FingerprintEnrollment attaches to
wrong ViewModel during onCreate() with non-null savedInstance after
rotation.

Read latest fragment through findFragmentById to fix it

Bug: 275513362
Test: atest FingerprintEnrollmentActivityTest
Change-Id: Icb2c0edec325a813ec5a7822aba39ca201d2d8e9
2023-04-19 17:35:33 +08:00
Milton Wu
562bbc8193 [BiometricsV2] fix enrolling rotate failed
Clean help message during progress changed, and reload help message from
ViewModel in onStart of enrolling page.

Bug: 275513362
Test: atest FingerprintEnrollProgressViewModelTest
Test: enable biometrics v2, and manully rotate screen when help msg
      is shown, and check help msg is kept after screen rotation.
Change-Id: I44220050806038ee62750f8945b8ba8f8bb9c282
2023-04-17 08:06:53 +00:00
Milton Wu
15267aab1f [BiometricsV2] IconTouchDialog continue enroll
When user clicks "OK" in FingerprintEnrollEnrollingIconTouchDialog,
continue enrolling.

Bug: 276416053
Test: atest FingerprintEnrollEnrollingViewModelTest
      FingerprintEnrollmentActivityTest
Test: Manually check enrolling status as clicking "OK" button on
      FingerprintEnrollEnrollingIconTouchDialog after enabling
      biometrics v2 v2 through feature flag.
Change-Id: I028723acfe35e5119e43b6860022c7432fc2ae0e
2023-04-11 14:39:59 +08:00
Milton Wu
4140b84881 [BiometricsV2] Fix 2nd touch not work for enroll
Use MessageDisplayController only when enroll reason is ENROLL_ENROLL
and R.bool.enrollment_message_display_controller_flag is true.
And always allocate a new MessageDisplayController for each new enroll
to avoid the possibility of events being ignored by
MessageDisplayController.

Bug: 275510856
Test: atest FingerprintEnrollProgressViewModelTest
Test: manually test sfps/udfps enrollment for biometricsV2
Change-Id: Ifc8b91916a3d76bed68dc523a90dc6ba422e3923
2023-04-06 13:18:41 +08:00
Milton Wu
05d275bf07 Update theme transition for fingerprint in U
Apply suw transition for fingerprint
1. Fix incorrect animation between Lock and Fingeprint in Suw
2. Fix incorrect animation between Fingeprint and FaceLock in Suw
3. Remove unnecessary overridePendingAnimation during Enorlling
4. Fix no animation in biometrics v2 because of incorrect calling order
   in FragmentTransaction

Bug: 269063515
Test: Manually test transition animation for fingerprint enrollments
Change-Id: I12475dae5cb2905c81b24d3b57438b898afa1e27
2023-03-28 11:24:59 +00:00
Milton Wu
ab488b3c5b Add biometrics v2 test
Add tests into FingerprintEnrollFinishViewModelTest and
FingerprintEnrollProgressViewModelTest. and also remove mDoneLiveData
from FingerprintEnrollProgressViewModel because no one uses it.

Bug: 271220339
Test: atest FingerprintEnrollFinishViewModelTest
      FingerprintEnrollProgressViewModelTest
Change-Id: Id74da29b7730a3e7feb8d0b263c28c8192adad9c
2023-03-14 04:33:12 +00:00
TreeHugger Robot
3e41d936b3 Merge "Fix icon touch dialog in Enrolling page" into udc-dev 2023-03-06 05:14:17 +00:00
Milton Wu
7b817dd0a0 Fix icon touch dialog in Enrolling page
1. Fix icon touch dialog not shown in Enrolling page for SFPS and RFPS
   devices
2. Remove AccessibilityRepository and VibratorRepository because they
   only bypass info w/o actual effect.
3. Add/Refine missing test cases for FingerprintRepositoryTest,
   CredentailModelTest, AutoCredentialViewModelTest,
   FingerprintEnrollEnrollingViewModelTest,
   FingerprintEnrollFindSensorViewModelTest,
   FingerprintEnrollIntroViewModelTest

Bug: 271535048
Bug: 271220339
Test: atest FingerprintEnrollmentActivityTest CredentialModelTest
      FingerprintRepositoryTest AutoCredentialViewModelTest
      FingerprintEnrollEnrollingViewModelTest
      FingerprintEnrollFindSensorViewModelTest
      FingerprintEnrollIntroViewModelTest
Test: Manually test enrollment
Change-Id: I7d1ed935e156bbd41d5da63902683e430fd3fc1f
2023-03-03 17:49:17 +08:00
Vincent Wang
3ff1939b59 Fix Incorrect lottie status on the beginning of enrolling UDFPS
Bug: b/271209610
Test: 1. adb root
      2. adb shell setprop sys.fflag.override.settings_biometrics2_enrollment true
      3. Excute fingerprint enroll process & check the state of enroll progress is
         correct
Change-Id: I3cac369e9dcf939a09dce11a7b9e96952bceeee8
2023-03-02 07:24:43 +00:00