Add handoff activity to parental consent flow.

Bug: 188847063
Test: manual
Change-Id: Ib6f38aae487a536fb8e85d608a22378a17c1bc64
This commit is contained in:
Joe Bolinger
2021-06-16 14:07:37 -07:00
parent 0fcac8bf0d
commit fb515ed608
8 changed files with 144 additions and 7 deletions

View File

@@ -69,6 +69,8 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
private static final int REQUEST_CONFIRM_LOCK = 2;
// prompt for parental consent options
private static final int REQUEST_CHOOSE_OPTIONS = 3;
// prompt hand phone back to parent after enrollment
private static final int REQUEST_HANDOFF_PARENT = 4;
public static final int RESULT_SKIP = BiometricEnrollBase.RESULT_SKIP;
@@ -303,11 +305,8 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
final boolean isStillPrompting = mParentalConsentHelper.launchNext(
this, REQUEST_CHOOSE_OPTIONS, resultCode, data);
if (!isStillPrompting) {
Log.d(TAG, "Enrollment options set, starting enrollment now");
mParentalOptions = mParentalConsentHelper.getConsentResult();
mParentalConsentHelper = null;
startEnroll();
Log.d(TAG, "Enrollment options set, requesting handoff");
launchHandoffToParent();
}
} else {
Log.d(TAG, "Unknown or cancelled parental consent");
@@ -315,6 +314,18 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
finish();
}
break;
case REQUEST_HANDOFF_PARENT:
if (resultCode == RESULT_OK) {
Log.d(TAG, "Enrollment options set, starting enrollment");
mParentalOptions = mParentalConsentHelper.getConsentResult();
mParentalConsentHelper = null;
startEnroll();
} else {
Log.d(TAG, "Unknown or cancelled handoff");
setResult(RESULT_CANCELED);
finish();
}
break;
default:
Log.w(TAG, "Unknown consenting requestCode: " + requestCode + ", finishing");
finish();
@@ -492,6 +503,11 @@ public class BiometricEnrollActivity extends InstrumentedActivity {
mMultiBiometricEnrollHelper.startNextStep();
}
private void launchHandoffToParent() {
final Intent intent = BiometricUtils.getHandoffToParentIntent(this, getIntent());
startActivityForResult(intent, REQUEST_HANDOFF_PARENT);
}
@Override
public int getMetricsCategory() {
return SettingsEnums.BIOMETRIC_ENROLL_ACTIVITY;