FaceUnlockServer: Use kFaceId for onRemoved
* And some fixes for remove
Change-Id: I2cc1cfa1d2174074f381de85a8e3813bfc88ae66
diff --git a/framework/server/com/libremobileos/faceunlock/server/FaceUnlockServer.java b/framework/server/com/libremobileos/faceunlock/server/FaceUnlockServer.java
index dc57602..6aa190e 100644
--- a/framework/server/com/libremobileos/faceunlock/server/FaceUnlockServer.java
+++ b/framework/server/com/libremobileos/faceunlock/server/FaceUnlockServer.java
@@ -240,13 +240,14 @@
mWorkHandler.post(() -> {
RemoteFaceServiceClient.connect(mStorePath, faced -> {
+ int[] faceIds = new int[1];
if ((faceId == kFaceId || faceId == 0) && faced.isEnrolled()) {
faced.unenroll();
- int[] faceIds = new int[1];
- faceIds[0] = faceId;
+ faceIds[0] = kFaceId;
+ }
+ if (mCallback != null) {
try {
- if (mCallback != null)
- mCallback.onRemoved(kDeviceId, faceIds, mUserId);
+ mCallback.onRemoved(kDeviceId, faceIds, mUserId);
} catch (RemoteException e) {
e.printStackTrace();
}