[MEP] sort the simSlotMapping by logcal slot id

The modem assign the simSlotMapping like UiccSlotMapping[
(mPortIndex=0, mPhysicalSlotIndex=0, mLogicalSlotIndex=1),
UiccSlotMapping (mPortIndex=1, mPhysicalSlotIndex=0,
mLogicalSlotIndex=0)]. The settings replace the first one
UiccSlotMapping when user insert psim and the both of esim
profile are not enabled. It is not correct. The root cause is that
the settings did not sort the simSlotMapping by logcal slot id.

Bug: 223662007
Test: atest UiccSlotUtilTest  (PASS)
Change-Id: I6871db6c2d8d7b9f3cb334bb5cd2c7978b5b3b85
Merged-In: I6871db6c2d8d7b9f3cb334bb5cd2c7978b5b3b85
This commit is contained in:
SongFerngWang
2022-03-11 02:58:55 +08:00
parent ccd55cc5c9
commit ef80331fb0
2 changed files with 52 additions and 3 deletions

View File

@@ -369,6 +369,7 @@ public class UiccSlotUtil {
}
return true;
})
.sorted(Comparator.comparingInt(UiccSlotMapping::getLogicalSlotIndex))
.mapToInt(uiccSlotMapping -> uiccSlotMapping.getLogicalSlotIndex())
.findFirst()
.orElse(INVALID_LOGICAL_SLOT_ID);