android TDD平台插入雙卡時,查看允許返回傳送報告的選項,去掉勾選,不起作用

來源:互聯網
上載者:User

修改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;
    }

修改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());
 ** 增加開始**
        } 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);
    }

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.