Adjust ConfirmDeviceCredentialActivity system bars

CDCA is a transparent activity with the sole purpose of
requesting authentication. Since authentication is all drawn
by SystemUI, we should also stop this activity from drawing
the StatusBar.

Register to receive biometric system events (early user canceled),
so that we can finish() and start the activity transition
simultaneously. This fixes some navigation bar jank.

Bug: 148273355

Test: Set up a work profile, then install BiometricPromptDemo
      Disable one-lock and set up a password/biometric for the
      work profile. Lock/unlock screen, then open the work
      profile version of the app. No status bar jank seen.
Change-Id: I54a352527ed007dcaf1bea14a51711e4022fe028
This commit is contained in:
Kevin Chyn
2020-03-26 17:54:27 -07:00
parent 6f16992d3c
commit 28a034d6ed
3 changed files with 24 additions and 37 deletions

View File

@@ -77,6 +77,13 @@ public class BiometricFragment extends InstrumentedFragment {
mClientCallback.onAuthenticationFailed();
});
}
@Override
public void onSystemEvent(int event) {
mClientExecutor.execute(() -> {
mClientCallback.onSystemEvent(event);
});
}
};
private final DialogInterface.OnClickListener mNegativeButtonListener =
@@ -121,10 +128,6 @@ public class BiometricFragment extends InstrumentedFragment {
}
}
boolean isAuthenticating() {
return mAuthenticating;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -144,7 +147,8 @@ public class BiometricFragment extends InstrumentedFragment {
.setConfirmationRequired(mBundle.getBoolean(
BiometricPrompt.KEY_REQUIRE_CONFIRMATION, true))
.setDisallowBiometricsIfPolicyExists(mBundle.getBoolean(
BiometricPrompt.EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS, false));
BiometricPrompt.EXTRA_DISALLOW_BIOMETRICS_IF_POLICY_EXISTS, false))
.setReceiveSystemEvents(true);
mBiometricPrompt = builder.build();
mCancellationSignal = new CancellationSignal();