Merge "Update SubscriptionManager API as per API council." into lmp-mr1-dev
This commit is contained in:
@@ -88,7 +88,7 @@ import android.os.SystemProperties;
|
|||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.os.UserManager;
|
import android.os.UserManager;
|
||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.telephony.SubInfoRecord;
|
import android.telephony.SubscriptionInfo;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -267,7 +267,7 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
private MenuItem mMenuSimCards;
|
private MenuItem mMenuSimCards;
|
||||||
private MenuItem mMenuCellularNetworks;
|
private MenuItem mMenuCellularNetworks;
|
||||||
|
|
||||||
private List<SubInfoRecord> mSubInfoList;
|
private List<SubscriptionInfo> mSubInfoList;
|
||||||
private Map<Integer,String> mMobileTagMap;
|
private Map<Integer,String> mMobileTagMap;
|
||||||
|
|
||||||
/** Flag used to ignore listeners during binding. */
|
/** Flag used to ignore listeners during binding. */
|
||||||
@@ -1130,8 +1130,8 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
};
|
};
|
||||||
|
|
||||||
private void handleMultiSimDataDialog() {
|
private void handleMultiSimDataDialog() {
|
||||||
final SubInfoRecord currentSir = getCurrentTabSubInfo(getActivity());
|
final SubscriptionInfo currentSir = getCurrentTabSubInfo(getActivity());
|
||||||
final SubInfoRecord nextSir = SubscriptionManager.getSubInfoForSubscriber(
|
final SubscriptionInfo nextSir = SubscriptionManager.getSubscriptionInfoForSubscriber(
|
||||||
SubscriptionManager.getDefaultDataSubId());
|
SubscriptionManager.getDefaultDataSubId());
|
||||||
|
|
||||||
if (currentSir.getSubscriptionId() == nextSir.getSubscriptionId()) {
|
if (currentSir.getSubscriptionId() == nextSir.getSubscriptionId()) {
|
||||||
@@ -2339,14 +2339,14 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
final ConnectivityManager conn = ConnectivityManager.from(context);
|
final ConnectivityManager conn = ConnectivityManager.from(context);
|
||||||
final TelephonyManager tele = TelephonyManager.from(context);
|
final TelephonyManager tele = TelephonyManager.from(context);
|
||||||
|
|
||||||
final List<SubInfoRecord> subInfoList = SubscriptionManager.getActiveSubInfoList();
|
final List<SubscriptionInfo> subInfoList = SubscriptionManager.getActiveSubscriptionInfoList();
|
||||||
// No activated Subscription
|
// No activated Subscription
|
||||||
if (subInfoList == null) {
|
if (subInfoList == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// require both supported network and ready SIM
|
// require both supported network and ready SIM
|
||||||
boolean isReady = true;
|
boolean isReady = true;
|
||||||
for (SubInfoRecord subInfo : subInfoList) {
|
for (SubscriptionInfo subInfo : subInfoList) {
|
||||||
isReady = isReady & tele.getSimState(subInfo.getSimSlotIndex()) == SIM_STATE_READY;
|
isReady = isReady & tele.getSimState(subInfo.getSimSlotIndex()) == SIM_STATE_READY;
|
||||||
}
|
}
|
||||||
return conn.isNetworkSupported(TYPE_MOBILE) && isReady;
|
return conn.isNetworkSupported(TYPE_MOBILE) && isReady;
|
||||||
@@ -2585,9 +2585,9 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private void addMobileTab(Context context, List<SubInfoRecord> subInfoList) {
|
private void addMobileTab(Context context, List<SubscriptionInfo> subInfoList) {
|
||||||
if (subInfoList != null) {
|
if (subInfoList != null) {
|
||||||
for (SubInfoRecord subInfo : mSubInfoList) {
|
for (SubscriptionInfo subInfo : mSubInfoList) {
|
||||||
if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
|
if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
|
||||||
mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
|
mTabHost.addTab(buildTabSpec(mMobileTagMap.get(subInfo.getSubscriptionId()),
|
||||||
subInfo.getDisplayName()));
|
subInfo.getDisplayName()));
|
||||||
@@ -2596,11 +2596,11 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private SubInfoRecord getCurrentTabSubInfo(Context context) {
|
private SubscriptionInfo getCurrentTabSubInfo(Context context) {
|
||||||
if (mSubInfoList != null && mTabHost != null) {
|
if (mSubInfoList != null && mTabHost != null) {
|
||||||
final int currentTagIndex = mTabHost.getCurrentTab();
|
final int currentTagIndex = mTabHost.getCurrentTab();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (SubInfoRecord subInfo : mSubInfoList) {
|
for (SubscriptionInfo subInfo : mSubInfoList) {
|
||||||
if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
|
if (hasReadyMobileRadio(context, subInfo.getSubscriptionId())) {
|
||||||
if (i++ == currentTagIndex) {
|
if (i++ == currentTagIndex) {
|
||||||
return subInfo;
|
return subInfo;
|
||||||
@@ -2616,12 +2616,12 @@ public class DataUsageSummary extends HighlightingFragment implements Indexable
|
|||||||
* @param subInfoList The subscription Info List
|
* @param subInfoList The subscription Info List
|
||||||
* @return The map or null if no activated subscription
|
* @return The map or null if no activated subscription
|
||||||
*/
|
*/
|
||||||
private Map<Integer, String> initMobileTabTag(List<SubInfoRecord> subInfoList) {
|
private Map<Integer, String> initMobileTabTag(List<SubscriptionInfo> subInfoList) {
|
||||||
Map<Integer, String> map = null;
|
Map<Integer, String> map = null;
|
||||||
if (subInfoList != null) {
|
if (subInfoList != null) {
|
||||||
String mobileTag;
|
String mobileTag;
|
||||||
map = new HashMap<Integer, String>();
|
map = new HashMap<Integer, String>();
|
||||||
for (SubInfoRecord subInfo : subInfoList) {
|
for (SubscriptionInfo subInfo : subInfoList) {
|
||||||
mobileTag = TAB_MOBILE + String.valueOf(subInfo.getSubscriptionId());
|
mobileTag = TAB_MOBILE + String.valueOf(subInfo.getSubscriptionId());
|
||||||
map.put(subInfo.getSubscriptionId(), mobileTag);
|
map.put(subInfo.getSubscriptionId(), mobileTag);
|
||||||
}
|
}
|
||||||
|
@@ -44,7 +44,7 @@ import android.security.KeyStore;
|
|||||||
import android.service.trust.TrustAgentService;
|
import android.service.trust.TrustAgentService;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.SubInfoRecord;
|
import android.telephony.SubscriptionInfo;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
@@ -372,9 +372,9 @@ public class SecuritySettings extends SettingsPreferenceFragment
|
|||||||
*/
|
*/
|
||||||
private static boolean isSimReady() {
|
private static boolean isSimReady() {
|
||||||
int simState = TelephonyManager.SIM_STATE_UNKNOWN;
|
int simState = TelephonyManager.SIM_STATE_UNKNOWN;
|
||||||
final List<SubInfoRecord> subInfoList = SubscriptionManager.getActiveSubInfoList();
|
final List<SubscriptionInfo> subInfoList = SubscriptionManager.getActiveSubscriptionInfoList();
|
||||||
if (subInfoList != null) {
|
if (subInfoList != null) {
|
||||||
for (SubInfoRecord subInfo : subInfoList) {
|
for (SubscriptionInfo subInfo : subInfoList) {
|
||||||
simState = TelephonyManager.getDefault().getSimState(subInfo.getSimSlotIndex());
|
simState = TelephonyManager.getDefault().getSimState(subInfo.getSimSlotIndex());
|
||||||
if((simState != TelephonyManager.SIM_STATE_ABSENT) &&
|
if((simState != TelephonyManager.SIM_STATE_ABSENT) &&
|
||||||
(simState != TelephonyManager.SIM_STATE_UNKNOWN)){
|
(simState != TelephonyManager.SIM_STATE_UNKNOWN)){
|
||||||
|
@@ -60,7 +60,7 @@ import android.provider.ContactsContract.Data;
|
|||||||
import android.provider.ContactsContract.Profile;
|
import android.provider.ContactsContract.Profile;
|
||||||
import android.provider.ContactsContract.RawContacts;
|
import android.provider.ContactsContract.RawContacts;
|
||||||
import android.service.persistentdata.PersistentDataBlockManager;
|
import android.service.persistentdata.PersistentDataBlockManager;
|
||||||
import android.telephony.SubInfoRecord;
|
import android.telephony.SubscriptionInfo;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -988,12 +988,13 @@ public final class Utils {
|
|||||||
* finds a record with subId.
|
* finds a record with subId.
|
||||||
* Since the number of SIMs are few, an array is fine.
|
* Since the number of SIMs are few, an array is fine.
|
||||||
*/
|
*/
|
||||||
public static SubInfoRecord findRecordBySubId(final int subId) {
|
public static SubscriptionInfo findRecordBySubId(final int subId) {
|
||||||
final List<SubInfoRecord> subInfoList = SubscriptionManager.getActiveSubInfoList();
|
final List<SubscriptionInfo> subInfoList =
|
||||||
|
SubscriptionManager.getActiveSubscriptionInfoList();
|
||||||
final int subInfoLength = subInfoList.size();
|
final int subInfoLength = subInfoList.size();
|
||||||
|
|
||||||
for (int i = 0; i < subInfoLength; ++i) {
|
for (int i = 0; i < subInfoLength; ++i) {
|
||||||
final SubInfoRecord sir = subInfoList.get(i);
|
final SubscriptionInfo sir = subInfoList.get(i);
|
||||||
if (sir != null && sir.getSubscriptionId() == subId) {
|
if (sir != null && sir.getSubscriptionId() == subId) {
|
||||||
return sir;
|
return sir;
|
||||||
}
|
}
|
||||||
@@ -1006,12 +1007,13 @@ public final class Utils {
|
|||||||
* finds a record with slotId.
|
* finds a record with slotId.
|
||||||
* Since the number of SIMs are few, an array is fine.
|
* Since the number of SIMs are few, an array is fine.
|
||||||
*/
|
*/
|
||||||
public static SubInfoRecord findRecordBySlotId(final int slotId) {
|
public static SubscriptionInfo findRecordBySlotId(final int slotId) {
|
||||||
final List<SubInfoRecord> subInfoList = SubscriptionManager.getActiveSubInfoList();
|
final List<SubscriptionInfo> subInfoList =
|
||||||
|
SubscriptionManager.getActiveSubscriptionInfoList();
|
||||||
final int subInfoLength = subInfoList.size();
|
final int subInfoLength = subInfoList.size();
|
||||||
|
|
||||||
for (int i = 0; i < subInfoLength; ++i) {
|
for (int i = 0; i < subInfoLength; ++i) {
|
||||||
final SubInfoRecord sir = subInfoList.get(i);
|
final SubscriptionInfo sir = subInfoList.get(i);
|
||||||
if (sir.getSimSlotIndex() == slotId) {
|
if (sir.getSimSlotIndex() == slotId) {
|
||||||
//Right now we take the first subscription on a SIM.
|
//Right now we take the first subscription on a SIM.
|
||||||
return sir;
|
return sir;
|
||||||
|
@@ -24,7 +24,7 @@ import android.os.Bundle;
|
|||||||
import android.preference.Preference;
|
import android.preference.Preference;
|
||||||
import android.preference.PreferenceActivity;
|
import android.preference.PreferenceActivity;
|
||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.telephony.SubInfoRecord;
|
import android.telephony.SubscriptionInfo;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
@@ -101,7 +101,7 @@ public class ImeiInformation extends PreferenceActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Phone getPhoneFromSlotId(int slotId) {
|
private Phone getPhoneFromSlotId(int slotId) {
|
||||||
final List<SubInfoRecord> subInfos = SubscriptionManager.getSubInfoUsingSlotId(slotId);
|
final List<SubscriptionInfo> subInfos = SubscriptionManager.getSubscriptionInfoUsingSlotId(slotId);
|
||||||
|
|
||||||
if (subInfos == null || subInfos.size() < 1) {
|
if (subInfos == null || subInfos.size() < 1) {
|
||||||
return null;
|
return null;
|
||||||
|
@@ -29,7 +29,7 @@ import android.preference.PreferenceCategory;
|
|||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.provider.SearchIndexableResource;
|
import android.provider.SearchIndexableResource;
|
||||||
import android.provider.Telephony;
|
import android.provider.Telephony;
|
||||||
import android.telephony.SubInfoRecord;
|
import android.telephony.SubscriptionInfo;
|
||||||
import android.telephony.SubscriptionManager;
|
import android.telephony.SubscriptionManager;
|
||||||
import android.telephony.TelephonyManager;
|
import android.telephony.TelephonyManager;
|
||||||
import android.telephony.PhoneNumberUtils;
|
import android.telephony.PhoneNumberUtils;
|
||||||
@@ -104,13 +104,13 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
* mSubInfoList is the list of all SubInfos.
|
* mSubInfoList is the list of all SubInfos.
|
||||||
* mSelectableSubInfos is the list of SubInfos that a user can select for data, calls, and SMS.
|
* mSelectableSubInfos is the list of SubInfos that a user can select for data, calls, and SMS.
|
||||||
*/
|
*/
|
||||||
private List<SubInfoRecord> mAvailableSubInfos = null;
|
private List<SubscriptionInfo> mAvailableSubInfos = null;
|
||||||
private List<SubInfoRecord> mSubInfoList = null;
|
private List<SubscriptionInfo> mSubInfoList = null;
|
||||||
private List<SubInfoRecord> mSelectableSubInfos = null;
|
private List<SubscriptionInfo> mSelectableSubInfos = null;
|
||||||
|
|
||||||
private SubInfoRecord mCellularData = null;
|
private SubscriptionInfo mCellularData = null;
|
||||||
private SubInfoRecord mCalls = null;
|
private SubscriptionInfo mCalls = null;
|
||||||
private SubInfoRecord mSMS = null;
|
private SubscriptionInfo mSMS = null;
|
||||||
|
|
||||||
private PreferenceCategory mSimCards = null;
|
private PreferenceCategory mSimCards = null;
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
super.onCreate(bundle);
|
super.onCreate(bundle);
|
||||||
|
|
||||||
if (mSubInfoList == null) {
|
if (mSubInfoList == null) {
|
||||||
mSubInfoList = SubscriptionManager.getActiveSubInfoList();
|
mSubInfoList = SubscriptionManager.getActiveSubscriptionInfoList();
|
||||||
}
|
}
|
||||||
|
|
||||||
createPreferences();
|
createPreferences();
|
||||||
@@ -141,11 +141,11 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
mSimCards = (PreferenceCategory)findPreference(SIM_CARD_CATEGORY);
|
mSimCards = (PreferenceCategory)findPreference(SIM_CARD_CATEGORY);
|
||||||
|
|
||||||
final int numSlots = tm.getSimCount();
|
final int numSlots = tm.getSimCount();
|
||||||
mAvailableSubInfos = new ArrayList<SubInfoRecord>(numSlots);
|
mAvailableSubInfos = new ArrayList<SubscriptionInfo>(numSlots);
|
||||||
mSelectableSubInfos = new ArrayList<SubInfoRecord>();
|
mSelectableSubInfos = new ArrayList<SubscriptionInfo>();
|
||||||
mNumSims = 0;
|
mNumSims = 0;
|
||||||
for (int i = 0; i < numSlots; ++i) {
|
for (int i = 0; i < numSlots; ++i) {
|
||||||
final SubInfoRecord sir = Utils.findRecordBySlotId(i);
|
final SubscriptionInfo sir = Utils.findRecordBySlotId(i);
|
||||||
mSimCards.addPreference(new SimPreference(getActivity(), sir, i));
|
mSimCards.addPreference(new SimPreference(getActivity(), sir, i));
|
||||||
mAvailableSubInfos.add(sir);
|
mAvailableSubInfos.add(sir);
|
||||||
if (sir != null) {
|
if (sir != null) {
|
||||||
@@ -163,9 +163,9 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
final int numSlots = tm.getSimCount();
|
final int numSlots = tm.getSimCount();
|
||||||
|
|
||||||
mNumSims = 0;
|
mNumSims = 0;
|
||||||
mAvailableSubInfos = new ArrayList<SubInfoRecord>(numSlots);
|
mAvailableSubInfos = new ArrayList<SubscriptionInfo>(numSlots);
|
||||||
for (int i = 0; i < numSlots; ++i) {
|
for (int i = 0; i < numSlots; ++i) {
|
||||||
final SubInfoRecord sir = Utils.findRecordBySlotId(i);
|
final SubscriptionInfo sir = Utils.findRecordBySlotId(i);
|
||||||
mAvailableSubInfos.add(sir);
|
mAvailableSubInfos.add(sir);
|
||||||
if (sir != null) {
|
if (sir != null) {
|
||||||
mNumSims++;
|
mNumSims++;
|
||||||
@@ -179,7 +179,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateSimSlotValues() {
|
private void updateSimSlotValues() {
|
||||||
SubscriptionManager.getAllSubInfoList();
|
SubscriptionManager.getAllSubscriptionInfoList();
|
||||||
|
|
||||||
final int prefSize = mSimCards.getPreferenceCount();
|
final int prefSize = mSimCards.getPreferenceCount();
|
||||||
for (int i = 0; i < prefSize; ++i) {
|
for (int i = 0; i < prefSize; ++i) {
|
||||||
@@ -198,7 +198,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
|
|
||||||
private void updateSmsValues() {
|
private void updateSmsValues() {
|
||||||
final Preference simPref = findPreference(KEY_SMS);
|
final Preference simPref = findPreference(KEY_SMS);
|
||||||
final SubInfoRecord sir = Utils.findRecordBySubId(SubscriptionManager.getDefaultSmsSubId());
|
final SubscriptionInfo sir = Utils.findRecordBySubId(SubscriptionManager.getDefaultSmsSubId());
|
||||||
simPref.setTitle(R.string.sms_messages_title);
|
simPref.setTitle(R.string.sms_messages_title);
|
||||||
if (mSubInfoList.size() == 1) {
|
if (mSubInfoList.size() == 1) {
|
||||||
simPref.setSummary(mSubInfoList.get(0).getDisplayName());
|
simPref.setSummary(mSubInfoList.get(0).getDisplayName());
|
||||||
@@ -212,7 +212,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
|
|
||||||
private void updateCellularDataValues() {
|
private void updateCellularDataValues() {
|
||||||
final Preference simPref = findPreference(KEY_CELLULAR_DATA);
|
final Preference simPref = findPreference(KEY_CELLULAR_DATA);
|
||||||
final SubInfoRecord sir = Utils.findRecordBySubId(SubscriptionManager.getDefaultDataSubId());
|
final SubscriptionInfo sir = Utils.findRecordBySubId(SubscriptionManager.getDefaultDataSubId());
|
||||||
simPref.setTitle(R.string.cellular_data_title);
|
simPref.setTitle(R.string.cellular_data_title);
|
||||||
if (mSubInfoList.size() == 1) {
|
if (mSubInfoList.size() == 1) {
|
||||||
simPref.setSummary(mSubInfoList.get(0).getDisplayName());
|
simPref.setSummary(mSubInfoList.get(0).getDisplayName());
|
||||||
@@ -240,7 +240,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|
||||||
mSubInfoList = SubscriptionManager.getActiveSubInfoList();
|
mSubInfoList = SubscriptionManager.getActiveSubscriptionInfoList();
|
||||||
updateAvailableSubInfos();
|
updateAvailableSubInfos();
|
||||||
updateAllOptions();
|
updateAllOptions();
|
||||||
}
|
}
|
||||||
@@ -271,7 +271,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(DialogInterface dialog, int value) {
|
public void onClick(DialogInterface dialog, int value) {
|
||||||
|
|
||||||
final SubInfoRecord sir;
|
final SubscriptionInfo sir;
|
||||||
|
|
||||||
if (id == DATA_PICK) {
|
if (id == DATA_PICK) {
|
||||||
sir = mSelectableSubInfos.get(value);
|
sir = mSelectableSubInfos.get(value);
|
||||||
@@ -305,7 +305,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (int i = 0; i < selectableSubInfoLength; ++i) {
|
for (int i = 0; i < selectableSubInfoLength; ++i) {
|
||||||
final SubInfoRecord sir = mSelectableSubInfos.get(i);
|
final SubscriptionInfo sir = mSelectableSubInfos.get(i);
|
||||||
CharSequence displayName = sir.getDisplayName();
|
CharSequence displayName = sir.getDisplayName();
|
||||||
if (displayName == null) {
|
if (displayName == null) {
|
||||||
displayName = "";
|
displayName = "";
|
||||||
@@ -379,7 +379,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setActivity(Preference preference, SubInfoRecord sir) {
|
private void setActivity(Preference preference, SubscriptionInfo sir) {
|
||||||
final String key = preference.getKey();
|
final String key = preference.getKey();
|
||||||
|
|
||||||
if (key.equals(KEY_CELLULAR_DATA)) {
|
if (key.equals(KEY_CELLULAR_DATA)) {
|
||||||
@@ -394,11 +394,11 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class SimPreference extends Preference{
|
private class SimPreference extends Preference{
|
||||||
private SubInfoRecord mSubInfoRecord;
|
private SubscriptionInfo mSubInfoRecord;
|
||||||
private int mSlotId;
|
private int mSlotId;
|
||||||
private int[] tintArr;
|
private int[] tintArr;
|
||||||
|
|
||||||
public SimPreference(Context context, SubInfoRecord subInfoRecord, int slotId) {
|
public SimPreference(Context context, SubscriptionInfo subInfoRecord, int slotId) {
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
mSubInfoRecord = subInfoRecord;
|
mSubInfoRecord = subInfoRecord;
|
||||||
@@ -438,7 +438,7 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubInfoRecord getSubInfoRecord() {
|
public SubscriptionInfo getSubInfoRecord() {
|
||||||
return mSubInfoRecord;
|
return mSubInfoRecord;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -528,13 +528,13 @@ public class SimSettings extends RestrictedSettingsFragment implements Indexable
|
|||||||
* @param context The Context
|
* @param context The Context
|
||||||
* @return Sorted Subscription List or NULL if no activated Subscription
|
* @return Sorted Subscription List or NULL if no activated Subscription
|
||||||
*/
|
*/
|
||||||
public static List<SubInfoRecord> getSortedSubInfoList(Context context) {
|
public static List<SubscriptionInfo> getSortedSubInfoList(Context context) {
|
||||||
List<SubInfoRecord> infoList = SubscriptionManager.getActiveSubInfoList();
|
List<SubscriptionInfo> infoList = SubscriptionManager.getActiveSubscriptionInfoList();
|
||||||
if (infoList != null) {
|
if (infoList != null) {
|
||||||
Collections.sort(infoList, new Comparator<SubInfoRecord>() {
|
Collections.sort(infoList, new Comparator<SubscriptionInfo>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int compare(SubInfoRecord arg0, SubInfoRecord arg1) {
|
public int compare(SubscriptionInfo arg0, SubscriptionInfo arg1) {
|
||||||
int flag = arg0.getSimSlotIndex() - arg1.getSimSlotIndex();
|
int flag = arg0.getSimSlotIndex() - arg1.getSimSlotIndex();
|
||||||
if (flag == 0) {
|
if (flag == 0) {
|
||||||
return arg0.getSubscriptionId() - arg1.getSubscriptionId();
|
return arg0.getSubscriptionId() - arg1.getSubscriptionId();
|
||||||
|
Reference in New Issue
Block a user