Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c506fcf3 authored by Shawn Lin's avatar Shawn Lin Committed by Android (Google) Code Review
Browse files

Merge "Update UX of parental consent page for biometrics enrollment" into main

parents 08fbc448 f0063df6
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -32,8 +32,7 @@ import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.android.settings.biometrics.face.FaceEnrollParentalConsent;
import com.android.settings.biometrics.fingerprint.FingerprintEnrollParentalConsent;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.password.ChooseLockSettingsHelper;

import com.google.android.setupcompat.util.WizardManagerHelper;
@@ -140,10 +139,12 @@ public class ParentalConsentHelper {
    @Nullable
    private Intent getNextConsentIntent(@NonNull Context context) {
        if (mRequireFingerprint && mConsentFingerprint == null) {
            return new Intent(context, FingerprintEnrollParentalConsent.class);
            return new Intent(context, FeatureFactory.getFeatureFactory()
                    .getFingerprintFeatureProvider().getParentalConsentPage());
        }
        if (mRequireFace && mConsentFace == null) {
            return new Intent(context, FaceEnrollParentalConsent.class);
            return new Intent(context, FeatureFactory.getFeatureFactory()
                    .getFaceFeatureProvider().getParentalConsentPage());
        }
        return null;
    }
@@ -161,11 +162,13 @@ public class ParentalConsentHelper {
        final Bundle result = new Bundle();
        result.putBoolean(KEY_FACE_CONSENT, mConsentFace != null ? mConsentFace : false);
        result.putIntArray(KEY_FACE_CONSENT_STRINGS,
                FaceEnrollParentalConsent.CONSENT_STRING_RESOURCES);
                FeatureFactory.getFeatureFactory().getFaceFeatureProvider()
                        .getParentalConsentStringRes());
        result.putBoolean(KEY_FINGERPRINT_CONSENT,
                mConsentFingerprint != null ? mConsentFingerprint : false);
        result.putIntArray(KEY_FINGERPRINT_CONSENT_STRINGS,
                FingerprintEnrollParentalConsent.CONSENT_STRING_RESOURCES);
                FeatureFactory.getFeatureFactory().getFingerprintFeatureProvider()
                        .getParentalConsentStringRes());
        result.putBoolean(KEY_IRIS_CONSENT, false);
        result.putIntArray(KEY_IRIS_CONSENT_STRINGS, new int[0]);
        return result;
+8 −0
Original line number Diff line number Diff line
@@ -54,4 +54,12 @@ public interface FaceFeatureProvider {

    /** Returns the max enrollable count. */
    int getMaxEnrollableCount(@NonNull Context context);

    /** Returns the parental consent page. */
    @NonNull
    Class<? extends FaceEnrollParentalConsent> getParentalConsentPage();

    /** Returns the string resources of the parental consent page. */
    @NonNull
    int[] getParentalConsentStringRes();
}
+12 −0
Original line number Diff line number Diff line
@@ -97,4 +97,16 @@ public class FaceFeatureProviderImpl implements FaceFeatureProvider {
        }
        return mMaxEnrollableCount;
    }

    @NonNull
    @Override
    public Class<? extends FaceEnrollParentalConsent> getParentalConsentPage() {
        return FaceEnrollParentalConsent.class;
    }

    @NonNull
    @Override
    public int[] getParentalConsentStringRes() {
        return  FaceEnrollParentalConsent.CONSENT_STRING_RESOURCES;
    }
}
+8 −0
Original line number Diff line number Diff line
@@ -89,4 +89,12 @@ public interface FingerprintFeatureProvider {
    default List<ChallengeGeneratedInvoker> getChallengeGeneratedInvokers() {
        return Collections.emptyList();
    }

    /** Returns the parental consent page. */
    @NonNull
    Class<? extends FingerprintEnrollParentalConsent> getParentalConsentPage();

    /** Returns the string resources of the parental consent page. */
    @NonNull
    int[] getParentalConsentStringRes();
}
+12 −0
Original line number Diff line number Diff line
@@ -49,4 +49,16 @@ public class FingerprintFeatureProviderImpl implements FingerprintFeatureProvide
        }
        return mSfpsRestToUnlockFeature;
    }

    @NonNull
    @Override
    public Class<? extends FingerprintEnrollParentalConsent> getParentalConsentPage() {
        return FingerprintEnrollParentalConsent.class;
    }

    @NonNull
    @Override
    public int[] getParentalConsentStringRes() {
        return FingerprintEnrollParentalConsent.CONSENT_STRING_RESOURCES;
    }
}
Loading