首页 > 代码库 > Android TDD平台插入双卡时,查看允许返回发送报告的选项,去掉勾选,不起作用
Android TDD平台插入双卡时,查看允许返回发送报告的选项,去掉勾选,不起作用
请在MultiSimPreferenceActivity.java 作如下的修改, 验证之后请反馈结果。
共修改2 处。
共修改2 处。
修改1: 函数 isChecked()
private boolean isChecked(String preference,int sim_id){
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (mIntentPreference.equals(SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE)) {
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE , false);
} else if (mIntentPreference.equals(MmsPreferenceActivity.MMS_DELIVERY_REPORT_MODE)) {
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.MMS_DELIVERY_REPORT_MODE, false);
} else if (mIntentPreference.equals(MmsPreferenceActivity.AUTO_RETRIEVAL)) {
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.AUTO_RETRIEVAL, true);
} else if (mIntentPreference.equals(MmsPreferenceActivity.READ_REPORT_MODE)) {
if (FeatureOption.EVDO_DT_SUPPORT && isUSimType((int)(mListSimInfo.get(sim_id)).getSlot())) {
(mSimPreferencesList.get((mListSimInfo.get(sim_id)).getSlot())).setEnabled(false);
return false;
}
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.READ_REPORT_MODE, false);
} else if (mIntentPreference.equals(MmsPreferenceActivity.RETRIEVAL_DURING_ROAMING)) {
if(prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.AUTO_RETRIEVAL, true) == false){
(mSimPreferencesList.get((mListSimInfo.get(sim_id)).getSlot())).setEnabled(false);
}
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.RETRIEVAL_DURING_ROAMING, false);
} else if (mIntentPreference.equals(MmsPreferenceActivity.READ_REPORT_AUTO_REPLY)) {
if (FeatureOption.EVDO_DT_SUPPORT && isUSimType((int)(mListSimInfo.get(sim_id)).getSlot())) {
(mSimPreferencesList.get((mListSimInfo.get(sim_id)).getSlot())).setEnabled(false);
return false;
}
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.READ_REPORT_AUTO_REPLY, false);
** 增加开始**
} else if (mIntentPreference.equals(MmsPreferenceActivity.MMS_ENABLE_TO_SEND_DELIVERY_REPORT)) {
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.MMS_ENABLE_TO_SEND_DELIVERY_REPORT, false);
** 增加结束**
}
return true;
}
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (mIntentPreference.equals(SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE)) {
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE , false);
} else if (mIntentPreference.equals(MmsPreferenceActivity.MMS_DELIVERY_REPORT_MODE)) {
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.MMS_DELIVERY_REPORT_MODE, false);
} else if (mIntentPreference.equals(MmsPreferenceActivity.AUTO_RETRIEVAL)) {
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.AUTO_RETRIEVAL, true);
} else if (mIntentPreference.equals(MmsPreferenceActivity.READ_REPORT_MODE)) {
if (FeatureOption.EVDO_DT_SUPPORT && isUSimType((int)(mListSimInfo.get(sim_id)).getSlot())) {
(mSimPreferencesList.get((mListSimInfo.get(sim_id)).getSlot())).setEnabled(false);
return false;
}
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.READ_REPORT_MODE, false);
} else if (mIntentPreference.equals(MmsPreferenceActivity.RETRIEVAL_DURING_ROAMING)) {
if(prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.AUTO_RETRIEVAL, true) == false){
(mSimPreferencesList.get((mListSimInfo.get(sim_id)).getSlot())).setEnabled(false);
}
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.RETRIEVAL_DURING_ROAMING, false);
} else if (mIntentPreference.equals(MmsPreferenceActivity.READ_REPORT_AUTO_REPLY)) {
if (FeatureOption.EVDO_DT_SUPPORT && isUSimType((int)(mListSimInfo.get(sim_id)).getSlot())) {
(mSimPreferencesList.get((mListSimInfo.get(sim_id)).getSlot())).setEnabled(false);
return false;
}
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.READ_REPORT_AUTO_REPLY, false);
** 增加开始**
} else if (mIntentPreference.equals(MmsPreferenceActivity.MMS_ENABLE_TO_SEND_DELIVERY_REPORT)) {
return prefs.getBoolean(Long.toString((mListSimInfo.get(sim_id)).getSimId()) + "_" + MmsPreferenceActivity.MMS_ENABLE_TO_SEND_DELIVERY_REPORT, false);
** 增加结束**
}
return true;
}
修改2 :函数 onPreferenceTreeClick()
public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
int i = 0;
int currentSlotId = -1;
long currentSimId = -1;
currentSlotId = mSimPreferencesList.indexOf(preference);
for (SIMInfo simInfo: mListSimInfo) {
if (simInfo.getSlot() == currentSlotId) {
currentSimId = simInfo.getSimId();
break;
}
}
Log.d(TAG, "onPreferenceTreeClick[SlotId]" +currentSlotId);
Log.d(TAG, "onPreferenceTreeClick[SimId]"+currentSimId);
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
if (mIntentPreference.equals(SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.MMS_DELIVERY_REPORT_MODE)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.MMS_DELIVERY_REPORT_MODE,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.AUTO_RETRIEVAL)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.AUTO_RETRIEVAL,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.READ_REPORT_MODE)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.READ_REPORT_MODE,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.RETRIEVAL_DURING_ROAMING)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.RETRIEVAL_DURING_ROAMING,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.READ_REPORT_AUTO_REPLY)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.READ_REPORT_AUTO_REPLY,
((AdvancedCheckBoxPreference) preference).isChecked());
int i = 0;
int currentSlotId = -1;
long currentSimId = -1;
currentSlotId = mSimPreferencesList.indexOf(preference);
for (SIMInfo simInfo: mListSimInfo) {
if (simInfo.getSlot() == currentSlotId) {
currentSimId = simInfo.getSimId();
break;
}
}
Log.d(TAG, "onPreferenceTreeClick[SlotId]" +currentSlotId);
Log.d(TAG, "onPreferenceTreeClick[SimId]"+currentSimId);
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
if (mIntentPreference.equals(SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + SmsPreferenceActivity.SMS_DELIVERY_REPORT_MODE,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.MMS_DELIVERY_REPORT_MODE)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.MMS_DELIVERY_REPORT_MODE,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.AUTO_RETRIEVAL)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.AUTO_RETRIEVAL,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.READ_REPORT_MODE)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.READ_REPORT_MODE,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.RETRIEVAL_DURING_ROAMING)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.RETRIEVAL_DURING_ROAMING,
((AdvancedCheckBoxPreference) preference).isChecked());
} else if (mIntentPreference.equals(MmsPreferenceActivity.READ_REPORT_AUTO_REPLY)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.READ_REPORT_AUTO_REPLY,
((AdvancedCheckBoxPreference) preference).isChecked());
** 增加开始**
} else if (mIntentPreference.equals(MmsPreferenceActivity.MMS_ENABLE_TO_SEND_DELIVERY_REPORT)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.MMS_ENABLE_TO_SEND_DELIVERY_REPORT,
((AdvancedCheckBoxPreference) preference).isChecked());
** 增加结束**
}
editor.apply();
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
} else if (mIntentPreference.equals(MmsPreferenceActivity.MMS_ENABLE_TO_SEND_DELIVERY_REPORT)) {
editor.putBoolean(Long.toString(currentSimId) + "_" + MmsPreferenceActivity.MMS_ENABLE_TO_SEND_DELIVERY_REPORT,
((AdvancedCheckBoxPreference) preference).isChecked());
** 增加结束**
}
editor.apply();
return super.onPreferenceTreeClick(preferenceScreen, preference);
}
Android TDD平台插入双卡时,查看允许返回发送报告的选项,去掉勾选,不起作用
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。