中间版本,正在添加HearRateServer
authorsnickersun <scy@incartech.cn>
Mon, 20 Jan 2020 09:45:23 +0000 (17:45 +0800)
committersnickersun <scy@incartech.cn>
Mon, 20 Jan 2020 09:45:23 +0000 (17:45 +0800)
14 files changed:
app/src/main/AndroidManifest.xml
app/src/main/java/com/ic/protocol/LocationClient.java
app/src/main/java/com/ic/protocol/MySqlitOpenHelper.java
app/src/main/java/com/ic/protocol/ParseUpdate.java
app/src/main/java/com/ic/protocol/adapter/protocolAPIHelper.java
app/src/main/java/com/ic/protocol/bean/Content.java
app/src/main/java/com/ic/protocol/bean/VoiceContent.java
app/src/main/java/com/ic/protocol/bean/heartRateStatus.java
app/src/main/java/com/ic/protocol/service/Initialize.java
app/src/main/java/com/ic/protocol/service/protocolMainServer.java
app/src/main/java/com/ic/protocol/utils/AlarmWakeUp.java
app/src/main/java/com/ic/protocol/utils/DBHelper.java
app/src/main/java/com/ic/protocol/utils/Util.java
app/version_code.properties

index 6a5089d..5072e55 100644 (file)
         </service>
         <service android:name="com.ic.protocol.service.protocolMainServer$InnerService"/>
 
-        <provider android:authorities="com.enqualcomm.support" android:exported="true" android:name="com.ic.protocol.ICContentProvider"/>
+        <provider
+            android:authorities="com.enqualcomm.support"
+            android:exported="true"
+            android:name="com.ic.protocol.ICContentProvider"/>
 
         <receiver android:exported="true" android:name="com.ic.protocol.BootCompleteReceiver">
             <intent-filter>
index e9fb3d4..0e115fa 100644 (file)
@@ -57,9 +57,9 @@ public class LocationClient {
   \r
   private static final int IS_WIFI = 1;\r
   \r
-  public static final String LACATION_CYCLE = "lacation_cycle";\r
+  public static final String LOCATION_CYCLE = "location_cycle";\r
   \r
-  public static final String LACATION_MODE = "lacation_mode";\r
+  public static final String LOCATION_MODE = "location_mode";\r
   \r
   private static final int MAX_SIZE = 50;\r
   \r
@@ -553,13 +553,13 @@ public void updateCellInfo() {
       }catch (Exception e){\r
         e.printStackTrace();\r
       }\r
-      SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LACATION_MODE, mod);\r
+      SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LOCATION_MODE, mod);\r
       runtime.getLocationInstance().setWorkingMod(mod);\r
 //      runtime.getLocationInstance().setLocation_cycle(3);\r
       Logger.i("Set WorkMODE  "+mod +" and reset Location AlarmCycle");\r
       protocolMainServer.getInstance().setLocationAlarm(mod);\r
-//      Logger.i("ResartLACATION_MODE  2");\r
-      runtime.getContextProxy().sendBroadcast(LACATION_MODE,runtime);\r
+//      Logger.i("ResartLOCATION_MODE  2");\r
+      runtime.getContextProxy().sendBroadcast(LOCATION_MODE,runtime);\r
       forceLocation=1;\r
       this.startLocationProcess(mod);\r
       WorkingMod=mod;\r
@@ -599,24 +599,24 @@ public void updateCellInfo() {
     //初始化设定当前工作模式及循环频率\r
     if (SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, "value_setting_ver", 0) == Config.value_setting) {\r
       //如果value_setting_ver = Config.value_setting 表示采用已经保存的模式\r
-      runtime.getLocationInstance().setWorkingMod(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, LACATION_MODE, ICLocation.NORMAL_MOD));\r
-//      runtime.getLocationInstance().setLocation_cycle(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, LACATION_CYCLE, 3));\r
+      runtime.getLocationInstance().setWorkingMod(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, LOCATION_MODE, ICLocation.NORMAL_MOD));\r
+//      runtime.getLocationInstance().setLocation_cycle(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, LOCATION_CYCLE, 3));\r
 //      runtime.getLocationInstance().setLocation_cycle(15);\r
     } else {\r
       //否则设置一个默认值\r
       SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, "value_setting_ver", Config.value_setting);\r
