release V417
authorsnickersun <scy@incartech.cn>
Fri, 15 May 2020 13:05:27 +0000 (21:05 +0800)
committersnickersun <scy@incartech.cn>
Fri, 15 May 2020 13:05:27 +0000 (21:05 +0800)
1、在main界面天加更多的info,显示服务器地址等信息
2、修复切换协议不直接生效问题
3、添加beehome消息推送的提示窗口显示。

app/release/ICSer_V416_2005151932_release.apk [deleted file]
app/release/ICSer_V417_2005152102_release.apk [new file with mode: 0644]
app/src/main/java/com/enqualcomm/support/ICSmsManager.java
app/src/main/java/com/enqualcomm/support/utils/ContextProxy.java
app/src/main/java/com/enqualcomm/support/utils/DeviceInfoUtil.java
app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java
app/version_code.properties

diff --git a/app/release/ICSer_V416_2005151932_release.apk b/app/release/ICSer_V416_2005151932_release.apk
deleted file mode 100644 (file)
index b13bed5..0000000
Binary files a/app/release/ICSer_V416_2005151932_release.apk and /dev/null differ
diff --git a/app/release/ICSer_V417_2005152102_release.apk b/app/release/ICSer_V417_2005152102_release.apk
new file mode 100644 (file)
index 0000000..3656bd4
Binary files /dev/null and b/app/release/ICSer_V417_2005152102_release.apk differ
index b3135ae..7a9385b 100644 (file)
@@ -802,6 +802,7 @@ public class ICSmsManager {
                             Config.setProtocolServerAddr(mContext,"",Config.BeehomePort);\r
                             Config.setProtocolServerHost(mContext,Config.BeehomeHost);\r
                             Config.getProtocolNumber();\r
+                            Config.loadServerSettings(runtime);\r
                             sendSMS(phonenumber, "set setprotocol to Beehome Protocol!");\r
                             CoreService.getInstance().disconnect_server();\r
                             CoreService.getInstance().ReConnectToServer();\r
@@ -815,6 +816,7 @@ public class ICSmsManager {
                             Config.setProtocolServerAddr(mContext, "", Config.JiAiPort);\r
                             Config.setProtocolServerHost(mContext, Config.JiAiHost);\r
                             Config.getProtocolNumber();\r
+                            Config.loadServerSettings(runtime);\r
                             sendSMS(phonenumber, "set setprotocol to JiAi Protocol!");\r
                             CoreService.getInstance().disconnect_server();\r
                             CoreService.getInstance().ReConnectToServer();\r
@@ -868,14 +870,6 @@ public class ICSmsManager {
                         if (handleSMS_CMD(from,message)==false){\r
                             //说明不是sms命令,提示短信接收。\r
                             ContextProxy.sendMsgBroadcast(context,message,1);\r
-                            Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
-                                public void call(Long param1Long) {\r
-                                    Intent intent = new Intent();\r
-                                    intent.setAction(DIALOG_ACTION);\r
-                                    intent.putExtra("sms", "SMS");\r
-                                    context.sendBroadcast(intent);\r
-                                }\r
-                            });\r
                         }\r
                     }\r
                 })).start();\r
index 054cec4..3169d28 100644 (file)
@@ -28,10 +28,15 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;\r
 import java.util.Calendar;\r
 import java.util.Iterator;\r
+import java.util.concurrent.TimeUnit;\r
+\r
+import rx.Observable;\r
+import rx.functions.Action1;\r
 \r
 import static android.app.PendingIntent.FLAG_UPDATE_CURRENT;\r
 import static android.content.Intent.FLAG_ACTIVITY_NEW_TASK;\r
 import static com.enqualcomm.support.Constants.ACTION_ISCONNECTED;\r
