fixed gator chat duration issues.
authorTrillGates <williamtrillgates@gmail.com>
Tue, 27 Jul 2021 12:44:37 +0000 (20:44 +0800)
committerTrillGates <williamtrillgates@gmail.com>
Tue, 27 Jul 2021 12:44:37 +0000 (20:44 +0800)
app/src/main/java/com/enqualcomm/support/bean/voicePacket.java
app/src/main/java/com/enqualcomm/support/service/Deliver.java
app/src/main/java/com/enqualcomm/support/utils/TimeUtil.java
app/src/main/java/com/ic/protocols/protocolAPIHelper.java
app/src/main/java/com/ic/protocols/protocol_gator.java

index e09fb11..0da91f0 100644 (file)
@@ -25,8 +25,8 @@ public class voicePacket {
 \r
     int filetype = 1;\r
     int datatype = 3;\r
-    String Sender="";\r
-    String durationHex="00";\r
+    String Sender = "";\r
+    String durationHex = "00";\r
     String time = null;\r
     String Name = null;\r
     String appendIndex = null;\r
@@ -45,14 +45,21 @@ public class voicePacket {
         return packetCount;\r
     }\r
 \r
-    public void setDurationHex(String duration){\r
-        durationHex=duration;\r
+    public void setDurationHex(String duration) {\r
+        durationHex = duration;\r
     }\r
-    public String getDurationHex(){ return durationHex;}\r
-    public void setSender(String sender){\r
-        Sender=sender;\r
+\r
+    public String getDurationHex() {\r
+        return durationHex;\r
+    }\r
+\r
+    public void setSender(String sender) {\r
+        Sender = sender;\r
+    }\r
+\r
+    public String getSender() {\r
+        return Sender;\r
     }\r
-    public String getSender(){return Sender;}\r
 \r
     public void setPacketTime(String _time) {\r
         time = _time;\r
index a59985c..9b87355 100644 (file)
@@ -446,7 +446,8 @@ 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(),
index c91dc4a..666e8d3 100644 (file)
@@ -10,7 +10,6 @@ import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.Locale;
-import java.util.SimpleTimeZone;
 import java.util.TimeZone;
 
 import static android.content.Context.ALARM_SERVICE;
@@ -81,6 +80,10 @@ public class TimeUtil {
         return (new SimpleDateFormat("HHmmss")).format(new Date(System.currentTimeMillis()));
     }
 
+    public static String getSystemTimeYYMMDDHHMMSS() {
+        return (new SimpleDateFormat("yyMMddHHmmss")).format(new Date(System.currentTimeMillis()));
+    }
+
     public static String getUTCSystemDateYYMMDD() {
         return (new SimpleDateFormat("yyMMdd")).format(new Date(System.currentTimeMillis() - TimeZone.getDefault().getRawOffset()));
     }
index fb0d833..59cb761 100644 (file)
@@ -620,7 +620,13 @@ public class protocolAPIHelper {
         }
 
     }
-    public static byte[] getVoicePacketItem(String sender,String durationHEX,String packetTime, int count, int index, int datalen, byte[] amrdata, int filetype, int datatype) {
+    public static byte[] getVoicePacketItem(String sender,
+                                            String durationHEX,
+                                            String packetTime,
+                                            int count, int index,
+                                            int datalen,
+                                            byte[] amrdata,
+                                            int filetype, int datatype) {
         byte[] ret = null;
         if (is_protocol_not_Initialled()) return null;
         switch (Config.protocol_no) {
index df911fb..20f0c0a 100644 (file)
@@ -39,7 +39,6 @@ import java.util.HashMap;
 
 import static com.enqualcomm.support.bean.Contact.GROUP_ALL;
 import static com.enqualcomm.support.bean.Content.CONTACT_CATEGORY_GROUP;
-import static java.lang.Math.abs;
 
 /**
  * IC协议
@@ -250,22 +249,23 @@ public class protocol_gator {
         String len = String.format("%04X", encreptedStr.length() + 8);
         return encreptionMSGHeader + len + "01" + encreptedStr;
     }
+
     private static byte[] encrepteMsgBytes(byte[] msgbytes) {
 
         String encreptionMSGHeader = "GT";
         byte[] encryptdata = AESCipher.aesEncryptBytesFixedKey(msgbytes);
-        int len=encryptdata.length+8;
+        int len = encryptdata.length + 8;
         String encdatalen = String.format("%04X01", len);
         byte[] sentbuf = new byte[len];
 
-        System.arraycopy(encreptionMSGHeader.getBytes(),0,sentbuf,0,2);
-        System.arraycopy(encdatalen.getBytes(),0,sentbuf,2,6);
+        System.arraycopy(encreptionMSGHeader.getBytes(), 0, sentbuf, 0, 2);
+        System.arraycopy(encdatalen.getBytes(), 0, sentbuf, 2, 6);
         System.arraycopy(encryptdata, 0, sentbuf, 8, encryptdata.length);
-        if(false) {
-            String tmp=Util.byte2hex(msgbytes);
-            ICLogger.d("src " + msgbytes.length+" --hex-- "+tmp.length()+" "+tmp);
-            tmp=Util.byte2hex(encryptdata);
-            ICLogger.d("encrypted " + encryptdata.length+ " --hex-- "+tmp.length()+" "+tmp);
+        if (false) {
+            String tmp = Util.byte2hex(msgbytes);
+            ICLogger.d("src " + msgbytes.length + " --hex-- " + tmp.length() + " " + tmp);
+            tmp = Util.byte2hex(encryptdata);
+            ICLogger.d("encrypted " + encryptdata.length + " --hex-- " + tmp.length() + " " + tmp);
 
             ICLogger.d("decrypted " + Util.byte2hex(AESCipher.aesDecryptBytesgFixedKey(encryptdata)));
         }
@@ -480,30 +480,30 @@ public class protocol_gator {
         }
     }
 
-    private void appendSOS(Runtime runtime,ArrayList<String> numbers,ArrayList<String> names,ArrayList<String> types){
+    private void appendSOS(Runtime runtime, ArrayList<String> numbers, ArrayList<String> names, ArrayList<String> types) {
         ArrayList<Contact> contactArray = new ArrayList<>();
         ContentValues contentValues = new ContentValues();
         contentValues.put(ICDatabaseHelper.fType, ICDatabaseHelper.MemberType.SOS);
-        for(int i=0;i< numbers.size();i++) {
+        for (int i = 0; i < numbers.size(); i++) {
             if (regexUtil.isMobileNumber(numbers.get(i)) || regexUtil.isPhoneNumber(numbers.get(i))) {
                 contactArray.add(new Contact(Contact.CATEGORY_SOS, names.get(i), numbers.get(i)));
-                ICLogger.i("find SOS "+ names.get(i)+" number " + numbers.get(i));
+                ICLogger.i("find SOS " + names.get(i) + " number " + numbers.get(i));
                 contentValues.put(ICDatabaseHelper.fUserName, names.get(i));
-                contentValues.put(ICDatabaseHelper.fPhoneNum,  numbers.get(i));
+                contentValues.put(ICDatabaseHelper.fPhoneNum, numbers.get(i));
                 //runtime.getContextProxy().getResolver().insert(Uri.parse(FZDMembersProvider.MEMBERS), contentValues);
             }
         }
         runtime.getDbHelper().saveContacts(contactArray, false, false, false, false, false, true);
     }
 
-    private void appendContact(Runtime runtime,ArrayList<String> numbers,ArrayList<String> names){
+    private void appendContact(Runtime runtime, ArrayList<String> numbers, ArrayList<String> names) {
         ArrayList<Contact> contactArray = new ArrayList<>();
         ContentValues contentValues = new ContentValues();
         ContentResolver resolver = runtime.getContextProxy().getResolver();
         resolver.delete(Uri.parse(ICMembersProvider.MEMBERS), "type=?", new String[]{
                 ICDatabaseHelper.MemberType.WHITE_LIST + ""
         });
-        for (int i = 0; i < numbers.size(); i ++) {
+        for (int i = 0; i < numbers.size(); i++) {
             String phoneNum = numbers.get(i);
             String name = names.get(i);
             ICLogger.i(i / 2 + " 姓名 " + name + ", 电话 " + phoneNum);
@@ -522,6 +522,7 @@ public class protocol_gator {
         //TODO:保存到fzd的联系人列表,类型为白名单
         runtime.getDbHelper().saveContacts(contactArray, false, false, true, false, false, false);
     }
+
     //设置亲情号码
     public void handleAP06(Runtime ds, Connection connection, String cmd) {
         log("AP06 设置亲情号码 " + cmd);
@@ -552,9 +553,9 @@ uncle:13141516175
             String cmdlist1[] = cmdlist[0].split("#");
             int index = 0;
             if (cmdlist1.length % 3 == 1) {
-                ArrayList<String> numbers=new ArrayList<>();
-                ArrayList<String> names=new ArrayList<>();
-                ArrayList<String> types=new ArrayList<>();
+                ArrayList<String> numbers = new ArrayList<>();
+                ArrayList<String> names = new ArrayList<>();
+                ArrayList<String> types = new ArrayList<>();
 
                 for (int i = 1; i < cmdlist1.length; i += 3) {
                     String number = cmdlist1[i];
@@ -562,30 +563,30 @@ uncle:13141516175
                     String type = cmdlist1[i + 2];
                     index++;
                     sb.append(index + " " + name + " " + number + " " + type + "\n");
-                    if (index <=3){
+                    if (index <= 3) {
                         //SOS
-                        if(!number.trim().equals("0")){
+                        if (!number.trim().equals("0")) {
                             numbers.add(number);
                             names.add(name);
                             types.add(type);
                         }
-                        if(index==3){
+                        if (index == 3) {
                             //触发保存sos
-                            appendSOS(ds,numbers,names,types);
+                            appendSOS(ds, numbers, names, types);
                             //保存sos后清除临时数据
                             numbers.clear();
                             names.clear();
                             types.clear();
                         }
-                    }else{
-                        if(!number.trim().equals("0")){
+                    } else {
+                        if (!number.trim().equals("0")) {
                             numbers.add(number);
                             names.add(name);
                             types.add(type);
                         }
                     }
                 }
-                appendContact(ds,numbers,names);
+                appendContact(ds, numbers, names);
 
             } else {
                 ICLogger.e("AP06 format error1 !");
@@ -640,7 +641,7 @@ uncle:13141516175
 //删除一条索引为0的闹铃
         String cmdlist[] = cmd.split(CMDSPLIT);
         if (cmdlist.length == 7) {
-            String   cmdindex = cmdlist[6];
+            String cmdindex = cmdlist[6];
             try {
                 String do_cmd = "";
                 int alarmindex = 0 /*alarm索引*/;
@@ -650,7 +651,7 @@ uncle:13141516175
                 int repeat = 0;// //0:一次,不重复;0x01:星期日;0x02:星期一;0x04:星期二;0x08:星期三;0x10:星期四;0x20:星期五;0x40星期六
                 // 0x01|0x02|0x04|0x08|0x10|0x20|0x40=0x7F
                 do_cmd = cmdlist[1];//0删除、1添加(修改)闹钟功能
-                alarmtime=cmdlist[4]+cmdlist[5]; //YYMMDDHHMMSS
+                alarmtime = cmdlist[4] + cmdlist[5]; //YYMMDDHHMMSS
                 alarmindex = Integer.parseInt(cmdlist[2]);
 
                 ArrayList<Alarm> alarmList = new ArrayList<>();
@@ -658,7 +659,7 @@ uncle:13141516175
                 //do clean and set alarm things
                 runtime.getDbHelper().saveAlarm(alarmList);
                 connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP09, cmdindex, true));
-            }catch (Exception e){
+            } catch (Exception e) {
                 connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP09, cmdindex, false));
             }
 
@@ -1153,13 +1154,12 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
                 String language = cmdlist[1];
                 ////1 意大利,2 德语,3 法语,4 中文,5, 英文 , 6 俄语
                 ICLogger.d("set language  " + language);
-                if (language.equals("0044"))
-                {
-                    LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context,"5");
-                }else if (language.equals("0086")){
-                    LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context,"4");
-                }else if (language.equals("0007")){
-                    LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context,"6");
+                if (language.equals("0044")) {
+                    LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context, "5");
+                } else if (language.equals("0086")) {
+                    LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context, "4");
+                } else if (language.equals("0007")) {
+                    LanguageUtils.changeLanguageByIndex(runtime.getContextProxy().context, "6");
                 }
                 connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP20, index, true));
             } catch (Exception e) {
@@ -1220,8 +1220,8 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
         String[] silent_items = cmd.split(CMDSPLIT);
         ArrayList<Silent> slist = new ArrayList<>();
 
-        if (silent_items.length ==19) {
-            String index=silent_items[18];
+        if (silent_items.length == 19) {
+            String index = silent_items[18];
 //            for (String si : silent_items) {
 //                String[] sl = si.split("-");
 //                if (sl.length == 4) {
@@ -1245,7 +1245,7 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
 //            }
             connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP22, index, true));
 
-        }else{
+        } else {
             ICLogger.i("免打扰时间格式错误,skip");
         }
         runtime.getDbHelper().saveSilent(slist);
@@ -1275,25 +1275,25 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
         //(003D357593060153353AP34,13026618172,170413163300,2710,6,1,1)
 
         String cmdlist[] = cmd.split(CMDSPLIT);
-        if (cmdlist.length ==7) {
-             try {
+        if (cmdlist.length == 7) {
+            try {
                 String time = cmdlist[2];
                 String sender = cmdlist[1];
                 String duration = cmdlist[3];
                 int packetCount = Integer.parseInt(cmdlist[4]);
                 int packetIndex = Integer.parseInt(cmdlist[5]);
                 int receiveSuccess = Integer.parseInt(cmdlist[6]);
-                ICLogger.i("服务器在" + time + " 收到 "+sender+" 语音 " +duration+" "+ packetIndex + "/" + packetCount + " " + (receiveSuccess == 1 ? "成功" : (receiveSuccess==0?"失敗":"非亲情号")));
+                ICLogger.i("服务器在" + time + " 收到 " + sender + " 语音 " + duration + " " + packetIndex + "/" + packetCount + " " + (receiveSuccess == 1 ? "成功" : (receiveSuccess == 0 ? "失敗" : "非亲情号")));
                 if (receiveSuccess == 1) {
                     //如果服务器接收 语音成功,则设置下一个要发送的语音包Index,当index == packetCount的时候表示所有包发送完毕,停止继续发送
                     voicePacket.getInstanceSent().setCurrentIndexToSent(packetIndex);
                     //发送消息,再次检查要发送的语音包,确认其发送完毕
                     connection.DeliverCMDMessageToSystem("SentVoicePacket", "SentVoicePacket");
-                }else if( receiveSuccess == 0){
+                } else if (receiveSuccess == 0) {
                     //发送消息,再次检查要发送的语音包,确认其发送完毕
                     connection.DeliverCMDMessageToSystem("SentVoicePacket", "SentVoicePacket");
-                }else{
-                    ICLogger.d("联系人不是亲情号!" );
+                } else {
+                    ICLogger.d("联系人不是亲情号!");
                 }
 
             } catch (Exception e) {
@@ -1304,6 +1304,7 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
             ICLogger.e("AP21 format error");
         }
     }
+
     public void handleAP26(Runtime runtime, Connection connection, String cmd) {
         ICLogger.d(cmd);
         //(0035357593060153353AP26,2,AA,3,BBB,0000000000000020)
@@ -1318,8 +1319,8 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
 
             try {
                 String androidappurl = cmdlist[4];
-                String iosappurl=cmdlist[2];
-                ICLogger.i("收到 app 下载链接 android "+androidappurl+" ios "+iosappurl);
+                String iosappurl = cmdlist[2];
+                ICLogger.i("收到 app 下载链接 android " + androidappurl + " ios " + iosappurl);
 
                 connection.send(BPXX_REPLY(runtime, CMD_TYPE.BP26, index, true));
             } catch (Exception e) {
@@ -1333,7 +1334,7 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
     }
 
 
-    public static byte[] BP34_Raw(String senderNumb,String packetTime, String recordtimelenHex, int count, int index, int datalen, byte[] amrdata) {
+    public static byte[] BP34_Raw(String senderNumb, String packetTime, String recordtimelenHex, int count, int index, int datalen, byte[] amrdata) {
         //recordtimelenHex 是yyyymmddhhmmss的,为了兼容其它协议,就不变了,自己修正一下放进现在的协议
 //(03C80106357593060153353BP34,13026618172,170413163300,2710,6,1,700,数据)
 //BP34:命令字符
@@ -1342,7 +1343,7 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
 //2710(0x2710):语音文件录音时长10000ms
 //6:语音包分包总数
 
-        Runtime runtime =(CoreService.getInstance()==null)?null:CoreService.getInstance().getRuntime();
+        Runtime runtime = (CoreService.getInstance() == null) ? null : CoreService.getInstance().getRuntime();
 
         /*
         (    CHAR            1
@@ -1352,42 +1353,52 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
            byte[]              msg.lenght
            )  CHAR             1
            */
-        if (runtime==null) return null;
+        ICLogger.d("record time len Hex == > " + recordtimelenHex);
+        ICLogger.d("count == > " + count);
+        ICLogger.d("index == > " + index);
+        int durationInt = Integer.parseInt(recordtimelenHex, 16);
+        long duration = durationInt * 1000;
+        if (runtime == null) return null;
         StringBuffer sb = new StringBuffer(CMDHEADER).append("0000").append("0106").append(runtime.IMEI());
-                sb.append(cmdMap.get(CMD_TYPE.BP34))
-                .append(CMDSPLIT).append("0")
-                .append(CMDSPLIT).append(packetTime.substring(2))
-                .append(CMDSPLIT).append(recordtimelenHex)
+        sb.append(cmdMap.get(CMD_TYPE.BP34))
+                //往后的是消息内容
+                .append(CMDSPLIT).append("0")//要发给谁
+                .append(CMDSPLIT).append(packetTime.substring(2))//时间
+                //.append(CMDSPLIT).append(TimeUtil.getSystemTimeYYMMDDHHMMSS())//时间
+                .append(CMDSPLIT).append(Long.toHexString(duration))
                 .append(CMDSPLIT).append(count)
                 .append(CMDSPLIT).append(index)
                 .append(CMDSPLIT).append(datalen)
                 .append(CMDSPLIT).toString();
-        int len= sb.length() +datalen+ 1;
-        String lenstr = String.format("%04X",len);
+        int len = sb.length() + datalen + 1;
+        String lenstr = String.format("%04X", len);
         byte[] sentbuf = new byte[len];
         System.arraycopy(sb.toString().getBytes(), 0, sentbuf, 0, sb.length());
         System.arraycopy(amrdata, 0, sentbuf, sb.length(), datalen);
-        System.arraycopy(lenstr.getBytes(),0,sentbuf,1,4);
-        sentbuf[len-1] = ')';
+        System.arraycopy(lenstr.getBytes(), 0, sentbuf, 1, 4);
+        sentbuf[len - 1] = ')';
         ICLogger.d(new String(sentbuf));
         return encrepteMsgBytes(sentbuf);
 
     }
 
-    public void sendVoicePackage(int duration, String remoteNum, String content, String voiceId)  {
+    public void sendVoicePackage(int duration, String remoteNum, String content, String voiceId) {
 
         //创建voiceConent并添加到数据
-        if (remoteNum==null || remoteNum.isEmpty()) {
-            remoteNum="123";
+        if (remoteNum == null || remoteNum.isEmpty()) {
+            remoteNum = "123";
         }
-        final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, remoteNum,String.format("%04X",duration), content, 1, 3);
+        final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, remoteNum, String.format("%04X", duration), content, 1, 3);
         // 把voiceContent拆解成1024的分包
-        Util.parseToVoicePacketSent(voiceContent,900);
+        Util.parseToVoicePacketSent(voiceContent, 900);
         //trigger 分包发送
-        if(CoreService.getInstance().getConnection() !=null)
-                CoreService.getInstance().getConnection().DeliverCMDMessageToSystem("SentVoicePacket","");
+        if (CoreService.getInstance().getConnection() != null) {
+            CoreService.getInstance().getConnection()
+                    .DeliverCMDMessageToSystem("SentVoicePacket", "");
+        }
 
     }
+
     public boolean handleCmd(CMD_TYPE type, String cmd) {
 
         //普通非二进制命令用此函数处理
@@ -1397,20 +1408,20 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
         cmd = cmd.replace(" ", "");
         switch (type) {
             case AP03: //登录包
-                handleAP03(mRuntime, mConnection,cmd);
+                handleAP03(mRuntime, mConnection, cmd);
                 ICLogger.i("服务器收到登录包");
                 mConnection.DeliverCMDMessageToSystem("login", cmd);//通知下面线程状态变化
                 break;
             case AP04://查询终端版本消息
-                handleAP04(mRuntime,mConnection,cmd);
+                handleAP04(mRuntime, mConnection, cmd);
                 break;
             case AP30:// 定位数据接收成功
                 mConnection.DeliverCMDMessageToSystem("BP30", cmd);//通知下面线程状态变化
                 break;
             case AP14: //gps定位包
-                handleAP14(mRuntime,mConnection,cmd);
+                handleAP14(mRuntime, mConnection, cmd);
                 ICLogger.i("收到服务器下发手表坐标");
-              //  mConnection.DeliverCMDMessageToSystem("AP01", cmd);//通知下面线程状态变化
+                //  mConnection.DeliverCMDMessageToSystem("AP01", cmd);//通知下面线程状态变化
                 break;
             case AP00:
                 //立即定位指令(长链接有效)
@@ -1419,50 +1430,50 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
                 break;
             case AP06:
                 //收到设置亲情号码
-                handleAP06( mRuntime, mConnection,cmd);
+                handleAP06(mRuntime, mConnection, cmd);
                 break;
             case AP07://清除亲情号码
-                handleAP07( mRuntime, mConnection,cmd);
+                handleAP07(mRuntime, mConnection, cmd);
                 break;
             case AP08://重启设备
-                handleAP08( mRuntime, mConnection,cmd);
+                handleAP08(mRuntime, mConnection, cmd);
                 break;
             case AP15://开关机控制设置消息
-                handleAP15(mRuntime,mConnection,cmd);
+                handleAP15(mRuntime, mConnection, cmd);
                 break;
 
             case AP16:
                 //    服务器激活SOS模式消息
-                handleAP16(mRuntime,mConnection,cmd);
+                handleAP16(mRuntime, mConnection, cmd);
                 break;
 
             case AP18:
                 //    手表名字设置消息
-                handleAP18(mRuntime,mConnection,cmd);
+                handleAP18(mRuntime, mConnection, cmd);
                 break;
             case AP09: //闹钟
-                handleAP09(mRuntime,mConnection,cmd);
+                handleAP09(mRuntime, mConnection, cmd);
                 break;
             case AP10://情景模式
-                handleAP10(mRuntime,mConnection,cmd);
+                handleAP10(mRuntime, mConnection, cmd);
                 break;
             case AP11://服务器推送待接收消息
-                handleAP11(mRuntime,mConnection,cmd);
+                handleAP11(mRuntime, mConnection, cmd);
                 break;
             case AP20://服务器设置语言
-                handleAP20(mRuntime,mConnection,cmd);
+                handleAP20(mRuntime, mConnection, cmd);
                 break;
             case AP21://服务器推送音量设置消息
-                handleAP21(mRuntime,mConnection,cmd);
+                handleAP21(mRuntime, mConnection, cmd);
                 break;
             case AP22://服务器设置静默时段
-                handleAP22(mRuntime,mConnection,cmd);
+                handleAP22(mRuntime, mConnection, cmd);
                 break;
             case AP26://服务器下发app下载url
-                handleAP26(mRuntime,mConnection,cmd);
+                handleAP26(mRuntime, mConnection, cmd);
                 break;
             case AP34://服务器回复语音接收
-                handleAP34(mRuntime,mConnection,cmd);
+                handleAP34(mRuntime, mConnection, cmd);
                 break;
 //            case AP14:// wifi定位包
 //                handleBP02(cmd);
@@ -1693,7 +1704,7 @@ SOS报警上行WIFI、LBS混合定位数据,步数为255步,电量等级5,数
         if (Config.LOG_TOFILE) ICLogger.logToFile("APILog", " recv " + new String(bytes));
         switch (type) {
             case AP12:
-                handleAP12(mRuntime,mConnection, bytes);
+                handleAP12(mRuntime, mConnection, bytes);
                 ICLogger.i("收到服务器语音AP12");
                 mConnection.DeliverCMDMessageToSystem("AP12", "");//通知下面线程状态变化
                 break;