-      SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LACATION_MODE, ICLocation.NORMAL_MOD);\r
-//      SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LACATION_CYCLE, 3);\r
+      SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LOCATION_MODE, ICLocation.NORMAL_MOD);\r
+//      SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LOCATION_CYCLE, 3);\r
       runtime.getLocationInstance().setWorkingMod(ICLocation.NORMAL_MOD);\r
 //      runtime.getLocationInstance().setLocation_cycle(15);\r
     }\r
     StringBuilder stringBuilder = new StringBuilder();\r
     stringBuilder.append("value_setting=");\r
     stringBuilder.append(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, "value_setting_ver", 0));\r
-    stringBuilder.append("LACATION_MODE=");\r
-    stringBuilder.append(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, LACATION_MODE, 1));\r
-    stringBuilder.append("LACATION_CYCLE=");\r
-    stringBuilder.append(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, LACATION_CYCLE, 3));\r
+    stringBuilder.append("LOCATION_MODE=");\r
+    stringBuilder.append(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, LOCATION_MODE, 1));\r
+    stringBuilder.append("LOCATION_CYCLE=");\r
+    stringBuilder.append(SharPreferenceUtil.getPrefInt((runtime.getContextProxy()).context, LOCATION_CYCLE, 3));\r
     Logger.i(stringBuilder.toString());\r
 \r
 \r
index 6b64602..ed93b17 100644 (file)
@@ -50,8 +50,3 @@ public class MySqlitOpenHelper extends SQLiteOpenHelper {
   }\r
 }\r
 \r
-\r
-/* Location:              D:\android\ApkIDE3.3\ApkIDE\Worksrc\com.enqualcomm.support\!\com\enqualcomm\support\MySqlitOpenHelper.class\r
- * Java compiler version: 6 (50.0)\r
- * JD-Core Version:       1.0.7\r
- */
\ No newline at end of file
index c7ace63..3c9053c 100644 (file)
@@ -211,10 +211,10 @@ public class ParseUpdate extends Object implements Observable.OnSubscribe<Update
 //                    EqcAlgorithmNative.native_EqcAlgorithmMethod1(j, k);\r
 //                    intent = new Intent((this.runtime.getContextProxy()).context, com.enqualcomm.support.CoreService.class);\r
 //                    intent.setAction("com.enqualcomm.support.ACTION_STWORKMODE_ALARM");\r
-//                    intent.putExtra("lacation_cycle", k);\r
+//                    intent.putExtra("location_cycle", k);\r
 //                    (this.runtime.getContextProxy()).context.startService(intent);\r
-//                    SharPreferenceUtil.setPrefInt((this.runtime.getContextProxy()).context, "lacation_mode", j);\r
-//                    SharPreferenceUtil.setPrefInt((this.runtime.getContextProxy()).context, "lacation_cycle", k);\r
+//                    SharPreferenceUtil.setPrefInt((this.runtime.getContextProxy()).context, "location_mode", j);\r
+//                    SharPreferenceUtil.setPrefInt((this.runtime.getContextProxy()).context, "location_cycle", k);\r
 //                  }\r
 //                } else {\r
 //                  String str;\r
index 5004d6e..6ab2fb0 100644 (file)
@@ -17,8 +17,8 @@ import com.ic.protocol.utils.Util;
 import java.util.ArrayList;\r
 import java.util.HashMap;\r
 \r
