Modify 1: function isChecked ()
Private boolean isChecked (String preference, int sim_id ){
SharedPreferences prefs = PreferenceManager. getdefasharsharedpreferences (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 );
** Add start **
} 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 );
** End of adding **
}
Return true;
}
Modify 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. getdefasharsharedpreferences (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 ());
** Add start **
} 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 ());
** End of adding **
}
Editor. apply ();
Return super. onPreferenceTreeClick (preferenceScreen, preference );
}