OSDN Git Service

Remove delay from enroll start button
authorKevin Chyn <kchyn@google.com>
Fri, 16 Aug 2019 23:40:39 +0000 (16:40 -0700)
committerKevin Chyn <kchyn@google.com>
Sat, 17 Aug 2019 04:52:30 +0000 (04:52 +0000)
Fixes: 139554930

Test: manual, button no longer delayed
Change-Id: I365308c2a00c122b80f70c904d11bb4a5d6cf404
Merged-in: I365308c2a00c122b80f70c904d11bb4a5d6cf404

src/com/android/settings/biometrics/face/FaceEnrollEducation.java

index 011cc12..e1253c1 100644 (file)
@@ -16,7 +16,6 @@
 
 package com.android.settings.biometrics.face;
 
-import static android.provider.Settings.Secure.FACE_UNLOCK_EDUCATION_INFO_DISPLAYED;
 import static android.security.KeyStore.getApplicationContext;
 
 import android.app.settings.SettingsEnums;
@@ -50,8 +49,6 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
     private static final String TAG = "FaceEducation";
     private static final int ON = 1;
     private static final int OFF = 0;
-    // 8 seconds.
-    private static final long FACE_ENROLL_EDUCATION_DELAY = 3000;
 
     private FaceManager mFaceManager;
     private FaceEnrollAccessibilityToggle mSwitchDiversity;
@@ -140,21 +137,9 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
                     && accessibilityManager.isTouchExplorationEnabled();
         }
         mFooterBarMixin.setPrimaryButton(footerButton);
-        final Context context = getApplicationContext();
-        final boolean didDisplayEdu = Settings.Secure.getIntForUser(context.getContentResolver(),
-                FACE_UNLOCK_EDUCATION_INFO_DISPLAYED, OFF, mUserId) == ON;
-        if (!didDisplayEdu && !accessibilityEnabled) {
-            Settings.Secure.putIntForUser(context.getContentResolver(),
-                    FACE_UNLOCK_EDUCATION_INFO_DISPLAYED, ON, mUserId);
-            footerButton.setEnabled(false);
-            mHandler.postDelayed(() -> {
-                footerButton.setEnabled(true);
-            }, FACE_ENROLL_EDUCATION_DELAY);
-        }
 
         final Button accessibilityButton = findViewById(R.id.accessibility_button);
         accessibilityButton.setOnClickListener(view -> {
-            footerButton.setEnabled(true);
             mSwitchDiversity.setChecked(true);
             accessibilityButton.setVisibility(View.GONE);
             mSwitchDiversity.setVisibility(View.VISIBLE);