feat: expose ES10c.EuiccMemoryReset #88

Merged
PeterCxy merged 2 commits from septs/OpenEUICC:expose-euicc-memory-reset into master 2024-12-07 04:43:32 +01:00
4 changed files with 17 additions and 0 deletions

View file

@ -37,6 +37,8 @@ interface LocalProfileAssistant {
fun deleteNotification(seqNumber: Long): Boolean
fun handleNotification(seqNumber: Long): Boolean
fun euiccMemoryReset()
fun setNickname(
iccid: String, nickname: String
): Boolean

View file

@ -33,6 +33,8 @@ internal object LpacJni {
// Cancel any ongoing es9p and/or es10b sessions
external fun cancelSessions(handle: Long)
// ES10c
external fun es10cEuiccMemoryReset(handle: Long): Int
// es10cex (actually part of es10b)
external fun es10cexGetEuiccInfo2(handle: Long): Long

View file

@ -241,6 +241,10 @@ class LocalProfileAssistantImpl(
override fun setNickname(iccid: String, nickname: String): Boolean =
LpacJni.es10cSetNickname(contextHandle, iccid, nickname) == 0
override fun euiccMemoryReset() {
LpacJni.es10cEuiccMemoryReset(contextHandle)
}
@Synchronized
override fun close() {
if (!finalized) {

View file

@ -245,6 +245,15 @@ Java_net_typeblog_lpac_1jni_LpacJni_es10cexGetEuiccInfo2(JNIEnv *env, jobject th
return (jlong) info;
}
JNIEXPORT jint JNICALL
Java_net_typeblog_lpac_1jni_LpacJni_es10cEuiccMemoryReset(JNIEnv *env, jobject thiz, jlong handle) {
struct euicc_ctx *ctx = (struct euicc_ctx *) handle;
int ret;
ret = es10c_euicc_memory_reset(ctx);
return ret
}
JNIEXPORT jstring JNICALL
Java_net_typeblog_lpac_1jni_LpacJni_stringDeref(JNIEnv *env, jobject thiz, jlong curr) {
return toJString(env, *((char **) curr));