2-1/ Add config_suw_support_face_enroll to customize SUW face enroll flow am: e05697fc65

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/20727251

Change-Id: Ib401d8eeb89c916a9cf934f6dcce6bc101d6965a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
lbill
2023-01-12 07:02:18 +00:00
committed by Automerger Merge Worker
4 changed files with 23 additions and 5 deletions

View File

@@ -292,6 +292,9 @@
<!-- Whether to use the Lottie animation for the face education enrollment screen --> <!-- Whether to use the Lottie animation for the face education enrollment screen -->
<bool name="config_face_education_use_lottie">false</bool> <bool name="config_face_education_use_lottie">false</bool>
<!-- Whether to support enrollment during setup wizard flow -->
<bool name="config_suw_support_face_enroll">true</bool>
<!-- App intent --> <!-- App intent -->
<string name="config_account_intent_uri" translatable="false"></string> <string name="config_account_intent_uri" translatable="false"></string>

View File

@@ -48,6 +48,7 @@ import com.android.internal.widget.LockPatternUtils;
import com.android.settings.R; import com.android.settings.R;
import com.android.settings.SetupWizardUtils; import com.android.settings.SetupWizardUtils;
import com.android.settings.core.InstrumentedActivity; import com.android.settings.core.InstrumentedActivity;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.password.ChooseLockGeneric; import com.android.settings.password.ChooseLockGeneric;
import com.android.settings.password.ChooseLockPattern; import com.android.settings.password.ChooseLockPattern;
import com.android.settings.password.ChooseLockSettingsHelper; import com.android.settings.password.ChooseLockSettingsHelper;
@@ -215,11 +216,16 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
mIsFaceEnrollable = mIsFaceEnrollable =
faceManager.getEnrolledFaces(mUserId).size() < maxEnrolls; faceManager.getEnrolledFaces(mUserId).size() < maxEnrolls;
// exclude face enrollment from setup wizard if configured as a convenience final boolean parentalConsent = isSetupWizard || (mParentalOptionsRequired
// isSetupWizard is always false for unicorn enrollment, so if consent is
// required check if setup has completed instead.
final boolean isSettingUp = isSetupWizard || (mParentalOptionsRequired
&& !WizardManagerHelper.isUserSetupComplete(this)); && !WizardManagerHelper.isUserSetupComplete(this));
if (parentalConsent && isMultiSensor && mIsFaceEnrollable) {
// Exclude face enrollment from setup wizard if feature config not supported
// in setup wizard flow, we still allow user enroll faces through settings.
mIsFaceEnrollable = FeatureFactory.getFactory(getApplicationContext())
.getFaceFeatureProvider()
.isSetupWizardSupported(getApplicationContext());
Log.d(TAG, "config_suw_support_face_enroll: " + mIsFaceEnrollable);
}
} }
} }
if (mHasFeatureFingerprint) { if (mHasFeatureFingerprint) {

View File

@@ -22,4 +22,7 @@ import android.content.Context;
public interface FaceFeatureProvider { public interface FaceFeatureProvider {
/** Returns true if attention checking is supported. */ /** Returns true if attention checking is supported. */
boolean isAttentionSupported(Context context); boolean isAttentionSupported(Context context);
/** Returns true if setup wizard supported face enrollment. */
boolean isSetupWizardSupported(Context context);
} }

View File

@@ -17,7 +17,8 @@
package com.android.settings.biometrics.face; package com.android.settings.biometrics.face;
import android.content.Context; import android.content.Context;
import android.provider.Settings;
import androidx.annotation.NonNull;
public class FaceFeatureProviderImpl implements FaceFeatureProvider { public class FaceFeatureProviderImpl implements FaceFeatureProvider {
@@ -25,4 +26,9 @@ public class FaceFeatureProviderImpl implements FaceFeatureProvider {
public boolean isAttentionSupported(Context context) { public boolean isAttentionSupported(Context context) {
return true; return true;
} }
@Override
public boolean isSetupWizardSupported(@NonNull Context context) {
return true;
}
} }