Consolidate face enroll intro/consent screens

Updates the UI of the face enroll intro screen based on the latest
mocks, while still allowing strings to be overlaid depending on the
device and/or face auth implementation.

Test: Manually tested face enrollment

Bug: 187207438
Change-Id: I5d912261b1eecfc7a241d6b48d549c4ff253ecdf
This commit is contained in:
Curtis Belmonte
2021-05-11 18:25:07 -07:00
parent 16e8c767f1
commit cef573f2d0
7 changed files with 138 additions and 73 deletions

View File

@@ -16,8 +16,6 @@
package com.android.settings.biometrics;
import static com.android.settings.Utils.SETTINGS_PACKAGE_NAME;
import android.app.Activity;
import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
@@ -34,8 +32,8 @@ import androidx.fragment.app.FragmentActivity;
import com.android.internal.widget.LockPatternUtils;
import com.android.internal.widget.VerifyCredentialResponse;
import com.android.settings.R;
import com.android.settings.SetupWizardUtils;
import com.android.settings.biometrics.face.FaceEnrollIntroduction;
import com.android.settings.biometrics.fingerprint.FingerprintEnrollFindSensor;
import com.android.settings.biometrics.fingerprint.FingerprintEnrollIntroduction;
import com.android.settings.biometrics.fingerprint.SetupFingerprintEnrollIntroduction;
@@ -173,9 +171,7 @@ public class BiometricUtils {
*/
public static Intent getFaceIntroIntent(@NonNull Context context,
@NonNull Intent activityIntent) {
final String className = context.getString(R.string.config_face_enroll_introduction);
Intent intent = new Intent();
intent.setClassName(SETTINGS_PACKAGE_NAME, className);
final Intent intent = new Intent(context, FaceEnrollIntroduction.class);
WizardManagerHelper.copyWizardManagerExtras(activityIntent, intent);
return intent;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018 The Android Open Source Project
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -11,7 +11,7 @@
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License
* limitations under the License.
*/
package com.android.settings.biometrics.face;
@@ -41,8 +41,11 @@ import com.google.android.setupdesign.template.RequireScrollMixin;
import java.util.List;
/**
* Provides introductory info about face unlock and prompts the user to agree before starting face
* enrollment.
*/
public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
private static final String TAG = "FaceEnrollIntroduction";
private FaceManager mFaceManager;
@@ -66,6 +69,9 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getLayout().setDescriptionText(getString(
R.string.security_settings_face_enroll_introduction_message));
mFaceManager = Utils.getFaceManagerOrNull(this);
mFaceFeatureProvider = FeatureFactory.getFactory(getApplicationContext())
.getFaceFeatureProvider();
@@ -82,7 +88,7 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
FooterButton.Builder nextButtonBuilder = new FooterButton.Builder(this)
.setText(R.string.security_settings_face_enroll_introduction_agree)
.setButtonType(FooterButton.ButtonType.NEXT)
.setButtonType(FooterButton.ButtonType.OPT_IN)
.setTheme(R.style.SudGlifButton_Primary);
if (maxFacesEnrolled()) {
nextButtonBuilder.setListener(this::onNextButtonClick);
@@ -97,13 +103,6 @@ public class FaceEnrollIntroduction extends BiometricEnrollIntroduction {
this::onNextButtonClick);
}
final TextView footer2 = findViewById(R.id.face_enroll_introduction_footer_part_2);
final int footer2TextResource =
mFaceFeatureProvider.isAttentionSupported(getApplicationContext())
? R.string.security_settings_face_enroll_introduction_footer_part_2
: R.string.security_settings_face_settings_footer_attention_not_supported;
footer2.setText(footer2TextResource);
// This path is an entry point for SetNewPasswordController, e.g.
// adb shell am start -a android.app.action.SET_NEW_PASSWORD
if (mToken == null && BiometricUtils.containsGatekeeperPasswordHandle(getIntent())) {

View File

@@ -68,7 +68,7 @@ public class FaceStatusPreferenceController extends BiometricStatusPreferenceCon
@Override
protected String getEnrollClassName() {
return mContext.getResources().getString(R.string.config_face_enroll_introduction);
return FaceEnrollIntroduction.class.getName();
}
}