Browse Source

merge FaceScenic_V2

yang 4 months ago
parent
commit
6cd1bb8e79

+ 1 - 1
app/src/main/java/com/hanghui/senic/activity/MainActivity.java

@@ -481,7 +481,7 @@ public class MainActivity extends BaseActivity {
         hardwareIcon_QRCode = findViewById(R.id.hardwareIcon_QRCode);
         hardwareIcon_Passport = findViewById(R.id.hardwareIcon_Passport);
         hardwareIcon_IcCard = findViewById(R.id.hardwareIcon_IcCard);
-        tv_time.setText(DateUtil.getTime("yyyy.MM.dd HH:mm:ss") + " " + DateUtil.getWeekOfDate(new Date()));
+        tv_time.setText(DateUtil.getTime(DATE_FORMAT) + " " + DateUtil.getWeekOfDate(new Date()));
         if (!(com.hanghui.senic.BuildConfig.BUILD_TYPE).equals("release")) {//debug版本
             bottomDebugView.setVisibility(View.VISIBLE);
             bottomDebugView.setText("DEBUG");

+ 0 - 6
app/src/main/java/com/hanghui/senic/controller/IDCardControllerManager.java

@@ -19,9 +19,6 @@ public class IDCardControllerManager {
 
 
     public static void init(int type) {
-        if (!ConfigManager.getAuthenticationBeanListBean().isUseIdcard()){
-            return;
-        }
         switch (type) {
             case 11:  //丽江身份证阅读器
                 idCardController = LiJiangIDCardController.getInstance();
@@ -51,9 +48,6 @@ public class IDCardControllerManager {
     }
 
     public static void destroy() {
-        if (!ConfigManager.getAuthenticationBeanListBean().isUseIdcard()){
-            return;
-        }
         try {
             if (idCardController != null) {
                 idCardController.destroy();

+ 0 - 6
app/src/main/java/com/hanghui/senic/controller/QRCodeController.java

@@ -202,18 +202,12 @@ public class QRCodeController extends BaseController {
 
     @Override
     public void init() {
-        if (!ConfigManager.getAuthenticationBeanListBean().isUseQrcode()){
-            return;
-        }
         QRCodeController.getInstance().setFilters();  //从UsbService开始监听通知
         QRCodeController.getInstance().startService(UsbService.class, null); //   启动UsbService(如果它之前没有启动)并绑定它
     }
 
     @Override
     public void destroy() {
-        if (!ConfigManager.getAuthenticationBeanListBean().isUseQrcode()){
-            return;
-        }
         try {
             CommonUtil.getCurrentActivity().unregisterReceiver(QRCodeController.getInstance().mUsbReceiver);
             CommonUtil.getCurrentActivity().unbindService(QRCodeController.getInstance().usbConnection);

+ 15 - 14
app/src/main/java/com/hanghui/senic/receiver/USBroadcastReceiver.java

@@ -29,14 +29,15 @@ public class USBroadcastReceiver extends BroadcastReceiver {
             if (ConfigManager.isDeviceQRCode(usbDevice) == 0){
                 AppLogUtils.e(true, "USB广播信号", "USB拔出广播信号已接收,监测到该类型为二维码USB");
                 //东信多合一阅读器的身份证和二维码是在同一个设备上,因此此时也需要初始化东信多合一的身份证阅读器DXAllInoneIDCardcontroller
-                if (ConfigManager.getAuthenticationBean().getData().get(0).isUseQrcode()
-                        && ConfigManager.getAuthenticationBean().getData().get(0).getQrCodeReaderBrand() == 6) {
-                    IDCardControllerManager.init(9);
-                } else {
-                    QRCodeController.getInstance().init();
-                }
-                if (usBroadcastCallback != null){
-                    usBroadcastCallback.updateView(Constants.Code_USBroadcastCallback_QRCodeSucceed,"二维码USB连接成功");
+                if (ConfigManager.getAuthenticationBean().getData().get(0).isUseQrcode()){
+                    if (ConfigManager.getAuthenticationBean().getData().get(0).getQrCodeReaderBrand() == 6) {
+                        IDCardControllerManager.init(9);
+                    } else {
+                        QRCodeController.getInstance().init();
+                    }
+                    if (usBroadcastCallback != null){
+                        usBroadcastCallback.updateView(Constants.Code_USBroadcastCallback_QRCodeSucceed,"二维码USB连接成功");
+                    }
                 }
             }else if (ConfigManager.isDeviceQRCode(usbDevice) == 1){//东信多合一插入特殊处理
                 IDCardControllerManager.init(9);
@@ -71,8 +72,7 @@ public class USBroadcastReceiver extends BroadcastReceiver {
             if (ConfigManager.isDeviceQRCode(usbDevice) == 0){
                 AppLogUtils.e(true, "USB广播信号", "USB拔出广播信号已接收,监测到该类型为二维码USB");
                 //东信多合一阅读器的身份证和二维码是在同一个设备上,因此此时也需要初始化东信多合一的身份证阅读器DXAllInoneIDCardcontroller
-                if (ConfigManager.getAuthenticationBean().getData().get(0).isUseQrcode()
-                        && ConfigManager.getAuthenticationBean().getData().get(0).getQrCodeReaderBrand() == 6) {
+                if (ConfigManager.getAuthenticationBean().getData().get(0).getQrCodeReaderBrand() == 6) {
                     IDCardControllerManager.destroy();
                 } else {
                     QRCodeController.getInstance().destroy();
@@ -80,7 +80,6 @@ public class USBroadcastReceiver extends BroadcastReceiver {
                 if (usBroadcastCallback != null){
                     usBroadcastCallback.updateView(Constants.Code_USBroadcastCallback_QRCodeFail,"二维码USB连接断开");
                 }
-
             }else if (ConfigManager.isDeviceQRCode(usbDevice) == 1){//东信多合一拔出特殊处理
                 IDCardControllerManager.destroy();
                 if (usBroadcastCallback != null){
@@ -88,9 +87,11 @@ public class USBroadcastReceiver extends BroadcastReceiver {
                 }
             }else {
                 AppLogUtils.e(true, "USB广播信号", "USB拔出广播信号已接收,监测到该类型为身份证阅读器USB");
-                IDCardControllerManager.destroy();
-                if (usBroadcastCallback != null){
-                    usBroadcastCallback.updateView(Constants.Code_USBroadcastCallback_IDCardFail,"身份证USB连接断开");
+                if (ConfigManager.getAuthenticationBean().getData().get(0).isUseIdcard()){
+                    IDCardControllerManager.destroy();
+                    if (usBroadcastCallback != null){
+                        usBroadcastCallback.updateView(Constants.Code_USBroadcastCallback_IDCardFail,"身份证USB连接断开");
+                    }
                 }
             }
         }