From: TrillGates Date: Mon, 1 Nov 2021 02:49:23 +0000 (+0800) Subject: 修复了SOS求救类型的判断 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=72df1166d31c0fe6d7fa212a9a2d35d4072edf0d;p=icsupport.git 修复了SOS求救类型的判断 --- diff --git a/app/release/ICSer_V1003_2111011034_release.apk b/app/release/ICSer_V1003_2111011034_release.apk new file mode 100644 index 00000000..91fa1f59 Binary files /dev/null and b/app/release/ICSer_V1003_2111011034_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index d4a9c28c..7de0e1fd 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index 5553deaa..bfc382e9 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -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 { diff --git a/app/version_code.properties b/app/version_code.properties index c3bb0fc9..eff2e3f8 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Thu Oct 28 15:27:36 CST 2021 -VERSION_CODE=1002 +#Mon Nov 01 10:34:52 CST 2021 +VERSION_CODE=1003