2 Commits 7ddab4f920 ... 27c0e7b1e9

Author SHA1 Message Date
  xwh 27c0e7b1e9 Merge remote-tracking branch 'origin/FaceScenic_V2_baiduface' into FaceScenic_V2_baiduface 1 week ago
  xwh a562f21cbe upgrade:悬浮无核验结果页优化 1 week ago

+ 2 - 2
app/build.gradle

@@ -16,8 +16,8 @@ android {
         applicationId "com.hanghui.senic"
         minSdkVersion 22
         targetSdkVersion 22
-        versionCode 150
-        versionName "1.4.1.241227"
+        versionCode 156
+        versionName "1.4.1.241230"
         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
         ndk {
             abiFilters "armeabi-v7a"   //armeabi-v7a 'arm64-v8a'

+ 5 - 14
app/src/main/java/com/hanghui/senic/ShowBaiDuFaceResultEvent.java → app/src/main/java/com/hanghui/senic/FaceOneToOneWaitEvent.java

@@ -1,19 +1,17 @@
 package com.hanghui.senic;
 
 /**
- * Description: $
- *
+ * Description: 百度刷脸1:1无核验事件
  * @author xwh
  * time 2024/12/25
  **/
-public class ShowBaiDuFaceResultEvent {
-    String msgStrString ,voiceStr;
-    boolean isSuucess;
+public class FaceOneToOneWaitEvent {
+    private String msgStrString ,voiceStr;
 
-    public ShowBaiDuFaceResultEvent(String msgStrString, String voiceStr, boolean isSuucess) {
+    public FaceOneToOneWaitEvent(String msgStrString, String voiceStr) {
         this.msgStrString = msgStrString;
         this.voiceStr = voiceStr;
-        this.isSuucess = isSuucess;
+
     }
 
     public String getMsgStrString() {
@@ -32,11 +30,4 @@ public class ShowBaiDuFaceResultEvent {
         this.voiceStr = voiceStr;
     }
 
-    public boolean isSuucess() {
-        return isSuucess;
-    }
-
-    public void setSuucess(boolean suucess) {
-        isSuucess = suucess;
-    }
 }

+ 3 - 3
app/src/main/java/com/hanghui/senic/baiduface/BaiduFaceController.java

@@ -3,7 +3,7 @@ package com.hanghui.senic.baiduface;
 
 import android.app.Activity;
 
-import com.hanghui.senic.ShowBaiDuFaceResultEvent;
+import com.hanghui.senic.FaceOneToOneWaitEvent;
 import com.hanghui.senic.activity.view.BaiDuFaceView;
 import com.hanghui.senic.bean.FederatedPlatformsResponseBean;
 import com.hanghui.senic.common.DataManager;
@@ -101,9 +101,9 @@ public class BaiduFaceController extends BaseController {
                     ConfigManager.getAuthenticationBean().getData().get(0).getOneToOneVoice());
 
             if(ConfigManager.isNoVerificationFloatingPages()){
-                EventBus.getDefault().post(new ShowBaiDuFaceResultEvent(
+                EventBus.getDefault().post(new FaceOneToOneWaitEvent(
                         ConfigManager.getAuthenticationBean().getData().get(0).getOneToOneTips()
-                ,ConfigManager.getAuthenticationBean().getData().get(0).getOneToOneVoice(),true));
+                ,ConfigManager.getAuthenticationBean().getData().get(0).getOneToOneVoice()));
             }else{
                 BaiDuFaceView.getInstance().getPlatformsCod(federatedPlatformsResponseBean);
             }

+ 12 - 45
app/src/main/java/com/hanghui/senic/baiduface/BaiduFacePreviewActivity.java

@@ -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();
     }
 

File diff suppressed because it is too large
+ 538 - 304
app/src/main/java/com/hanghui/senic/baiduface/view/BaiduResultView.java


+ 1 - 1
app/src/main/java/com/hanghui/senic/common/Constants.java

@@ -33,7 +33,7 @@ public class Constants {
      * case 7://15693IC卡
      * Verifytypes="ICCARD";
      */
-    public static int IDCARD_TYPE = 0;//判断类型
+    public volatile static int IDCARD_TYPE = 0;//判断类型
 
     public static final int Code_AppStatusTextView = 1;//更新主页面的应用状态的文字
     public static final int Code_StartFaceOrManualClickButton = 2;//主页面底部的 点击开始刷脸核验按钮 和  点击手输证件号按钮

Some files were not shown because too many files changed in this diff