release V695
authorsnickersun <scy@incartech.cn>
Thu, 12 Nov 2020 07:46:53 +0000 (15:46 +0800)
committersnickersun <scy@incartech.cn>
Thu, 12 Nov 2020 07:46:53 +0000 (15:46 +0800)
protocol_jiai  消息未读标志设置
解决震动设置无效问题
窗口弹出会被置入后台问题。

app/release/ICSer_V695_2011121531_release.apk [moved from app/release/ICSer_V692_2011112333_release.apk with 78% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/utils/ContextProxy.java
app/src/main/java/com/enqualcomm/support/utils/CustomDialog.java
app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java
app/src/main/java/com/enqualcomm/support/utils/Util.java
app/src/main/java/com/enqualcomm/support/utils/VibrateUtil.java
app/src/main/java/com/ic/protocols/protocol_jiai.java
app/src/main/res/layout/dialog_normal_layout.xml
app/version_code.properties

similarity index 78%
rename from app/release/ICSer_V692_2011112333_release.apk
rename to app/release/ICSer_V695_2011121531_release.apk
index 5975996..0009235 100644 (file)
Binary files a/app/release/ICSer_V692_2011112333_release.apk and b/app/release/ICSer_V695_2011121531_release.apk differ
index e794536..a4e240b 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":692,"versionName":"2011112333","enabled":true,"outputFile":"ICSer_V692_2011112333_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V692_2011112333_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":695,"versionName":"2011121531","enabled":true,"outputFile":"ICSer_V695_2011121531_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V695_2011121531_release.apk","properties":{}}]
\ No newline at end of file
index 980894e..e8541ba 100644 (file)
@@ -392,7 +392,7 @@ public class ContextProxy {
         }\r
       },50);\r
 \r
