fixed a delete too much bug
authorTrillGates <williamtrillgates@gmail.com>
Mon, 13 Sep 2021 12:51:27 +0000 (20:51 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Mon, 13 Sep 2021 12:51:27 +0000 (20:51 +0800)
app/src/main/java/com/enqualcomm/support/Constants.java
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/ic/protocols/protocol_fzd.java

index c30cbe4..3a83579 100644 (file)
@@ -4,6 +4,9 @@ import android.net.Uri;
 
 public interface Constants {
 
+    String ACTION_START_PRACTISE = "com.ic.action_start_practice";
+    String KeyPractice = "cmd";
+
     String ACTION_SHUTDOWN = "com.ic.action.shutdown";
 
     String ACTION_PLAYTIME = "com.ic.action.playtime";
@@ -48,7 +51,6 @@ public interface Constants {
     String ACTION_PRACTICE_REPORT_ALARM = "com.enqualcomm.support.PRACTICE_ALARM";
 
 
-
     Uri CONTACT_URI = Uri.parse("content://com.enqualcomm.support/contact");
 
 
index bd6dc55..b84c578 100644 (file)
@@ -379,14 +379,11 @@ public class CoreService extends Service {
         }
     }
 
-    private Runnable mupdatePracticeData = new Runnable() {
-        @Override
-        public void run() {
-            //ICHttpUtil.uploadData(Runtime.healthInfo.getBufferDataStr(),runtime,TimeUtil.getSystemTime2(),null);
-            Deliver.sendLocationMSG(protocolAPIHelper.getPRACTICE());
-            //发送过后重置
-            Runtime.healthInfo.resetBuffer();
-        }
+    private Runnable updatePracticeData = () -> {
+        //ICHttpUtil.uploadData(Runtime.healthInfo.getBufferDataStr(),runtime,TimeUtil.getSystemTime2(),null);
+        Deliver.sendLocationMSG(protocolAPIHelper.getPRACTICE());
+        //发送过后重置
+        Runtime.healthInfo.resetBuffer();
     };
 
     private final BroadcastReceiver broadcastPracticeCMDReceiver = new BroadcastReceiver() {
@@ -414,7 +411,7 @@ public class CoreService extends Service {
                         //超过30次发送数据给服务器
                         ICLogger.i("自由锻炼结束,发送数据给服务器 "
                                 + Runtime.healthInfo.getBufferData().length);
-                        mHandler.post(mupdatePracticeData);
+                        mHandler.post(updatePracticeData);
                     }
                 }
             }
@@ -910,7 +907,7 @@ public class CoreService extends Service {
 
         //添加自由锻炼 接收
         intentFilter = new IntentFilter();
-        intentFilter.addAction(Constants.ACTION_START_PRACTISE);
+        //intentFilter.addAction(Constants.ACTION_START_PRACTISE);
         registerReceiver(broadcastPracticeCMDReceiver, intentFilter);
 
 
index 1412dfd..1cddb37 100644 (file)
@@ -2341,7 +2341,6 @@ public class protocol_fzd {
         values.put(ICDatabaseHelper.sKey, cmdMap.get(cmd));
         values.put(ICDatabaseHelper.sValue, data);
         resolver.insert(Uri.parse(ICGlobalSettingsProvider.SETTINGS), values);
-
         if (data.equals("1")) {
             Util.setSystemProperties("persist.sys.whitelist.enable", "true");
         } else {