completed sos block in w100 protocol.
authorTrillGates <williamtrillgates@gmail.com>
Wed, 25 Aug 2021 08:27:08 +0000 (16:27 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Wed, 25 Aug 2021 08:27:08 +0000 (16:27 +0800)
app/release/ICProtocol8.1_V918_2108251623_release.apk [moved from app/release/ICProtocol8.1_V917_2108251543_release.apk with 77% similarity]
app/release/output.json
app/src/main/java/com/ic/protocolSrv/CoreService.java
app/src/main/java/com/ic/protocols/protocol_fzd.java
app/version_code.properties

similarity index 77%
rename from app/release/ICProtocol8.1_V917_2108251543_release.apk
rename to app/release/ICProtocol8.1_V918_2108251623_release.apk
index 01ec984..413dff7 100644 (file)
Binary files a/app/release/ICProtocol8.1_V917_2108251543_release.apk and b/app/release/ICProtocol8.1_V918_2108251623_release.apk differ
index 75ca125..015168e 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":917,"versionName":"2108251543","enabled":true,"outputFile":"ICProtocol8.1_V917_2108251543_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol8.1_V917_2108251543_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":918,"versionName":"2108251623","enabled":true,"outputFile":"ICProtocol8.1_V918_2108251623_release.apk","fullName":"release","baseName":"release"},"path":"ICProtocol8.1_V918_2108251623_release.apk","properties":{}}]
\ No newline at end of file
index eb7d2f7..760313e 100644 (file)
@@ -229,7 +229,7 @@ public class CoreService extends Service {
                 AlarmWakeUp.isNeedWakeUpAlarm(runtime);
         }
     };
-    private BroadcastReceiver broadcastSOSReceiver = new BroadcastReceiver() {
+    private final BroadcastReceiver broadcastSOSReceiver = new BroadcastReceiver() {
         public void onReceive(Context param1Context, Intent param1Intent) {
 
             StringBuilder stringBuilder2 = new StringBuilder();
@@ -249,6 +249,23 @@ public class CoreService extends Service {
                 }
                 setEmegencyLocationSTOPAlarm(5);
             } else if (ACTION_LOCAL_SOS_ACTION.endsWith(param1Intent.getAction())) {
+                //判断SOS是否需要,W100的开关
+                boolean disableSos = false;
+                //默认是需要的
+                Cursor query = getContentResolver().query(Uri.parse(SETTINGS),
+                        new String[]{"s_value"}, "s_key=?", new String[]{"SOSON"}, null);
+                if (query != null) {
+                    if (query.moveToNext()) {
+                        String value = query.getString(0);
+                        ICLogger.d("sos on value ==> " + value);
+                        disableSos = "1".equals(value);
+                    }
+                    query.close();
+                }
+                if (disableSos) {
+                    ICLogger.d("disable sos...");
+                    return;
+                }
                 VibrateUtil.getInstance(runtime.getContextProxy().context).vibrateOn(true);
                 //if( param1Intent.getIntExtra("type", 1) == 1) {
                 if (needHRSTestOnSOS) {
index 11245c6..ff7abb6 100644 (file)
@@ -438,6 +438,7 @@ public class protocol_fzd {
         UNKNOWN_CMD,
         MESSAGE/*文字消息*/,
         profile,//情景模式
+        SOSON,//w100SOS 报警开关
     }
 
     public static HashMap<CMD_TYPE, String> cmdMap = null;
@@ -514,6 +515,7 @@ public class protocol_fzd {
         cmdMap.put(CMD_TYPE.AGTALK, "AGTALK");
         cmdMap.put(CMD_TYPE.CALLING, "CALLING");
         cmdMap.put(CMD_TYPE.RESET, "RESET");
+        cmdMap.put(CMD_TYPE.SOSON, "SOSON");
     }
 
     private Connection mConnection = null;
@@ -1839,6 +1841,10 @@ public class protocol_fzd {
                 ICLogger.d("收到好友列表...");
                 handlerPPQ(data, mRuntime);
                 break;
+            case SOSON:
+                ICLogger.d("收到服务器设置的SOS开发消息..");
+                handleSettings(type, data, mRuntime);
+                break;
         }
         return ret;
     }
@@ -2254,6 +2260,7 @@ public class protocol_fzd {
      */
     private void handleSettings(CMD_TYPE cmd, String data, Runtime mRuntime) {
         ICLogger.d(cmd + " trigger setting --> " + data);
+        ICLogger.d("cmd==> " + cmd);
         ContentResolver resolver = mRuntime.getContextProxy().getResolver();
         ContentValues values = new ContentValues();
         values.put(ICDatabaseHelper.sKey, cmdMap.get(cmd));
index b4629ff..033fa4b 100644 (file)
@@ -1,2 +1,2 @@
-#Wed Aug 25 15:43:24 CST 2021\r
-VERSION_CODE=917\r
+#Wed Aug 25 16:23:34 CST 2021\r
+VERSION_CODE=918\r