您的位置:首页 > 移动开发 > Android开发

Android 通话记录不包含紧急呼叫问题

2013-05-03 10:08 465 查看
通话记录中不包含紧急呼叫有Phone配置文件控制

路径: packages/apps/Phone/res/values

文件:config.xml

修改:allow_emergency_numbers_in_call_log

说明:

allow_emergency_numbers_in_call_log 设置为 true 则 通话记录中含有紧急呼叫号码

allow_emergency_numbers_in_call_log 设置为 false 则通话记录中不含有紧急呼叫号码

涉及代码:

路径: packages\apps\Phone\src\com\android\phone\CallNotifier.java

方法:

private void onDisconnect(AsyncResult r) {
。。。。。。。
。。。。。。。
// On some devices, to avoid accidental redialing of
// emergency numbers, we *never* log emergency calls to
// the Call Log.  (This behavior is set on a per-product
// basis, based on carrier requirements.)
final boolean okToLogEmergencyNumber =
mApplication.getResources().getBoolean(
R.bool.allow_emergency_numbers_in_call_log);

// Don't call isOtaSpNumber() on phones that don't support OTASP.
final boolean isOtaspNumber = TelephonyCapabilities.supportsOtasp(phone)
&& phone.isOtaSpNumber(number);

// Don't log emergency numbers if the device doesn't allow it,
// and never log OTASP calls.
final boolean okToLogThisCall =
(!isEmergencyNumber || okToLogEmergencyNumber)
&& !isOtaspNumber;

if (okToLogThisCall) {
CallLogAsync.AddCallArgs args =
new CallLogAsync.AddCallArgs(
mApplication, ci, logNumber, presentation,
callLogType, date, duration);
mCallLog.addCall(args);
}
}


okToLogEmergencyNumber  为关键变量。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: