Browse Source

EuiccChannelManager: slot -> logicalSlot

Peter Cai 1 year ago
parent
commit
8e806c3ae5

+ 4 - 4
app-common/src/main/java/im/angry/openeuicc/core/DefaultEuiccChannelManager.kt

@@ -91,7 +91,7 @@ open class DefaultEuiccChannelManager(
         }
         }
     }
     }
 
 
-    private suspend fun findEuiccChannelBySlot(logicalSlotId: Int): EuiccChannel? =
+    private suspend fun findEuiccChannelByLogicalSlot(logicalSlotId: Int): EuiccChannel? =
         withContext(Dispatchers.IO) {
         withContext(Dispatchers.IO) {
             if (logicalSlotId == EuiccChannelManager.USB_CHANNEL_ID) {
             if (logicalSlotId == EuiccChannelManager.USB_CHANNEL_ID) {
                 return@withContext usbChannel
                 return@withContext usbChannel
@@ -108,9 +108,9 @@ open class DefaultEuiccChannelManager(
             null
             null
         }
         }
 
 
-    protected fun findEuiccChannelBySlotBlocking(logicalSlotId: Int): EuiccChannel? =
+    protected fun findEuiccChannelByLogicalSlotBlocking(logicalSlotId: Int): EuiccChannel? =
         runBlocking {
         runBlocking {
-            findEuiccChannelBySlot(logicalSlotId)
+            findEuiccChannelByLogicalSlot(logicalSlotId)
         }
         }
 
 
     private suspend fun findAllEuiccChannelsByPhysicalSlot(physicalSlotId: Int): List<EuiccChannel>? {
     private suspend fun findAllEuiccChannelsByPhysicalSlot(physicalSlotId: Int): List<EuiccChannel>? {
@@ -176,7 +176,7 @@ open class DefaultEuiccChannelManager(
         logicalSlotId: Int,
         logicalSlotId: Int,
         fn: suspend (EuiccChannel) -> R
         fn: suspend (EuiccChannel) -> R
     ): R {
     ): R {
-        val channel = findEuiccChannelBySlot(logicalSlotId)
+        val channel = findEuiccChannelByLogicalSlot(logicalSlotId)
             ?: throw EuiccChannelManager.EuiccChannelNotFoundException()
             ?: throw EuiccChannelManager.EuiccChannelNotFoundException()
         val wrapper = EuiccChannelWrapper(channel)
         val wrapper = EuiccChannelWrapper(channel)
         try {
         try {

+ 1 - 1
app/src/main/java/im/angry/openeuicc/core/PrivilegedEuiccChannelManager.kt

@@ -30,7 +30,7 @@ class PrivilegedEuiccChannelManager(
 
 
     override fun notifyEuiccProfilesChanged(logicalSlotId: Int) {
     override fun notifyEuiccProfilesChanged(logicalSlotId: Int) {
         appContainer.subscriptionManager.apply {
         appContainer.subscriptionManager.apply {
-            findEuiccChannelBySlotBlocking(logicalSlotId)?.let {
+            findEuiccChannelByLogicalSlotBlocking(logicalSlotId)?.let {
                 tryRefreshCachedEuiccInfo(it.cardId)
                 tryRefreshCachedEuiccInfo(it.cardId)
             }
             }
         }
         }