Revert "Additional changes to SubscriptionManager API as per API council."
This reverts commit 1285f74fcb
.
Change-Id: I366556368a9c429d8c356bcdb8e29af9c6c4c71e
This commit is contained in:
@@ -42,12 +42,9 @@ public class ImeiInformation extends PreferenceActivity {
|
||||
private static final String KEY_IMEI = "imei";
|
||||
private static final String KEY_IMEI_SV = "imei_sv";
|
||||
|
||||
private SubscriptionManager mSubscriptionManager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
mSubscriptionManager = SubscriptionManager.from(this);
|
||||
final TelephonyManager telephonyManager =
|
||||
(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
|
||||
initPreferenceScreen(telephonyManager.getSimCount());
|
||||
@@ -103,17 +100,17 @@ public class ImeiInformation extends PreferenceActivity {
|
||||
}
|
||||
}
|
||||
|
||||
private Phone getPhoneFromSlotId(int slotIdx) {
|
||||
final SubscriptionInfo subInfo =
|
||||
mSubscriptionManager.getActiveSubscriptionInfoForSimSlotIndex(slotIdx);
|
||||
private Phone getPhoneFromSlotId(int slotId) {
|
||||
final List<SubscriptionInfo> subInfos = SubscriptionManager.getSubscriptionInfoUsingSlotId(slotId);
|
||||
|
||||
if (subInfo == null) {
|
||||
if (subInfos == null || subInfos.size() < 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
final Phone[] phones = PhoneFactory.getPhones();
|
||||
for (int i = 0; i < phones.length; i++) {
|
||||
if (phones[i].getSubId() == subInfo.getSubscriptionId()) {
|
||||
// Currently we only operate with the first subscription of a SIM.
|
||||
if (phones[i].getSubId() == subInfos.get(0).getSubscriptionId()) {
|
||||
return phones[i];
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user