From: TrillGates Date: Tue, 19 Oct 2021 07:19:05 +0000 (+0800) Subject: 关机添加3次震动 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=8c7580d8b2feffe5ae6cf0d03204194c10c5609c;p=icsupport.git 关机添加3次震动 --- diff --git a/app/release/ICSer_V904_2110142133_release.apk b/app/release/ICSer_V906_2110191455_release.apk similarity index 78% rename from app/release/ICSer_V904_2110142133_release.apk rename to app/release/ICSer_V906_2110191455_release.apk index ffd04382..d712442f 100644 Binary files a/app/release/ICSer_V904_2110142133_release.apk and b/app/release/ICSer_V906_2110191455_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index bea4a2f1..b7f77127 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index e56d98f3..6ce29fbe 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -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); diff --git a/app/src/main/java/com/enqualcomm/support/service/Deliver.java b/app/src/main/java/com/enqualcomm/support/service/Deliver.java index 582dc7ee..f66743cd 100644 --- a/app/src/main/java/com/enqualcomm/support/service/Deliver.java +++ b/app/src/main/java/com/enqualcomm/support/service/Deliver.java @@ -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 diff --git a/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java b/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java index 8c4afad9..ba30e7ca 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java +++ b/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java @@ -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)) { diff --git a/app/src/main/java/com/enqualcomm/support/utils/VibrateUtil.java b/app/src/main/java/com/enqualcomm/support/utils/VibrateUtil.java index 84418a9f..6f53f3e2 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/VibrateUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/VibrateUtil.java @@ -77,4 +77,10 @@ public class VibrateUtil { } } } + + public void vibrate(long[] longs, int i) { + if (vibrator != null) { + vibrator.vibrate(longs, i);//不循环 + } + } } diff --git a/app/src/main/java/com/ic/protocols/protocol_beehome.java b/app/src/main/java/com/ic/protocols/protocol_beehome.java index 88014232..eafee897 100644 --- a/app/src/main/java/com/ic/protocols/protocol_beehome.java +++ b/app/src/main/java/com/ic/protocols/protocol_beehome.java @@ -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("收到服务器心率检测命令"); diff --git a/app/version_code.properties b/app/version_code.properties index 4bdedac9..5e17b72a 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Thu Oct 14 21:33:40 CST 2021 -VERSION_CODE=904 +#Tue Oct 19 14:55:47 CST 2021 +VERSION_CODE=906