怎么去掉联系人、通话记录、拨号列表界面中的电话号码中间的空格?
来源:互联网 发布:淘宝网防身甩棍 编辑:程序博客网 时间:2024/05/01 12:23
1. 注解掉格式化处理
FILE: PhoneNumberFormatter.java
Before KK1
PATH: alps/packages/apps/contacts/src/com/android/contacts/Util
After KK1
PATH: alps/packages/apps/contactscommon/src/com/android/contacts/common/Util
public void afterTextChanged(Editable s) {
mSelfChanged = true;
/**不去调用父类format逻辑
*super.afterTextChanged(s);
**/
mSelfChanged = false;
}
2. 修改formatNumber方法直接返回原始号码,不会其进行格式化
FILE: PhoneNumberUtils.java
PATH: alps/frameworks/base/telephony/java/android/Telephony
* Format a phone number.
* <p>
* If the given number doesn't have the country code, the phone will be
* formatted to the default country's convention.
*
* @param phoneNumber
* the number to be formatted.
* @param defaultCountryIso
* the ISO 3166-1 two letters country code whose convention will
* be used if the given number doesn't have the country code.
* @return the formatted number, or null if the given number is not valid.
*
* @hide
*/
public static String formatNumber(String phoneNumber, String defaultCountryIso) {
// Before modified
// // Do not attempt to format numbers that start with a hash or star symbol.
// if (phoneNumber.startsWith("#") || phoneNumber.startsWith("*")) {
// return phoneNumber;
// }
// PhoneNumberUtil util = PhoneNumberUtil.getInstance();
// String result = null;
// try {
// PhoneNumber pn = util.parseAndKeepRawInput(phoneNumber, defaultCountryIso);
// result = util.formatInOriginalFormat(pn, defaultCountryIso);
// } catch (NumberParseException e) {
// }
// return result;
// After modified
return phoneNumber; // Just return, don't format the phoneNumber
}
3. 去掉导入号码时的格式化处理代码
Before JB5
FILE: AbstractStartSIMService.java
PATH: alps/packages/apps/contacts/src/com/mediatek/contacts/Simcontact
After JB5
FILE: SIMImportProcessor.java
PATH: alps/packages/apps/contacts/src/com/mediatek/contacts/simservice
(1) 去掉 actuallyImportOneSimContact() 方法中对 phoneNumber 的格式化处理代码 :
/*
* Bug Fix by Mediatek Begin. Original Android's code: xxx
* CR ID: ALPS00289127 Descriptions:
*/
Log.i(TAG, "[actuallyImportOneSimContact] phoneNumber before : " + phoneNumber);
// AsYouTypeFormatter mFormatter = PhoneNumberUtil.getInstance()
// .getAsYouTypeFormatter(countryCode);
// char[] cha = phoneNumber.toCharArray();
// int ii = cha.length;
// for (int num = 0; num < ii; num++) {
// phoneNumber = mFormatter.inputDigit(cha[num]);
// }
Log.i(TAG, "[actuallyImportOneSimContact] phoneNumber after : " + phoneNumber);
/*
* Bug Fix by Mediatek End.
*/
(2) 去掉 actuallyImportOneSimContact() 方法中对 additionalNumber 的格式化处理代码:
/*
* Bug Fix by Mediatek Begin. Original Android's code:
* xxx CR ID: ALPS00289127 Descriptions:
*/
Log.i(TAG, "[actuallyImportOneSimContact] additionalNumber before : "
+ additionalNumber);
// AsYouTypeFormatter mFormatter = PhoneNumberUtil.getInstance()
// .getAsYouTypeFormatter(countryCode);
// char[] cha = additionalNumber.toCharArray();
// int ii = cha.length;
// for (int num = 0; num < ii; num++) {
// additionalNumber = mFormatter.inputDigit(cha[num]);
// }
Log.i(TAG, "[actuallyImportOneSimContact] additionalNumber after : "
+ additionalNumber);
/*
* Bug Fix by Mediatek End.
*/
FILE: PhoneNumberFormatter.java
Before KK1
PATH: alps/packages/apps/contacts/src/com/android/contacts/Util
After KK1
PATH: alps/packages/apps/contactscommon/src/com/android/contacts/common/Util
public void afterTextChanged(Editable s) {
mSelfChanged = true;
/**不去调用父类format逻辑
*super.afterTextChanged(s);
**/
mSelfChanged = false;
}
2. 修改formatNumber方法直接返回原始号码,不会其进行格式化
FILE: PhoneNumberUtils.java
PATH: alps/frameworks/base/telephony/java/android/Telephony
* Format a phone number.
* <p>
* If the given number doesn't have the country code, the phone will be
* formatted to the default country's convention.
*
* @param phoneNumber
* the number to be formatted.
* @param defaultCountryIso
* the ISO 3166-1 two letters country code whose convention will
* be used if the given number doesn't have the country code.
* @return the formatted number, or null if the given number is not valid.
*
* @hide
*/
public static String formatNumber(String phoneNumber, String defaultCountryIso) {
// Before modified
// // Do not attempt to format numbers that start with a hash or star symbol.
// if (phoneNumber.startsWith("#") || phoneNumber.startsWith("*")) {
// return phoneNumber;
// }
// PhoneNumberUtil util = PhoneNumberUtil.getInstance();
// String result = null;
// try {
// PhoneNumber pn = util.parseAndKeepRawInput(phoneNumber, defaultCountryIso);
// result = util.formatInOriginalFormat(pn, defaultCountryIso);
// } catch (NumberParseException e) {
// }
// return result;
// After modified
return phoneNumber; // Just return, don't format the phoneNumber
}
3. 去掉导入号码时的格式化处理代码
Before JB5
FILE: AbstractStartSIMService.java
PATH: alps/packages/apps/contacts/src/com/mediatek/contacts/Simcontact
After JB5
FILE: SIMImportProcessor.java
PATH: alps/packages/apps/contacts/src/com/mediatek/contacts/simservice
(1) 去掉 actuallyImportOneSimContact() 方法中对 phoneNumber 的格式化处理代码 :
/*
* Bug Fix by Mediatek Begin. Original Android's code: xxx
* CR ID: ALPS00289127 Descriptions:
*/
Log.i(TAG, "[actuallyImportOneSimContact] phoneNumber before : " + phoneNumber);
// AsYouTypeFormatter mFormatter = PhoneNumberUtil.getInstance()
// .getAsYouTypeFormatter(countryCode);
// char[] cha = phoneNumber.toCharArray();
// int ii = cha.length;
// for (int num = 0; num < ii; num++) {
// phoneNumber = mFormatter.inputDigit(cha[num]);
// }
Log.i(TAG, "[actuallyImportOneSimContact] phoneNumber after : " + phoneNumber);
/*
* Bug Fix by Mediatek End.
*/
(2) 去掉 actuallyImportOneSimContact() 方法中对 additionalNumber 的格式化处理代码:
/*
* Bug Fix by Mediatek Begin. Original Android's code:
* xxx CR ID: ALPS00289127 Descriptions:
*/
Log.i(TAG, "[actuallyImportOneSimContact] additionalNumber before : "
+ additionalNumber);
// AsYouTypeFormatter mFormatter = PhoneNumberUtil.getInstance()
// .getAsYouTypeFormatter(countryCode);
// char[] cha = additionalNumber.toCharArray();
// int ii = cha.length;
// for (int num = 0; num < ii; num++) {
// additionalNumber = mFormatter.inputDigit(cha[num]);
// }
Log.i(TAG, "[actuallyImportOneSimContact] additionalNumber after : "
+ additionalNumber);
/*
* Bug Fix by Mediatek End.
*/
1 1
- Android 怎么去掉联系人、通话记录、拨号列表界面中的电话号码中间的空格?
- 怎么去掉联系人、通话记录、拨号列表界面中的电话号码中间的空格?
- [FAQ10145] 怎么去掉联系人、通话记录、拨号列表界面中的电话号码中间的空格?
- Android点击跳转到联系人列表、拨号面板和通话记录
- 去掉字符串中间的空格
- 通话记录界面 包含拨号界面的监听事件
- java 去掉字符串的空格(中间空格,左右空格)
- 去掉输入字符串中间的空格
- java中去掉字符串中间的空格
- Excel中去掉单元格中间的空格
- 删除联系人的通话记录
- linphone-去掉linphone的ContactsListFragment联系人界面
- Atom编辑器怎么去掉中间的虚线
- android 短信下,添加联系人,进入联系人多选界面出现联系人电话号码晃动的问题
- 获取联系人的电话号码
- Intent跳转到系统应用中的拨号界面、联系人界面、短信界面及其他
- 使用intent跳转到系统应用中的拨号界面、联系人界面、短信界面及其他
- Intent跳转到系统应用中的拨号界面、联系人界面、短信界面及其他
- 如何设置联系人地址从大到小显示(按照省、市、街道)
- java多线程学习(二)——线程的创建
- C#多线程编程总结
- java 抽象类和接口的区别
- LightOJ - 1422 Halloween Costumes (区间DP)
- 怎么去掉联系人、通话记录、拨号列表界面中的电话号码中间的空格?
- 美国某前端职位面试题-- 寻找最大shape
- 类名.class的意思
- win7配置host添加本地域名测试以及代理和host共存的解决方案
- Android KK平,联系人列表#组置于A~Z之前
- 重新认识C语言
- match_parent和fill_parent的有什么区别?
- Android硬件加速的一些问题和错误
- iOS应用性能调优的25个建议和技巧