release V497
authorsnickersun <scy@incartech.cn>
Wed, 12 Aug 2020 12:46:59 +0000 (20:46 +0800)
committersnickersun <scy@incartech.cn>
Wed, 12 Aug 2020 12:46:59 +0000 (20:46 +0800)
1、给PushTxt增加 eventtype 2, 带声音提示的文字
2、添加5分钟一次提醒(每次心跳检测是否需要提醒)
3、识别YQ和 YQ_EN

app/release/ICSer_V491_2008111430_release.apk [deleted file]
app/release/output.json
app/src/main/java/com/enqualcomm/support/Config.java
app/src/main/java/com/enqualcomm/support/Constants.java
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/bean/Runtime.java
app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java
app/src/main/java/com/enqualcomm/support/utils/ContextProxy.java
app/src/main/java/com/ic/protocols/protocol_ic.java
app/version_code.properties
local.properties

diff --git a/app/release/ICSer_V491_2008111430_release.apk b/app/release/ICSer_V491_2008111430_release.apk
deleted file mode 100644 (file)
index a7bdfe9..0000000
Binary files a/app/release/ICSer_V491_2008111430_release.apk and /dev/null differ
index 373dfe7..c4509e6 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":491,"versionName":"2008111430","enabled":true,"outputFile":"ICSer_V491_2008111430_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V491_2008111430_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":497,"versionName":"2008122043","enabled":true,"outputFile":"ICSer_V497_2008122043_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V497_2008122043_release.apk","properties":{}}]
\ No newline at end of file
index 4da4f61..4b95bd7 100644 (file)
@@ -390,7 +390,7 @@ public class Config {
       needBroadcastAntiAlarm=true;\r
       noPPGSensor=false;\r
       noTempSensor=false;\r
-    }else if ((custom_branch_name.equals("YQ")) ) { //A9-YQ\r
+    }else if (custom_branch_name.equals("YQ") ||custom_branch_name.equals("YQ_EN")  ) { //A9-YQ\r
       noPushTxtNotifyDialog=true;\r
       noSMSNotifyDialog=true;\r
       noVoiceNotifyDialog=true;\r
index d13138d..0c9bd3a 100644 (file)
@@ -310,13 +310,11 @@ public interface Constants {
 \r
   public static String ACTION_ANTI_OFF = "com.ic.ACTION_STRIP";\r
   public static String KEY_ANTI_EVENT="eventID"; //integer  eventID =1 脱落, eventID =0 佩戴\r
-\r
+  public static String KEY_ANTI_TXT="eventTxt"; //String AnitMessage\r
 \r
   public static String ACTION_BATTERYLOW = "com.ic.ACTION_BATTERYLOW";\r
   public static String KEY_BATTERY_EVENT="eventID"; //integer  eventID =1 battery low, eventID =0 解除\r
 \r
-\r
-\r
   public static String PersistFotaServer2Url="persist.sys.ota.host2";\r
 \r
 /**\r
index 89cf000..87d07d3 100644 (file)
@@ -717,6 +717,25 @@ public class CoreService extends Service {
     public static void DevliverStringMessage(String cmd,String str){\r
         CoreService.getInstance().connection.DeliverCMDMessageToSystem(cmd,str);\r
     }\r
+\r
+    public void checkAlarmMessage(){\r
+\r
+        if (runtime.Fence_Warning_flag>0){\r
+            runtime.Fence_Warning_flag++;\r
+            WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context);\r
+            runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_out_wall),2);\r
+        }\r
+        if(runtime.Anti_off_flag>0){\r
+            runtime.Anti_off_flag++;\r
+            WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context);\r
+            if (runtime.getAntioffStatus()) {\r
+                runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_Illegal_unlock), 2);\r
+            }else{\r
+                runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_wristband_off), 2);\r
+            }\r
+        }\r
+\r
+    }\r
     public void checkKeepSitting(){\r
         String dateyyyyMMDDhhmmss=TimeUtil.getSystemTime3();\r
         String sleepdate=TimeUtil.getCurrentSleepRecordDate(dateyyyyMMDDhhmmss);\r
@@ -935,6 +954,7 @@ public class CoreService extends Service {
                 locationClient.updateStepCount();\r
                 updateSleepDate(); //检查睡眠\r
                 checkKeepSitting();//检查久坐\r
+                checkAlarmMessage();//检测是否有报警消息需要显示\r
                 if (this.mKeepAlive != null) {\r
                     if (connection.isServerConnected() && runtime.isServerProtocolConnected()) {\r
                         this.mKeepAlive.onHeartAlarm(this.connection, this.runtime);\r
index fb9da50..feb4951 100644 (file)
@@ -148,6 +148,12 @@ public class Runtime {
     return alarmType;\r
   }\r
 \r
+  //0 代表没有出围栏,如果出围栏则置1,每次报警再加1\r
+  public int Fence_Warning_flag=0;\r
+\r
+    //0 代表佩戴,如果脱腕则置1,每次报警再加1\r
+  public int Anti_off_flag=0;\r
+\r
   public enum AlarmType{\r
       ALARM_SOS,\r
       ALARM_LOWBATTERY,\r
index af2d492..abd83e2 100644 (file)
@@ -13,6 +13,7 @@ import android.os.PowerManager;
 \r
 import com.enqualcomm.support.Config;\r
 import com.enqualcomm.support.CoreService;\r
+import com.enqualcomm.support.R;\r
 import com.enqualcomm.support.bean.Runtime;\r
 import com.enqualcomm.support.service.base.AbstractInvokeHandlerService;\r
 import com.enqualcomm.support.utils.Connection;\r
@@ -23,6 +24,8 @@ import com.ic.protocols.protocolAPIHelper;
 \r
 import static com.enqualcomm.support.Constants.ACTION_ANTI_OFF;\r
 import static com.enqualcomm.support.Constants.KEY_ANTI_EVENT;\r
+import static com.enqualcomm.support.Constants.KEY_ANTI_TXT;\r
+import static java.lang.Thread.interrupted;\r
 import static java.lang.Thread.sleep;\r
 \r
 \r
@@ -87,9 +90,11 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                //  play_notify();\r
                  send_anti_event_broadcast(0);\r
              }\r
+             mRuntime.Anti_off_flag=0;\r
             mRuntime.setAlarmType(Runtime.AlarmType.ALARM_WEARED);\r
             String msg=protocolAPIHelper.getWarningMSG(mRuntime);\r
             Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
+\r
 //            try {\r
 //                sleep(1000);\r
 //            } catch (InterruptedException e) {\r
@@ -109,6 +114,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。\r
                  send_anti_event_broadcast(1);\r
              }\r
+             mRuntime.Anti_off_flag=1;\r
              mRuntime.setAlarmType(Runtime.AlarmType.ALARM_ANTIOFF);\r
             String msg=protocolAPIHelper.getWarningMSG(mRuntime);\r
             Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送!\r
@@ -176,7 +182,19 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
         Intent intent=new Intent();\r
         intent.setAction(ACTION_ANTI_OFF);\r
         intent.putExtra(KEY_ANTI_EVENT,antioff);\r
-        mContext.sendBroadcast(intent);\r
+        if (antioff==0) {\r
+            intent.putExtra(KEY_ANTI_TXT, "");\r
+            mContext.sendBroadcast(intent);\r
+            mRuntime.getContextProxy().sendMsgBroadcast(mContext.getResources().getString(R.string.alarm_wristband_on),0); //佩戴\r
+        }else{\r
+            if (mRuntime.getAntioffStatus()==true){\r
+                intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_Illegal_unlock));\r
+            }else {\r
+                intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off));\r
+            }\r
+            mContext.sendBroadcast(intent);\r
+        }\r
+\r
 \r
     }\r
 \r
index f573be1..9cb3d5a 100644 (file)
@@ -336,15 +336,15 @@ public class ContextProxy {
   }\r
   public static void sendMsgBroadcast(Context _context,String msg, int msgType) {\r
 \r
-    if (msgType==0){\r
+    if (msgType==0) {\r
       Observable.timer(50L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
         public void call(Long param1Long) {\r
-          if(Config.noPushTxtNotifyDialog==false) {\r
+          if (Config.noPushTxtNotifyDialog == false) {\r
             Intent intent = new Intent();\r
             intent.setAction(DIALOG_ACTION);\r
             intent.putExtra("pushtxt", msg);\r
             _context.sendBroadcast(intent);\r
-          }else{\r
+          } else {\r
             WakeLockUtil.ScreenOnWakeLockTemperary(_context);\r
             play_waning_notify(_context);\r
             VibrateUtil.getInstance(_context).VibrateOnOnce(true);\r
@@ -355,12 +355,38 @@ public class ContextProxy {
             }\r
           }\r
           Intent intent = new Intent("action.ic.srvPushTxt");\r
-          intent.putExtra("msgType", 0); //0 代表 server下发消息,1代表 SMS消息\r
+          intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息\r
           intent.putExtra("txtMsg", msg);\r
           intent.addFlags(FLAG_ACTIVITY_NEW_TASK);\r
           _context.sendBroadcast(intent);\r
         }\r
       });\r
+    }else  if (msgType==2){\r
+      Observable.timer(50L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+        public void call(Long param1Long) {\r
+          if (Config.noPushTxtNotifyDialog == false) {\r
+            Intent intent = new Intent();\r
+            intent.setAction(DIALOG_ACTION);\r
+            intent.putExtra("pushtxt", msg);\r
+            _context.sendBroadcast(intent);\r
+          } else {\r
+            WakeLockUtil.ScreenOnWakeLockTemperary(_context);\r
+            play_waning_notify(_context);\r
+            VibrateUtil.getInstance(_context).VibrateOnOnce(true);\r
+            try {\r
+              Thread.sleep(2000);\r
+            } catch (InterruptedException e) {\r
+              e.printStackTrace();\r
+            }\r
+          }\r
+          Intent intent = new Intent("action.ic.srvPushTxt");\r
+          intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息\r
+          intent.putExtra("txtMsg", msg);\r
+          intent.addFlags(FLAG_ACTIVITY_NEW_TASK);\r
+          _context.sendBroadcast(intent);\r
+        }\r
+      });\r
+\r
     }else{\r
       Observable.timer(50L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
         public void call(Long param1Long) {\r
@@ -381,7 +407,7 @@ public class ContextProxy {
           }\r
 \r
           Intent intent = new Intent("action.ic.srvPushTxt");\r
-          intent.putExtra("msgType", 1); //0 代表 server下发消息,1代表 SMS消息\r
+          intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息\r
           intent.putExtra("txtMsg", msg);\r
           intent.addFlags(FLAG_ACTIVITY_NEW_TASK);\r
           _context.sendBroadcast(intent);\r
index 7e84210..0f20857 100644 (file)
@@ -8,6 +8,7 @@ import android.os.Environment;
 \r
 import com.enqualcomm.support.Config;\r
 import com.enqualcomm.support.CoreService;\r
+import com.enqualcomm.support.R;\r
 import com.enqualcomm.support.bean.Alarm;\r
 import com.enqualcomm.support.bean.Contact;\r
 import com.enqualcomm.support.bean.Content;\r
@@ -24,6 +25,7 @@ import com.enqualcomm.support.utils.NettyConnection;
 import com.enqualcomm.support.utils.TemperatureUtil;\r
 import com.enqualcomm.support.utils.TimeUtil;\r
 import com.enqualcomm.support.utils.Util;\r
+import com.enqualcomm.support.utils.WakeLockUtil;\r
 \r
 import java.io.File;\r
 import java.util.ArrayList;\r
@@ -1524,6 +1526,23 @@ public class protocol_ic {
             String type=list[3];\r
             connection.send(genStringMessage("AP86",AP68(index)));\r
             ICLogger.i("收到服务器消息:"+(type.equals("1")?"绑定成功 ":"未激活或者解绑"));\r
+            if (Config.custom_branch_name.equals("YQ")||Config.custom_branch_name.equals("YQ_EN")) {//AK-YQ\r
+                if (type.equals("1")) {\r
+                    WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context);\r
+                    runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_lock_success), 2);\r
+                    runtime.setAntioffStatus(true);\r
+                } else {\r
+                    WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context);\r
+                    runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_unbind_success), 2);\r
+                    runtime.setAntioffStatus(false);\r
+                    //1 分钟后重置\r
+                    Observable.timer(60L, TimeUnit.SECONDS).subscribe(new Action1<Long>() {\r
+                        public void call(Long param1Long) {\r
+                          Util.doMasterClear(runtime.getContextProxy().context);\r
+                        }\r
+                    });\r
+                }\r
+            }\r
 \r
         }else{\r
             ICLogger.i("BP86 format error!");\r
@@ -1918,8 +1937,13 @@ public class protocol_ic {
             connection.send(genStringMessage("APDE",APDE(index)));\r
             if ( Integer.parseInt(msg) == 1) {\r
                 ICLogger.i("Handle BPDE index " + index + ", 进入禁止区域 ");\r
+                runtime.Fence_Warning_flag=1;\r
+                WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context);\r
+                runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_out_wall),2);\r
             }else {\r
                 ICLogger.i("Handle BPDE index " + index + ", 离开禁止区域 ");\r
+                runtime.Fence_Warning_flag=0;\r
+//                runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_out_wall),0);\r
             }\r
         }else{\r
             ICLogger.i("BPDE format error!");\r
index 26c8317..f46ea86 100644 (file)
@@ -1,2 +1,2 @@
-#Tue Aug 11 14:30:49 CST 2020\r
-VERSION_CODE=491\r
+#Wed Aug 12 20:43:40 CST 2020\r
+VERSION_CODE=497\r
index 06d18e6..bed8bc1 100644 (file)
@@ -4,5 +4,5 @@
 # Location of the SDK. This is only used by Gradle.\r
 # For customization when using a Version Control System, please read the\r
 # header note.\r
-#Wed Aug 05 23:43:00 CST 2020\r
-sdk.dir=D\:\\Android\\Sdk\r
+#Wed Aug 12 10:23:43 CST 2020\r
+sdk.dir=C\:\\Users\\incar\\AppData\\Local\\Android\\Sdk\r