Compare commits
1 commit
5d22fb5b2a
...
2c8f5cb2a7
Author | SHA1 | Date | |
---|---|---|---|
2c8f5cb2a7 |
1 changed files with 13 additions and 13 deletions
|
@ -12,7 +12,7 @@ jobject profile_management_operation_disable;
|
||||||
jobject profile_management_operation_delete;
|
jobject profile_management_operation_delete;
|
||||||
jobject profile_management_operation_unknown;
|
jobject profile_management_operation_unknown;
|
||||||
|
|
||||||
jmethodID local_profile_notification_constructor;
|
jmethodID notification_constructor;
|
||||||
|
|
||||||
#define LOCAL_PROFILE_NOTIFICATION_CLASS "net/typeblog/lpac_jni/LocalProfileNotification"
|
#define LOCAL_PROFILE_NOTIFICATION_CLASS "net/typeblog/lpac_jni/LocalProfileNotification"
|
||||||
#define PROFILE_MANAGEMENT_OPERATION_CLASS "net/typeblog/lpac_jni/ProfileManagementOperation"
|
#define PROFILE_MANAGEMENT_OPERATION_CLASS "net/typeblog/lpac_jni/ProfileManagementOperation"
|
||||||
|
@ -30,7 +30,7 @@ static jobject bind_static_field(JNIEnv *env, jclass clazz, const char *name, co
|
||||||
void lpac_notifications_init(JNIEnv *env) {
|
void lpac_notifications_init(JNIEnv *env) {
|
||||||
local_profile_notification_class = (*env)->FindClass(env, LOCAL_PROFILE_NOTIFICATION_CLASS);
|
local_profile_notification_class = (*env)->FindClass(env, LOCAL_PROFILE_NOTIFICATION_CLASS);
|
||||||
local_profile_notification_class = (*env)->NewGlobalRef(env, local_profile_notification_class);
|
local_profile_notification_class = (*env)->NewGlobalRef(env, local_profile_notification_class);
|
||||||
local_profile_notification_constructor = (*env)->GetMethodID(
|
notification_constructor = (*env)->GetMethodID(
|
||||||
env, local_profile_notification_class, "<init>",
|
env, local_profile_notification_class, "<init>",
|
||||||
"(JL" PROFILE_MANAGEMENT_OPERATION_CLASS ";Ljava/lang/String;Ljava/lang/String;)V");
|
"(JL" PROFILE_MANAGEMENT_OPERATION_CLASS ";Ljava/lang/String;Ljava/lang/String;)V");
|
||||||
|
|
||||||
|
@ -71,8 +71,8 @@ Java_net_typeblog_lpac_1jni_LpacJni_es10bListNotification(
|
||||||
jobject notifications
|
jobject notifications
|
||||||
) {
|
) {
|
||||||
struct euicc_ctx *ctx = (struct euicc_ctx *) handle;
|
struct euicc_ctx *ctx = (struct euicc_ctx *) handle;
|
||||||
struct es10b_notification_metadata_list *metadata = NULL;
|
struct es10b_notification_metadata_list *info = NULL;
|
||||||
int ret = es10b_list_notification(ctx, &metadata);
|
int ret = es10b_list_notification(ctx, &info);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -84,19 +84,19 @@ Java_net_typeblog_lpac_1jni_LpacJni_es10bListNotification(
|
||||||
);
|
);
|
||||||
|
|
||||||
jobject element;
|
jobject element;
|
||||||
while (metadata) {
|
while (info) {
|
||||||
jlong sequence_number = metadata->seqNumber;
|
|
||||||
jobject operation = to_profile_management_operation(metadata->profileManagementOperation);
|
|
||||||
jstring address = toJString(env, metadata->notificationAddress);
|
|
||||||
jstring iccid = toJString(env, metadata->iccid);
|
|
||||||
element = (*env)->NewObject(
|
element = (*env)->NewObject(
|
||||||
env, local_profile_notification_class, local_profile_notification_constructor,
|
env, local_profile_notification_class, notification_constructor,
|
||||||
sequence_number, operation, address, iccid);
|
info->seqNumber,
|
||||||
|
to_profile_management_operation(info->profileManagementOperation),
|
||||||
|
toJString(env, info->notificationAddress),
|
||||||
|
toJString(env, info->iccid)
|
||||||
|
);
|
||||||
(*env)->CallBooleanMethod(env, notifications, add_notification, element);
|
(*env)->CallBooleanMethod(env, notifications, add_notification, element);
|
||||||
metadata = metadata->next;
|
info = info->next;
|
||||||
}
|
}
|
||||||
out:
|
out:
|
||||||
es10b_notification_metadata_list_free_all(metadata);
|
es10b_notification_metadata_list_free_all(info);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue