Loading services/core/java/com/android/server/biometrics/AuthService.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,8 @@ import static android.hardware.biometrics.BiometricAuthenticator.TYPE_NONE; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_CANCELED; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_CANCELED; import static android.hardware.biometrics.BiometricManager.Authenticators; import static android.hardware.biometrics.BiometricManager.Authenticators; import static com.android.server.biometrics.sensors.fingerprint.aidl.FingerprintProvider.getWorkaroundSensorProps; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.app.AppOpsManager; import android.app.AppOpsManager; Loading Loading @@ -802,6 +804,10 @@ public class AuthService extends SystemService { final int[] udfpsProps = getContext().getResources().getIntArray( final int[] udfpsProps = getContext().getResources().getIntArray( com.android.internal.R.array.config_udfps_sensor_props); com.android.internal.R.array.config_udfps_sensor_props); // Non-empty workaroundLocations indicates that the sensor is SFPS. final List<SensorLocationInternal> workaroundLocations = getWorkaroundSensorProps(getContext()); final boolean isUdfps = !ArrayUtils.isEmpty(udfpsProps); final boolean isUdfps = !ArrayUtils.isEmpty(udfpsProps); // config_is_powerbutton_fps indicates whether device has a power button fingerprint sensor. // config_is_powerbutton_fps indicates whether device has a power button fingerprint sensor. Loading Loading @@ -831,6 +837,12 @@ public class AuthService extends SystemService { resetLockoutRequiresHardwareAuthToken, resetLockoutRequiresHardwareAuthToken, List.of(new SensorLocationInternal("" /* display */, udfpsProps[0], List.of(new SensorLocationInternal("" /* display */, udfpsProps[0], udfpsProps[1], udfpsProps[2]))); udfpsProps[1], udfpsProps[2]))); } else if (!workaroundLocations.isEmpty()) { return new FingerprintSensorPropertiesInternal(sensorId, Utils.authenticatorStrengthToPropertyStrength(strength), maxEnrollmentsPerUser, componentInfo, sensorType, false /* halControlsIllumination */, resetLockoutRequiresHardwareAuthToken, workaroundLocations); } else { } else { return new FingerprintSensorPropertiesInternal(sensorId, return new FingerprintSensorPropertiesInternal(sensorId, Utils.authenticatorStrengthToPropertyStrength(strength), maxEnrollmentsPerUser, Utils.authenticatorStrengthToPropertyStrength(strength), maxEnrollmentsPerUser, Loading services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -98,6 +98,8 @@ import java.util.stream.Collectors; @SuppressWarnings("deprecation") @SuppressWarnings("deprecation") public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvider { public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvider { private static final String TAG = "FingerprintProvider"; private boolean mTestHalEnabled; private boolean mTestHalEnabled; @NonNull @NonNull Loading Loading @@ -234,7 +236,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi } } private String getTag() { private String getTag() { return "FingerprintProvider/" + mHalInstanceName; return TAG + "/" + mHalInstanceName; } } boolean hasHalInstance() { boolean hasHalInstance() { Loading Loading @@ -816,7 +818,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi // TODO(b/174868353): workaround for gaps in HAL interface (remove and get directly from HAL) // TODO(b/174868353): workaround for gaps in HAL interface (remove and get directly from HAL) // reads values via an overlay instead of querying the HAL // reads values via an overlay instead of querying the HAL @NonNull @NonNull private List<SensorLocationInternal> getWorkaroundSensorProps(@NonNull Context context) { public static List<SensorLocationInternal> getWorkaroundSensorProps(@NonNull Context context) { final List<SensorLocationInternal> sensorLocations = new ArrayList<>(); final List<SensorLocationInternal> sensorLocations = new ArrayList<>(); final TypedArray sfpsProps = context.getResources().obtainTypedArray( final TypedArray sfpsProps = context.getResources().obtainTypedArray( Loading @@ -837,7 +839,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi } } @Nullable @Nullable private SensorLocationInternal parseSensorLocation(@Nullable TypedArray array) { private static SensorLocationInternal parseSensorLocation(@Nullable TypedArray array) { if (array == null) { if (array == null) { return null; return null; } } Loading @@ -849,7 +851,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi array.getInt(2, 0), array.getInt(2, 0), array.getInt(3, 0)); array.getInt(3, 0)); } catch (Exception e) { } catch (Exception e) { Slog.w(getTag(), "malformed sensor location", e); Slog.w(TAG, "malformed sensor location", e); } } return null; return null; } } Loading Loading
services/core/java/com/android/server/biometrics/AuthService.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -31,6 +31,8 @@ import static android.hardware.biometrics.BiometricAuthenticator.TYPE_NONE; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_CANCELED; import static android.hardware.biometrics.BiometricConstants.BIOMETRIC_ERROR_CANCELED; import static android.hardware.biometrics.BiometricManager.Authenticators; import static android.hardware.biometrics.BiometricManager.Authenticators; import static com.android.server.biometrics.sensors.fingerprint.aidl.FingerprintProvider.getWorkaroundSensorProps; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.Nullable; import android.app.AppOpsManager; import android.app.AppOpsManager; Loading Loading @@ -802,6 +804,10 @@ public class AuthService extends SystemService { final int[] udfpsProps = getContext().getResources().getIntArray( final int[] udfpsProps = getContext().getResources().getIntArray( com.android.internal.R.array.config_udfps_sensor_props); com.android.internal.R.array.config_udfps_sensor_props); // Non-empty workaroundLocations indicates that the sensor is SFPS. final List<SensorLocationInternal> workaroundLocations = getWorkaroundSensorProps(getContext()); final boolean isUdfps = !ArrayUtils.isEmpty(udfpsProps); final boolean isUdfps = !ArrayUtils.isEmpty(udfpsProps); // config_is_powerbutton_fps indicates whether device has a power button fingerprint sensor. // config_is_powerbutton_fps indicates whether device has a power button fingerprint sensor. Loading Loading @@ -831,6 +837,12 @@ public class AuthService extends SystemService { resetLockoutRequiresHardwareAuthToken, resetLockoutRequiresHardwareAuthToken, List.of(new SensorLocationInternal("" /* display */, udfpsProps[0], List.of(new SensorLocationInternal("" /* display */, udfpsProps[0], udfpsProps[1], udfpsProps[2]))); udfpsProps[1], udfpsProps[2]))); } else if (!workaroundLocations.isEmpty()) { return new FingerprintSensorPropertiesInternal(sensorId, Utils.authenticatorStrengthToPropertyStrength(strength), maxEnrollmentsPerUser, componentInfo, sensorType, false /* halControlsIllumination */, resetLockoutRequiresHardwareAuthToken, workaroundLocations); } else { } else { return new FingerprintSensorPropertiesInternal(sensorId, return new FingerprintSensorPropertiesInternal(sensorId, Utils.authenticatorStrengthToPropertyStrength(strength), maxEnrollmentsPerUser, Utils.authenticatorStrengthToPropertyStrength(strength), maxEnrollmentsPerUser, Loading
services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java +6 −4 Original line number Original line Diff line number Diff line Loading @@ -98,6 +98,8 @@ import java.util.stream.Collectors; @SuppressWarnings("deprecation") @SuppressWarnings("deprecation") public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvider { public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvider { private static final String TAG = "FingerprintProvider"; private boolean mTestHalEnabled; private boolean mTestHalEnabled; @NonNull @NonNull Loading Loading @@ -234,7 +236,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi } } private String getTag() { private String getTag() { return "FingerprintProvider/" + mHalInstanceName; return TAG + "/" + mHalInstanceName; } } boolean hasHalInstance() { boolean hasHalInstance() { Loading Loading @@ -816,7 +818,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi // TODO(b/174868353): workaround for gaps in HAL interface (remove and get directly from HAL) // TODO(b/174868353): workaround for gaps in HAL interface (remove and get directly from HAL) // reads values via an overlay instead of querying the HAL // reads values via an overlay instead of querying the HAL @NonNull @NonNull private List<SensorLocationInternal> getWorkaroundSensorProps(@NonNull Context context) { public static List<SensorLocationInternal> getWorkaroundSensorProps(@NonNull Context context) { final List<SensorLocationInternal> sensorLocations = new ArrayList<>(); final List<SensorLocationInternal> sensorLocations = new ArrayList<>(); final TypedArray sfpsProps = context.getResources().obtainTypedArray( final TypedArray sfpsProps = context.getResources().obtainTypedArray( Loading @@ -837,7 +839,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi } } @Nullable @Nullable private SensorLocationInternal parseSensorLocation(@Nullable TypedArray array) { private static SensorLocationInternal parseSensorLocation(@Nullable TypedArray array) { if (array == null) { if (array == null) { return null; return null; } } Loading @@ -849,7 +851,7 @@ public class FingerprintProvider implements IBinder.DeathRecipient, ServiceProvi array.getInt(2, 0), array.getInt(2, 0), array.getInt(3, 0)); array.getInt(3, 0)); } catch (Exception e) { } catch (Exception e) { Slog.w(getTag(), "malformed sensor location", e); Slog.w(TAG, "malformed sensor location", e); } } return null; return null; } } Loading