-import static com.ic.protocol.LocationClient.LACATION_CYCLE;\r
-import static com.ic.protocol.LocationClient.LACATION_MODE;\r
+import static com.ic.protocol.LocationClient.LOCATION_CYCLE;\r
+import static com.ic.protocol.LocationClient.LOCATION_MODE;\r
 import static java.lang.Math.abs;\r
 \r
 public class protocolAPIHelper {\r
@@ -488,10 +488,10 @@ public class protocolAPIHelper {
             //设定当前工作模式及循环频率\r
             connection.send(genStringMessage("AP33",msg));\r
             log("reply msg "+msg);\r
-            log("LACATION_MODE  "+LACATION_MODE+" mod "+ mod);\r
+            log("LOCATION_MODE  "+LOCATION_MODE+" mod "+ mod);\r
             SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, "value_setting_ver", Config.value_setting);\r
-            SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LACATION_MODE, mod);\r
-//            SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LACATION_CYCLE, Cycle);\r
+            SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LOCATION_MODE, mod);\r
+//            SharPreferenceUtil.setPrefInt((runtime.getContextProxy()).context, LOCATION_CYCLE, Cycle);\r
             runtime.getLocationInstance().setWorkingMod(mod);\r
             runtime.getLocationInstance().setLocation_cycle(Cycle);\r
 \r
@@ -513,7 +513,7 @@ public class protocolAPIHelper {
     public static String AP49(Runtime ds){\r
         //示例数据:IWAP49,68##\r
         return new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP49))\r
-                .append(CMDSPLIT).append("460")\r
+                .append(CMDSPLIT).append(ds.get)\r
                 .append(CMDEND).toString();\r
 \r
     }\r
