S123静音设置,防止重复设置
authorTrillGates <williamtrillgates@gmail.com>
Mon, 25 Oct 2021 08:44:20 +0000 (16:44 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Mon, 25 Oct 2021 08:44:20 +0000 (16:44 +0800)
app/release/ICSer_V981_2110251558_release.apk [moved from app/release/ICSer_V979_2110201800_release.apk with 77% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/ic/protocols/protocol_s123.java
app/version_code.properties

similarity index 77%
rename from app/release/ICSer_V979_2110201800_release.apk
rename to app/release/ICSer_V981_2110251558_release.apk
index a7f936b..a2fb69b 100644 (file)
Binary files a/app/release/ICSer_V979_2110201800_release.apk and b/app/release/ICSer_V981_2110251558_release.apk differ
index 3df6eac..0b09e33 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":979,"versionName":"2110201800","enabled":true,"outputFile":"ICSer_V979_2110201800_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V979_2110201800_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":981,"versionName":"2110251558","enabled":true,"outputFile":"ICSer_V981_2110251558_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V981_2110251558_release.apk","properties":{}}]
\ No newline at end of file
index 3080584..5ae9100 100644 (file)
@@ -371,10 +371,17 @@ public class CoreService extends Service {
 
     private void trigger_SOS_Call() {
         try {
-            Intent intent = new Intent("com.eqc.shutdown_sos");
-            intent.putExtra("type", 1);
-            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-            this.startActivity(intent);
+            //查询有没有IC的sos,如果有就用IC的SOS
+            Intent icIntent = getPackageManager().getLaunchIntentForPackage("com.ic.sos");
+            if (icIntent != null) {
+                icIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                startActivity(icIntent);
+            } else {
+                Intent intent = new Intent("com.eqc.shutdown_sos");
+                intent.putExtra("type", 1);
+                intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                this.startActivity(intent);
+            }
         } catch (Exception e) {
             e.printStackTrace();
         }
@@ -450,7 +457,6 @@ public class CoreService extends Service {
                 coreService.getFZDWeatherInfo();
                 coreService.sendAntiStatus();
             }, 30 * 1000);
-
         }
 
         public void onReceive(StringMessage param1StringMessage) {
index e26d72c..2a65658 100644 (file)
@@ -7,7 +7,6 @@ import android.content.ContentValues;
 import android.content.Context;
 import android.content.Intent;
 import android.database.Cursor;
-import android.media.AudioManager;
 import android.net.Uri;
 import android.os.Environment;
 import android.os.Handler;
@@ -49,7 +48,6 @@ import com.enqualcomm.support.utils.CameraUtil;
 import com.enqualcomm.support.utils.Connection;
 import com.enqualcomm.support.utils.ICAudioManager;
 import com.enqualcomm.support.utils.ICLogger;
-import com.enqualcomm.support.utils.ProfileManager;
 import com.enqualcomm.support.utils.SharePreferenceUtil;
 import com.enqualcomm.support.utils.TemperatureUtil;
 import com.enqualcomm.support.utils.TimeUtil;
@@ -4024,14 +4022,6 @@ public class protocol_s123 {
         if (split.length == 4) {
             String indexId = split[2];
             String value = split[3];
-            Context context = mRuntime.getContextProxy().context;
-            AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
-            //更新设置
-            if ("1".equals(value)) {
-                ProfileManager.silentAll(context, audioManager);
-            } else {
-                ProfileManager.restoreSilent(context, audioManager);
-            }
             //修改数据库
             updateSettingValue("key_silent", value);
             //返回消息
@@ -4321,11 +4311,24 @@ public class protocol_s123 {
 
     private void updateSettingValue(String key, String value) {
         ContentResolver resolver = mRuntime.getContextProxy().getResolver();
+        //先查询,如果已经是当前值了,就不要去更新了
+        Uri parse = Uri.parse(ICGlobalSettingsProvider.SETTINGS);
+        Cursor query = resolver.query(parse, new String[]{"s_value"}, "s_key=?", new String[]{key}, null);
+        if (query != null) {
+            if (query.moveToNext()) {
+                String string = query.getString(0);
+                if (value.equals(string)) {
+                    ICLogger.d("值一样,不做修改.");
+                    return;
+                }
+                query.close();
+            }
+        }
         ContentValues values = new ContentValues();
         values.put(ICDatabaseHelper.sKey, key);
         //把值保存到数据库中,相机会就监听数据库值的变化,做出响应
         values.put(ICDatabaseHelper.sValue, value);
-        resolver.insert(Uri.parse(ICGlobalSettingsProvider.SETTINGS), values);
+        resolver.insert(parse, values);
     }
 
     /**
index ce820e1..7808bfc 100644 (file)
@@ -1,2 +1,2 @@
-#Wed Oct 20 18:00:38 CST 2021\r
-VERSION_CODE=979\r
+#Mon Oct 25 15:58:30 CST 2021\r
+VERSION_CODE=981\r