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之来电转接号码显示修改的更多相关文章

  1. Android6.0 源码修改之 Contacts应用

    一.Contacts应用的主界面和联系人详情界面增加顶部菜单添加退出按钮 通过Hierarchy View 工具可以发现 主界面对应的类为 PeopleActivity 联系人详情界面对应的类为 Qu ...

  2. Android6.0 源码修改之 仿IOS添加全屏可拖拽浮窗返回按钮

    前言 之前写过屏蔽系统导航栏功能的文章,具体可看Android6.0 源码修改之屏蔽导航栏虚拟按键(Home和RecentAPP)/动态显示和隐藏NavigationBar 在某些特殊定制的版本中要求 ...

  3. android6.0搜索蓝牙无法显示问题解决

    1.android6.0版本搜索蓝牙需要开启位置信息 需在Manifest中添加权限: <uses-permission android:name="android.permissio ...

  4. 【Android】Android6.0读取通话记录

    需求:读取通话记录,然后列表显示,每条记录的数据包括姓名.号码.类型(来电.去电.未接,字体颜色分别为绿.蓝.红),然后长按条目弹出一个列表弹窗,显示[复制号码到拨号盘].[发短信].[打电话]. 先 ...

  5. Android6.0运行时权限管理

    自从Android6.0发布以来,在权限上做出了很大的变动,不再是之前的只要在manifest设置就可以任意获取权限,而是更加的注重用户的隐私和体验,不会再强迫用户因拒绝不该拥有的权限而导致的无法安装 ...

  6. Android6.0 中appcompat_v7 报错

    更新了AndroidSDK以后 各种错误,新建一个项目会附赠一个appcompat_v7,你只要知道这个是一个兼容包就可以了,具体的特性可以看相关介绍,其实也没啥特别的就是为了兼容低版本的呗, 但是呢 ...

  7. Android6.0权限大全和权限分类

    本文转载至: https://blog.csdn.net/qq_26440221/article/details/53097868 自从出了Android6.0权限管理之后,再也不能像以前那样粘贴复制 ...

  8. Android app 在线更新那点事儿(适配Android6.0、7.0、8.0)

    一.前言 app在线更新是一个比较常见需求,新版本发布时,用户进入我们的app,就会弹出更新提示框,第一时间更新新版本app.在线更新分为以下几个步骤: 1, 通过接口获取线上版本号,versionC ...

  9. [IMX6]Android6.0移植和分析

    0. 知识点 中断(设备树) [IMX6]设备树分析--dts 1. 编译 Android6.0内核移植(1):分析编译日志 Android6.0内核移植(2):kernel编译内核 单独烧录kern ...

随机推荐

  1. Visual Studio配色方案

    Eclipse开源工具和VS在诸多方面真的是差距非常大,无奈Java编程,使用VS非常麻烦.所以只能选择Eclipse 但是Eclipse的系统配色,又实在是不舒服,于是抽时间,从VS上抠了一份默认的 ...

  2. 关于JSON

    JSON:一种数据交换格式,不是一种编程语言.(JSON 语法是 JavaScript 对象表示法语法的子集.) 什么是 JSON ? JSON 指的是 JavaScript 对象表示法(JavaSc ...

  3. 乐1S 5.8(Android 6.0) 刷第三方recovery并刷入root权限

    说明 我的是 乐视1S, 系统为EUI 5.8 (powered by Android 6.0) 使用的是 superSu来root, 你可以到这里下载 文件 *下载 Recovery Flashab ...

  4. angularJS和jQuery的区别

    问题: 假如我熟悉利用jQuery去开发客户端应用,那么我怎么上手angularjs,能否描述下所需要的模式转变,下面这些问题能够帮助你给出一个回答: 1.在设计客户端web应用的时候有什么区别,最大 ...

  5. java socket 多线程通讯 使用mina作为服务端

    客户端代码不变,参照 http://www.cnblogs.com/Westfalen/p/6251473.html 服务端代码如下: import java.io.IOException; impo ...

  6. kthread_run【转】

    转自:http://blog.csdn.net/zhangxuechao_/article/details/50876397 头文件 include/linux/kthread.h 创建并启动 /** ...

  7. prince2 证书有用吗

    prince2 证书有用吗  ? 项目管理是一件非常困难的事情,新闻里充斥着虽利润高却未能成功支付的项目案例.这是为什么呢? 最主要的原因是项目工作比日常的商业工作要困难的多.日常的商业工作往往是重复 ...

  8. Java Web学习路线

    2016-08-22的早上,本是一个很平静的早上,坐在去往公司的公交车上想到了很多之前上学时的点点滴滴,回想起来还真的是耐人寻味啊,当初青春的懵懂,当初的冲动,当初的做事不考虑后果! 也正是这耐人寻味 ...

  9. Eclipse创建maven项目

    许久不创建maven web项目了,今天上手很是陌生,搜集资料后终于创建成功,跟大家也分享一下,同时也便于以后再次忘记使用... 新建maven项目(右击new,若不存在,可在other里面寻找)

  10. jQuery 弹出层脚本

    直接贴代码: $.extend({ closeBox: function (o, x, fn) { $('#' + o).fadeOut(500, function () { if (fn & ...