Compare commits
2 commits
ddc421dae7
...
d3a04b94a9
Author | SHA1 | Date | |
---|---|---|---|
d3a04b94a9 | |||
19dc215b3f |
6 changed files with 24 additions and 2 deletions
|
@ -41,7 +41,10 @@ open class DefaultEuiccChannelFactory(protected val context: Context) : EuiccCha
|
||||||
context.preferenceRepository.verboseLoggingFlow
|
context.preferenceRepository.verboseLoggingFlow
|
||||||
),
|
),
|
||||||
context.preferenceRepository.verboseLoggingFlow
|
context.preferenceRepository.verboseLoggingFlow
|
||||||
)
|
).also {
|
||||||
|
Log.i(DefaultEuiccChannelManager.TAG, "Is OMAPI channel, setting MSS to 60")
|
||||||
|
it.lpa.setEs10xMss(60)
|
||||||
|
}
|
||||||
} catch (e: IllegalArgumentException) {
|
} catch (e: IllegalArgumentException) {
|
||||||
// Failed
|
// Failed
|
||||||
Log.w(
|
Log.w(
|
||||||
|
|
|
@ -8,6 +8,13 @@ interface LocalProfileAssistant {
|
||||||
// Extended EuiccInfo for use with LUIs, containing information such as firmware version
|
// Extended EuiccInfo for use with LUIs, containing information such as firmware version
|
||||||
val euiccInfo2: EuiccInfo2?
|
val euiccInfo2: EuiccInfo2?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the max segment size (mss) for all es10x commands. This can help with removable
|
||||||
|
* eUICCs that may run at a baud rate too fast for the modem.
|
||||||
|
* By default, this is set to 60 by libeuicc.
|
||||||
|
*/
|
||||||
|
fun setEs10xMss(mss: Byte)
|
||||||
|
|
||||||
// All blocking functions in this class assume that they are executed on non-Main threads
|
// All blocking functions in this class assume that they are executed on non-Main threads
|
||||||
// The IO context in Kotlin's coroutine library is recommended.
|
// The IO context in Kotlin's coroutine library is recommended.
|
||||||
fun enableProfile(iccid: String, refresh: Boolean = true): Boolean
|
fun enableProfile(iccid: String, refresh: Boolean = true): Boolean
|
||||||
|
|
|
@ -9,6 +9,7 @@ internal object LpacJni {
|
||||||
external fun destroyContext(handle: Long)
|
external fun destroyContext(handle: Long)
|
||||||
|
|
||||||
external fun euiccInit(handle: Long): Int
|
external fun euiccInit(handle: Long): Int
|
||||||
|
external fun euiccSetMss(handle: Long, mss: Byte)
|
||||||
external fun euiccFini(handle: Long)
|
external fun euiccFini(handle: Long)
|
||||||
|
|
||||||
// es10c
|
// es10c
|
||||||
|
|
|
@ -30,6 +30,10 @@ class LocalProfileAssistantImpl(
|
||||||
httpInterface.usePublicKeyIds(pkids)
|
httpInterface.usePublicKeyIds(pkids)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun setEs10xMss(mss: Byte) {
|
||||||
|
LpacJni.euiccSetMss(contextHandle, mss)
|
||||||
|
}
|
||||||
|
|
||||||
override val valid: Boolean
|
override val valid: Boolean
|
||||||
get() = !finalized && apduInterface.valid && try {
|
get() = !finalized && apduInterface.valid && try {
|
||||||
// If we can read both eID and euiccInfo2 properly, we are likely looking at
|
// If we can read both eID and euiccInfo2 properly, we are likely looking at
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 0011ea6cc4c045c84f7aac839c1cce7804422355
|
Subproject commit a5a0516f084936e7e87cf7420fb99283fa3052ef
|
|
@ -75,6 +75,13 @@ Java_net_typeblog_lpac_1jni_LpacJni_euiccFini(JNIEnv *env, jobject thiz, jlong h
|
||||||
euicc_fini(ctx);
|
euicc_fini(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_net_typeblog_lpac_1jni_LpacJni_euiccSetMss(JNIEnv *env, jobject thiz, jlong handle,
|
||||||
|
jbyte mss) {
|
||||||
|
struct euicc_ctx *ctx = (struct euicc_ctx *) handle;
|
||||||
|
ctx->es10x_mss = (uint8_t) mss;
|
||||||
|
}
|
||||||
|
|
||||||
jstring toJString(JNIEnv *env, const char *pat) {
|
jstring toJString(JNIEnv *env, const char *pat) {
|
||||||
jbyteArray bytes = NULL;
|
jbyteArray bytes = NULL;
|
||||||
jstring encoding = NULL;
|
jstring encoding = NULL;
|
||||||
|
|
Loading…
Add table
Reference in a new issue