ContentResolver resolver = runtime.getContextProxy().getResolver();
//添加之前先删除白名单的内容
//删除第0组
- resolver.delete(Uri.parse(ICMembersProvider.MEMBERS), "type=? and group_type is null", new String[]{
- ICDatabaseHelper.MemberType.WHITE_LIST + ""
- });
- resolver.delete(Uri.parse(ICMembersProvider.MEMBERS), "type=? and group_type=?", new String[]{
- ICDatabaseHelper.MemberType.WHITE_LIST + "", "0"
- });
+ resolver.delete(Uri.parse(ICMembersProvider.MEMBERS),
+ "type=? and group_type is null", new String[]{
+ ICDatabaseHelper.MemberType.WHITE_LIST + ""
+ });
+ resolver.delete(Uri.parse(ICMembersProvider.MEMBERS),
+ "type=? and group_type=?", new String[]{
+ ICDatabaseHelper.MemberType.WHITE_LIST + "", "0"
+ });
//从记录上看,
for (int i = 0; i < phnums.length; i++) {
String[] tmp = phnums[i].split("\\|");
if (tmp.length == 2) {
String name = Util.decodeUnicode2Utf8(tmp[0]);
- String phonem = tmp[1];
- ICLogger.i("phnums[" + i + "]=" + phnums[i] + ",split = " + tmp.length + " , name=" + name + ",-" + phonem);
- contactArray.add(new Contact(Contact.CATEGORY_CALL, name, phonem));
+ String phoneNum = tmp[1];
+ ICLogger.i("phnums[" + i + "]=" + phnums[i] + ",split = " + tmp.length + " , name=" + name + ",-" + phoneNum);
+ contactArray.add(new Contact(Contact.CATEGORY_CALL, name, phoneNum));
ContentValues contentValues = new ContentValues();
contentValues.put(ICDatabaseHelper.fType, ICDatabaseHelper.MemberType.WHITE_LIST);
- contentValues.put(ICDatabaseHelper.fPhoneNum, phonem);
+ contentValues.put(ICDatabaseHelper.fPhoneNum, phoneNum);
contentValues.put(ICDatabaseHelper.fUserName, name);
//这个是第0组
contentValues.put(ICDatabaseHelper.fGroup, 0);
contentValues.put(ICDatabaseHelper.fCreateTime, System.currentTimeMillis());
contentValues.put(ICDatabaseHelper.fUpdateTime, System.currentTimeMillis());
resolver.insert(Uri.parse(ICMembersProvider.MEMBERS), contentValues);
+ ICLogger.d("insert completed..");
} else {
ICLogger.i("phnums[" + i + "]=" + phnums[i] + ",split = " + tmp.length);
}
}
- runtime.getDbHelper().saveContacts(contactArray,
- false, false, true, false, false, false);
+ //runtime.getDbHelper().saveContacts(contactArray, false, false, true, false, false, false);
} else {
ICLogger.i(" BP14 format error!");
}
-
}
voiceContent.serverTime = TimeUtil.getSystemTime3();
voiceContent.preview = String.valueOf(Util.getDuration(voiceContent.content));
runtime.getDbHelper().updateMessage(voiceContent, uri2);
-// runtime.getContextProxy().sendBroadcast(ACTION_IMESSAGE, runtime);
+ //runtime.getContextProxy().sendBroadcast(ACTION_IMESSAGE, runtime);
connection.DeliverCMDMessageToSystem("NewVoice", amrFilepath);//通知下面线程状态变化
}
} catch (Exception e) {
ICLogger.e(e.getMessage(), e);
}
-
} else {
log("handleBP28", "format Error");
-// connection.send(genStringMessage("AP28",AP28(Name,appendIndex,packetCount,currentId,0)));
+ //connection.send(genStringMessage("AP28",AP28(Name,appendIndex,packetCount,currentId,0)));
}
-
}
public void sendBroadcast(String cmd, Runtime dev) {
-
- ComponentName componentName = new ComponentName("com.eqc.watch", "com.eqc.watch.launcher.ChatActivity");
+ ComponentName componentName = new ComponentName("com.eqc.watch",
+ "com.eqc.watch.launcher.ChatActivity");
Intent intent = new Intent("android.intent.action.MAIN");
-// intent.putExtra("ACTIVITY_TYPE", 2);
-// intent.addCategory("android.intent.category.DEFAULT");
+ //intent.putExtra("ACTIVITY_TYPE", 2);
+ //intent.addCategory("android.intent.category.DEFAULT");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setComponent(componentName);
dev.getContextProxy().context.startActivity(intent);
//白名单开关(下行协议号:BP84,响应:AP84)
public static StringMessage AP84(String index, int success) {
-
//设备响应: IWAP80,080835,1#
//080835:指令流水号
//1:表示设备执行成功,0 表示设备执行失败
}
public void handleBP84(String cmd, Connection connection) {
-//示例:
+ //示例:
//IWBP84,353456789012345,080835,1#
//说明:
//IW:标识符
} else {
ICLogger.i("BP84 format error!");
}
-
}
//17.绑定解绑(下行协议号:BP68,响应:AP68)
public static StringMessage AP68(String index, String cmd) {
-
//设备响应: IWAP86, 080835,1#
//080835:指令流水号
return genStringMessage("AP86", new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP68))
* @param cmd
*/
private void handleBP99(String cmd) {
- //IWBP99,866671044898063,33936,https://www.baidu.com
+ //IWBP99,866671044898063,33936,https://www.baidu.com#
//解析数据,设置数据
String[] split = cmd.split(CMDSPLIT);
if (split.length == 4) {