release V504
authorsnickersun <scy@incartech.cn>
Fri, 21 Aug 2020 12:22:17 +0000 (20:22 +0800)
committersnickersun <scy@incartech.cn>
Fri, 21 Aug 2020 12:22:17 +0000 (20:22 +0800)
protocol_beehome protocol_ic 两个协议 BP40 接收到服务器推送文本时,发送广播 action.ic.PushTxtToSMSDB 给Mms.apk 保存到SMS数据库中。

app/release/ICSer_V504_2008212009_release.apk [moved from app/release/ICSer_V503_2008181921_release.apk with 78% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/Constants.java
app/src/main/java/com/enqualcomm/support/utils/ContextProxy.java
app/src/main/java/com/ic/protocols/protocol_beehome.java
app/src/main/java/com/ic/protocols/protocol_ic.java
app/version_code.properties

similarity index 78%
rename from app/release/ICSer_V503_2008181921_release.apk
rename to app/release/ICSer_V504_2008212009_release.apk
index b087b88..cf14047 100644 (file)
Binary files a/app/release/ICSer_V503_2008181921_release.apk and b/app/release/ICSer_V504_2008212009_release.apk differ
index c64cfe5..e48e91c 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":503,"versionName":"2008181921","enabled":true,"outputFile":"ICSer_V503_2008181921_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V503_2008181921_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":504,"versionName":"2008212009","enabled":true,"outputFile":"ICSer_V504_2008212009_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V504_2008212009_release.apk","properties":{}}]
\ No newline at end of file
index 0c9bd3a..72efe0f 100644 (file)
@@ -317,6 +317,11 @@ public interface Constants {
 \r
   public static String PersistFotaServer2Url="persist.sys.ota.host2";\r
 \r
+  //把服务器下发的文本消息作为短信消息存储在短信数据库中,mms.apk会接收此消息并保存到数据库\r
+  //persist.sys.pushtxtAsSMS == false的时候mms.apk会忽略此消息,默认事true,所以要关闭要单独设置\r
+  public static String ActionReceivePushTxt="action.ic.PushTxtToSMSDB";\r
+  public static String ActionSrvPushTxt="action.ic.srvPushTxt";\r
+\r
 /**\r
  *   PreferenceManager.getDefaultSharedPreferences(context) , package name "com.enqualcomm.support"\r
  */\r
index 9cb3d5a..25572df 100644 (file)
@@ -41,6 +41,8 @@ import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;
 import static com.enqualcomm.support.Constants.ACTION_ISCONNECTED;\r
 import static com.enqualcomm.support.Constants.ACTION_KEEPSIT_ALARM;\r
 import static com.enqualcomm.support.Constants.ACTION_SIT_ALARM;\r
+import static com.enqualcomm.support.Constants.ActionReceivePushTxt;\r
+import static com.enqualcomm.support.Constants.ActionSrvPushTxt;\r
 import static com.enqualcomm.support.Constants.DIALOG_ACTION;\r
 \r
 public class ContextProxy {\r
@@ -327,9 +329,15 @@ public class ContextProxy {
     this.context.sendBroadcast(intent);\r
   }\r
 \r
+  public void saveMstToSMSDB(String msg){\r
+    Intent intent = new Intent();\r
+    intent.setAction(ActionReceivePushTxt);\r
+    intent.putExtra("txtMsg", msg);\r
+    intent.addFlags(FLAG_ACTIVITY_NEW_TASK);\r
+    this.context.sendBroadcast(intent);\r
+  }\r
   public void sendMsgBroadcast(String msg, int msgType) {\r
     sendMsgBroadcast(this.context,msg,msgType);\r
-\r
   }\r
   private static void play_waning_notify(Context context){\r
     AudioService.getInstance().play(context.getAssets(), "warning.mp3");\r
@@ -354,7 +362,7 @@ public class ContextProxy {
               e.printStackTrace();\r
             }\r
           }\r
-          Intent intent = new Intent("action.ic.srvPushTxt");\r
+          Intent intent = new Intent(ActionSrvPushTxt);\r
           intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息\r
           intent.putExtra("txtMsg", msg);\r
           intent.addFlags(FLAG_ACTIVITY_NEW_TASK);\r
@@ -379,7 +387,7 @@ public class ContextProxy {
               e.printStackTrace();\r
             }\r
           }\r
-          Intent intent = new Intent("action.ic.srvPushTxt");\r
+          Intent intent = new Intent(ActionSrvPushTxt);\r
           intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息\r
           intent.putExtra("txtMsg", msg);\r
           intent.addFlags(FLAG_ACTIVITY_NEW_TASK);\r
@@ -406,7 +414,7 @@ public class ContextProxy {
             }\r
           }\r
 \r
-          Intent intent = new Intent("action.ic.srvPushTxt");\r
+          Intent intent = new Intent(ActionSrvPushTxt);\r
           intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息\r
           intent.putExtra("txtMsg", msg);\r
           intent.addFlags(FLAG_ACTIVITY_NEW_TASK);\r
index 5aa37f0..a8ff2bb 100644 (file)
@@ -1124,6 +1124,7 @@ public class protocol_beehome {
             connection.send(genStringMessage("AP40",msg));\r
             ICLogger.i("received Txt Msg "+txtmsg);\r
             runtime.getContextProxy().sendMsgBroadcast(txtmsg,0);\r
+            runtime.getContextProxy().saveMstToSMSDB(txtmsg);\r
         }else{\r
             ICLogger.i("BP40 format error!");\r
         }\r
index cc15426..b056e68 100644 (file)
@@ -1170,6 +1170,7 @@ public class protocol_ic {
             connection.send(genStringMessage("AP40",msg));\r
             ICLogger.i("received Txt Msg "+txtmsg);\r
             runtime.getContextProxy().sendMsgBroadcast(txtmsg,0);\r
+            runtime.getContextProxy().saveMstToSMSDB(txtmsg);\r
         }else{\r
             ICLogger.i("BP40 format error!");\r
         }\r
index b2601e6..e9912a8 100644 (file)
@@ -1,2 +1,2 @@
-#Tue Aug 18 19:21:41 CST 2020\r
-VERSION_CODE=503\r
+#Fri Aug 21 20:09:36 CST 2020\r
+VERSION_CODE=504\r