修复了SOS求救类型的判断
authorTrillGates <williamtrillgates@gmail.com>
Mon, 1 Nov 2021 02:49:23 +0000 (10:49 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Mon, 1 Nov 2021 02:49:23 +0000 (10:49 +0800)
app/release/ICSer_V1003_2111011034_release.apk [new file with mode: 0644]
app/release/output.json
app/src/main/java/com/enqualcomm/support/CoreService.java
app/version_code.properties

diff --git a/app/release/ICSer_V1003_2111011034_release.apk b/app/release/ICSer_V1003_2111011034_release.apk
new file mode 100644 (file)
index 0000000..91fa1f5
Binary files /dev/null and b/app/release/ICSer_V1003_2111011034_release.apk differ
index d4a9c28..7de0e1f 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1002,"versionName":"2110281527","enabled":true,"outputFile":"ICSer_V1002_2110281527_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1002_2110281527_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":1003,"versionName":"2111011034","enabled":true,"outputFile":"ICSer_V1003_2111011034_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V1003_2111011034_release.apk","properties":{}}]
\ No newline at end of file
index 5553dea..bfc382e 100644 (file)
@@ -274,8 +274,19 @@ public class CoreService extends Service {
                         //拨打电话走流程
                         //只要判断是否需要发短信即可
                         ICLogger.d("start check need SOS SMS...");
-                        checkSendSMS(resolver);
+                        //是否需要拨号
+                        boolean needCall = checkSendSMS(resolver);
+                        //需要拨号再拨号
+                        if (needCall) {
+                            //50ms后开始拨打电话
+                            mHandler.postDelayed(mTriggerSOSCALLThread, 1000);
+                        }
                     });
+                } else {
+                    if (!Config.SOSNoNeedDial) {
+                        //50ms后开始拨打电话
+                        mHandler.postDelayed(mTriggerSOSCALLThread, 1000);
+                    }
                 }
                 //add by TrillGates=====end
                 runtime.setAlarmType(Runtime.AlarmType.ALARM_SOS);
@@ -294,10 +305,6 @@ public class CoreService extends Service {
                 }
                 //设置5分钟后结束紧急定位模式
                 setEmegencyLocationSTOPAlarm(5);
-                if (!Config.SOSNoNeedDial) {
-                    //50ms后开始拨打电话
-                    mHandler.postDelayed(mTriggerSOSCALLThread, 500);
-                }
             } else if (ACTION_QUERY_WEATHER.equals(param1Intent.getAction())) {
                 ICLogger.i("ACTION_QUERY_WEATHER ");
                 connection.send(protocolAPIHelper.getWeatherMSG(runtime));
@@ -305,14 +312,13 @@ public class CoreService extends Service {
         }
     };
 
-
     /**
      * add by TrillGates.
      * S123的机器,会根据设置项来判断,SOS的时候是否要发送短信
      *
      * @param resolver
      */
-    private void checkSendSMS(ContentResolver resolver) {
+    private boolean checkSendSMS(ContentResolver resolver) {
         Cursor query = resolver.query(Uri.parse(SETTINGS), new String[]{"s_value"}, "s_key=?",
                 new String[]{"sos_notify_type"}, null);
         if (query != null) {
@@ -335,7 +341,7 @@ public class CoreService extends Service {
                     }
                     if (sosNumbers.size() == 0) {
                         ICLogger.d("no sos number...");
-                        return;
+                        return value == 3;
                     }
                     //发送短信
                     //获取短信内容
@@ -354,13 +360,20 @@ public class CoreService extends Service {
                         smsManager.sendSMS(sosNumber, smsContent);
                     }
                 }
+                //    public static final int TYPE_CHECK_PHONE = 1;
+                //    public static final int TYPE_CHECK_SMS = 2;
+                //    public static final int TYPE_CHECK_PHONE_AND_SMS = 3;
+                return value == 1 || value == 3;
             } else {
                 ICLogger.d("no sos settings value...");
             }
             query.close();
         }
+        return true;
     }
 
+
+
     private TriggerSOSCALLThread mTriggerSOSCALLThread = new TriggerSOSCALLThread();
 
     private class TriggerSOSCALLThread implements Runnable {
index c3bb0fc..eff2e3f 100644 (file)
@@ -1,2 +1,2 @@
-#Thu Oct 28 15:27:36 CST 2021\r
-VERSION_CODE=1002\r
+#Mon Nov 01 10:34:52 CST 2021\r
+VERSION_CODE=1003\r