|
@@ -11,14 +11,12 @@ import com.google.zxing.RGBLuminanceSource
|
|
|
import com.google.zxing.common.HybridBinarizer
|
|
import com.google.zxing.common.HybridBinarizer
|
|
|
import com.google.zxing.qrcode.QRCodeReader
|
|
import com.google.zxing.qrcode.QRCodeReader
|
|
|
import im.angry.openeuicc.OpenEuiccApplication
|
|
import im.angry.openeuicc.OpenEuiccApplication
|
|
|
-import im.angry.openeuicc.core.EuiccChannel
|
|
|
|
|
import im.angry.openeuicc.di.AppContainer
|
|
import im.angry.openeuicc.di.AppContainer
|
|
|
import kotlinx.coroutines.Dispatchers
|
|
import kotlinx.coroutines.Dispatchers
|
|
|
import kotlinx.coroutines.runBlocking
|
|
import kotlinx.coroutines.runBlocking
|
|
|
import kotlinx.coroutines.sync.Mutex
|
|
import kotlinx.coroutines.sync.Mutex
|
|
|
import kotlinx.coroutines.sync.withLock
|
|
import kotlinx.coroutines.sync.withLock
|
|
|
import kotlinx.coroutines.withContext
|
|
import kotlinx.coroutines.withContext
|
|
|
-import net.typeblog.lpac_jni.LocalProfileInfo
|
|
|
|
|
import kotlin.RuntimeException
|
|
import kotlin.RuntimeException
|
|
|
import kotlin.coroutines.resume
|
|
import kotlin.coroutines.resume
|
|
|
import kotlin.coroutines.resumeWithException
|
|
import kotlin.coroutines.resumeWithException
|
|
@@ -60,12 +58,6 @@ interface OpenEuiccContextMarker {
|
|
|
get() = appContainer.telephonyManager
|
|
get() = appContainer.telephonyManager
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-val LocalProfileInfo.isEnabled: Boolean
|
|
|
|
|
- get() = state == LocalProfileInfo.State.Enabled
|
|
|
|
|
-
|
|
|
|
|
-val List<EuiccChannel>.hasMultipleChips: Boolean
|
|
|
|
|
- get() = distinctBy { it.slotId }.size > 1
|
|
|
|
|
-
|
|
|
|
|
// Create an instance of OMAPI SEService in a manner that "makes sense" without unpredictable callbacks
|
|
// Create an instance of OMAPI SEService in a manner that "makes sense" without unpredictable callbacks
|
|
|
suspend fun connectSEService(context: Context): SEService = suspendCoroutine { cont ->
|
|
suspend fun connectSEService(context: Context): SEService = suspendCoroutine { cont ->
|
|
|
// Use a Mutex to make sure the continuation is run *after* the "service" variable is assigned
|
|
// Use a Mutex to make sure the continuation is run *after* the "service" variable is assigned
|