国外运营商要求在Disable CF失败时自动转移到Voice mail number
时间:10-02
整理:3721RD
点击:
[android Version]
Android V2.3 (GB,GB2,GB3)
Android V4.0, 4.1(ICS,ICS2,JB)
Android V4.2(JB2,JB3,JB5)
[DESCRIPTION]
国外运营商要求在Disable CF失败时自动转移到Voice mail number
[SOLUTION]
(packages\apps\phone\src\com\android\phone)如下几个地方:
1 先定义private boolean bRetry = false;
2 在CallForwardEditPreference.java定义private String mVoiceMailNumber;
3 在handleGetCFResponse()开始处获取voicenumber:mVoiceMailNumber = phone.getVoiceMailNumber();
4 在handleGetCFResponse中添加如下代码:
if (s!=null)
{
if (mVoiceMailNumber!= null)
if (bRetry =false)
{
bRetry=true;
int action =CommandsInterface.CF_ACTION_REGISTRATION;
int time = (reason != CommandsInterface.CF_REASON_NO_REPLY) ? 0 : 20;
String number = mVoiceMailNumber;
phone.setCallForwardingOption(action,
reason,
number,
time,
mHandler.obtainMessage(MyHandler.MESSAGE_SET_CF));
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setNeutralButton(R.string.close_dialog, null);
builder.setTitle(getContext().getText(R.string.error_updating_title));
builder.setMessage(s);
builder.setCancelable(true);
builder.create();
}
else
{
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setNeutralButton(R.string.close_dialog, null);
builder.setTitle(getContext().getText(R.string.error_updating_title));
builder.setMessage(s);
builder.setCancelable(true);
builder.create().show();
bRetry=false;
}
}
Android V2.3 (GB,GB2,GB3)
Android V4.0, 4.1(ICS,ICS2,JB)
Android V4.2(JB2,JB3,JB5)
[DESCRIPTION]
国外运营商要求在Disable CF失败时自动转移到Voice mail number
[SOLUTION]
(packages\apps\phone\src\com\android\phone)如下几个地方:
1 先定义private boolean bRetry = false;
2 在CallForwardEditPreference.java定义private String mVoiceMailNumber;
3 在handleGetCFResponse()开始处获取voicenumber:mVoiceMailNumber = phone.getVoiceMailNumber();
4 在handleGetCFResponse中添加如下代码:
if (s!=null)
{
if (mVoiceMailNumber!= null)
if (bRetry =false)
{
bRetry=true;
int action =CommandsInterface.CF_ACTION_REGISTRATION;
int time = (reason != CommandsInterface.CF_REASON_NO_REPLY) ? 0 : 20;
String number = mVoiceMailNumber;
phone.setCallForwardingOption(action,
reason,
number,
time,
mHandler.obtainMessage(MyHandler.MESSAGE_SET_CF));
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setNeutralButton(R.string.close_dialog, null);
builder.setTitle(getContext().getText(R.string.error_updating_title));
builder.setMessage(s);
builder.setCancelable(true);
builder.create();
}
else
{
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setNeutralButton(R.string.close_dialog, null);
builder.setTitle(getContext().getText(R.string.error_updating_title));
builder.setMessage(s);
builder.setCancelable(true);
builder.create().show();
bRetry=false;
}
}
学习了~~~~~~~~~~~~~
:loveliness:
学习学习
学学学学
小编写的什么东西