title: Determine if biometric hardware is present and the user has enrolled biometrics on Android P
body: <p>I'm asked to show certain UI elements depending on the presence of biometric hardware. For Android 23-27 I use <code>FingerprintManager#isHardwareDetected()</code> and <code>FingerprintManager#hasEnrolledFingerprints()</code>. Both of which are deprecated in Android 28.</p>
  
  <p>I understand that I can get this information by using <code>BiometricPrompt#authenticate(...)</code> and receiving either <code>BiometricPrompt#BIOMETRIC_ERROR_HW_NOT_PRESENT</code> or <code>BiometricPrompt#BIOMETRIC_ERROR_NO_BIOMETRICS</code> in the <code>BiometricPrompt.AuthenticationCallback#onAuthenticationError(int errorCode, ...)</code> method. But this would lead to the <code>BiometricPrompt</code> being shown on supporting devices, which is undesirable. Using the <code>CancellationSignal</code> doesn't seem to be a solution either, since I wouldn't know when to cancel the prompt.</p>
  
  <p>Is there any way to detect biometric hardware presence and user enrolment?</p>