Android6.0之来电转接号码显示修改
Android6.0之来电转接号码显示修改
手机来电转接界面是在,点开Dialer-搜索框右边的三个点-设置-通话账户(要先插卡)-中国移动或者中国联通--来电转接--第一行,显示始终转接
将所有来电转接到+86xxxxxxxxxxx
当按home键回到主界面,然后在设置里切换语言,然后在recent键回到来电转接设置界面时发现来电转接的号码变成了{0},
通过搜索字符串
package/service/Telephony/res/values/strings.xml:219:
<string name="sum_cfu_enabled">Forwarding all calls to <xliff:g id="phonenumber" example="555-1212">{0}</xliff:g></string>
发现引用的地方在package/service/Telephony/res/xml/callforward_options.xml
<com.android.phone.CallForwardEditPreference
android:key="button_cfu_key"
android:title="@string/labelCFU"
android:persistent="false"
android:summaryOn="@string/sum_cfu_enabled"
android:summaryOff="@string/sum_cfu_disabled"
android:dialogTitle="@string/labelCFU"
android:dialogMessage="@string/messageCFU"
phone:confirmMode="activation"
phone:serviceClass="voice"
phone:reason="unconditional"
android:singleLine="true"
android:autoText="false"
android:enabled="false" />
发现这是一个自定义的com.android.phone.CallForwardEditPreference
用eng的手机通过View视图查看工具可以发现
当前的界面是package/service/Telephony/src/com/android/phone/GsmUmtsCallForwardOptions.java
private static final String BUTTON_CFU_KEY = "button_cfu_key";
PreferenceScreen prefSet = getPreferenceScreen();
mButtonCFU = (CallForwardEditPreference) prefSet.findPreference(BUTTON_CFU_KEY);
mButtonCFU.setParentActivity(this, mButtonCFU.reason);
mButtonCFB.setParentActivity(this, mButtonCFB.reason);
mPreferences.add(mButtonCFU);
mPreferences.add(mButtonCFB);
switch (requestCode) {
case CommandsInterface.CF_REASON_UNCONDITIONAL:
mButtonCFU.onPickActivityResult(getArabCharNumber(cursor.getString(0)));
@Override
public void onResume() {
super.onResume();
if (mFirstResume) {
if (mIcicle == null) {
if (DBG) Log.d(LOG_TAG, "start to init ");
mPreferences.get(mInitIndex).init(this, false, mPhone);
} else {
mInitIndex = mPreferences.size();
for (CallForwardEditPreference pref : mPreferences) {
Bundle bundle = mIcicle.getParcelable(pref.getKey());
pref.setToggled(bundle.getBoolean(KEY_TOGGLE));
pref.setEnabled(bundle.getBoolean(KEY_STATE));
CallForwardInfo cf = new CallForwardInfo();
cf.number = bundle.getString(KEY_NUMBER);
cf.status = bundle.getInt(KEY_STATUS);
pref.handleCallForwardResult(cf);
pref.init(this, true, mPhone);
}
}
mFirstResume = false;
mIcicle = null;
}
}
中的
cf.number = bundle.getString(KEY_NUMBER);
cf.status = bundle.getInt(KEY_STATUS);
pref.handleCallForwardResult(cf);
进到handleCallForwardResult()这个方法中
然后可以发现进到了package/service/Telephony/src/com/android/phone/CallForwardEditPreference.java中
void handleCallForwardResult(CallForwardInfo cf) {
callForwardInfo = cf;
if (DBG) Log.d(LOG_TAG, "handleGetCFResponse done, callForwardInfo=" + callForwardInfo);
setToggled(callForwardInfo.status == 1);
setPhoneNumber(callForwardInfo.number);
}
然后发现
private void updateSummaryText() {
if (isToggled()) {
CharSequence summaryOn;
final String number = getRawPhoneNumber();
if (number != null && number.length() > 0) {
// Wrap the number to preserve presentation in RTL languages.
String wrappedNumber = BidiFormatter.getInstance().unicodeWrap(
number, TextDirectionHeuristics.LTR);
String values[] = { wrappedNumber };
/// M: for Plug-in @{
ExtensionManager.getCallForwardExt().updateSummaryTimeSlotText(this, values);
/// }@
summaryOn = TextUtils.replace(mSummaryOnTemplate, SRC_TAGS, values);
} else {
summaryOn = getContext().getString(R.string.sum_cfu_enabled_no_number);
}
setSummaryOn(summaryOn);
}
}
所以在
| /// }@ | /// }@ | 78 | ||
![]() |
79 | mPhone.getCallForwardingOption(reason, | mPhone.getCallForwardingOption(reason, | 79 |
| 80 | mHandler.obtainMessage(MyHandler.MESSAGE_GET_CF, | mHandler.obtainMessage(MyHandler.MESSAGE_GET_CF, | 80 | |
| 81 | // unused in this case | // unused in this case | 81 | |
| 82 | CommandsInterface.CF_ACTION_DISABLE, | CommandsInterface.CF_ACTION_DISABLE, | 82 | |
| 83 | MyHandler.MESSAGE_GET_CF, null)); | MyHandler.MESSAGE_GET_CF, null)); | 83 | |
| 84 | } | } | 84 | |
| 85 | if (mTcpListener != null) { | if (mTcpListener != null) { | 85 | |
| 86 | mTcpListener.onStarted(this, true); | mTcpListener.onStarted(this, true); | 86 | |
| 87 | } | } | 87 | |
| } else { | 88 | |||
| updateSummaryText(); | 89 | |||
| 88 | } | } | 90 | |
| 89 | } | } | 91 | |
| 90 | 92 | |||
| 91 | @Override | @Override | 93 | |
| 92 | protected void onBindDialogView(View view) { | protected void onBindDialogView(View view) { | 94 | |
| 93 | // default the button clicked to be the cancel button. | // default the button clicked to be the cancel button. | 95 | |
| 94 | mButtonClicked = DialogInterface.BUTTON_NEGATIVE; | mButtonClicked = DialogInterface.BUTTON_NEGATIVE; | 96 | |
| 95 | super.onBindDialogView(view); | super.onBindDialogView(view); | 97 | |
| 96 | /// M: for Plug-in @{ | /// M: for Plug-in @{ | 98 | |
| 97 | ExtensionManager.getCallForwardExt().onBindDialogView(this, view); | ExtensionManager.getCallForwardExt().onBindDialogView(this, view); |
void init(TimeConsumingPreferenceListener listener, boolean skipReading, Phone phone) {
mPhone = phone;
mTcpListener = listener;
if (!skipReading) {
/// M: for Plug-in @{
} else {
updateSummaryText();
}
}
调用已经写好的updateSummaryText();方法便可以实现通过recent键进到来电转接界面来电转接号码的显示
Android6.0之来电转接号码显示修改的更多相关文章
- Android6.0 源码修改之 Contacts应用
一.Contacts应用的主界面和联系人详情界面增加顶部菜单添加退出按钮 通过Hierarchy View 工具可以发现 主界面对应的类为 PeopleActivity 联系人详情界面对应的类为 Qu ...
- Android6.0 源码修改之 仿IOS添加全屏可拖拽浮窗返回按钮
前言 之前写过屏蔽系统导航栏功能的文章,具体可看Android6.0 源码修改之屏蔽导航栏虚拟按键(Home和RecentAPP)/动态显示和隐藏NavigationBar 在某些特殊定制的版本中要求 ...
- android6.0搜索蓝牙无法显示问题解决
1.android6.0版本搜索蓝牙需要开启位置信息 需在Manifest中添加权限: <uses-permission android:name="android.permissio ...
- 【Android】Android6.0读取通话记录
需求:读取通话记录,然后列表显示,每条记录的数据包括姓名.号码.类型(来电.去电.未接,字体颜色分别为绿.蓝.红),然后长按条目弹出一个列表弹窗,显示[复制号码到拨号盘].[发短信].[打电话]. 先 ...
- Android6.0运行时权限管理
自从Android6.0发布以来,在权限上做出了很大的变动,不再是之前的只要在manifest设置就可以任意获取权限,而是更加的注重用户的隐私和体验,不会再强迫用户因拒绝不该拥有的权限而导致的无法安装 ...
- Android6.0 中appcompat_v7 报错
更新了AndroidSDK以后 各种错误,新建一个项目会附赠一个appcompat_v7,你只要知道这个是一个兼容包就可以了,具体的特性可以看相关介绍,其实也没啥特别的就是为了兼容低版本的呗, 但是呢 ...
- Android6.0权限大全和权限分类
本文转载至: https://blog.csdn.net/qq_26440221/article/details/53097868 自从出了Android6.0权限管理之后,再也不能像以前那样粘贴复制 ...
- Android app 在线更新那点事儿(适配Android6.0、7.0、8.0)
一.前言 app在线更新是一个比较常见需求,新版本发布时,用户进入我们的app,就会弹出更新提示框,第一时间更新新版本app.在线更新分为以下几个步骤: 1, 通过接口获取线上版本号,versionC ...
- [IMX6]Android6.0移植和分析
0. 知识点 中断(设备树) [IMX6]设备树分析--dts 1. 编译 Android6.0内核移植(1):分析编译日志 Android6.0内核移植(2):kernel编译内核 单独烧录kern ...
随机推荐
- 在access中如何创建数据库。你认为数据库在网站开发中所扮演的角色是什么。使用数据库和使用文件,两者的优缺点各是什么。
首先在access里面填写所用的信息,将数据库创建,在导入程序设计里进行完成代码. 首先打开我们的access程序,打开方法是单击开始——所有程序. 所有程序中找到microsoft office文件 ...
- java基础复习:final,static,以及String类
2.final 1)为啥String是final修饰的呢? 自己答: 答案: 主要是为了“效率” 和 “安全性” 的缘故.若 String允许被继承, 由于它的高度被使用率, 可能会降低程序的性能,所 ...
- .NET开发者必备的工具箱
本文作者Spencer是一名专注于ASP.NET和C#的程序员,他列举了平时工作.在家所使用的大部分开发工具,其中大部分工具都是集中于开发,当然也有一些其它用途的,比如图片处理.文件压缩等. 如果你是 ...
- zmap在阿里云主机上的编译
环境: cat /etc/issueUbuntu 14.04.2 LTS \n \l cat /proc/cpuinfoprocessor : 0vendor_id : GenuineIntelcpu ...
- git push :推送本地更改到远程仓库的三种模式
摘要:由于在git push过程中,no-fast-forward 的push会被拒绝,如何解决git push失败的问题?这里面有三种方法,分别会形成merge形式的提交历史,线性形式的提交历史,覆 ...
- node平台截取图片模块——jimp
前几天介绍了一个简单的截图模块——iamges,虽然简单,但是功能还是有很多局限的地方. jimp的优势:1.简单,2.支持回调方式和ES6(promise)语法也可以链式调用 3. 丰富的api ...
- Android 颜色渲染PorterDuff及Xfermode详解
在讲具体的使用之前补充一点知识,这就是 ProterDuff的由来: 相信大多数人看到这个ProterDuff单词很奇怪了吧,这肿么个意思呢,然后就用有道啊,金山啊开始翻译,但是翻译软件给出的结果肯定 ...
- Rational Rose
Rational Rose简明实用教程 http://furzoom.com/rational-rose-course/ Unidirectional Association 单向关联 general ...
- 在Linux上配置Zabbix的环境
useradd -s /bin/false zabbix mkdir /usr/local/zabbix_agent mv /home/zihexin/zabbix_agents_3.2.0.linu ...
- Linux C 学习
int main() { int64_t test = ; printf("%lld\n",test); float f_test = 100.2123; printf(" ...
