Merge "Limit biometric enrollments when Unicorn account is present." into sc-dev am: 12e161d1dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/15413152 Change-Id: If88427e1b7ed4d5227c821ab65e47f52cc9c5481
This commit is contained in:
@@ -28,6 +28,7 @@ import android.app.settings.SettingsEnums;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.hardware.biometrics.BiometricAuthenticator;
|
||||||
import android.hardware.biometrics.BiometricManager;
|
import android.hardware.biometrics.BiometricManager;
|
||||||
import android.hardware.biometrics.BiometricManager.Authenticators;
|
import android.hardware.biometrics.BiometricManager.Authenticators;
|
||||||
import android.hardware.biometrics.BiometricManager.BiometricError;
|
import android.hardware.biometrics.BiometricManager.BiometricError;
|
||||||
@@ -116,8 +117,10 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
|||||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
|
final Intent intent = getIntent();
|
||||||
|
|
||||||
if (this instanceof InternalActivity) {
|
if (this instanceof InternalActivity) {
|
||||||
mUserId = getIntent().getIntExtra(Intent.EXTRA_USER_ID, UserHandle.myUserId());
|
mUserId = intent.getIntExtra(Intent.EXTRA_USER_ID, UserHandle.myUserId());
|
||||||
if (BiometricUtils.containsGatekeeperPasswordHandle(getIntent())) {
|
if (BiometricUtils.containsGatekeeperPasswordHandle(getIntent())) {
|
||||||
mGkPwHandle = BiometricUtils.getGatekeeperPasswordHandle(getIntent());
|
mGkPwHandle = BiometricUtils.getGatekeeperPasswordHandle(getIntent());
|
||||||
}
|
}
|
||||||
@@ -135,7 +138,6 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Log a framework stats event if this activity was launched via intent action.
|
// Log a framework stats event if this activity was launched via intent action.
|
||||||
final Intent intent = getIntent();
|
|
||||||
if (!mIsEnrollActionLogged && ACTION_BIOMETRIC_ENROLL.equals(intent.getAction())) {
|
if (!mIsEnrollActionLogged && ACTION_BIOMETRIC_ENROLL.equals(intent.getAction())) {
|
||||||
mIsEnrollActionLogged = true;
|
mIsEnrollActionLogged = true;
|
||||||
|
|
||||||
@@ -205,6 +207,22 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
|
|||||||
Log.d(TAG, "parentalOptionsRequired: " + mParentalOptionsRequired
|
Log.d(TAG, "parentalOptionsRequired: " + mParentalOptionsRequired
|
||||||
+ ", skipReturnToParent: " + mSkipReturnToParent);
|
+ ", skipReturnToParent: " + mSkipReturnToParent);
|
||||||
|
|
||||||
|
// Only allow the consent flow to happen once when running from setup wizard.
|
||||||
|
// This isn't common and should only happen if setup wizard is not completed normally
|
||||||
|
// due to a restart, etc.
|
||||||
|
if (isSetupWizard && mParentalOptionsRequired) {
|
||||||
|
final boolean consentAlreadyManaged = ParentalControlsUtils.parentConsentRequired(this,
|
||||||
|
BiometricAuthenticator.TYPE_FACE | BiometricAuthenticator.TYPE_FINGERPRINT)
|
||||||
|
!= null;
|
||||||
|
if (consentAlreadyManaged) {
|
||||||
|
Log.w(TAG, "Consent was already setup - skipping enrollment");
|
||||||
|
setResult(RESULT_SKIP);
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// start enrollment process if we haven't bailed out yet
|
||||||
if (mParentalOptionsRequired && mParentalOptions == null) {
|
if (mParentalOptionsRequired && mParentalOptions == null) {
|
||||||
mParentalConsentHelper = new ParentalConsentHelper(
|
mParentalConsentHelper = new ParentalConsentHelper(
|
||||||
mIsFaceEnrollable, mIsFingerprintEnrollable, mGkPwHandle);
|
mIsFaceEnrollable, mIsFingerprintEnrollable, mGkPwHandle);
|
||||||
|
Reference in New Issue
Block a user