Converting HAL power press to Framework power press

Test: 	Manually checked behavior when power is pressed for:
	Biometric Prompt: an error is shown
	Keyguard authentication: nothing happens
	Fingerprint Enrollment: an acquired message is displayed

Bug: 269293986
Change-Id: I6eb1a4771429e21f4292592283ea8dddaf308582
This commit is contained in:
Diya Bera
2023-02-14 21:45:42 +00:00
parent 3a81bb0471
commit fa60887085
3 changed files with 5 additions and 14 deletions

View File

@@ -48,6 +48,8 @@ final class AidlConversionUtils {
return BiometricFingerprintConstants.FINGERPRINT_ERROR_VENDOR;
} else if (aidlError == Error.BAD_CALIBRATION) {
return BiometricFingerprintConstants.FINGERPRINT_ERROR_BAD_CALIBRATION;
} else if (aidlError == Error.POWER_PRESS) {
return BiometricFingerprintConstants.BIOMETRIC_ERROR_POWER_PRESSED;
} else {
return BiometricFingerprintConstants.FINGERPRINT_ERROR_UNKNOWN;
}
@@ -84,6 +86,8 @@ final class AidlConversionUtils {
} else if (aidlAcquiredInfo == AcquiredInfo.RETRYING_CAPTURE) {
// No framework constant available
return BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_UNKNOWN;
} else if (aidlAcquiredInfo == AcquiredInfo.POWER_PRESS) {
return BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_POWER_PRESSED;
} else {
return BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_UNKNOWN;
}

View File

@@ -274,8 +274,5 @@ class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps
}
@Override
public void onPowerPressed() {
onAcquired(BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_POWER_PRESSED,
0 /* vendorCode */);
}
public void onPowerPressed() {}
}

View File

@@ -273,16 +273,6 @@ public class FingerprintEnrollClientTest {
showHideOverlay(c -> c.onEnrollResult(new Fingerprint("", 1, 1), 0));
}
@Test
public void testPowerPressForwardsAcquireMessage() throws RemoteException {
final FingerprintEnrollClient client = createClient();
client.start(mCallback);
client.onPowerPressed();
verify(mClientMonitorCallbackConverter).onAcquired(anyInt(),
eq(FINGERPRINT_ACQUIRED_POWER_PRESSED), anyInt());
}
private void showHideOverlay(Consumer<FingerprintEnrollClient> block)
throws RemoteException {
final FingerprintEnrollClient client = createClient();