保存记录方便后续工作中使用。
1、系统语言为英文状态下,新建一个联系人号码(如0504285105 或*121# 或+97155678161),保存;
2、切换系统语言为阿拉伯文,进入联系人界面查看号码显示
[实际结果]号码变为5105428050 , 121#* ,816156755971+
[期望结果]号码应仍显示0504285105 , *121# , +97155678161
//,20161209,add ,optimize boot contacts speed ,200ms
private static Pattern mPatternsPhone=null;
//#ifdef LAVA_EIDT
//20170110 add for bug 13294
private static final String NUM_PATTERN = "[+]?[[0-9][*#pw,;][\\s*]]+[[0-9][*#pw,;][\\s*]]*";
public static void initPatternsPhone() {
/* mPatternsPhone = Pattern.compile( // sdd = space, dot, or dash
"(\\+[0-9]+[\\- \\.]*)?" // +<digits><sdd>*
+ "(\\([0-9]+\\)[\\- \\.]*)?" // (<digits>)<sdd>*
+ "([0-9][0-9\\- \\.]+[0-9])"); // <digit><digit|sdd>+<digit>*/
mPatternsPhone = Pattern.compile(NUM_PATTERN);
}
// #endif
//#endif
public static boolean isPossiblePhoneNumber(CharSequence text) {
//,20161209,add ,optimize boot contacts speed ,200ms
if(mPatternsPhone == null)
{
initPatternsPhone();
}
//#endif
//20161209,modify ,optimize boot contacts speed ,200ms
return text == null ? false : mPatternsPhone.matcher(text.toString()).matches();
}