[MEP] psim->esim, don't skip carrierConfigChanged with subId -1

After simSlotMapping from psim to esim, since the esim can not be
enabled by the modem, the UI start to enable the esim. Therefore,
when receiver receive the first carrier config changed, UI can
exit waiting state, and then start to enable esim.

Bug: 246556280
Test: Build pass. Verify by QA
Change-Id: I4b8b2f3d1dd014fc1ddb92ebffa614d6daf9d142
This commit is contained in:
SongFerngWang
2022-09-27 20:45:17 +08:00
parent 51cabc5553
commit 078ecbd765
2 changed files with 21 additions and 6 deletions

View File

@@ -141,7 +141,8 @@ public class UiccSlotUtil {
inactiveRemovableSlot,
/*removable sim's port Id*/ TelephonyManager.DEFAULT_PORT_INDEX,
excludedLogicalSlotIndex),
context);
context,
/*isWaitingForValidSubId=*/ true);
}
/**
@@ -179,7 +180,8 @@ public class UiccSlotUtil {
performSwitchToSlot(telMgr,
prepareUiccSlotMappings(uiccSlotMappings, /*slot is not psim*/ false,
physicalSlotId, port, excludedLogicalSlotIndex),
context);
context,
/*isWaitingForValidSubId=*/ false);
}
/**
@@ -231,7 +233,8 @@ public class UiccSlotUtil {
}
private static void performSwitchToSlot(TelephonyManager telMgr,
Collection<UiccSlotMapping> uiccSlotMappings, Context context)
Collection<UiccSlotMapping> uiccSlotMappings, Context context,
boolean isWaitingForValidSubId)
throws UiccSlotsException {
CarrierConfigChangedReceiver receiver = null;
long waitingTimeMillis =
@@ -241,7 +244,7 @@ public class UiccSlotUtil {
DEFAULT_WAIT_AFTER_SWITCH_TIMEOUT_MILLIS);
try {
CountDownLatch latch = new CountDownLatch(1);
receiver = new CarrierConfigChangedReceiver(latch);
receiver = new CarrierConfigChangedReceiver(latch, isWaitingForValidSubId);
receiver.registerOn(context);
telMgr.setSimSlotMapping(uiccSlotMappings);
latch.await(waitingTimeMillis, TimeUnit.MILLISECONDS);