Merge "Updated power press strings in enrollment." into tm-qpr-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ce1e8cee95
@@ -217,7 +217,8 @@ public interface BiometricFingerprintConstants {
|
|||||||
FINGERPRINT_ACQUIRED_START,
|
FINGERPRINT_ACQUIRED_START,
|
||||||
FINGERPRINT_ACQUIRED_UNKNOWN,
|
FINGERPRINT_ACQUIRED_UNKNOWN,
|
||||||
FINGERPRINT_ACQUIRED_IMMOBILE,
|
FINGERPRINT_ACQUIRED_IMMOBILE,
|
||||||
FINGERPRINT_ACQUIRED_TOO_BRIGHT})
|
FINGERPRINT_ACQUIRED_TOO_BRIGHT,
|
||||||
|
FINGERPRINT_ACQUIRED_POWER_PRESSED})
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@interface FingerprintAcquired {}
|
@interface FingerprintAcquired {}
|
||||||
|
|
||||||
@@ -301,6 +302,13 @@ public interface BiometricFingerprintConstants {
|
|||||||
*/
|
*/
|
||||||
int FINGERPRINT_ACQUIRED_TOO_BRIGHT = 10;
|
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
|
* @hide
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1538,6 +1538,9 @@ public class FingerprintManager implements BiometricAuthenticator, BiometricFing
|
|||||||
case FINGERPRINT_ACQUIRED_TOO_BRIGHT:
|
case FINGERPRINT_ACQUIRED_TOO_BRIGHT:
|
||||||
return context.getString(
|
return context.getString(
|
||||||
com.android.internal.R.string.fingerprint_acquired_too_bright);
|
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: {
|
case FINGERPRINT_ACQUIRED_VENDOR: {
|
||||||
String[] msgArray = context.getResources().getStringArray(
|
String[] msgArray = context.getResources().getStringArray(
|
||||||
com.android.internal.R.array.fingerprint_acquired_vendor);
|
com.android.internal.R.array.fingerprint_acquired_vendor);
|
||||||
|
|||||||
@@ -1708,6 +1708,8 @@
|
|||||||
<string name="fingerprint_acquired_already_enrolled">Try another fingerprint</string>
|
<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] -->
|
<!-- Message shown during fingerprint acquisition when fingerprint sensor detected too much light.[CHAR LIMIT=50] -->
|
||||||
<string name="fingerprint_acquired_too_bright">Too bright</string>
|
<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] -->
|
<!-- Message shown during fingerprint acquisition when a fingerprint must be adjusted.[CHAR LIMIT=50] -->
|
||||||
<string name="fingerprint_acquired_try_adjusting">Try adjusting</string>
|
<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] -->
|
<!-- 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
|
<!-- [CHAR LIMIT=40] Title of dialog shown to confirm device going to sleep if the power button
|
||||||
is pressed during fingerprint enrollment. -->
|
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
|
<!-- [CHAR LIMIT=20] Positive button of dialog shown to confirm device going to sleep if the
|
||||||
power button is pressed during fingerprint enrollment. -->
|
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
|
<!-- [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. -->
|
is pressed during biometric prompt when a side fingerprint sensor is present. -->
|
||||||
|
|||||||
@@ -2612,6 +2612,7 @@
|
|||||||
<java-symbol type="string" name="fingerprint_acquired_imager_dirty" />
|
<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_slow" />
|
||||||
<java-symbol type="string" name="fingerprint_acquired_too_fast" />
|
<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="string" name="fingerprint_acquired_too_bright" />
|
||||||
<java-symbol type="array" name="fingerprint_acquired_vendor" />
|
<java-symbol type="array" name="fingerprint_acquired_vendor" />
|
||||||
<java-symbol type="string" name="fingerprint_error_canceled" />
|
<java-symbol type="string" name="fingerprint_error_canceled" />
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public class ClientMonitorCallbackConverter {
|
|||||||
|
|
||||||
// The following apply to all clients
|
// 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) {
|
if (mSensorReceiver != null) {
|
||||||
mSensorReceiver.onAcquired(sensorId, acquiredInfo, vendorCode);
|
mSensorReceiver.onAcquired(sensorId, acquiredInfo, vendorCode);
|
||||||
} else if (mFaceServiceReceiver != null) {
|
} 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.EnrollClient;
|
||||||
import com.android.server.biometrics.sensors.SensorOverlays;
|
import com.android.server.biometrics.sensors.SensorOverlays;
|
||||||
import com.android.server.biometrics.sensors.fingerprint.FingerprintUtils;
|
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.Udfps;
|
||||||
import com.android.server.biometrics.sensors.fingerprint.UdfpsHelper;
|
import com.android.server.biometrics.sensors.fingerprint.UdfpsHelper;
|
||||||
|
|
||||||
import java.util.function.Supplier;
|
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";
|
private static final String TAG = "FingerprintEnrollClient";
|
||||||
|
|
||||||
@@ -266,4 +268,10 @@ class FingerprintEnrollClient extends EnrollClient<AidlSession> implements Udfps
|
|||||||
Slog.e(TAG, "Unable to send UI ready", e);
|
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;
|
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 com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||||
@@ -253,6 +255,16 @@ public class FingerprintEnrollClientTest {
|
|||||||
showHideOverlay(c -> c.onEnrollResult(new Fingerprint("", 1, 1), 0));
|
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)
|
private void showHideOverlay(Consumer<FingerprintEnrollClient> block)
|
||||||
throws RemoteException {
|
throws RemoteException {
|
||||||
final FingerprintEnrollClient client = createClient();
|
final FingerprintEnrollClient client = createClient();
|
||||||
|
|||||||
Reference in New Issue
Block a user