Fix FaceSettings UI problem

Update the visibility of button in onStart to avoid missing check
state if Fragment & Activity were restarted

Bug: 269553342
Test: 1. enroll face
      2. go to settings > Security  privacy > device lock > face & fingerprint unlock
      3. Eenter screen lock
      4. Click face unlock > delete face model
      5.re-enroll face
      6.check the UI of face unlock detailed page
Change-Id: I152467afe2cc90932a53fe73b541e97b5b742831
This commit is contained in:
Vincent Wang
2023-02-21 07:30:20 +00:00
parent 98d2e83c3d
commit 4e8bded71b

View File

@@ -203,7 +203,11 @@ public class FaceSettings extends DashboardFragment {
if (savedInstanceState != null) {
mToken = savedInstanceState.getByteArray(KEY_TOKEN);
}
}
@Override
public void onStart() {
super.onStart();
final boolean hasEnrolled = mFaceManager.hasEnrolledTemplates(mUserId);
mEnrollButton.setVisible(!hasEnrolled);
mRemoveButton.setVisible(hasEnrolled);