|
@@ -1,7 +1,6 @@
|
|
|
package com.hanghui.senic.baiduface;
|
|
|
|
|
|
|
|
|
-import android.content.Intent;
|
|
|
import android.graphics.Bitmap;
|
|
|
import android.hardware.Camera;
|
|
|
import android.os.Handler;
|
|
@@ -9,7 +8,6 @@ import android.os.Looper;
|
|
|
import android.os.Message;
|
|
|
import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
-import android.view.MotionEvent;
|
|
|
import android.view.TextureView;
|
|
|
import android.view.View;
|
|
|
import android.view.ViewGroup;
|
|
@@ -24,7 +22,6 @@ import com.baidu.idl.main.facesdk.model.BDFaceSDKCommon;
|
|
|
import com.baidu.idl.main.facesdk.model.SingleBaseConfig;
|
|
|
import com.baidu.idl.main.facesdk.utils.FaceUtils;
|
|
|
import com.bumptech.glide.load.engine.DiskCacheStrategy;
|
|
|
-import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
|
|
import com.bumptech.glide.request.RequestOptions;
|
|
|
import com.example.datalibrary.callback.CameraDataCallback;
|
|
|
import com.example.datalibrary.callback.FaceDetectCallBack;
|
|
@@ -40,15 +37,13 @@ import com.example.datalibrary.model.User;
|
|
|
import com.example.datalibrary.utils.BitmapUtils;
|
|
|
import com.example.datalibrary.utils.FaceOnDrawTexturViewUtil;
|
|
|
import com.example.datalibrary.utils.ToastUtils;
|
|
|
-import com.google.gson.Gson;
|
|
|
import com.hanghui.senic.MyAppliction;
|
|
|
import com.hanghui.senic.R;
|
|
|
-import com.hanghui.senic.ShowBaiDuFaceResultEvent;
|
|
|
+import com.hanghui.senic.FaceOneToOneWaitEvent;
|
|
|
import com.hanghui.senic.activity.view.BaiDuFaceView;
|
|
|
import com.hanghui.senic.activity.view.ClickButtonFloatView;
|
|
|
import com.hanghui.senic.baiduface.view.BaiduPreviewTexture;
|
|
|
import com.hanghui.senic.baiduface.view.BaiduResultView;
|
|
|
-import com.hanghui.senic.bean.AuthenticationBean;
|
|
|
import com.hanghui.senic.bean.FederatedPlatformsRequestBean;
|
|
|
import com.hanghui.senic.bean.FederatedPlatformsResponseBean;
|
|
|
import com.hanghui.senic.bean.PADQREvent;
|
|
@@ -59,7 +54,6 @@ import com.hanghui.senic.common.Constants;
|
|
|
import com.hanghui.senic.common.DataManager;
|
|
|
import com.hanghui.senic.common.DataReturns;
|
|
|
import com.hanghui.senic.common.DeviceExpireManager;
|
|
|
-import com.hanghui.senic.common.MTTSManager;
|
|
|
import com.hanghui.senic.common.TaskStatus;
|
|
|
import com.hanghui.senic.common.ThreadPoolManager;
|
|
|
import com.hanghui.senic.common.UserInfoManager;
|
|
@@ -70,21 +64,14 @@ import com.hanghui.senic.network.HttpRequest;
|
|
|
import com.hanghui.senic.service.usbserialdemo.utile.ConfigManager;
|
|
|
import com.hanghui.senic.service.usbserialdemo.utile.StringIsNull;
|
|
|
import com.hanghui.senic.service.usbserialdemo.utile.StringUtils;
|
|
|
-import com.hanghui.senic.service.usbserialdemo.utile.X1.RelaysAndLedUtile;
|
|
|
-import com.hanghui.senic.service.usbserialdemo.utile.devicesUI.BaseDeviceUI;
|
|
|
import com.hanghui.senic.service.usbserialdemo.utile.devicesUI.DeviceUtils;
|
|
|
import com.hanghui.senic.service.usbserialdemo.utile.loacat.AppLogUtils;
|
|
|
-import com.hanghui.senic.service.keep.MyJobService;
|
|
|
import com.hanghui.senic.utils.DoubClickUtils;
|
|
|
import com.hanghui.senic.utils.ImageLoaderUtils;
|
|
|
|
|
|
import org.greenrobot.eventbus.EventBus;
|
|
|
import org.greenrobot.eventbus.Subscribe;
|
|
|
import org.greenrobot.eventbus.ThreadMode;
|
|
|
-import org.json.JSONArray;
|
|
|
-
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 百度face的刷脸页面
|
|
@@ -105,7 +92,7 @@ import java.util.List;
|
|
|
* <p>
|
|
|
* 本地5w条人脸时1:n比对要多少秒
|
|
|
*/
|
|
|
-public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements BaiduResultView.BaiduFaceResultCallback {
|
|
|
+public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements BaiduResultView.BaiduFaceResultStateCallback {
|
|
|
|
|
|
private static final String TAG = "BaiduFaceActivity";
|
|
|
|
|
@@ -297,6 +284,9 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
|
|
|
|
|
|
public void OnDestoryListener() {
|
|
|
super.OnDestoryListener();
|
|
|
+ if (baiduResultView != null) {
|
|
|
+ baiduResultView.onRelease();
|
|
|
+ }
|
|
|
CommonUtil.setLedLight(false);
|
|
|
EventBus.getDefault().unregister(this);
|
|
|
AppLogUtils.i(true, TAG, "BaiduFaceActivity, onDestroy()");
|
|
@@ -452,7 +442,7 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
|
|
|
.diskCacheStrategy(DiskCacheStrategy.NONE).skipMemoryCache(true);
|
|
|
ImageLoaderUtils.loadImage(ConfigManager.getAuthenticationBeanListBean().getPreviewPageUrl(), iv_please_scanface, options);
|
|
|
baiduResultView=findViewById(R.id.result_view);
|
|
|
- baiduResultView.setBaiduFaceResultCallback(this);
|
|
|
+ baiduResultView.setBaiduFaceResultStateCallback(this);
|
|
|
baiduResultView.setVisibility(View.INVISIBLE);
|
|
|
}
|
|
|
|
|
@@ -604,28 +594,11 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
|
|
|
AppLogUtils.i(false, TAG, "onFaceDetectCallback(), 刷脸结果, livenessModel=" + livenessModel + " ,isNeedVerify=" + isNeedVerify + " ,checkMode=" + bdFaceCheckConfig.getFeatureCheckMode());
|
|
|
|
|
|
if (isNeedVerify) {
|
|
|
-
|
|
|
-
|
|
|
if(ConfigManager.isNoVerificationFloatingPages()){
|
|
|
- baiduResultView.result(livenessModel,bdFaceCheckConfig.getFeatureCheckMode());
|
|
|
+ baiduResultView.baiDuFaceNoVerificationResultPage(livenessModel,
|
|
|
+ bdFaceCheckConfig.getFeatureCheckMode());
|
|
|
return;
|
|
|
}
|
|
|
- /* AppHandler.getHandler().post(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- mCurLivenessModel = livenessModel;
|
|
|
-
|
|
|
- //AppLogUtils.i(false, TAG, "bdFaceCheckConfig.getFeatureCheckMode()=" + bdFaceCheckConfig.getFeatureCheckMode() );
|
|
|
-
|
|
|
- if (bdFaceCheckConfig.getFeatureCheckMode() == 3) {
|
|
|
- doScanFaceResult(livenessModel);
|
|
|
- } else if (bdFaceCheckConfig.getFeatureCheckMode() == 4) {
|
|
|
- doPersonCardResult(livenessModel);
|
|
|
- }
|
|
|
- }
|
|
|
- });*/
|
|
|
-
|
|
|
-
|
|
|
mCurLivenessModel = livenessModel;
|
|
|
|
|
|
//AppLogUtils.i(false, TAG, "bdFaceCheckConfig.getFeatureCheckMode()=" + bdFaceCheckConfig.getFeatureCheckMode() );
|
|
@@ -1215,7 +1188,7 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
|
|
|
startTime = 0L;
|
|
|
|
|
|
if (baiduResultView != null && ConfigManager.isNoVerificationFloatingPages()) {
|
|
|
- baiduResultView.showResultPageUI(false, msg, openVoiceMsg);
|
|
|
+ baiduResultView.showFailUI(msg, openVoiceMsg);
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -1252,24 +1225,18 @@ public class BaiduFacePreviewActivity extends BaiduFaceMainActivity implements B
|
|
|
|
|
|
}
|
|
|
@Subscribe(threadMode = ThreadMode.MAIN)
|
|
|
- public void showBaiDuFaceResultEvent(ShowBaiDuFaceResultEvent event) {
|
|
|
+ public void showOneToOneUIEvent(FaceOneToOneWaitEvent event) {
|
|
|
if (event == null || baiduResultView == null) {
|
|
|
return;
|
|
|
}
|
|
|
- baiduResultView.showResultPageUI(event.isSuucess(),event.getMsgStrString(),event.getVoiceStr());
|
|
|
-
|
|
|
+ baiduResultView.showOneToOneComparisonWaitUi(event.getMsgStrString(),event.getVoiceStr());
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- @Override
|
|
|
- public void personCardinvokeStopVerify() {
|
|
|
- AppHandler.getHandler().removeCallbacks(mPersonCardTimeoutRunnable);
|
|
|
- invoke_StopVerify();
|
|
|
- }
|
|
|
-
|
|
|
@Override
|
|
|
public void invokeStopVerify() {
|
|
|
+ AppHandler.getHandler().removeCallbacks(mPersonCardTimeoutRunnable);
|
|
|
invoke_StopVerify();
|
|
|
}
|
|
|
|