Compare commits
1 commit
8011376997
...
56c0c9f0af
Author | SHA1 | Date | |
---|---|---|---|
56c0c9f0af |
2 changed files with 5 additions and 13 deletions
|
@ -10,9 +10,8 @@ import java.lang.IllegalArgumentException
|
|||
|
||||
class PrivilegedEuiccChannelFactory(context: Context) : DefaultEuiccChannelFactory(context),
|
||||
PrivilegedEuiccContextMarker {
|
||||
private val tm by lazy {
|
||||
(context.applicationContext as OpenEuiccApplication).appContainer.telephonyManager
|
||||
}
|
||||
override val openEuiccMarkerContext: Context
|
||||
get() = context
|
||||
|
||||
@Suppress("NAME_SHADOWING")
|
||||
override suspend fun tryOpenEuiccChannel(port: UiccPortInfoCompat): EuiccChannel? {
|
||||
|
@ -35,7 +34,7 @@ class PrivilegedEuiccChannelFactory(context: Context) : DefaultEuiccChannelFacto
|
|||
intrinsicChannelName = null,
|
||||
TelephonyManagerApduInterface(
|
||||
port,
|
||||
tm,
|
||||
telephonyManager,
|
||||
context.preferenceRepository.verboseLoggingFlow
|
||||
),
|
||||
context.preferenceRepository.verboseLoggingFlow,
|
||||
|
|
|
@ -10,16 +10,9 @@ import java.util.concurrent.Executors
|
|||
import kotlin.coroutines.resume
|
||||
import kotlin.coroutines.suspendCoroutine
|
||||
|
||||
interface PrivilegedEuiccContextMarker {
|
||||
val privilegedEuiccMarkerContext: Context
|
||||
get() = when (this) {
|
||||
is Context -> this
|
||||
is Fragment -> requireContext()
|
||||
else -> throw RuntimeException("PrivilegedEuiccContextMarker shall only be used on Fragments or UI types that derive from Context")
|
||||
}
|
||||
|
||||
interface PrivilegedEuiccContextMarker : OpenEuiccContextMarker {
|
||||
val preferenceRepository: PrivilegedPreferenceRepository
|
||||
get() = privilegedEuiccMarkerContext.preferenceRepository as PrivilegedPreferenceRepository
|
||||
get() = openEuiccMarkerContext.preferenceRepository as PrivilegedPreferenceRepository
|
||||
}
|
||||
|
||||
suspend fun Context.bindServiceSuspended(intent: Intent, flags: Int): Pair<IBinder?, () -> Unit> =
|
||||
|
|
Loading…
Add table
Reference in a new issue