关机添加3次震动
authorTrillGates <williamtrillgates@gmail.com>
Tue, 19 Oct 2021 07:19:05 +0000 (15:19 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Tue, 19 Oct 2021 07:19:05 +0000 (15:19 +0800)
app/release/ICSer_V906_2110191455_release.apk [moved from app/release/ICSer_V904_2110142133_release.apk with 78% similarity]
app/release/output.json
app/src/main/java/com/enqualcomm/support/CoreService.java
app/src/main/java/com/enqualcomm/support/service/Deliver.java
app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java
app/src/main/java/com/enqualcomm/support/utils/VibrateUtil.java
app/src/main/java/com/ic/protocols/protocol_beehome.java
app/version_code.properties

similarity index 78%
rename from app/release/ICSer_V904_2110142133_release.apk
rename to app/release/ICSer_V906_2110191455_release.apk
index ffd0438..d712442 100644 (file)
Binary files a/app/release/ICSer_V904_2110142133_release.apk and b/app/release/ICSer_V906_2110191455_release.apk differ
index bea4a2f..b7f7712 100644 (file)
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":904,"versionName":"2110142133","enabled":true,"outputFile":"ICSer_V904_2110142133_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V904_2110142133_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":906,"versionName":"2110191455","enabled":true,"outputFile":"ICSer_V906_2110191455_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V906_2110191455_release.apk","properties":{}}]
\ No newline at end of file
index e56d98f..6ce29fb 100644 (file)
@@ -235,6 +235,12 @@ public class CoreService extends Service {
                 }
                 setEmegencyLocationSTOPAlarm(5);
             } else if (ACTION_LOCAL_SOS_ACTION.endsWith(param1Intent.getAction())) {
+                //如果不允许拨号就不玩了
+                String isPhoneEnable = Util.getSystemProperties("persist.sys.phone.enable");
+                ICLogger.d("isPhoneEnable ==> " + isPhoneEnable);
+                if ("0".equals(isPhoneEnable)) {
+                    return;
+                }
                 VibrateUtil.getInstance(runtime.getContextProxy().context).vibrateOn(true);
 //               if( param1Intent.getIntExtra("type", 1) == 1) {
                 if (Config.needHRSTestOnSOS) {
@@ -1285,12 +1291,7 @@ public class CoreService extends Service {
                         PendingIntent.FLAG_UPDATE_CURRENT);
                 AlarmHelper.setPowerOffAlarm(context, pendingIntent, hour, min);
                 //关机
-                mHandler.postDelayed(new Runnable() {
-                    @Override
-                    public void run() {
-                        Util.shutdown();
-                    }
-                }, 1000);
+                mHandler.postDelayed(() -> Util.shutdown(), 1000);
             }
             this.invokeHandlerServiceChain.processUserRequest(paramIntent, this.connection, this.runtime);
 
index 582dc7e..f66743c 100644 (file)
@@ -32,6 +32,7 @@ import com.enqualcomm.support.utils.SimSignalUtil;
 import com.enqualcomm.support.utils.TemperatureUtil;
 import com.enqualcomm.support.utils.TimeUtil;
 import com.enqualcomm.support.utils.Util;
+import com.enqualcomm.support.utils.VibrateUtil;
 import com.ic.protocols.protocolAPIHelper;
 
 import java.util.concurrent.LinkedBlockingDeque;
@@ -158,8 +159,8 @@ public class Deliver extends AbstractConnectionService {
                     .append("\nDate ").append(msg.getDate()).append(msg.getTime())
                     .append("\nflag ").append(msg.haveSent())
                     .append("\ntopic ").append(msg.cmd());
-            if(Config.protocol_no == Config.PROTOCOL_GATOR){
-                if(msg.isFromCache().length()>8) {
+            if (Config.protocol_no == Config.PROTOCOL_GATOR) {
+                if (msg.isFromCache().length() > 8) {
                     sb.append("\norigin ").append(AESCipher.aesDecryptStringFixedKey(msg.isFromCache().substring(8)));
                 }
             }
@@ -420,7 +421,7 @@ public class Deliver extends AbstractConnectionService {
                 ICLogger.i("voicepacket " + voicepacket.getName() + " filetype " + voicepacket.getFiletype() + " , datatype " + voicepacket.getDateType() + " " + voicepacket.getPacketTime() + " send " + (voicepacket.getCurrentIndexToSent() + 1) + "/" + voicepacket.getPacketCount());
                 if (mConnection instanceof NettyConnection) {
                     ((NettyConnection) mConnection).sendMsg("RAWPACKET",
-                            protocolAPIHelper.getVoicePacketItem(voicepacket.getSender(),voicepacket.getDurationHex(),voicepacket.getPacketTime(),
+                            protocolAPIHelper.getVoicePacketItem(voicepacket.getSender(), voicepacket.getDurationHex(), voicepacket.getPacketTime(),
                                     voicepacket.getPacketCount(),
                                     (voicepacket.getCurrentIndexToSent() + 1),
                                     voicepacket.getVoicePacketWithIndex(voicepacket.getCurrentIndexToSent()).getPacketLen(),
@@ -428,7 +429,7 @@ public class Deliver extends AbstractConnectionService {
                     );
                 }
             } else {
-                ICLogger.i("voicepacket Sender "+voicepacket.getSender()+" duration 0x"+voicepacket.getDurationHex()+" " + voicepacket.getName() + " filetype " + voicepacket.getFiletype() + " , datatype " + voicepacket.getDateType() + " " + voicepacket.getPacketTime() + " sent Done!");
+                ICLogger.i("voicepacket Sender " + voicepacket.getSender() + " duration 0x" + voicepacket.getDurationHex() + " " + voicepacket.getName() + " filetype " + voicepacket.getFiletype() + " , datatype " + voicepacket.getDateType() + " " + voicepacket.getPacketTime() + " sent Done!");
             }
             return true;
         } else if ("PhotoRemoteTaken".equals(paramStringMessage.cmd())) {
@@ -461,10 +462,10 @@ public class Deliver extends AbstractConnectionService {
 
             //创建voiceConent并添加到数据
             final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP,
-                    "123", msgUrl,"0000", 2, 2);
+                    "123", msgUrl, "0000", 2, 2);
 
             // 把voiceContent拆解成1024的分包
-            Util.parseToVoicePacketSent(voiceContent,1024);
+            Util.parseToVoicePacketSent(voiceContent, 1024);
             //trigger 分包发送
             if (CoreService.getInstance().getConnection() != null) {
                 //H88 专用功能拍照时检测用户体温心率
@@ -486,7 +487,6 @@ public class Deliver extends AbstractConnectionService {
             return true;
         } else if ("poweroffCheckSim".equals(paramStringMessage.cmd())) {
             paramRuntime.setShutdown(true);
-
             if (SimSignalUtil.hasSimCard(paramRuntime.getContextProxy().context)) {
                 ICLogger.i("Has Sim Card Skip poweroff!");
                 Util.ShowToast(paramRuntime, "Has Sim Card Skip poweroff!");
@@ -494,6 +494,8 @@ public class Deliver extends AbstractConnectionService {
             } else {
                 Util.ShowToast(paramRuntime, "Do poweroff!");
             }
+            VibrateUtil.getInstance(paramRuntime.getContextProxy().context).
+                    vibrate(new long[]{1000, 500, 1000, 500, 1000}, -1);
             mSendMSGHandler.postDelayed(new Runnable() {
                 @Override
                 public void run() {
@@ -638,9 +640,9 @@ public class Deliver extends AbstractConnectionService {
                  *        *        * 1 语音——    1.监听语音      *   2.SOS语音      *      3.扩展
                  *        *          * 2 图片——  1.签到图片      *   2.指令图片      *   3.设备图片      *   4.扩展
                  */
-                final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, "123","0000", recordfilepath, 1, 1);
+                final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, "123", "0000", recordfilepath, 1, 1);
                 // 把voiceContent拆解成1024的分包
-                Util.parseToVoicePacketSent(voiceContent,1024);
+                Util.parseToVoicePacketSent(voiceContent, 1024);
                 //trigger 分包发送
                 if (CoreService.getInstance().getConnection() != null)
                     CoreService.getInstance().getConnection().DeliverCMDMessageToSystem("SentVoicePacket", "");
@@ -691,18 +693,17 @@ public class Deliver extends AbstractConnectionService {
         WifiListWakeLock = Deliver.WakeLockForGetWifiList(mRuntime);
 
         //尝试connect 指定networkid
-        if ( Util.connectWifiByReflectMethod(mRuntime.getContextProxy().context, networkid) == null/*连接wifi出错*/ ) {
+        if (Util.connectWifiByReflectMethod(mRuntime.getContextProxy().context, networkid) == null/*连接wifi出错*/) {
             ICLogger.i("连接失败 则重试");
             SystemClock.sleep(3000L);
 
             //如果失败 通过enableNetwork 连接指定networkid
             //首先停止所有网络自动连接。
-            for (WifiConfiguration c: wifiManager.getConfiguredNetworks()){
+            for (WifiConfiguration c : wifiManager.getConfiguredNetworks()) {
                 wifiManager.disableNetwork(c.networkId);
             }
             //接着自动裂解wifi
-            if( !wifiManager.enableNetwork(networkid, true))
-            {
+            if (!wifiManager.enableNetwork(networkid, true)) {
                 ICLogger.i("连接再次失败 ");
                 /*如果 连接 指定wifi networkid 再次失败*/
                 //所有连接都失败了, wifi还不是用户手动打开的,那么就关闭wifi
index 8c4afad..ba30e7c 100644 (file)
@@ -358,9 +358,7 @@ public class ProcessReceiver extends BroadcastReceiver {
                 }
             }
         } else if (ACTION_SHUTDOWN.equals(str)) {
-
             playshutdownsound(paramContext);
-
             Util.shutdown();
             return;
         } else if (ACTION_PLAYTIME.equals(str)) {
index 84418a9..6f53f3e 100644 (file)
@@ -77,4 +77,10 @@ public class VibrateUtil {
             }\r
         }\r
     }\r
+\r
+    public void vibrate(long[] longs, int i) {\r
+        if (vibrator != null) {\r
+            vibrator.vibrate(longs, i);//不循环\r
+        }\r
+    }\r
 }\r
index 8801423..eafee89 100644 (file)
@@ -711,13 +711,10 @@ public class protocol_beehome {
     }
 
     public void handleBP31(Connection connection, String cmd) {
-
-        //    IWBP31,867155030001063,161723
+        //IWBP31,867155030001063,161723
         String[] cmdlist = cmd.split(CMDSPLIT);
         if (cmdlist.length == 3) {
-
             connection.send(AP31(cmdlist[2]));
-
         }
     }
 
@@ -2208,7 +2205,6 @@ public class protocol_beehome {
                 ICLogger.i("收到服务器推送文本消息");
                 mConnection.DeliverCMDMessageToSystem("showTxt", cmd);//通知下面线程状态变化
                 break;
-
             case BPXL:
                 handleBPXL(cmd, mConnection);
                 ICLogger.i("收到服务器心率检测命令");
index 4bdedac..5e17b72 100644 (file)
@@ -1,2 +1,2 @@
-#Thu Oct 14 21:33:40 CST 2021\r
-VERSION_CODE=904\r
+#Tue Oct 19 14:55:47 CST 2021\r
+VERSION_CODE=906\r