Loading app-common/src/main/java/im/angry/openeuicc/core/DefaultEuiccChannelManager.kt +4 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,10 @@ open class DefaultEuiccChannelManager( break } // Set the hasMultipleSE field now since we only get to know that after we have iterated all AIDs // This also flips a flag in EuiccChannelImpl and prevents the field from being set again ret.forEach { it.hasMultipleSE = (seId > 1) } return ret } Loading app-common/src/main/java/im/angry/openeuicc/core/EuiccChannel.kt +8 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,14 @@ interface EuiccChannel { */ val seId: SecureElementId /** * Does this channel belong to a chip that supports multiple SEs? * Note that this is only made `var` to make initialization a bit less annoying -- * this should never be set again after the channel is originally opened. * Attempting to do so will yield an exception. */ var hasMultipleSE: Boolean val lpa: LocalProfileAssistant val valid: Boolean Loading app-common/src/main/java/im/angry/openeuicc/core/EuiccChannelImpl.kt +11 −0 Original line number Diff line number Diff line Loading @@ -39,5 +39,16 @@ class EuiccChannelImpl( override val valid: Boolean get() = lpa.valid private var hasMultipleSEInitialized = false override var hasMultipleSE: Boolean = false set(value) { if (hasMultipleSEInitialized) { throw IllegalStateException("already initialized") } field = value } override fun close() = lpa.close() } app-common/src/main/java/im/angry/openeuicc/core/EuiccChannelWrapper.kt +5 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ class EuiccChannelWrapper(orig: EuiccChannel) : EuiccChannel { get() = channel.atr override val isdrAid: ByteArray get() = channel.isdrAid override var hasMultipleSE: Boolean get() = channel.hasMultipleSE set(value) { channel.hasMultipleSE = value } override fun close() = channel.close() Loading app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt +7 −1 Original line number Diff line number Diff line Loading @@ -166,8 +166,14 @@ open class MainActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker { // but it could change in the future euiccChannelManager.notifyEuiccProfilesChanged(channel.logicalSlotId) val channelName = val channelName = if (channel.hasMultipleSE) { appContainer.customizableTextProvider.formatNonUsbChannelNameWithSeId( channel.logicalSlotId, channel.seId ) } else { appContainer.customizableTextProvider.formatNonUsbChannelName(channel.logicalSlotId) } newPages.add(Page(channel.logicalSlotId, channelName) { appContainer.uiComponentFactory.createEuiccManagementFragment( slotId, Loading Loading
app-common/src/main/java/im/angry/openeuicc/core/DefaultEuiccChannelManager.kt +4 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,10 @@ open class DefaultEuiccChannelManager( break } // Set the hasMultipleSE field now since we only get to know that after we have iterated all AIDs // This also flips a flag in EuiccChannelImpl and prevents the field from being set again ret.forEach { it.hasMultipleSE = (seId > 1) } return ret } Loading
app-common/src/main/java/im/angry/openeuicc/core/EuiccChannel.kt +8 −0 Original line number Diff line number Diff line Loading @@ -68,6 +68,14 @@ interface EuiccChannel { */ val seId: SecureElementId /** * Does this channel belong to a chip that supports multiple SEs? * Note that this is only made `var` to make initialization a bit less annoying -- * this should never be set again after the channel is originally opened. * Attempting to do so will yield an exception. */ var hasMultipleSE: Boolean val lpa: LocalProfileAssistant val valid: Boolean Loading
app-common/src/main/java/im/angry/openeuicc/core/EuiccChannelImpl.kt +11 −0 Original line number Diff line number Diff line Loading @@ -39,5 +39,16 @@ class EuiccChannelImpl( override val valid: Boolean get() = lpa.valid private var hasMultipleSEInitialized = false override var hasMultipleSE: Boolean = false set(value) { if (hasMultipleSEInitialized) { throw IllegalStateException("already initialized") } field = value } override fun close() = lpa.close() }
app-common/src/main/java/im/angry/openeuicc/core/EuiccChannelWrapper.kt +5 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,11 @@ class EuiccChannelWrapper(orig: EuiccChannel) : EuiccChannel { get() = channel.atr override val isdrAid: ByteArray get() = channel.isdrAid override var hasMultipleSE: Boolean get() = channel.hasMultipleSE set(value) { channel.hasMultipleSE = value } override fun close() = channel.close() Loading
app-common/src/main/java/im/angry/openeuicc/ui/MainActivity.kt +7 −1 Original line number Diff line number Diff line Loading @@ -166,8 +166,14 @@ open class MainActivity : BaseEuiccAccessActivity(), OpenEuiccContextMarker { // but it could change in the future euiccChannelManager.notifyEuiccProfilesChanged(channel.logicalSlotId) val channelName = val channelName = if (channel.hasMultipleSE) { appContainer.customizableTextProvider.formatNonUsbChannelNameWithSeId( channel.logicalSlotId, channel.seId ) } else { appContainer.customizableTextProvider.formatNonUsbChannelName(channel.logicalSlotId) } newPages.add(Page(channel.logicalSlotId, channelName) { appContainer.uiComponentFactory.createEuiccManagementFragment( slotId, Loading