[Settings] Fix crash and UI error when turn ON/OFF SIM
1. Should update the UI when turn off SIM 2. Fix ConcurrentModificationException Bug: 259487637 Test: manual Change-Id: If30a6b6323ac0237c92dc210bf3953ce86a199ae
This commit is contained in:
@@ -264,8 +264,7 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
|||||||
mIsActive = portInfo.isActive();
|
mIsActive = portInfo.isActive();
|
||||||
mPortIndex = portInfo.getPortIndex();
|
mPortIndex = portInfo.getPortIndex();
|
||||||
} else if (DEBUG) {
|
} else if (DEBUG) {
|
||||||
Log.d(TAG,
|
Log.d(TAG, "Can not get port index and physicalSlotIndex for subId "
|
||||||
"Can not get port index and physicalSlotIndex for subId "
|
|
||||||
+ mSubId);
|
+ mSubId);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -297,8 +296,7 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
|||||||
setActiveSubInfoList(mActiveSubInfoEntityList);
|
setActiveSubInfoList(mActiveSubInfoEntityList);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setActiveSubInfoList(
|
private void setActiveSubInfoList(List<SubscriptionInfoEntity> activeSubInfoEntityList) {
|
||||||
List<SubscriptionInfoEntity> activeSubInfoEntityList) {
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG,
|
Log.d(TAG,
|
||||||
"onActiveSubInfoChanged, activeSubInfoEntityList = " + activeSubInfoEntityList);
|
"onActiveSubInfoChanged, activeSubInfoEntityList = " + activeSubInfoEntityList);
|
||||||
@@ -460,11 +458,16 @@ public class MobileNetworkRepository extends SubscriptionManager.OnSubscriptions
|
|||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG, "availableSudInfoList from framework is empty, remove all subs");
|
Log.d(TAG, "availableSudInfoList from framework is empty, remove all subs");
|
||||||
}
|
}
|
||||||
for (SubscriptionInfoEntity info : mAvailableSubInfoEntityList) {
|
|
||||||
|
SubscriptionInfoEntity[] availableInfoArray = mAvailableSubInfoEntityList.toArray(
|
||||||
|
new SubscriptionInfoEntity[0]);
|
||||||
|
for (SubscriptionInfoEntity info : availableInfoArray) {
|
||||||
deleteAllInfoBySubId(info.subId);
|
deleteAllInfoBySubId(info.subId);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (availableInfoList != null) {
|
} else if (availableInfoList != null) {
|
||||||
for (SubscriptionInfo subInfo : availableInfoList) {
|
SubscriptionInfo[] infoArray = availableInfoList.toArray(new SubscriptionInfo[0]);
|
||||||
|
for (SubscriptionInfo subInfo : infoArray) {
|
||||||
mSubscriptionInfoMap.remove(subInfo.getSubscriptionId());
|
mSubscriptionInfoMap.remove(subInfo.getSubscriptionId());
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
Log.d(TAG,
|
Log.d(TAG,
|
||||||
|
@@ -464,10 +464,6 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAvailableSubInfoChanged(List<SubscriptionInfoEntity> subInfoEntityList) {
|
public void onAvailableSubInfoChanged(List<SubscriptionInfoEntity> subInfoEntityList) {
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onActiveSubInfoChanged(List<SubscriptionInfoEntity> subInfoEntityList) {
|
|
||||||
if (DataServiceUtils.shouldUpdateEntityList(mSubInfoEntityList, subInfoEntityList)) {
|
if (DataServiceUtils.shouldUpdateEntityList(mSubInfoEntityList, subInfoEntityList)) {
|
||||||
|
|
||||||
// Check the current subId is existed or not, if so, finish it.
|
// Check the current subId is existed or not, if so, finish it.
|
||||||
@@ -499,6 +495,10 @@ public class MobileNetworkSettings extends AbstractMobileNetworkSettings impleme
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActiveSubInfoChanged(List<SubscriptionInfoEntity> subInfoEntityList) {
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAllUiccInfoChanged(List<UiccInfoEntity> uiccInfoEntityList) {
|
public void onAllUiccInfoChanged(List<UiccInfoEntity> uiccInfoEntityList) {
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user