release V635
authorsnickersun <scy@incartech.cn>
Sun, 27 Sep 2020 08:43:49 +0000 (16:43 +0800)
committersnickersun <scy@incartech.cn>
Sun, 27 Sep 2020 08:43:49 +0000 (16:43 +0800)
1、FZD,MQTT 低电量增加17状态
2、C5 佩戴,剪断事件 修正
3、电池低电 15% , %5 都会上报一次,并且采用 buffer,保证上报成功。
4、处理蓝牙扫描结果为null的状态

app/release/ICSer_V635_2009271639_release.apk [moved from app/release/ICSer_V634_2009252122_release.apk with 78% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/Config.java
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/LocationClient.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/service/KeepAlive.java
app/src/main/java/com/enqualcomm/support/utils/BatteryUtil.java
app/version_code.properties

similarity index 78%
rename from app/release/ICSer_V634_2009252122_release.apk
rename to app/release/ICSer_V635_2009271639_release.apk
index 7fba9e5..9c1c00b 100644 (file)
Binary files a/app/release/ICSer_V634_2009252122_release.apk and b/app/release/ICSer_V635_2009271639_release.apk differ
index b359140..01ed487 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":634,"versionName":"2009252122","enabled":true,"outputFile":"ICSer_V634_2009252122_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V634_2009252122_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":635,"versionName":"2009271639","enabled":true,"outputFile":"ICSer_V635_2009271639_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V635_2009271639_release.apk","properties":{}}]
\ No newline at end of file
index be0f34d..a404549 100644 (file)
@@ -353,6 +353,7 @@ public class Config {
   public static boolean needAllwaysAlarmCutOff=false;\r
   public static boolean needTemperature_abnormal_alarm=false;\r
   public static boolean A9_noBroadCastActionStrip=false;\r
+  public static boolean C5_noBroadCastActionStrip=false;\r
   public static boolean L004_BroadCastActionStrip=false;\r
   public static boolean disable_ntp_server=false;\r
 \r
@@ -442,6 +443,18 @@ public class Config {
       noPPGSensor=false;\r
       noTempSensor=false;\r
       A9_noBroadCastActionStrip=true;\r
+    }else if (custom_name.equals("SGL"))\r
+    {\r
+      noPushTxtNotifyDialog=false;\r
+      noSMSNotifyDialog=false;\r
+      noVoiceNotifyDialog=true;\r
+      needBroadcastAntiAlarm=true;\r
+      needAllwaysAlarmCutOff=true;\r
+      needAllwaysAlarmFenceOut=false;\r
+      needTemperature_abnormal_alarm=false;\r
+      noPPGSensor=false;\r
+      noTempSensor=false;\r
+      C5_noBroadCastActionStrip=true;\r
     }\r
     noPPGSensor=(ICJniUtils.isPPGavailable()==0);\r
     noTempSensor=(ICJniUtils.isTemperatureDevAvailable()==0);\r
@@ -685,7 +698,7 @@ public class Config {
   public static void ConfigAlarm(Runtime.AlarmType alarmType,boolean enabled){\r
     AlarmConfiglist.put(alarmType.ordinal(),enabled);\r
   }\r
-  private static void dumpAlarmConfig(){\r
+  public static void dumpAlarmConfig(){\r
     for (int i=0;i<AlarmConfiglist.size();i++) {\r
       ICLogger.i(Runtime.AlarmType.values()[i].name()+" "+AlarmConfiglist.get(i));\r
     }\r
@@ -719,8 +732,8 @@ public class Config {
   public static boolean isAlarmTypeEnabled(Runtime.AlarmType alarmType){\r
 \r
     boolean en=false;\r
-    if (AlarmConfiglist.containsKey(alarmType)){\r
-      en=AlarmConfiglist.get(alarmType);\r
+    if (AlarmConfiglist.containsKey(alarmType.ordinal())){\r
+      en=AlarmConfiglist.get(alarmType.ordinal());\r
     }\r
     return en;\r
   }\r
index 33c8bec..0c16906 100644 (file)
@@ -616,9 +616,6 @@ public class CoreService extends Service {
             resetStepCount();\r
         }\r
 \r
-        //初始化剪断,脱腕报警开关\r
-        runtime.setNeddReportCutoff(Config.getNeedCutOff(this));\r
-        runtime.setNeedAntioff(Config.getNeedAntiOff(this));\r
 \r
         //初始化消息相关配置\r
         Config.LoadMessageConfigs();\r
@@ -667,14 +664,16 @@ public class CoreService extends Service {
         }else if (Config.custom_name.equals("SGL")) { //C5项目\r
             if (Config.getConfigInitFlag(this)==0) {\r
                 Config.setLocationMode(this, CUSTOM_MOD8_GPS);\r
-                Config.setLocationCycle(this, 1800);\r
+                Config.setLocationMode(this, CUSTOM_MOD8_WIFI);\r
+                Config.setLocationCycle(this, 5*60);\r
                 Config.setPPGTestCycle(this, 0);\r
                 Config.setTemperatureTestCycle(runtime, 0);\r
-                Config.setConfigInitFlag(this, 1);\r
                 Config.ConfigAlarm(Runtime.AlarmType.ALARM_ESCAPE,true);\r
                 Config.ConfigAlarm(Runtime.AlarmType.ALARM_CUTOFF,true);\r
                 Config.ConfigAlarm(Runtime.AlarmType.ALARM_ILLEGAL_CUTOFF,true);\r
                 Config.ConfigAlarm(Runtime.AlarmType.ALARM_LOCK_WATCH,true);\r
+                Config.setConfigInitFlag(this, 1);\r
+\r
 //                int contactcount=runtime.getDbHelper().getContactCount(getContentResolver());\r
 //                ICLogger.i("=====Contact count "+contactcount);\r
 //                if(contactcount==0){ //如果没有SOS\r
@@ -699,6 +698,12 @@ public class CoreService extends Service {
                 Config.setConfigInitFlag(this, 1);\r
             }\r
         }\r
+\r
+        Config.dumpAlarmConfig();\r
+        //初始化剪断,脱腕报警开关\r
+        runtime.setNeddReportCutoff(Config.getNeedCutOff(this));\r
+        runtime.setNeedAntioff(Config.getNeedAntiOff(this));\r
+\r
         Config.setHeartBeatCycle(this,5); //临时设置为3分钟,给L03测试用。测试断线问题未解决,取消测试。\r
         //初始化ServerHeartBeat Cycle\r
         Config.loadHearBeatSetting(runtime);\r
@@ -782,6 +787,7 @@ public class CoreService extends Service {
         //保证发送心跳时提前获取BatLevel数据\r
         int batlevel=batteryUtil.getBatteryLevel(this);\r
         runtime.setBattery(String.format("%03d",batlevel));\r
+        runtime.setBattery(batlevel);\r
         ICLogger.i("Battery get from api "+batlevel);\r
 \r
 \r
index 8b42937..5dbacc8 100644 (file)
@@ -136,7 +136,7 @@ public class LocationClient {
       @Override\r
       public void OnScanFinished(ArrayList<String> btPairedScanResult, ArrayList<String> btNewScanResult) {\r
 \r
-        if (btNewScanResult.size() > 0) {\r
+        if (btNewScanResult!=null && btNewScanResult.size() > 0) {\r
           ICLogger.i("found bt mac " + btNewScanResult.size() + " btMacList " + runtime.bleInfo.btMacList.size());\r
           boolean in_area = false;\r
           try {\r
index c46e8a5..9a9717a 100644 (file)
@@ -334,8 +334,10 @@ public class Runtime {
 \r
         if(lowbattery){\r
             fzdDevStatus|=0x00000001;\r
+            fzdDevStatus|=0x00020000;\r
         }else{\r
             fzdDevStatus&=~0x00000001;\r
+            fzdDevStatus&=~0x00020000;\r
         }\r
     }\r
     public void updateFZDDevStatusWeared(boolean weared) {\r
@@ -596,11 +598,16 @@ public class Runtime {
 \r
   \r
   public boolean isShutdown() { return this.shutdown; }\r
-  \r
 \r
-  public void setBattery(String paramString) { this.battery = paramString; }\r
-  \r
-  public void setBatteryLow(boolean paramBoolean) {\r
+\r
+  private static int batterylevel=0;\r
+  public int getBatterylevel(){\r
+      return batterylevel;\r
+  }\r
+    public void setBattery(String paramString) { this.battery = paramString; }\r
+    public void setBattery(int param) { this.batterylevel = param; }\r
+\r
+    public void setBatteryLow(boolean paramBoolean) {\r
       this.batteryLow = paramBoolean;\r
       updateFZDDevStatusLowbat(batteryLow); //设置batterylow Alarm\r
   }\r
index 911477a..10306c1 100644 (file)
@@ -87,11 +87,11 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 return;\r
         }\r
 \r
-        //current_anti_status == 0 表示表带 锁定 , ==10 表示表带非法解锁\r
-        //current_anti_status == 2 表示佩戴       ==12 表示脱腕\r
+        //current_anti_status == 2 表示表带 锁定 , ==12 表示表带非法解锁\r
+        //current_anti_status == 0 表示佩戴       ==10 表示脱腕\r
 \r
         switch(current_anti_status){\r
-            case 0:\r
+            case 2:\r
                 //锁定\r
             {\r
                 if (Config.needBroadcastAntiAlarm) {\r
@@ -111,7 +111,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
 //            }\r
             }\r
                 break;\r
-            case 10:\r
+            case 12:\r
             {\r
                 //非法解锁\r
                 if(Config.needBroadcastAntiAlarm) {\r
@@ -130,7 +130,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
 //            }\r
             }\r
                 break;\r
-            case 2:\r
+            case 0:\r
                 //佩戴\r
             {\r
                 if (Config.needBroadcastAntiAlarm) {\r
@@ -149,7 +149,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
 //            }\r
             }\r
                 break;\r
-            case 12:\r
+            case 10:\r
             {\r
                 //脱腕\r
                 if(Config.needBroadcastAntiAlarm) {\r
@@ -225,7 +225,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
 \r
 \r
     public void send_cutoff_event_broadcast(int antioff){\r
-\r
+        ICLogger.i("send_cutoff_event_broadcast "+antioff);\r
         Intent intent=new Intent();\r
         intent.setAction(ACTION_ANTI_OFF);\r
         intent.putExtra(KEY_ANTI_EVENT,antioff);\r
@@ -235,11 +235,15 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 if (mRuntime.needReportCutoff() == true) {\r
                     Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success));\r
                 }\r
-            }else if (Config.L004_BroadCastActionStrip){\r
+            }else if (Config.L004_BroadCastActionStrip) {\r
                 Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_wristband_on));\r
                 //下面消息是为了把锁定窗口关掉\r
                 intent.putExtra(KEY_ANTI_TXT, "");\r
                 mContext.sendBroadcast(intent);\r
+            }else  if (Config.C5_noBroadCastActionStrip) {\r
+\r
+                Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success));\r
+\r
             }else{\r
                 intent.putExtra(KEY_ANTI_TXT, "");\r
                 mContext.sendBroadcast(intent);\r
@@ -272,6 +276,19 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。\r
                 intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off));\r
                 mContext.sendBroadcast(intent);\r
+            }else if (Config.C5_noBroadCastActionStrip) {\r
+\r
+\r
+                    play_notify();\r
+                    VibrateUtil.getInstance(mContext).VibrateOnOnce(true);\r
+                    screen_on();\r
+                    try {\r
+                        sleep(1000);\r
+                    } catch (InterruptedException e) {\r
+                        e.printStackTrace();\r
+                    }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。\r
+                    Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_Illegal_unlock));\r
+\r
             }else{\r
                 play_notify();\r
                 VibrateUtil.getInstance(mContext).VibrateOnOnce(true);\r
@@ -293,6 +310,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
     }\r
     public void send_anti_event_broadcast(int antioff){\r
 \r
+        ICLogger.i("send_anti_event_broadcast "+antioff);\r
         Intent intent=new Intent();\r
         intent.setAction(ACTION_ANTI_OFF);\r
         intent.putExtra(KEY_ANTI_EVENT,antioff);\r
@@ -302,11 +320,14 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 if (mRuntime.needReportCutoff() == true) {\r
                     Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success));\r
                 }\r
-            }else if (Config.L004_BroadCastActionStrip){\r
+            }else if (Config.L004_BroadCastActionStrip) {\r
                 Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_wristband_on));\r
                 //下面消息是为了把锁定窗口关掉\r
                 intent.putExtra(KEY_ANTI_TXT, "");\r
                 mContext.sendBroadcast(intent);\r
+            }else  if (Config.C5_noBroadCastActionStrip) {\r
+                Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success));\r
+\r
             }else{\r
                 intent.putExtra(KEY_ANTI_TXT, "");\r
                 mContext.sendBroadcast(intent);\r
@@ -338,6 +359,19 @@ public class AntiMonitorService extends AbstractInvokeHandlerService {
                 }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。\r
                 intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off));\r
                 mContext.sendBroadcast(intent);\r
+\r
+            }else  if (Config.C5_noBroadCastActionStrip) {\r
+\r
+                        play_notify();\r
+                        VibrateUtil.getInstance(mContext).VibrateOnOnce(true);\r
+                        screen_on();\r
+                        try {\r
+                            sleep(1000);\r
+                        } catch (InterruptedException e) {\r
+                            e.printStackTrace();\r
+                        }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。\r
+                        Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_Illegal_unlock));\r
+\r
             }else{\r
                 play_notify();\r
                 VibrateUtil.getInstance(mContext).VibrateOnOnce(true);\r
index ddaeeee..16c4f62 100644 (file)
@@ -409,7 +409,7 @@ public class KeepAlive extends AbstractConnectionService {
 //          if (KeepAlive.this.mRuntime.getBatteryLow()){\r
 //          KeepAlive.this.mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);\r
           KeepAlive.this.mRuntime.setAlarmType(Runtime.AlarmType.ALARM_POWER_OFF);\r
-          KeepAlive.this.connection.send(protocolAPIHelper.getWarningMSG(KeepAlive.this.mRuntime));\r
+          Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(KeepAlive.this.mRuntime));\r
 \r
           ICLogger.i("Shutdown Received! send AP10 !");\r
 //        }\r
index 518448a..6541033 100644 (file)
@@ -15,6 +15,7 @@ import com.enqualcomm.support.Config;
 import com.enqualcomm.support.CoreService;\r
 import com.enqualcomm.support.service.AntiMonitorService;\r
 import com.enqualcomm.support.service.AudioService;\r
+import com.enqualcomm.support.service.Deliver;\r
 import com.ic.protocols.protocolAPIHelper;\r
 import com.enqualcomm.support.bean.Runtime;\r
 \r
@@ -75,46 +76,52 @@ public class BatteryUtil {
           ICLogger.i(msg.toString());\r
           if (batLevel >= 100) {\r
             mRuntime.setBattery(String.format("%03d",100));\r
+            mRuntime.setBattery(100);\r
             mRuntime.setHaveBatteryChange(false);\r
             mRuntime.setBatteryLow(false);\r
           } else if (batLevel<100 && batLevel >= 25) {\r
             mRuntime.setBattery(String.format("%03d",batLevel));\r
+            mRuntime.setBattery(batLevel);\r
             mRuntime.setHaveBatteryChange(false);\r
             mRuntime.setBatteryLow(false);\r
           } else if (batLevel<25 && batLevel >= 15) {\r
             mRuntime.setBattery(String.format("%03d",batLevel));\r
+            mRuntime.setBattery(batLevel);\r
             mRuntime.setHaveBatteryChange(true);\r
 \r
           } else if (batLevel<15 && batLevel >= 5) {\r
-            mRuntime.setBattery(String.format("%03d",batLevel));\r
-            mRuntime.setHaveBatteryChange(true);\r
-            mRuntime.setBatteryLow(true);\r
+\r
 \r
             if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","BatteryLow  less than 15%!");\r
-            if (mRuntime.isPowerConnected()==false) {\r
+            //没有充电,上次电池level > 15% , 上次电池并且不是 低电状态,则报警\r
+            if (mRuntime.isPowerConnected()==false  && mRuntime.getBatterylevel()>15 && mRuntime.getBatteryLow()==false) {\r
               send_batterylow_event_broadcast(param1Context, 1);\r
               play_waning_notify(param1Context);\r
               mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);\r
               //trigger AP10 报警定位\r
-              connection.send(protocolAPIHelper.getWarningMSG(mRuntime));\r
+              Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(mRuntime));\r
             }\r
-          } else {\r
             mRuntime.setBattery(String.format("%03d",batLevel));\r
+            mRuntime.setBattery(batLevel);\r
             mRuntime.setHaveBatteryChange(true);\r
             mRuntime.setBatteryLow(true);\r
+          } else {\r
 \r
             if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","BatteryLow less than 5% !");\r
-\r
-            if (mRuntime.isPowerConnected()==false) {\r
+            //没有充电,上次电池level > 15% , 上次电池并且不是 电池低电状态,则报警\r
+            if (mRuntime.isPowerConnected()==false && mRuntime.getBatterylevel()>5 ) {\r
               send_batterylow_event_broadcast(param1Context, 1);\r
 \r
               play_waning_notify(param1Context);\r
               mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);\r
               //trigger AP10 报警定位\r
-              connection.send( protocolAPIHelper.getWarningMSG(mRuntime));\r
-\r
+              Deliver.sendLocationMSG( protocolAPIHelper.getWarningMSG(mRuntime));\r
 \r
             }\r
+            mRuntime.setBattery(String.format("%03d",batLevel));\r
+            mRuntime.setBattery(batLevel);\r
+            mRuntime.setHaveBatteryChange(true);\r
+            mRuntime.setBatteryLow(true);\r
           }\r
 \r
         }else if (Intent.ACTION_BATTERY_LOW.equals(intent.getAction())) {\r
@@ -173,7 +180,6 @@ public class BatteryUtil {
         public void handleMessage(Message msg) {\r
           super.handleMessage(msg);\r
           if (msg.what == 100) {\r
-\r
             if (mWakeLock != null && mWakeLock.isHeld()) {\r
               mWakeLock.release();\r
             }\r
index 057c765..a9618b2 100644 (file)
@@ -1,2 +1,2 @@
-#Fri Sep 25 21:22:18 CST 2020\r
-VERSION_CODE=634\r
+#Sun Sep 27 16:39:23 CST 2020\r
+VERSION_CODE=635\r