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

Commit f90f6329 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 27e434ff
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -560,10 +560,15 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
            public boolean onItemSelected(int pos, Object value) {
                final int subId = value == null ? 0 : ((SubscriptionInfo)value).getSubscriptionId();

                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.from(getActivity()).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