Plumb setRequireConfirmation to CC

Bug: 111461540

Test: Tested with modified demo app with
      original and new KeyguardManager APIs

Change-Id: I56585fbfd704195586f2f516b35e9338e91b0346
This commit is contained in:
Kevin Chyn
2019-01-23 18:08:17 -08:00
parent 7c7e0d4d7d
commit 56c745c38e
2 changed files with 19 additions and 3 deletions

View File

@@ -45,6 +45,7 @@ public class BiometricFragment extends InstrumentedFragment {
private static final String KEY_SUBTITLE = "subtitle";
private static final String KEY_DESCRIPTION = "description";
private static final String KEY_NEGATIVE_TEXT = "negative_text";
private static final String KEY_REQUIRE_CONFIRMATION = "require_confirmation";
// Re-set by the application. Should be done upon orientation changes, etc
private Executor mClientExecutor;
@@ -129,6 +130,7 @@ public class BiometricFragment extends InstrumentedFragment {
.setDescription(mPromptInfo.getDescription())
.setNegativeButton(mPromptInfo.getNegativeButtonText(), mClientExecutor,
mNegativeButtonListener)
.setRequireConfirmation(mPromptInfo.getRequireConfirmation())
.build();
mCancellationSignal = new CancellationSignal();
@@ -173,6 +175,10 @@ public class BiometricFragment extends InstrumentedFragment {
return mBundle.getCharSequence(KEY_NEGATIVE_TEXT);
}
public boolean getRequireConfirmation() {
return mBundle.getBoolean(KEY_REQUIRE_CONFIRMATION);
}
public static class Builder {
private final Bundle mBundle = new Bundle();
@@ -196,6 +202,11 @@ public class BiometricFragment extends InstrumentedFragment {
return this;
}
public Builder setRequireConfirmation(boolean requireConfirmation) {
mBundle.putBoolean(KEY_REQUIRE_CONFIRMATION, requireConfirmation);
return this;
}
public PromptInfo build() {
return new PromptInfo(mBundle);
}