From: TrillGates Date: Thu, 28 Oct 2021 03:55:49 +0000 (+0800) Subject: 删除心跳检查心率体温 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=dc55e217deacf5ac900c4d2108a72cdbbfed5e2d;p=icsupport.git 删除心跳检查心率体温 --- diff --git a/app/release/ICSer_V1000_2110281007_release.apk b/app/release/ICSer_V1000_2110281007_release.apk new file mode 100644 index 00000000..8da5bbe8 Binary files /dev/null and b/app/release/ICSer_V1000_2110281007_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 2f30358b..a954683f 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":999,"versionName":"2110271213","enabled":true,"outputFile":"ICSer_V999_2110271213_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V999_2110271213_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1000,"versionName":"2110281007","enabled":true,"outputFile":"ICSer_V1000_2110281007_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1000_2110281007_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index 44f16935..c7e61691 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -1318,14 +1318,6 @@ public class CoreService extends Service { checkAlarmMessage();//检测是否有报警消息需要显示 checkUnreadMessage();//检查未读消息 - if(!batteryUtil.isPowerConnected(runtime.getContextProxy().context)){ - if (runtime.check_stat_do_temp_test()) { - TemperatureUtil.getInstance().doTempTestInThread(FROM_SERVER); - } - if (runtime.check_stat_do_ppg_test()) { - HeartRateManager.getInstance().triggerPPGTest(FROM_SERVER); - } - } if (this.mKeepAlive != null) { if (connection.isServerConnected() && runtime.isServerProtocolConnected()) { this.mKeepAlive.onHeartAlarm(this.connection, this.runtime); diff --git a/app/src/main/java/com/enqualcomm/support/LocationClient.java b/app/src/main/java/com/enqualcomm/support/LocationClient.java index adc52892..56729461 100644 --- a/app/src/main/java/com/enqualcomm/support/LocationClient.java +++ b/app/src/main/java/com/enqualcomm/support/LocationClient.java @@ -597,7 +597,7 @@ public class LocationClient { // ICLogger.i("getMNC "+runtime.getLocationInstance().getMNC()+" getMCC "+runtime.getLocationInstance().getMCC()+" getGSMStationCID " + runtime.getLocationInstance().getGSMStationCID()+ " getLAC "+runtime.getLocationInstance().getLAC()+" changed "+runtime.getLocationInstance().isDataChanged()); ICLogger.i("waitAndSendLocation " + checktimes + ", lbs=" + lbs_ok + ", wifi=" + wifi_ok + ", gps=" + gps_ok + ", mode=" + mode); - if (NoMoveAndNoGPSsignalSkipGpsFlag) { + if (mNoMoveAndNoGPSsignalSkipGpsFlag) { ICLogger.i("NoMove And NoGPSsignal SkipGpsLocation!"); mode = ICLocation.NORMAL_MOD;//如果没有移动且没有Gps信号,则采用Normal 模式进行wifi定位 } @@ -611,7 +611,7 @@ public class LocationClient { ICLogger.i("waitAndSendLocation " + checktimes + " timeout"); timeout = true; } - if (NoMoveTimeout && (timeout || gps_nosignal)) { + if (mNoMoveTimeout && (timeout || gps_nosignal)) { //没有移动,GPS超时或者没信号都会给 计数 加 1 gpsTimeoutCountOnNoMove++; } @@ -854,9 +854,9 @@ public class LocationClient { return skipMoveCheck; } - private static boolean NoMoveAndNoGPSsignalSkipGpsFlag = false; + private static boolean mNoMoveAndNoGPSsignalSkipGpsFlag = false; private static boolean noMove = false; - private static boolean NoMoveTimeout = false; + private static boolean mNoMoveTimeout = false; private static boolean last_noMove = false; private static final int MaxNoMoveTimeout = 3 * 60 * 1000; //3分钟 private static long first_NoMove_timestamp = 0; @@ -916,13 +916,13 @@ public class LocationClient { private boolean needLocationForBT() { updateStepCount();//update StepCount,保证每次定位前,计步数据是最新的。防止丢数据。 //如果没有动,且超时。则跳过定位 - NoMoveTimeout = checkNoMoveTimeoutForBT(); - ICLogger.i("BT NoMoveTimeout " + NoMoveTimeout + ", forceLocation=" + forceLocation + ", Config.GpsForceMoveCheck=" + Config.GpsForceMoveCheck + ", skipMoveCheck=" + skipMoveCheck); + mNoMoveTimeout = checkNoMoveTimeoutForBT(); + ICLogger.i("BT NoMoveTimeout " + mNoMoveTimeout + ", forceLocation=" + forceLocation + ", Config.GpsForceMoveCheck=" + Config.GpsForceMoveCheck + ", skipMoveCheck=" + skipMoveCheck); // 不强制定位 且 (WorkingMod 不是紧急模式 或者 强制进行移动检测),且 没有移动过 if ((forceLocation != 1) && (Config.GpsForceMoveCheck == true) && - (NoMoveTimeout) && (skipMoveCheck == false)) { + (mNoMoveTimeout) && (skipMoveCheck == false)) { ICLogger.i("No Move ,skip BT location!"); return false; @@ -935,13 +935,13 @@ public class LocationClient { private boolean needLocation() { updateStepCount();//update StepCount,保证每次定位前,计步数据是最新的。防止丢数据。 //如果没有动,且超时。则跳过定位 - NoMoveTimeout = checkNoMoveTimeout(); - ICLogger.i(" NoMoveTimeout " + NoMoveTimeout + ", forceLocation=" + forceLocation + ", Config.GpsForceMoveCheck=" + Config.GpsForceMoveCheck + ", skipMoveCheck=" + skipMoveCheck); + mNoMoveTimeout = checkNoMoveTimeout(); + ICLogger.i(" NoMoveTimeout " + mNoMoveTimeout + ", forceLocation=" + forceLocation + ", Config.GpsForceMoveCheck=" + Config.GpsForceMoveCheck + ", skipMoveCheck=" + skipMoveCheck); // 不强制定位 且 (WorkingMod 不是紧急模式 或者 强制进行移动检测),且 没有移动过 if ((forceLocation != 1) && (Config.GpsForceMoveCheck == true) && - (NoMoveTimeout) && (skipMoveCheck == false)) { + (mNoMoveTimeout) && (skipMoveCheck == false)) { ICLogger.i("No Move ,skip BT location2!"); return false; @@ -952,31 +952,57 @@ public class LocationClient { public void startLocationProcess(int mod) { updateStepCount();//update StepCount,保证每次定位前,计步数据是最新的。防止丢数据。 - ICLogger.i("forceLocation=" + forceLocation + ", WorkingMod=" + mod + ", isLocating=" + isLocating + ", lastStep=" + runtime.getLastStepCount() + ", currentStep=" + runtime.getTotalStepCount()); - if (isLocating && 1 != forceLocation) { //如果是强制定位,则即使是正在定位,也要执行,因为有时模式变换的时候,需要取消上一次定位信息,马上新的模式定位。 + ICLogger.i("forceLocation=" + forceLocation + + ", WorkingMod=" + mod + ", isLocating=" + + isLocating + ", lastStep=" + + runtime.getLastStepCount() + + ", currentStep=" + runtime.getTotalStepCount()); + + //如果是强制定位,则即使是正在定位,也要执行,因为有时模式变换的时候,需要取消上一次定位信息,马上新的模式定位。 + if (isLocating && 1 != forceLocation) { ICLogger.i("locating ,skip location!"); return; } //如果没有动,且超时。则跳过定位 - NoMoveTimeout = checkNoMoveTimeout(); + //如果超时,返回true,表示静止 + //如果是false表示移动了 + + mNoMoveTimeout = checkNoMoveTimeout(); + + // 不强制定位 且 (WorkingMod 不是紧急模式 或者 强制进行移动检测),且 没有移动过 if ((forceLocation != 1) && - (((mod == ICLocation.NORMAL_MOD) || (mod == ICLocation.LOWPOWER_MOD) || (mod == ICLocation.CUSTOM_MOD8_WIFI)) || Config.GpsForceMoveCheck == true) && - (NoMoveTimeout) && (skipMoveCheck == false)) { + (((mod == ICLocation.NORMAL_MOD) || (mod == ICLocation.LOWPOWER_MOD) || + (mod == ICLocation.CUSTOM_MOD8_WIFI)) || Config.GpsForceMoveCheck == true) && + (mNoMoveTimeout) && (skipMoveCheck == false)) { ICLogger.i("No Move ,skip location!"); + //走到这里返回的条件是 + //1.非强制定位 + //2.当前模式是NORMAL_MOD,或者LOWPOWER_MOD,或者是CUSTOM_MOD8_WIFI,或者GPS强制移动检查为true + //3.静止时间超时(没有移动过) + //4.不跳过移动检测 return; } - - if (NoMoveTimeout) { + //能走到这里的case有: + //1.强制定位 + //2.mode是紧急模式,或者普通模式下,非强制GPS定位检查 + //3.移动了 + //4.跳过移动检查 + + /** + * GpsForceMoveCheck true表示强制GPS移动检查,false表示不强制GPS移动检查 + * skipMoveCheck true跳过移动检查,false不跳过移动检查 + */ + if (mNoMoveTimeout) { // 记录gps 无信号或者timeout的次数,超过5 就会停止使用gps定位,只要有一次 移动,或者设置为wifi定位,则清零。 if (gpsTimeoutCountOnNoMove >= MaxGpsTimeoutCountOnNoMove) { - NoMoveAndNoGPSsignalSkipGpsFlag = true; + //没有移动,没有GPS信号,跳过GPS + mNoMoveAndNoGPSsignalSkipGpsFlag = true; } else { - NoMoveAndNoGPSsignalSkipGpsFlag = false; + mNoMoveAndNoGPSsignalSkipGpsFlag = false; } - } else { - NoMoveAndNoGPSsignalSkipGpsFlag = false; + mNoMoveAndNoGPSsignalSkipGpsFlag = false; gpsTimeoutCountOnNoMove = 0; //只要有一次 移动,则清零。 } @@ -990,7 +1016,7 @@ public class LocationClient { switch (mod) { case ICLocation.CUSTOM_MOD: case ICLocation.CUSTOM_MOD8_GPS: - if (!NoMoveAndNoGPSsignalSkipGpsFlag) { + if (!mNoMoveAndNoGPSsignalSkipGpsFlag) { if (runtime.getLocationInstance().getLocation_cycle() <= 60) { nmeaListener.setNoStop(true); } else { @@ -1003,7 +1029,7 @@ public class LocationClient { break; case ICLocation.EMERGNECY_MOD: case ICLocation.REALTIME_MOD: - if (!NoMoveAndNoGPSsignalSkipGpsFlag) { + if (!mNoMoveAndNoGPSsignalSkipGpsFlag) { nmeaListener.setNoStop(true); //nmeaListener.setNoStop(false);//保证从Custom切换回来的时候不至于不关闭gps startGpsLocate(); @@ -1053,11 +1079,11 @@ public class LocationClient { IntentFilter intentFilter = new IntentFilter(); intentFilter.addAction(ACTION_GPSCMD); - (this.runtime.getContextProxy()).context.registerReceiver(this.mLocationBroadcastReceiver, intentFilter); + (runtime.getContextProxy()).context.registerReceiver(this.mLocationBroadcastReceiver, intentFilter); } public void unregisterBroadReceiver() { - (this.runtime.getContextProxy()).context.unregisterReceiver(this.mLocationBroadcastReceiver); + (runtime.getContextProxy()).context.unregisterReceiver(this.mLocationBroadcastReceiver); } private final BroadcastReceiver mLocationBroadcastReceiver = new BroadcastReceiver() { diff --git a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java index f6ebf45c..39a119fc 100644 --- a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java +++ b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java @@ -12,6 +12,7 @@ import android.net.Uri; import android.os.Handler; import android.os.IBinder; import android.os.Message; +import android.util.Log; import com.enqualcomm.support.Config; import com.enqualcomm.support.Constants; @@ -421,7 +422,8 @@ public class HeartRateManager extends AbstractInvokeHandlerService { } } //开始去测试 - ICLogger.d("from == > " + from + " HeartRateManager "); + ICLogger.d("from == > " + from + " HeartRateManager " + Log.getStackTraceString(new Throwable())); + new Thread(() -> { try { if (heartRateSensorService != null) { @@ -432,9 +434,9 @@ public class HeartRateManager extends AbstractInvokeHandlerService { ICLogger.i("customname = " + customname); if (!Boolean.parseBoolean(isGh301) || customname.equals("AA")) { heartRateSensorService.getHeartRateInfo(from, HeartRateManager.class.getName()); - ICLogger.i("!gh301 or AA " ); + ICLogger.i("!gh301 or AA "); } else { - ICLogger.i("gh301 && !AA" ); + ICLogger.i("gh301 && !AA"); //如果是的话,就要判断类型了 //这个类型在Config里,在parseCMD里进行设置 //在这里进行使用 diff --git a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java index a58fa929..cc17ed2f 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java @@ -8,6 +8,7 @@ import android.content.Intent; import android.content.ServiceConnection; import android.net.Uri; import android.os.IBinder; +import android.util.Log; import com.enqualcomm.support.Config; import com.enqualcomm.support.Constants; @@ -91,6 +92,7 @@ public class TemperatureUtil { private Temperature lastTemperature; private final ITempSensorCallback.Stub mRemoteCallback = new ITempSensorCallback.Stub() { + @Override public void onTemperatureTestError(String message, int code) { ICLogger.d("message==> " + message + " code==> " + code); @@ -276,7 +278,7 @@ public class TemperatureUtil { * @param from */ public void DoTempTest(int from) { - ICLogger.d("DoTempTest..." + from); + ICLogger.d("DoTempTest..." + from + " " + Log.getStackTraceString(new Throwable())); if (CoreService.getInstance() != null && CoreService.getInstance().getRuntime().Anti_off_flag == 1) { ICLogger.i("未佩戴,取消TempTest!" + from); return; diff --git a/app/version_code.properties b/app/version_code.properties index 0e40edb7..1f324e74 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Wed Oct 27 12:13:09 CST 2021 -VERSION_CODE=999 +#Thu Oct 28 10:07:29 CST 2021 +VERSION_CODE=1000