+import static com.enqualcomm.support.Constants.DIALOG_ACTION;\r
 \r
 public class ContextProxy {\r
   private static final long ONE_WEEK = 604800000L;\r
@@ -319,6 +324,7 @@ public class ContextProxy {
 \r
   public void sendMsgBroadcast(String msg, int msgType) {\r
     sendMsgBroadcast(this.context,msg,msgType);\r
+\r
   }\r
 \r
   public static void sendMsgBroadcast(Context _context,String msg, int msgType) {\r
@@ -326,6 +332,26 @@ public class ContextProxy {
     intent.putExtra("msgType", 0); //0 代表 server下发消息,1代表 SMS消息\r
     intent.putExtra("txtMsg", msg);\r
     _context.sendBroadcast(intent);\r
+\r
+    if (msgType==0){\r
+      Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+        public void call(Long param1Long) {\r
+          Intent intent = new Intent();\r
+          intent.setAction(DIALOG_ACTION);\r
+          intent.putExtra("pushtxt", msg);\r
+          _context.sendBroadcast(intent);\r
+        }\r
+      });\r
+    }else{\r
+      Observable.timer(500L, TimeUnit.MILLISECONDS).subscribe(new Action1<Long>() {\r
+        public void call(Long param1Long) {\r
+          Intent intent = new Intent();\r
+          intent.setAction(DIALOG_ACTION);\r
+          intent.putExtra("sms", msg);\r
+          _context.sendBroadcast(intent);\r
+        }\r
+       });\r
+    }\r
   }\r
   public void sendStheartRateBroadcast(String paramString, int paramInt) {\r
     Intent intent = new Intent();\r
index 0bacfd0..146e140 100644 (file)
@@ -232,7 +232,7 @@ public class DeviceInfoUtil {
             .append(sim.getNetworkType()==SimSignalUtil.IS_2G?"2G":(sim.getNetworkType()==SimSignalUtil.IS_3G)?"3G":(sim.getNetworkType()==SimSignalUtil.IS_4G?"4G":"unknown"))\r
             .append(" [").append(runtime.getSignalStrength()).append(",").append(runtime.getSignalInfo()).append("] ")\r
             .append(runtime.IMEI())\r
-            .append("\n SocketConnection ").append(KeepAlive.isConnected).append(" , HBcycle ").append(runtime.getHeartBeatCycle())\r
+            .append("\n Srv [").append(runtime.getHost()).append(":").append(runtime.getPort()).append("]").append(KeepAlive.isConnected).append(" , HBcycle ").append(runtime.getHeartBeatCycle())\r
             .append("\n ServerConnected is ").append(runtime.isServerProtocolConnected())\r
             .append(" \n Bat ").append(runtime.getBattery()).append(",").append(runtime.getBatteryVotage())\r
             .append(" charged ").append(runtime.isPowerConnected())\r
index 2e0c9f7..f7c3c9d 100644 (file)
@@ -80,7 +80,7 @@ public class ProcessReceiver extends BroadcastReceiver {
   \r
   private float y2 = 0.0F;\r
   \r
-  private void initMyDialog(final Context context, final Contact contact, int app_id) {\r
+  private void initMyDialog(final Context context, final Contact contact, int app_id,String msg) {\r
     String var4 = contact==null?"SMS":contact.name;\r
 \r
     if (this.mDialog == null) {\r
@@ -174,6 +174,18 @@ public class ProcessReceiver extends BroadcastReceiver {
       }).create();\r
       mCustomDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_TOAST);\r
       mCustomDialog.show();\r
+    }else if (app_id ==4) {\r
+      tmpDialog = this.mDialog.setTitle("WEB"+context.getString(R.string.sms_title)).setApp(1);\r
+      StringBuilder var7 = new StringBuilder();\r
+      var7.append(msg);\r
+      mCustomDialog = tmpDialog.setMessage(var7.toString()).setPositiveButton("确定", new DialogInterface.OnClickListener() {\r
+        public void onClick(DialogInterface var1, int var2) {\r
+          var1.dismiss();\r
+          VibrateUtil.getInstance(context).VibrateOn(false);\r
+        }\r
+      }).create();\r
+      mCustomDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_TOAST);\r
+      mCustomDialog.show();\r
     }\r
   }\r
   \r
@@ -238,7 +250,7 @@ public class ProcessReceiver extends BroadcastReceiver {
           isSilence = SharPreferenceUtil.getPrefBoolean(paramContext, "KEY_ISSILENCE", false);\r
           if (contact != null && !isSilence) {\r
             if (!DeviceInfoUtil.isTopActivity(paramContext)) {\r
-              this.initMyDialog(paramContext, contact, 1);\r
+              this.initMyDialog(paramContext, contact, 1,"");\r
               this.playNotificationVoice(paramContext);\r
               VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
             }\r
@@ -251,7 +263,20 @@ public class ProcessReceiver extends BroadcastReceiver {
           isSilence = SharPreferenceUtil.getPrefBoolean(paramContext, "KEY_ISSILENCE", false);\r
           if (sms != null && !isSilence) {\r
             if (!DeviceInfoUtil.isTopActivity(paramContext)) {\r
-              this.initMyDialog(paramContext, null, 3);\r
+              this.initMyDialog(paramContext, null, 3,sms);\r
+              this.playNotificationVoice(paramContext);\r
+              VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
+            }\r
+\r
+            this.screenOn(paramContext);\r
+          }\r
+        }else if (paramIntent.hasExtra("pushtxt")) {\r
+          String sms = paramIntent.getStringExtra("pushtxt");\r
+          SharPreferenceUtil.getPrefBoolean(paramContext, "key_is_resume", false);\r
+          isSilence = SharPreferenceUtil.getPrefBoolean(paramContext, "KEY_ISSILENCE", false);\r
+          if (sms != null && !isSilence) {\r
+            if (!DeviceInfoUtil.isTopActivity(paramContext)) {\r
+              this.initMyDialog(paramContext, null, 4,sms);\r
               this.playNotificationVoice(paramContext);\r
               VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
             }\r
@@ -265,7 +290,7 @@ public class ProcessReceiver extends BroadcastReceiver {
           contact.extra = paramIntent.getStringExtra("date");\r
           isSilence = SharPreferenceUtil.getPrefBoolean(paramContext, "KEY_ISSILENCE", false);\r
           if (contact != null && !isSilence) {\r
-            this.initMyDialog(paramContext, contact, 2);\r
+            this.initMyDialog(paramContext, contact, 2,"");\r
             this.playNotificationVoice(paramContext);\r
             VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
             this.screenOn(paramContext);\r
index 7ff6881..df7eb81 100644 (file)
@@ -1,2 +1,2 @@
-#Fri May 15 19:32:38 CST 2020\r
-VERSION_CODE=416\r
+#Fri May 15 21:02:38 CST 2020\r
+VERSION_CODE=417\r