Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0d8d0960 authored by Qiang Chen's avatar Qiang Chen
Browse files

MSIM: Backup preferred data subId only if DDS switch manually

Backup preferred data subId to DB only if user switch DDS from UI manually.

Change-Id: Icc78991c3e53bf0697e31b783c1c21adb4a0c4bf
CRs-Fixed: 796305
parent 79ce2ea1
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -558,12 +558,16 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
            public boolean onItemSelected(int pos, Object value) {
                final long subId = value == null ? 0 : ((SubInfoRecord)value).subId;

                Log.d(TAG,"calling setCallback: " + simPref.getKey() + "subId: " + subId);
                Log.d(TAG,"calling setCallback: " + simPref.getKey() + "subId: " + subId +
                        " defaultSubId: " + SubscriptionManager.getDefaultDataSubId());
                if (simPref.getKey().equals(KEY_CELLULAR_DATA)) {
                    if (SubscriptionManager.getDefaultDataSubId() != subId) {
                        SubscriptionManager.setDefaultDataSubId(subId);
                        Log.d(TAG,"subAvailableSize: "+ subAvailableSize);
                        if(subAvailableSize > 1) {
                            setUserPrefDataSubIdInDb(subId);
                        }
                   }
                } else if (simPref.getKey().equals(KEY_CALLS)) {
                    //subId 0 is meant for "Ask First"/"Prompt" option as per AOSP
                    if (subId == 0) {