From: snickersun Date: Sat, 6 Feb 2021 16:32:38 +0000 (+0800) Subject: release 760 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=7e999b7e25536b54f1f34ff92e1ebcdc88f5a157;p=protocol_srv.git release 760 整理cutoff antioff事件上报逻辑等。待测。 --- diff --git a/app/release/ICSer_V758_2102061642_release.apk b/app/release/ICSer_V760_2102062340_release.apk similarity index 78% rename from app/release/ICSer_V758_2102061642_release.apk rename to app/release/ICSer_V760_2102062340_release.apk index 7e7315dd..9be8e40d 100644 Binary files a/app/release/ICSer_V758_2102061642_release.apk and b/app/release/ICSer_V760_2102062340_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index 92ac68ea..b81fd0e4 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":758,"versionName":"2102061642","enabled":true,"outputFile":"ICSer_V758_2102061642_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V758_2102061642_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":760,"versionName":"2102062340","enabled":true,"outputFile":"ICSer_V760_2102062340_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V760_2102062340_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index 2752ccfa..e9763cd8 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -75,7 +75,7 @@ public class Config { public static boolean noTempSensor=false; //配置是否有心率传感器 public static boolean noPPGSensor=false; - //配置脱腕报警是否需要弹出脱腕提示 默认关闭 + //配置脱腕报警是否需要弹出脱腕提示 默认关闭,所有项目目前都不希望显示弹窗 public static boolean needBroadcastAntiAlarm=false; //配置脱腕报警是否需要弹出剪断提示 默认开启 public static boolean needBroadcastCutoffAlarm=true; @@ -548,7 +548,7 @@ public class Config { noPushTxtNotifyDialog=false; noSMSNotifyDialog=false; noVoiceNotifyDialog=true; - needBroadcastAntiAlarm=true; + needBroadcastAntiAlarm=false; needBroadcastCutoffAlarm=true; needAllwaysAlarmCutOff=true; needAllwaysAlarmFenceOut=false; diff --git a/app/src/main/java/com/enqualcomm/support/Constants.java b/app/src/main/java/com/enqualcomm/support/Constants.java index c73ef318..adcfabbb 100644 --- a/app/src/main/java/com/enqualcomm/support/Constants.java +++ b/app/src/main/java/com/enqualcomm/support/Constants.java @@ -327,7 +327,7 @@ public interface Constants { String KEY_TEMP_OUT = "out"; // double 腕温 String ACTION_ANTI_OFF0 = "com.ic.ACTION_ANTIOFF"; - String ACTION_ANTI_OFF = "com.ic.ACTION_STRIP"; + String ACTION_CUT_OFF = "com.ic.ACTION_STRIP"; String KEY_ANTI_EVENT = "eventID"; //integer eventID =1 脱落, eventID =0 佩戴 String KEY_ANTI_TXT = "eventTxt"; //String AnitMessage diff --git a/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java b/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java index 3aa3f90e..26832a5e 100644 --- a/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java +++ b/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java @@ -28,10 +28,10 @@ import java.lang.ref.WeakReference; import rx.Observable; import rx.schedulers.Schedulers; -import static com.enqualcomm.support.Constants.ACTION_ANTI_OFF; import static com.enqualcomm.support.Constants.ACTION_ANTI_OFF0; import static com.enqualcomm.support.Constants.ACTION_CHECK_ANTIOFF_EVENT; import static com.enqualcomm.support.Constants.ACTION_CHECK_CUTOFF_EVENT; +import static com.enqualcomm.support.Constants.ACTION_CUT_OFF; import static com.enqualcomm.support.Constants.KEY_ANTI_EVENT; import static com.enqualcomm.support.Constants.KEY_ANTI_TXT; import static java.lang.Thread.sleep; @@ -138,7 +138,8 @@ public class AntiMonitorService extends AbstractInvokeHandlerService implements } /*** - * 广播给其他应用,用于UI在客户操作 + * 广播给其他应用,用于UI在客户操作,主要是佩戴检测影响心率,体温检测, + * 所以必须发送,不然可能造成应用不能及时更新,无法正常检测。 * @param antioff */ private void broadcast_antioff_event_to_other_application(boolean antioff) { @@ -154,7 +155,6 @@ public class AntiMonitorService extends AbstractInvokeHandlerService implements if (antioff) { //脱落 mHandler.postDelayed(mDeleteTimeFlagTask, getAntiOffDelayTime()); - Util.setSystemProperties("persist.sys.ic_antioff", "true"); //Util.setSystemProperties("persist.sys.ic.antioff_time", TimeUtil.getSystemTimeyyyyMMddHHmmss()); intent.putExtra(KEY_ANTI_EVENT, 1); } else { @@ -162,11 +162,13 @@ public class AntiMonitorService extends AbstractInvokeHandlerService implements mHandler.removeCallbacks(mDeleteTimeFlagTask); //佩戴的时候开始计时,5分钟后修改佩戴够长的标记值(脱落了会干掉这个任务) mHandler.postDelayed(mUpdateTimeFlagTask, getWearEnoughTime()); - Util.setSystemProperties("persist.sys.ic_antioff", "false"); //Util.setSystemProperties("persist.sys.ic.weared_time", TimeUtil.getSystemTimeyyyyMMddHHmmss()); intent.putExtra(KEY_ANTI_EVENT, 0); } - mContext.sendBroadcast(intent); + //如果 needBroadcastAntiAlarm 意味着 后面会根据项目需求发送这个action,所以在此就不发送了 + if (!Config.needBroadcastAntiAlarm) { + mContext.sendBroadcast(intent); + } } //5分钟 @@ -218,46 +220,39 @@ public class AntiMonitorService extends AbstractInvokeHandlerService implements case STATUS_WEARED: //佩戴 { + + Util.setSystemProperties("persist.sys.ic_antioff", "false"); + mRuntime.Anti_off_flag = 0; + broadcast_antioff_event_to_other_application(false); if (Config.needBroadcastAntiAlarm) { // play_notify(); - send_anti_event_broadcast(0); + send_anti_event_broadcast(0); //发送 Action } - mRuntime.Anti_off_flag = 0; - - broadcast_antioff_event_to_other_application(false); - if (mRuntime.setAlarmType(Runtime.AlarmType.ALARM_WEARED)) { ICLogger.i("triggerSOSLocationProcess "); LocationClient.getInstance().triggerSOSLocationProcess(); // StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); // Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! } -// try { -// sleep(1000); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } + } break; case STATUS_ANTI_OFF: { //脱腕 + Util.setSystemProperties("persist.sys.ic_antioff", "true"); + mRuntime.Anti_off_flag = 1; + broadcast_antioff_event_to_other_application(true); if (Config.needBroadcastAntiAlarm) { send_anti_event_broadcast(1); } - mRuntime.Anti_off_flag = 1; - broadcast_antioff_event_to_other_application(true); if (mRuntime.setAlarmType(Runtime.AlarmType.ALARM_ANTIOFF)) { ICLogger.i("triggerSOSLocationProcess "); LocationClient.getInstance().triggerSOSLocationProcess(); // StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); // Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! } -// try { -// sleep(1000); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } + } break; default: @@ -280,11 +275,12 @@ public class AntiMonitorService extends AbstractInvokeHandlerService implements case STATUS_LOCK_ON: //锁定 { + Util.setSystemProperties("persist.sys.ic_cutoff", "false"); + mRuntime.Cut_off_flag = 0; if (Config.needBroadcastCutoffAlarm) { // play_notify(); send_cutoff_event_broadcast(0); } - mRuntime.Cut_off_flag = 0; if (mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOCK_WATCH)) { //发送消息定位报警消息 ICLogger.i("triggerSOSLocationProcess "); @@ -296,22 +292,18 @@ public class AntiMonitorService extends AbstractInvokeHandlerService implements break; case STATUS_CUT_OFF: { //非法解锁 + Util.setSystemProperties("persist.sys.ic_cutoff", "true"); + mRuntime.Cut_off_flag = 1; if (Config.needBroadcastCutoffAlarm) { send_cutoff_event_broadcast(1); } - mRuntime.Cut_off_flag = 1; if (mRuntime.setAlarmType(Runtime.AlarmType.ALARM_CUTOFF)) { ICLogger.i("triggerSOSLocationProcess "); LocationClient.getInstance().triggerSOSLocationProcess(); // StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); // Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! } -// try { -// sleep(1000); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } } break; default: @@ -419,7 +411,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService implements public void send_cutoff_event_broadcast(int cutoff) { ICLogger.i("send_cutoff_event_broadcast " + cutoff); Intent intent = new Intent(); - intent.setAction(ACTION_ANTI_OFF); + intent.setAction(ACTION_CUT_OFF); intent.putExtra(KEY_ANTI_EVENT, cutoff); if (cutoff == 0) { @@ -509,7 +501,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService implements ICLogger.i("send_anti_event_broadcast " + antioff); Intent intent = new Intent(); - intent.setAction(ACTION_ANTI_OFF); + intent.setAction(ACTION_ANTI_OFF0); intent.putExtra(KEY_ANTI_EVENT, antioff); if (antioff == 0) { mRuntime.isAntioff = false; diff --git a/app/version_code.properties b/app/version_code.properties index 10515333..6f5f547c 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Sat Feb 06 16:42:00 CST 2021 -VERSION_CODE=758 +#Sat Feb 06 23:40:53 CST 2021 +VERSION_CODE=760