-    }else  if (msgType==2){\r
+    }else  if (msgType==2) {\r
       new Handler().postDelayed(new Runnable() {\r
         @Override\r
         public void run() {\r
@@ -407,7 +407,7 @@ public class ContextProxy {
             VibrateUtil.getInstance(_context).VibrateOnOnce(true);\r
             Util.mSleep(2000);\r
           }\r
-          if(Config.noBroadCastPushTxtNotify==false) {\r
+          if (Config.noBroadCastPushTxtNotify == false) {\r
             Intent intent = new Intent(ActionSrvPushTxt);\r
             intent.putExtra("msgType", msgType); //0 代表 server下发消息,1代表 SMS消息,2代表有提示音的消息\r
             intent.putExtra("txtMsg", msg);\r
@@ -415,8 +415,28 @@ public class ContextProxy {
             _context.sendBroadcast(intent);\r
           }\r
         }\r
-      },50);\r
+      }, 50);\r
+\r
+    }else if (msgType==3){ //专门给需要回复的消息\r
+\r
+      new Handler().postDelayed(new Runnable() {\r
+        @Override\r
+        public void run() {\r
+          if (Config.noPushTxtNotifyDialog == false) {\r
+            Intent intent = new Intent();\r
+            intent.setAction(DIALOG_ACTION);\r
+            intent.putExtra("pushtxt", msg);\r
+            intent.putExtra("needreply",true);\r
+            _context.sendBroadcast(intent);\r
+          } else {\r
+            WakeLockUtil.ScreenOnWakeLockTemperary(_context);\r
+            play_waning_notify(_context);\r
+            VibrateUtil.getInstance(_context).VibrateOnOnce(true);\r
+            Util.mSleep(2000);\r
+          }\r
 \r
+        }\r
+      },50);\r
     }else{\r
 \r
       new Handler().postDelayed(new Runnable() {\r
index 5886f01..c76545d 100644 (file)
@@ -4,15 +4,19 @@ package com.enqualcomm.support.utils;
 import android.app.Dialog;\r
 import android.content.Context;\r
 import android.content.DialogInterface.OnClickListener;\r
+import android.os.Bundle;\r
+import android.view.Display;\r
 import android.view.LayoutInflater;\r
 import android.view.View;\r
 import android.view.ViewGroup;\r
 import android.view.ViewGroup.LayoutParams;\r
+import android.view.Window;\r
 import android.widget.Button;\r
 import android.widget.ImageButton;\r
 import android.widget.LinearLayout;\r
 import android.widget.TextView;\r
 \r
+import com.enqualcomm.support.Config;\r
 import com.enqualcomm.support.R;\r
 \r
 public class CustomDialog extends Dialog {\r
@@ -24,6 +28,7 @@ public class CustomDialog extends Dialog {
     super(var1, var2);\r
   }\r
 \r
+\r
   public static class Builder {\r
     private int app_id;\r
     private View contentView;\r
@@ -40,6 +45,17 @@ public class CustomDialog extends Dialog {
       this.context = var1;\r
     }\r
 \r
+    private void resizewindow(){\r
+      if(Config.custom_name.equals("YQ")||Config.custom_name.equals("YQ_EN")) {\r
+        if(mDialog!=null)\r
+        {\r
+          Window window =mDialog.getWindow();\r
+          ViewGroup.LayoutParams windowLayoutParams = window.getAttributes(); // 获取对话框当前的参数值\r
+          windowLayoutParams.width = 200;//(int) (display.getWidth() * 0.7); // 宽度设置为屏幕的0.95\r
+          windowLayoutParams.height = 200;//(int) (display.getHeight() * 0.6); // 高度设置为屏幕的0.6\r
+        }\r
+      }\r
+    }\r
     private CustomDialog getDialogInstance() {\r
 \r
       this.mDialog = new CustomDialog(this.context, R.style.Dialog);\r
@@ -99,6 +115,8 @@ public class CustomDialog extends Dialog {
       }\r
 \r
       this.mDialog.setContentView(view);\r
+      mDialog.setCanceledOnTouchOutside(false);\r
+      resizewindow();\r
       return this.mDialog;\r
     }\r
 \r
index 1a3d039..2ab3655 100644 (file)
@@ -90,7 +90,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,String msg) {\r
+  private void initMyDialog(final Context context, final Contact contact, int app_id,String msg,boolean needreply) {\r
     String var4 = contact==null?"SMS":contact.name;\r
 \r
     if (this.mDialog == null) {\r
@@ -188,26 +188,32 @@ public class ProcessReceiver extends BroadcastReceiver {
       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(context.getString(R.string.ok), new DialogInterface.OnClickListener() {\r
-        public void onClick(DialogInterface var1, int var2) {\r
-          var1.dismiss();\r
-          VibrateUtil.getInstance(context).VibrateOn(false);\r
-\r
 \r
-          if(CoreService.getInstance()!=null) {\r
-            Runtime runtime=CoreService.getInstance().getRuntime();\r
-            if(Config.custom_name.equals("YQ") || Config.custom_name.equals("YQ_EN"))\r
-            {\r
-              runtime.setAlarmType(Runtime.AlarmType.ALARM_MSGREAD);\r
-              Config.setLastUnReadMessage(CoreService.getInstance(),"");\r
-              Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
-            }else{\r
-              CoreService.getInstance().getConnection().send(protocolAPIHelper.getPushTxtReadFlagToSrvMSG(runtime));\r
+      if (needreply) {\r
+        mCustomDialog = tmpDialog.setMessage(var7.toString()).setPositiveButton(context.getString(R.string.ok), new DialogInterface.OnClickListener() {\r
+          public void onClick(DialogInterface var1, int var2) {\r
+            var1.dismiss();\r
+            VibrateUtil.getInstance(context).VibrateOn(false);\r
+            if (CoreService.getInstance() != null) {\r
+              Runtime runtime = CoreService.getInstance().getRuntime();\r
+              if (Config.custom_name.equals("YQ") || Config.custom_name.equals("YQ_EN")) {\r
+                runtime.setAlarmType(Runtime.AlarmType.ALARM_MSGREAD);\r
+                Config.setLastUnReadMessage(CoreService.getInstance(), "");\r
+                Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+              } else {\r
+                CoreService.getInstance().getConnection().send(protocolAPIHelper.getPushTxtReadFlagToSrvMSG(runtime));\r
+              }\r
             }\r
-\r
           }\r
-        }\r
-      }).create();\r
+        }).create();\r
+      }else{\r
+        mCustomDialog = tmpDialog.setMessage(var7.toString()).setPositiveButton(context.getString(R.string.ok), new DialogInterface.OnClickListener() {\r
+          public void onClick(DialogInterface var1, int var2) {\r
+            var1.dismiss();\r
+            VibrateUtil.getInstance(context).VibrateOn(false);\r
+          }\r
+        }).create();\r
+      }\r
       mCustomDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_TOAST);\r
       mCustomDialog.show();\r
     } else if (app_id ==5) {\r
@@ -416,7 +422,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,"",false);\r
               this.playNotificationVoice(paramContext);\r
               VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
             }\r
@@ -428,21 +434,25 @@ public class ProcessReceiver extends BroadcastReceiver {
           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, 3,sms);\r
+            //if (!DeviceInfoUtil.isTopActivity(paramContext)) {\r
+              this.initMyDialog(paramContext, null, 3,sms,false);\r
               this.playNotificationVoice(paramContext);\r
               VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
-            }\r
+            //}\r
 \r
             this.screenOn(paramContext);\r
           }\r
         }else if (paramIntent.hasExtra("pushtxt")) {\r
             String sms = paramIntent.getStringExtra("pushtxt");\r
+            boolean needreply=false;\r
+            if (paramIntent.hasExtra("needreply")){\r
+              needreply= paramIntent.getBooleanExtra("needreply",false);\r
+            }\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.initMyDialog(paramContext, null, 4, sms,needreply);\r
                     this.playNotificationVoice(paramContext);\r
                     VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
                 }\r
@@ -454,13 +464,10 @@ public class ProcessReceiver extends BroadcastReceiver {
           SharPreferenceUtil.getPrefBoolean(paramContext, "key_is_resume", false);\r
           isSilence = SharPreferenceUtil.getPrefBoolean(paramContext, "KEY_ISSILENCE", false);\r
           if (finddevtxt != null && !isSilence) {\r
-            if (!DeviceInfoUtil.isTopActivity(paramContext)) {\r
-              this.initMyDialog(paramContext, null, 5,finddevtxt);\r
+              this.initMyDialog(paramContext, null, 5,finddevtxt,false);\r
               this.playFindDevVoice(paramContext);\r
               VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
 \r
-            }\r
-\r
             this.screenOn(paramContext);\r
           }\r
         }else if (paramIntent.hasExtra("takephoto")) {\r
@@ -468,13 +475,11 @@ public class ProcessReceiver extends BroadcastReceiver {
           SharPreferenceUtil.getPrefBoolean(paramContext, "key_is_resume", false);\r
           isSilence = SharPreferenceUtil.getPrefBoolean(paramContext, "KEY_ISSILENCE", false);\r
           if (takephoto != null && !isSilence) {\r
-            if (!DeviceInfoUtil.isTopActivity(paramContext)) {\r
-              this.initMyDialog(paramContext, null, 6,takephoto);\r
+\r
+              this.initMyDialog(paramContext, null, 6,takephoto,false);\r
               this.playNotificationVoice(paramContext);\r
               VibrateUtil.getInstance(paramContext).VibrateOn(true);\r
 \r
-            }\r
-\r
             this.screenOn(paramContext);\r
           }\r
         }\r
index 66e29b6..5668804 100644 (file)
@@ -91,20 +91,29 @@ public class Util {
 \r
         long lasttime_inms=System.currentTimeMillis()-TimeUtil.parseDatetiime(datetime).getTime();\r
         ICLogger.i("有消息"+lasttime_inms/1000 +"秒未读!");\r
-        if ((lasttime_inms>=8*60*1000 && lasttime_inms<=13*60*1000)  //在10分钟,20分钟时都提醒一次。\r
+        if ((lasttime_inms>8*60*1000 && lasttime_inms<=13*60*1000)  //在10分钟,20分钟时都提醒一次。\r
             ||(lasttime_inms>18*60*1000 && lasttime_inms<=23*60*1000))\r
         {\r
 \r
-          if (!Config.custom_name.equals("VitracK")){\r
-            txtmsg = Util.UrlGB2312ToUTF8(txtmsg);\r
+          if (!Config.custom_name.equals("VitracK") ){\r
+            if(Config.protocol_no==Config.PROTOCOL_JIAI){\r
+              txtmsg=Util.decodeUnicode2Utf8(txtmsg);\r
+            }else {\r
+              txtmsg = Util.UrlGB2312ToUTF8(txtmsg);\r
+            }\r
           }\r
           if(Config.custom_name.equals("YQ") || Config.custom_name.equals("YQ_EN"))\r
           {\r
             runtime.setAlarmType(Runtime.AlarmType.ALARM_UNREADMSG);\r
           //  Config.setLastUnReadMessage(CoreService.getInstance(),"");\r
             Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));\r
+\r
           }\r
-          runtime.getContextProxy().sendMsgBroadcast(txtmsg, 0);\r
+          runtime.getContextProxy().sendMsgBroadcast(txtmsg, 3); //需要恢复消息\r
+\r
+          //runtime.getContextProxy().sendMsgBroadcast(txtmsg, 0); //不需要回复\r
+\r
+\r
         }\r
 \r
 \r
index 8baa2c7..465f262 100644 (file)
@@ -20,7 +20,7 @@ public class VibrateUtil {
     private static VibrateUtil vibrateUtil=null;\r
 \r
     private static long patter_item= 1000;\r
-    private long[] patter = {patter_item, 1000, patter_item, 1000}; //1秒开,1秒关,2秒开,50ms关\r
+    private long[] patter = { patter_item, 1000, patter_item,1000}; //1秒开,1秒关,2秒开,50ms关\r
     private long[] patterOnce = {patter_item, 1000}; //1秒开,1秒关,2秒开,50ms关\r
 \r
     /**\r
@@ -33,6 +33,7 @@ public class VibrateUtil {
     public void VibrateOn(boolean on){\r
         if (patter_item>0) {\r
             if (vibrator != null) {\r
+                patter = new long[]{patter_item, 1000, patter_item, 1000};\r
                 if (on)\r
 //                vibrator.vibrate(patter, 0);//一直循环\r
                     vibrator.vibrate(patter, -1);//不循环\r
@@ -44,6 +45,7 @@ public class VibrateUtil {
     public void VibrateOnOnce(boolean on){\r
         if (patter_item>0) {\r
             if (vibrator != null) {\r
+                patterOnce = new long[]{patter_item, 1000};\r
                 if (on)\r
 //                vibrator.vibrate(patter, 0);//一直循环\r
                     vibrator.vibrate(patterOnce, -1);//不循环\r
index c1145eb..5cd8a82 100644 (file)
@@ -1658,13 +1658,14 @@ public static StringMessage AP50(Runtime ds){
             String play_time=cmdlist[5];\r
             String vib_time=cmdlist[6];\r
             ICLogger.i("收到服务器文本 "+txtmsg+" 序号 "+msg_index_no+" , 播放 "+play_time+" 次,震动 "+vib_time+" 次!");\r
+            Config.setLastUnReadMessage(runtime.getContextProxy().context,txtmsg); //保存未读文档\r
             txtmsg=Util.decodeUnicode2Utf8(txtmsg);\r
             StringMessage msg=AP93(cmdindex);\r
             //设定当前工作模式及循环频率\r
             connection.send(msg);\r
             runtime.PushtxtMsg_srv_index=msg_index_no;//给回复AP94用\r
             ICLogger.i("received Txt Msg "+txtmsg);\r
-            runtime.getContextProxy().sendMsgBroadcast(txtmsg,0);\r
+            runtime.getContextProxy().sendMsgBroadcast(txtmsg,3);\r
             runtime.getContextProxy().saveMstToSMSDB(txtmsg);\r
 \r
         }else{\r
index f1917ce..9fe3446 100644 (file)
@@ -17,7 +17,7 @@
             android:id="@id/title"\r
             android:visibility="visible"\r
             android:layout_width="fill_parent"\r
-            android:layout_height="40.0dip"\r
+            android:layout_height="35dip"\r
             android:text="@string/title_alert"\r
             style="@style/text_18_ffffff"\r
             android:textSize="30sp" />\r
index 1c806fc..b8dee78 100644 (file)
@@ -1,2 +1,2 @@
-#Wed Nov 11 23:33:52 CST 2020\r
-VERSION_CODE=692\r
+#Thu Nov 12 15:31:34 CST 2020\r
+VERSION_CODE=695\r