Fixed issue related apn not getting displayed with sim in slot 2.
Bug: 18999392
Change-Id: Ibd736a653d3e50af888461a90d2f34689d0a45b3
diff --git a/src/com/android/phone/MobileNetworkSettings.java b/src/com/android/phone/MobileNetworkSettings.java
index d00ff9f..abbc3f7 100644
--- a/src/com/android/phone/MobileNetworkSettings.java
+++ b/src/com/android/phone/MobileNetworkSettings.java
@@ -281,9 +281,12 @@
mActiveSubInfos.clear();
if (sil != null) {
mActiveSubInfos.addAll(sil);
+ // If there is only 1 sim then currenTab should represent slot no. of the sim.
+ if (sil.size() == 1) {
+ currentTab = sil.get(0).getSimSlotIndex();
+ }
}
-
switch (state) {
case UPDATE: {
if (DBG) log("initializeSubscriptions: UPDATE");
@@ -323,7 +326,6 @@
}
case NO_TABS: {
if (DBG) log("initializeSubscriptions: NO_TABS");
- currentTab = 0;
if (mTabHost != null) {
mTabHost.clearAllTabs();
@@ -334,7 +336,9 @@
}
case DO_NOTHING: {
if (DBG) log("initializeSubscriptions: DO_NOTHING");
- currentTab = mTabHost != null ? mTabHost.getCurrentTab() : 0;
+ if (mTabHost != null) {
+ currentTab = mTabHost.getCurrentTab();
+ }
break;
}
}