Adding biometric FRR Notification atom.
Test: statsd_testdrive 793 Test: statsd_testdrive 184 Test: m -j50 RunSettingsRoboTests ROBOTEST_FILTER=com.android.settings.biometrics Test: atest FingerprintUpdaterTest FaceUpdaterTest Bug: 302171089 Change-Id: I4c921b75321db79cc975b98b54b176a43379cd7c
This commit is contained in:
committed by
Joshua Mccloskey
parent
e28934a9f9
commit
e5f62676c8
@@ -17,8 +17,10 @@
|
||||
package com.android.settings.biometrics.face;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.hardware.face.Face;
|
||||
import android.hardware.face.FaceEnrollCell;
|
||||
import android.hardware.face.FaceEnrollOptions;
|
||||
import android.hardware.face.FaceManager;
|
||||
import android.os.CancellationSignal;
|
||||
import android.view.Surface;
|
||||
@@ -26,6 +28,7 @@ import android.view.Surface;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.android.settings.Utils;
|
||||
import com.android.settings.biometrics.BiometricUtils;
|
||||
import com.android.settings.safetycenter.BiometricsSafetySource;
|
||||
|
||||
/**
|
||||
@@ -49,19 +52,19 @@ public class FaceUpdater {
|
||||
|
||||
/** Wrapper around the {@link FaceManager#enroll} method. */
|
||||
public void enroll(int userId, byte[] hardwareAuthToken, CancellationSignal cancel,
|
||||
FaceManager.EnrollmentCallback callback, int[] disabledFeatures) {
|
||||
FaceManager.EnrollmentCallback callback, int[] disabledFeatures, Intent intent) {
|
||||
this.enroll(userId, hardwareAuthToken, cancel,
|
||||
new NotifyingEnrollmentCallback(mContext, callback), disabledFeatures,
|
||||
null, false);
|
||||
null, false, intent);
|
||||
}
|
||||
|
||||
/** Wrapper around the {@link FaceManager#enroll} method. */
|
||||
public void enroll(int userId, byte[] hardwareAuthToken, CancellationSignal cancel,
|
||||
FaceManager.EnrollmentCallback callback, int[] disabledFeatures,
|
||||
@Nullable Surface previewSurface, boolean debugConsent) {
|
||||
@Nullable Surface previewSurface, boolean debugConsent, Intent intent) {
|
||||
mFaceManager.enroll(userId, hardwareAuthToken, cancel,
|
||||
new NotifyingEnrollmentCallback(mContext, callback), disabledFeatures,
|
||||
previewSurface, debugConsent);
|
||||
previewSurface, debugConsent, toFaceEnrollOptions(intent));
|
||||
}
|
||||
|
||||
/** Wrapper around the {@link FaceManager#remove} method. */
|
||||
@@ -135,4 +138,14 @@ public class FaceUpdater {
|
||||
BiometricsSafetySource.onBiometricsChanged(mContext); // biometrics data changed
|
||||
}
|
||||
}
|
||||
|
||||
private FaceEnrollOptions toFaceEnrollOptions(Intent intent) {
|
||||
final int reason = intent.getIntExtra(BiometricUtils.EXTRA_ENROLL_REASON, -1);
|
||||
final FaceEnrollOptions.Builder builder = new FaceEnrollOptions.Builder();
|
||||
builder.setEnrollReason(FaceEnrollOptions.ENROLL_REASON_UNKNOWN);
|
||||
if (reason != -1) {
|
||||
builder.setEnrollReason(reason);
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user