-[{"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
private HeartRateManager() {
-
+ if(heartRateSensorService == null) {
+ bindServer();
+ }
}
public void bindServer(){
//这是4.4的ICWorkService
//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;
}
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();
}
}
//开始去测试
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");
private ITempSensorService temperatureRemoteService;
private TemperatureUtil() {
-
+ if(temperatureRemoteService == null)
+ bind_server();
}
public void bind_server(){
Intent intent = new Intent();
}
- public void release() {
+ public void unbindserver() {
if (temperatureRemoteService != null) {
try {
temperatureRemoteService.unRegisterCallback(mRemoteCallback);
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...");