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

Commit 13b05b6f authored by Kevin Chyn's avatar Kevin Chyn Committed by Android (Google) Code Review
Browse files

Merge changes from topics "fp-revokeChallenge", "new-revokeChallenge" into sc-dev

* changes:
  Update fingerprint revokeChallenge with frameworks/base
  Update revokeChallenge together with frameworks/base
parents bf182903 39b2fe8b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ public abstract class BiometricEnrollBase extends InstrumentedActivity {
    public static final String EXTRA_KEY_LAUNCHED_CONFIRM = "launched_confirm_lock";
    public static final String EXTRA_KEY_REQUIRE_VISION = "accessibility_vision";
    public static final String EXTRA_KEY_REQUIRE_DIVERSITY = "accessibility_diversity";
    public static final String EXTRA_KEY_SENSOR_ID = "sensor_id";
    public static final String EXTRA_KEY_CHALLENGE = "challenge";

    /**
     * Used by the choose fingerprint wizard to indicate the wizard is
@@ -90,12 +92,16 @@ public abstract class BiometricEnrollBase extends InstrumentedActivity {
    protected boolean mLaunchedConfirmLock;
    protected byte[] mToken;
    protected int mUserId;
    protected int mSensorId;
    protected long mChallenge;
    protected boolean mFromSettingsSummary;
    protected FooterBarMixin mFooterBarMixin;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mChallenge = getIntent().getLongExtra(EXTRA_KEY_CHALLENGE, -1L);
        mSensorId = getIntent().getIntExtra(EXTRA_KEY_SENSOR_ID, -1);
        // Don't need to retrieve the HAT if it already exists. In some cases, the extras do not
        // contain EXTRA_KEY_CHALLENGE_TOKEN but contain EXTRA_KEY_GK_PW, in which case enrollment
        // classes may request a HAT to be created (as opposed to being passed in)
@@ -110,6 +116,8 @@ public abstract class BiometricEnrollBase extends InstrumentedActivity {
                    ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN);
            mFromSettingsSummary =
                    savedInstanceState.getBoolean(EXTRA_FROM_SETTINGS_SUMMARY, false);
            mChallenge = savedInstanceState.getLong(EXTRA_KEY_CHALLENGE);
            mSensorId = savedInstanceState.getInt(EXTRA_KEY_SENSOR_ID);
        }
        mUserId = getIntent().getIntExtra(Intent.EXTRA_USER_ID, UserHandle.myUserId());
    }
@@ -127,6 +135,8 @@ public abstract class BiometricEnrollBase extends InstrumentedActivity {
        outState.putBoolean(EXTRA_KEY_LAUNCHED_CONFIRM, mLaunchedConfirmLock);
        outState.putByteArray(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
        outState.putBoolean(EXTRA_FROM_SETTINGS_SUMMARY, mFromSettingsSummary);
        outState.putLong(EXTRA_KEY_CHALLENGE, mChallenge);
        outState.putInt(EXTRA_KEY_SENSOR_ID, mSensorId);
    }

    @Override
@@ -192,6 +202,8 @@ public abstract class BiometricEnrollBase extends InstrumentedActivity {
        intent.setClassName(SETTINGS_PACKAGE_NAME, FingerprintEnrollEnrolling.class.getName());
        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, mToken);
        intent.putExtra(EXTRA_FROM_SETTINGS_SUMMARY, mFromSettingsSummary);
        intent.putExtra(EXTRA_KEY_CHALLENGE, mChallenge);
        intent.putExtra(EXTRA_KEY_SENSOR_ID, mSensorId);
        if (mUserId != UserHandle.USER_NULL) {
            intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
        }
+6 −0
Original line number Diff line number Diff line
@@ -243,6 +243,8 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
        }
        BiometricUtils.copyMultiBiometricExtras(getIntent(), intent);
        intent.putExtra(EXTRA_FROM_SETTINGS_SUMMARY, mFromSettingsSummary);
        intent.putExtra(EXTRA_KEY_CHALLENGE, mChallenge);
        intent.putExtra(EXTRA_KEY_SENSOR_ID, mSensorId);
        startActivityForResult(intent, BIOMETRIC_FIND_SENSOR_REQUEST);
    }

@@ -262,6 +264,8 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
                overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
                getNextButton().setEnabled(false);
                getChallenge(((sensorId, challenge) -> {
                    mSensorId = sensorId;
                    mChallenge = challenge;
                    mToken = BiometricUtils.requestGatekeeperHat(this, data, mUserId, challenge);
                    BiometricUtils.removeGatekeeperPasswordHandle(this, data);
                    getNextButton().setEnabled(true);
@@ -276,6 +280,8 @@ public abstract class BiometricEnrollIntroduction extends BiometricEnrollBase
                overridePendingTransition(R.anim.sud_slide_next_in, R.anim.sud_slide_next_out);
                getNextButton().setEnabled(false);
                getChallenge(((sensorId, challenge) -> {
                    mSensorId = sensorId;
                    mChallenge = challenge;
                    mToken = BiometricUtils.requestGatekeeperHat(this, data, mUserId, challenge);
                    BiometricUtils.removeGatekeeperPasswordHandle(this, data);
                    getNextButton().setEnabled(true);
+2 −0
Original line number Diff line number Diff line
@@ -121,6 +121,8 @@ public abstract class BiometricsEnrollEnrolling extends BiometricEnrollBase
                | Intent.FLAG_ACTIVITY_CLEAR_TOP
                | Intent.FLAG_ACTIVITY_SINGLE_TOP);
        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE_TOKEN, token);
        intent.putExtra(BiometricEnrollBase.EXTRA_KEY_SENSOR_ID, mSensorId);
        intent.putExtra(BiometricEnrollBase.EXTRA_KEY_CHALLENGE, mChallenge);
        intent.putExtra(EXTRA_FROM_SETTINGS_SUMMARY, mFromSettingsSummary);
        if (mUserId != UserHandle.USER_NULL) {
            intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
+4 −0
Original line number Diff line number Diff line
@@ -72,6 +72,8 @@ public class MultiBiometricEnrollHelper {
                    mGkPwHandle, mUserId, challenge);
            final Intent faceIntent = BiometricUtils.getFaceIntroIntent(mActivity,
                    mActivity.getIntent());
            faceIntent.putExtra(BiometricEnrollBase.EXTRA_KEY_SENSOR_ID, sensorId);
            faceIntent.putExtra(BiometricEnrollBase.EXTRA_KEY_CHALLENGE, challenge);

            if (mRequestEnrollFingerprint) {
                // Give FaceEnroll a pendingIntent pointing to fingerprint enrollment, so that it
@@ -97,6 +99,8 @@ public class MultiBiometricEnrollHelper {
                    mGkPwHandle, mUserId, challenge);
            final Intent intent = BiometricUtils.getFingerprintIntroIntent(mActivity,
                    mActivity.getIntent());
            intent.putExtra(BiometricEnrollBase.EXTRA_KEY_SENSOR_ID, sensorId);
            intent.putExtra(BiometricEnrollBase.EXTRA_KEY_CHALLENGE, challenge);
            BiometricUtils.launchEnrollForResult(mActivity, intent, REQUEST_FINGERPRINT_ENROLL,
                    hardwareAuthToken, mGkPwHandle, mUserId);
        }));
+2 −0
Original line number Diff line number Diff line
@@ -183,6 +183,8 @@ public class FaceEnrollEducation extends BiometricEnrollBase {
        if (mUserId != UserHandle.USER_NULL) {
            intent.putExtra(Intent.EXTRA_USER_ID, mUserId);
        }
        intent.putExtra(EXTRA_KEY_CHALLENGE, mChallenge);
        intent.putExtra(EXTRA_KEY_SENSOR_ID, mSensorId);
        intent.putExtra(EXTRA_FROM_SETTINGS_SUMMARY, mFromSettingsSummary);
        BiometricUtils.copyMultiBiometricExtras(getIntent(), intent);
        final String flattenedString = getString(R.string.config_face_enroll);
Loading