index aa44c7b..f9ded19 100644 (file)
@@ -55,16 +55,16 @@ public abstract class Content {
   \r
   public int status;\r
   \r
-  protected Content(int paramInt1, String paramString1, String paramString2, int paramInt2, int paramInt3, int paramInt4, String paramString3, String paramString4, long paramLong) {\r
-    this.category = paramInt1;\r
-    this.content = paramString1;\r
-    this.preview = paramString2;\r
-    this.status = paramInt2;\r
-    this.inOrOut = paramInt3;\r
-    this.contactCategory = paramInt4;\r
-    this.contactNumber = paramString3;\r
-    this.serverTime = paramString4;\r
-    this.localTime = paramLong;\r
+  protected Content(int _category, String _content, String _preview, int _status, int _inOrOut, int _contactCategory, String _contactNumber, String _serverTime, long _localtime) {\r
+    this.category = _category;\r
+    this.content = _content;\r
+    this.preview = _preview;\r
+    this.status = _status;\r
+    this.inOrOut = _inOrOut;\r
+    this.contactCategory = _contactCategory;\r
+    this.contactNumber = _contactNumber;\r
+    this.serverTime = _serverTime;\r
+    this.localTime = _localtime;\r
   }\r
   \r
   public String toString() {\r
index 7467fae..4930e48 100644 (file)
@@ -6,41 +6,41 @@ import java.io.File;
 import java.util.ArrayList;\r
 \r
 public class VoiceContent extends Content {\r
-  private VoiceContent(String paramString1, String paramString2, int paramInt1, int paramInt2, int paramInt3, String paramString3, String paramString4, long paramLong)\r
+  private VoiceContent(String _content, String _preview, int _status, int _inOrOut, int _contactCategory, String _contactNumber, String _serverTime, long _localtime)\r
   {\r
-    super(1, paramString1, paramString2, paramInt1, paramInt2, paramInt3, paramString3, paramString4, paramLong);\r
+    super(1, _content, _preview, _status, _inOrOut, _contactCategory, _contactNumber, _serverTime, _localtime);\r
 \r
   }\r
   \r
-  public static VoiceContent from(VoiceContent paramVoiceContent, byte[] paramArrayOfByte, File paramFile) {\r
-    byte b = paramArrayOfByte[0];\r
+  public static VoiceContent from(VoiceContent _voiceContent, byte[] amrData, File amrFilepath) {\r
+    byte b = amrData[0];\r
     byte[] arrayOfByte = new byte[b];\r
-    System.arraycopy(paramArrayOfByte, 1, arrayOfByte, 0, b);\r
+    System.arraycopy(amrData, 1, arrayOfByte, 0, b);\r
     ArrayList arrayList = Util.split(arrayOfByte, (byte)59, 0);\r
     StringBuilder stringBuilder1 = new StringBuilder();\r
     stringBuilder1.append(new String((byte[])arrayList.get(1)));\r
     stringBuilder1.append(new String((byte[])arrayList.get(2)));\r
     String str2 = stringBuilder1.toString();\r
     String str3 = new String((byte[])arrayList.get(4));\r
-    int i = paramArrayOfByte.length - 1 - b;\r
-    int j = paramArrayOfByte.length;\r
+    int i = amrData.length - 1 - b;\r
+    int j = amrData.length;\r
     StringBuilder stringBuilder2 = new StringBuilder();\r
     stringBuilder2.append(str3);\r
     stringBuilder2.append(".amr");\r
-    String str1 = Util.saveFile(paramArrayOfByte, j - i, i, paramFile, stringBuilder2.toString());\r
+    String str1 = Util.saveFile(amrData, j - i, i, amrFilepath, stringBuilder2.toString());\r
     i = Util.getDuration(str1);\r
-    paramVoiceContent.preview = (paramVoiceContent.content = str1).valueOf(i);\r
-    paramVoiceContent.status = 2;\r
-    paramVoiceContent.serverTime = str2;\r
-    return paramVoiceContent;\r
+    _voiceContent.preview = (_voiceContent.content = str1).valueOf(i);\r
+    _voiceContent.status = 2;\r
+    _voiceContent.serverTime = str2;\r
+    return _voiceContent;\r
   }\r
   \r
-  public static VoiceContent placeHolderIn(int paramInt, String paramString1, String paramString2) {\r
-    return new VoiceContent(paramString2, null, 1, 1, paramInt, paramString1, null, System.currentTimeMillis());\r
+  public static VoiceContent placeHolderIn(int _contactCategory, String _contactNumber, String _content) {\r
+    return new VoiceContent(_content, null, 1, 1, _contactCategory, _contactNumber, null, System.currentTimeMillis());\r
   }\r
   \r
-  public static VoiceContent placeHolderOut(int paramInt, String paramString1, String paramString2) {\r
-    return new VoiceContent(paramString2, null, 1, 2, paramInt, paramString1, null, System.currentTimeMillis());\r
+  public static VoiceContent placeHolderOut(int _contactCategory, String _contactNumber, String _content) {\r
+    return new VoiceContent(_content, null, 1, 2, _contactCategory, _contactNumber, null, System.currentTimeMillis());\r
   }\r
 }\r
 \r
index a295076..742bf84 100644 (file)
@@ -1,5 +1,7 @@
 package com.ic.protocol.bean;\r
 \r
+import com.ic.jni.ICJniUtils;\r
+\r
 public class heartRateStatus {\r
 \r
     private int lastHeartrate;\r
@@ -14,10 +16,25 @@ public class heartRateStatus {
     } ;\r
 \r
     public boolean isHeartrRateExists(){\r
-        return true;\r
+        return ICJniUtils.isPPGavailable()==1;\r
     }\r
 \r
     public HEARTRATE_WORKINGSTAT getHeartrateWorkingStat(){\r
+\r
+        int PPG=ICJniUtils.getPPG();//调用底层函数保证状态更新。\r
+        if (ICJniUtils.isPPGStarted()==1 ){\r
+            if ( ICJniUtils.isWeared()==1) {\r
+                if (PPG > 0) {\r
+                    currentStat = HEARTRATE_WORKINGSTAT.HEARTRATE_TEST_SUCCESS;\r
+                } else {\r
+                    currentStat = HEARTRATE_WORKINGSTAT.HEARTRATE_WARED_AND_TESTING;\r
+                }\r
+            }else{\r
+                currentStat=HEARTRATE_WORKINGSTAT.HEARTRATE_NOTWARED;\r
+            }\r
+        }else{\r
+            currentStat=HEARTRATE_WORKINGSTAT.HEARTRATE_CLOSED;\r
+        }\r
         return currentStat;\r
     }\r
 \r
index 260c957..adaf6ef 100644 (file)
@@ -61,8 +61,8 @@ public class Initialize extends AbstractConnectionService {
       return false; \r
     if (paramRuntime.IMSI() != null && !paramRuntime.IMSI().startsWith("46001"))\r
       paramRuntime.IMSI().startsWith("46006"); \r
-    int i = SharPreferenceUtil.getPrefInt((paramRuntime.getContextProxy()).context, "lacation_mode", 2);\r
-    int j = SharPreferenceUtil.getPrefInt((paramRuntime.getContextProxy()).context, "lacation_cycle", 3);\r
+    int i = SharPreferenceUtil.getPrefInt((paramRuntime.getContextProxy()).context, "location_mode", 2);\r
+    int j = SharPreferenceUtil.getPrefInt((paramRuntime.getContextProxy()).context, "location_cycle", 3);\r
     StringBuilder stringBuilder = new StringBuilder();\r
     stringBuilder.append(i);\r
     stringBuilder.append("@");\r
index fe8fb1e..945724e 100644 (file)
@@ -345,7 +345,7 @@ public class protocolMainServer extends Service {
     }\r
     private void wakeUpFromSleep() {\r
         this.startAlarmCount = 0;\r
-        alarmCycle = 3;\r
+//        alarmCycle = 1;\r
         setAlarm(alarmCycle);\r
         this.runtime.getContextProxy().sendBroadcast(ACTION_EQC_ALARM, this.runtime);\r
         this.connection.open();\r
@@ -514,7 +514,7 @@ public class protocolMainServer extends Service {
                 if (this.startAlarmCount < 5 && alarmCycle == 1) {\r
                     this.startAlarmCount++;\r
                 } else {\r
-                    alarmCycle = SharPreferenceUtil.getPrefInt((this.runtime.getContextProxy()).context, "lacation_cycle", 3);\r
+                    alarmCycle = SharPreferenceUtil.getPrefInt((this.runtime.getContextProxy()).context, "location_cycle", 3);\r
                 }\r
                 AlarmWakeUp.setAlarmWakeUpTime();\r
                 boolean screenon = ((PowerManager)getSystemService(POWER_SERVICE)).isScreenOn();\r
@@ -595,7 +595,7 @@ public class protocolMainServer extends Service {
                         }\r
                         if (Constants.STWORKMODE_ALARM.equals(paramIntent.getAction())) {\r
                             if (this.startAlarmCount >= 5) {\r
-                                alarmCycle = paramIntent.getIntExtra("lacation_cycle", 3);\r
+                                alarmCycle = paramIntent.getIntExtra("location_cycle", 3);\r
                                 setAlarm(alarmCycle);\r
                             }\r
                             stringBuilder1 = new StringBuilder();\r
index 57b20e8..56b8713 100644 (file)
@@ -15,7 +15,7 @@ public class AlarmWakeUp {
   \r
   public static void isNeedWakeUpAlarm(Runtime dev) {\r
     long l = SystemClock.elapsedRealtime();\r
-    int i = SharPreferenceUtil.getPrefInt((dev.getContextProxy()).context, "lacation_cycle", 3);\r
+    int i = SharPreferenceUtil.getPrefInt((dev.getContextProxy()).context, "location_cycle", 3);\r
     if (l - lastAlarmTime > ((i + 1) * 60 * 1000)) {\r
       ComponentName componentName = new ComponentName("com.ic.protocol", "com.ic.protocol.service.protocolMainServer");\r
       Intent intent = (new Intent(protocolMainServer.ACTION_ALARM)).setComponent(componentName);\r
index f4f4e62..1b04c55 100644 (file)
@@ -1,7 +1,3 @@
-//\r
-// Source code recreated from a .class file by IntelliJ IDEA\r
-// (powered by Fernflower decompiler)\r
-//\r
 \r
 package com.ic.protocol.utils;\r
 \r
index d1c8ec0..bc65229 100644 (file)
@@ -29,9 +29,9 @@ import com.ic.protocol.bean.Runtime;
 import static android.content.Context.CONNECTIVITY_SERVICE;\r
 \r
 public class Util {\r
-  public static Charset UTF_16 = (UTF_8 = Charset.forName("UTF-8")).forName("UTF-16LE");\r
+  public static Charset UTF_16 = Charset.forName("UTF-16LE");\r
   \r
-  public static Charset UTF_8;\r
+  public static Charset UTF_8 = Charset.forName("UTF-8");\r
 \r
 \r
   /**\r
@@ -47,7 +47,9 @@ public class Util {
         String[] ipAddressArr = new String[inetAddressArr.length];\r
 \r
         for (int i = 0; i < inetAddressArr.length; i++) {\r
-          serverip.append( inetAddressArr[i].getHostAddress());;\r
+          String ip=inetAddressArr[i].getHostAddress();\r
+          serverip.append( ip);\r
+          ipAddressArr[i]=ip;\r
         }\r
       }\r
     } catch (Exception e) {\r
@@ -70,7 +72,8 @@ public class Util {
     }\r
     return str;\r
   }\r
-  public static WifiConfiguration GetconfigWifiInfo(Context paramContext, String paramString1, String paramString2, String paramString3) { // Byte code:\r
+  public static WifiConfiguration GetconfigWifiInfo(Context paramContext, String paramString1, String paramString2, String paramString3) {\r
+\r
     WifiConfiguration wificonfig=new WifiConfiguration();\r
     return wificonfig;\r
   }\r
@@ -142,52 +145,6 @@ public class Util {
 //          Logger.i(stringBuilder.toString());\r
 //          return null;\r
 //        }\r
-//    } else {\r
-//      if (Build.VERSION.SDK_INT == 16) {\r
-//        Logger.i("connectWifiByReflectMethod road 2");\r
-//        return null;\r
-//      }\r
-//      if (Build.VERSION.SDK_INT >= 14 && Build.VERSION.SDK_INT < 16) {\r
-//        Logger.i("connectWifiByReflectMethod road 3");\r
-//        Method[] arrayOfMethod = wifiManager.getClass().getDeclaredMethods();\r
-//        int i = arrayOfMethod.length;\r
-//        paramContext = null;\r
-//        byte b = 0;\r
-//        while (b < i) {\r
-//          Method method3 = arrayOfMethod[b];\r
-//          Method method2 = paramContext;\r
-//          if ("connectNetwork".equalsIgnoreCase(method3.getName())) {\r
-//            Class[] arrayOfClass = method3.getParameterTypes();\r
-//            method2 = paramContext;\r
-//            if (arrayOfClass != null) {\r
-//              method2 = paramContext;\r
-//              if (arrayOfClass.length > 0) {\r
-//                method2 = paramContext;\r
-//                if ("int".equalsIgnoreCase(arrayOfClass[0].getName()))\r
-//                  method2 = method3;\r
-//              }\r
-//            }\r
-//          }\r
-//          b++;\r
-//          method1 = method2;\r
-//        }\r
-//        method = method1;\r
-//        if (method1 != null)\r
-//          try {\r
-//            method1.invoke(wifiManager, new Object[] { Integer.valueOf(paramInt) });\r
-//            return method1;\r
-//          } catch (Exception method1) {\r
-//            method1.printStackTrace();\r
-//            StringBuilder stringBuilder = new StringBuilder();\r
-//            stringBuilder.append("connectWifiByReflectMethod Android ");\r
-//            stringBuilder.append(Build.VERSION.SDK_INT);\r
-//            stringBuilder.append(" error!");\r
-//            Logger.i(stringBuilder.toString());\r
-//            return null;\r
-//          }\r
-//        return method;\r
-//      }\r
-//      return null;\r
 //    }\r
     return null;\r
   }\r
index 9a7e295..5cc6ea1 100644 (file)
@@ -1,2 +1,2 @@
-#Thu Jan 16 18:40:41 CST 2020\r
-VERSION_CODE=327\r
+#Sun Jan 19 16:03:14 CST 2020\r
+VERSION_CODE=328\r