Updated power press strings in enrollment.
Test: Manual. Test: atest FingerprintEnrollClientTest Fixes: 245150708 Change-Id: Icdf83c3c46d12b6241a3695f3151528b412b2ccd
This commit is contained in:
@@ -217,7 +217,8 @@ public interface BiometricFingerprintConstants {
|
||||
FINGERPRINT_ACQUIRED_START,
|
||||
FINGERPRINT_ACQUIRED_UNKNOWN,
|
||||
FINGERPRINT_ACQUIRED_IMMOBILE,
|
||||
FINGERPRINT_ACQUIRED_TOO_BRIGHT})
|
||||
FINGERPRINT_ACQUIRED_TOO_BRIGHT,
|
||||
FINGERPRINT_ACQUIRED_POWER_PRESSED})
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@interface FingerprintAcquired {}
|
||||
|
||||
@@ -301,6 +302,13 @@ public interface BiometricFingerprintConstants {
|
||||
*/
|
||||
int FINGERPRINT_ACQUIRED_TOO_BRIGHT = 10;
|
||||
|
||||
/**
|
||||
* For sensors that have the power button co-located with their sensor, this event will
|
||||
* be sent during enrollment.
|
||||
* @hide
|
||||
*/
|
||||
int FINGERPRINT_ACQUIRED_POWER_PRESSED = 11;
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
|
||||
@@ -1538,6 +1538,9 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
||||
case FINGERPRINT_ACQUIRED_TOO_BRIGHT:
|
||||
return context.getString(
|
||||
com.android.internal.R.string.fingerprint_acquired_too_bright);
|
||||
case FINGERPRINT_ACQUIRED_POWER_PRESSED:
|
||||
return context.getString(
|
||||
com.android.internal.R.string.fingerprint_acquired_power_press);
|
||||
case FINGERPRINT_ACQUIRED_VENDOR: {
|
||||
String[] msgArray = context.getResources().getStringArray(
|
||||
com.android.internal.R.array.fingerprint_acquired_vendor);
|
||||
|
||||
@@ -1708,6 +1708,8 @@
|
||||
<string name="fingerprint_acquired_already_enrolled">Try another fingerprint</string>
|
||||
<!-- Message shown during fingerprint acquisition when fingerprint sensor detected too much light.[CHAR LIMIT=50] -->
|
||||
<string name="fingerprint_acquired_too_bright">Too bright</string>
|
||||
<!-- Message shown during fingerprint acquisition when a Power press has been detected.[CHAR LIMIT=50] -->
|
||||
<string name="fingerprint_acquired_power_press">Power press detected</string>
|
||||
<!-- Message shown during fingerprint acquisition when a fingerprint must be adjusted.[CHAR LIMIT=50] -->
|
||||
<string name="fingerprint_acquired_try_adjusting">Try adjusting</string>
|
||||
<!-- Message shown during fingerprint acquisition when a fingeprint area has already been captured during enrollment [CHAR LIMIT=100] -->
|
||||
@@ -3574,11 +3576,11 @@
|
||||
|
||||
<!-- [CHAR LIMIT=40] Title of dialog shown to confirm device going to sleep if the power button
|
||||
is pressed during fingerprint enrollment. -->
|
||||
<string name="fp_power_button_enrollment_title">Tap to turn off screen</string>
|
||||
<string name="fp_power_button_enrollment_title">To end setup, turn off screen</string>
|
||||
|
||||
<!-- [CHAR LIMIT=20] Positive button of dialog shown to confirm device going to sleep if the
|
||||
power button is pressed during fingerprint enrollment. -->
|
||||
<string name="fp_power_button_enrollment_button_text">Turn off screen</string>
|
||||
<string name="fp_power_button_enrollment_button_text">Turn off</string>
|
||||
|
||||
<!-- [CHAR LIMIT=40] Title of dialog shown to confirm device going to sleep if the power button
|
||||
is pressed during biometric prompt when a side fingerprint sensor is present. -->
|
||||
|
||||
@@ -2606,6 +2606,7 @@
|
||||
<java-symbol type="string" name="fingerprint_acquired_imager_dirty" />
|
||||
<java-symbol type="string" name="fingerprint_acquired_too_slow" />
|
||||
<java-symbol type="string" name="fingerprint_acquired_too_fast" />
|
||||
<java-symbol type="string" name="fingerprint_acquired_power_press" />
|
||||
<java-symbol type="string" name="fingerprint_acquired_too_bright" />
|
||||
<java-symbol type="array" name="fingerprint_acquired_vendor" />
|
||||
<java-symbol type="string" name="fingerprint_error_canceled" />
|
||||
|
||||
@@ -59,7 +59,7 @@ public class ClientMonitorCallbackConverter {
|
||||
|
||||
// The following apply to all clients
|
||||
|
||||
void onAcquired(int sensorId, int acquiredInfo, int vendorCode) throws RemoteException {
|
||||
public void onAcquired(int sensorId, int acquiredInfo, int vendorCode) throws RemoteException {
|
||||
if (mSensorReceiver != null) {
|
||||
mSensorReceiver.onAcquired(sensorId, acquiredInfo, vendorCode);
|
||||
} else if (mFaceServiceReceiver != null) {
|
||||
|
||||
@@ -50,12 +50,14 @@ import com.android.server.biometrics.sensors.ClientMonitorCompositeCallback;
|
||||
import com.android.server.biometrics.sensors.EnrollClient;
|
||||
import com.android.server.biometrics.sensors.SensorOverlays;
|
||||
import com.android.server.biometrics.sensors.fingerprint.FingerprintUtils;
|
||||
import com.android.server.biometrics.sensors.fingerprint.PowerPressHandler;
|
||||
import com.android.server.biometrics.sensors.fingerprint.Udfps;
|
||||
import com.android.server.biometrics.sensors.fingerprint.UdfpsHelper;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps {
|
||||
class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps,
|
||||
PowerPressHandler {
|
||||
|
||||
private static final String TAG = "FingerprintEnrollClient";
|
||||
|
||||
@@ -268,4 +270,10 @@ class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps
|
||||
Slog.e(TAG, "Unable to send UI ready", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPowerPressed() {
|
||||
onAcquired(BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_POWER_PRESSED,
|
||||
0 /* vendorCode */);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.server.biometrics.sensors.fingerprint.aidl;
|
||||
|
||||
import static android.hardware.biometrics.BiometricFingerprintConstants.FINGERPRINT_ACQUIRED_POWER_PRESSED;
|
||||
|
||||
import static com.google.common.truth.Truth.assertThat;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||
@@ -251,6 +253,16 @@ 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();
|
||||
|
||||
Reference in New Issue
Block a user