relase ICProtocol81_V965_2306132258_release.apk
authorSnickerSun <snickersun@163.com>
Wed, 14 Jun 2023 10:00:34 +0000 (18:00 +0800)
committerSnickerSun <snickersun@163.com>
Wed, 14 Jun 2023 10:00:34 +0000 (18:00 +0800)
优化binder ,增加心率和体温binder成功率

app/release/ICProtocol81_V965_2306132258_release.apk [moved from app/release/ICProtocol81_V964_2306112300_release.apk with 78% similarity]
app/release/output.json
app/src/main/java/com/ic/protocolSrv/service/HeartRateManager.java
app/src/main/java/com/ic/protocolSrv/utils/TemperatureUtil.java
app/version_code.properties

similarity index 78%
rename from app/release/ICProtocol81_V964_2306112300_release.apk
rename to app/release/ICProtocol81_V965_2306132258_release.apk
index 6d1962d..9e3a409 100644 (file)
Binary files a/app/release/ICProtocol81_V964_2306112300_release.apk and b/app/release/ICProtocol81_V965_2306132258_release.apk differ
index 77d4973..272ad26 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":964,"versionName":"2306112300","enabled":true,"outputFile":"ICProtocol81_V964_2306112300_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol81_V964_2306112300_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":965,"versionName":"2306132258","enabled":true,"outputFile":"ICProtocol81_V965_2306132258_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol81_V965_2306132258_release.apk","properties":{}}]
\ No newline at end of file
index c721d23..715b567 100644 (file)
@@ -134,7 +134,9 @@ public class HeartRateManager extends AbstractInvokeHandlerService {
 
 
     private HeartRateManager() {
-
+        if(heartRateSensorService == null) {
+            bindServer();
+        }
     }
     public void bindServer(){
         //这是4.4的ICWorkService
@@ -145,15 +147,28 @@ public class HeartRateManager extends AbstractInvokeHandlerService {
         //intent.setPackage(ICApplication.sContext.getPackageName());
         intent.setPackage("com.ic.work");
         ICApplication.sContext.bindService(intent, mRemoteConnection, Context.BIND_AUTO_CREATE);
-        //绑定8.1的WorkService
-        //使用的时候,谁不空就使用谁
-        ICLogger.d(" start bind service...");
-        Intent intent8541 = new Intent();
-        intent8541.setAction(ACTION_HEART_RATE);
-        intent8541.setPackage("com.ic.work");
-        ICApplication.sContext.bindService(intent8541, mRemoteConnection8541, Context.BIND_AUTO_CREATE);
+//        //绑定8.1的WorkService
+//        //使用的时候,谁不空就使用谁
+//        ICLogger.d(" start bind service...");
+//        Intent intent8541 = new Intent();
+//        intent8541.setAction(ACTION_HEART_RATE);
+//        intent8541.setPackage("com.ic.work");
+//        ICApplication.sContext.bindService(intent8541, mRemoteConnection8541, Context.BIND_AUTO_CREATE);
+    }
+    public void unbindServer(){
+        //取消服务注册
+        try {
+            heartRateSensorService.unRegisterCallback(mRemoteCallback);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        if (heartRateSensorService != null) {
+            ICApplication.sContext.unbindService(mRemoteConnection);
+        }
+        if (iBloodRemoteService8521 != null) {
+            ICApplication.sContext.unbindService(mRemoteConnection8541);
+        }
     }
-
     public void init(Runtime runtime) {
         this.runtime = runtime;
     }
@@ -477,18 +492,7 @@ public class HeartRateManager extends AbstractInvokeHandlerService {
     public void onDetach(Connection paramConnection, Runtime paramRuntime) {
         ICLogger.d("onDetach...");
 //        unRegReceiver();
-        //取消服务注册
-        try {
-            heartRateSensorService.unRegisterCallback(mRemoteCallback);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        if (heartRateSensorService != null) {
-            ICApplication.sContext.unbindService(mRemoteConnection);
-        }
-        if (iBloodRemoteService8521 != null) {
-            ICApplication.sContext.unbindService(mRemoteConnection8541);
-        }
+        unbindServer();
     }
 
 
@@ -501,10 +505,12 @@ public class HeartRateManager extends AbstractInvokeHandlerService {
         }
         //开始去测试
         ICLogger.d("from == >  " + from);
+
+        if(heartRateSensorService == null) {
+            bindServer();
+        }
         new Thread(() -> {
             try {
-                if(heartRateSensorService == null)
-                    bindServer();
                 if (heartRateSensorService != null) {
                     //判断类型,如果不是GH301的硬件,直接走全部测试
                     String isGh301 = Util.getSystemProperties("persist.sys.is_gh301", "false");
index a0917fd..2a2321c 100644 (file)
@@ -36,7 +36,8 @@ public class TemperatureUtil {
     private ITempSensorService temperatureRemoteService;
 
     private TemperatureUtil() {
-
+        if(temperatureRemoteService == null)
+            bind_server();
     }
     public void bind_server(){
         Intent intent = new Intent();
@@ -47,7 +48,7 @@ public class TemperatureUtil {
     }
 
 
-    public void release() {
+    public void unbindserver() {
         if (temperatureRemoteService != null) {
             try {
                 temperatureRemoteService.unRegisterCallback(mRemoteCallback);
@@ -225,10 +226,12 @@ public class TemperatureUtil {
             ICLogger.i("未佩戴,取消TempTest!" + from);
             return;
         }
+
+        if(temperatureRemoteService == null)
+            bind_server();
+
         new Thread(() -> {
             try {
-                if(temperatureRemoteService == null)
-                    bind_server();
 
                 if (temperatureRemoteService != null) {
                     ICLogger.d("get temperature info...");
index d75c4c4..f0e097a 100644 (file)
@@ -1,2 +1,2 @@
-#Sun Jun 11 23:00:31 GMT+08:00 2023\r
-VERSION_CODE=964\r
+#Tue Jun 13 22:58:31 GMT+08:00 2023\r
+VERSION_CODE=965\r