forked from PeterCxy/OpenEUICC
PrivilegedTelephonyUtils: do not disable profiles on external eUICCs
This commit is contained in:
parent
2a6002d053
commit
41a53816f8
|
@ -19,10 +19,12 @@ fun TelephonyManager.setDsdsEnabled(euiccManager: EuiccChannelManager, enabled:
|
|||
euiccManager.enumerateEuiccChannels()
|
||||
}
|
||||
|
||||
// Disable all eSIM profiles before performing a DSDS switch
|
||||
// Disable all eSIM profiles before performing a DSDS switch (only for internal eSIMs)
|
||||
euiccManager.knownChannels.forEach {
|
||||
if (!it.removable) {
|
||||
it.lpa.disableActiveProfileWithUndo()
|
||||
}
|
||||
}
|
||||
|
||||
switchMultiSimConfig(if (enabled) { 2 } else { 1 })
|
||||
}
|
||||
|
@ -42,7 +44,13 @@ fun TelephonyManager.updateSimSlotMapping(
|
|||
|
||||
val undo = unmapped.mapNotNull { mapping ->
|
||||
euiccManager.findEuiccChannelByPortBlocking(mapping.physicalSlotIndex, mapping.portIndex)?.let { channel ->
|
||||
if (!channel.removable) {
|
||||
return@mapNotNull channel.lpa.disableActiveProfileWithUndo()
|
||||
} else {
|
||||
// Do not do anything for external eUICCs -- we can't really trust them to work properly
|
||||
// with no profile enabled.
|
||||
return@mapNotNull null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue