Compare commits
1 commit
2c8f5cb2a7
...
5d22fb5b2a
Author | SHA1 | Date | |
---|---|---|---|
5d22fb5b2a |
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_unknown;
|
||||
|
||||
jmethodID notification_constructor;
|
||||
jmethodID local_profile_notification_constructor;
|
||||
|
||||
#define LOCAL_PROFILE_NOTIFICATION_CLASS "net/typeblog/lpac_jni/LocalProfileNotification"
|
||||
#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) {
|
||||
local_profile_notification_class = (*env)->FindClass(env, LOCAL_PROFILE_NOTIFICATION_CLASS);
|
||||
local_profile_notification_class = (*env)->NewGlobalRef(env, local_profile_notification_class);
|
||||
notification_constructor = (*env)->GetMethodID(
|
||||
local_profile_notification_constructor = (*env)->GetMethodID(
|
||||
env, local_profile_notification_class, "<init>",
|
||||
"(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
|
||||
) {
|
||||
struct euicc_ctx *ctx = (struct euicc_ctx *) handle;
|
||||
struct es10b_notification_metadata_list *info = NULL;
|
||||
int ret = es10b_list_notification(ctx, &info);
|
||||
struct es10b_notification_metadata_list *metadata = NULL;
|
||||
int ret = es10b_list_notification(ctx, &metadata);
|
||||
if (ret < 0) {
|
||||
goto out;
|
||||
}
|
||||
|
@ -84,19 +84,19 @@ Java_net_typeblog_lpac_1jni_LpacJni_es10bListNotification(
|
|||
);
|
||||
|
||||
jobject element;
|
||||
while (info) {
|
||||
while (metadata) {
|
||||
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(
|
||||
env, local_profile_notification_class, notification_constructor,
|
||||
info->seqNumber,
|
||||
to_profile_management_operation(info->profileManagementOperation),
|
||||
toJString(env, info->notificationAddress),
|
||||
toJString(env, info->iccid)
|
||||
);
|
||||
env, local_profile_notification_class, local_profile_notification_constructor,
|
||||
sequence_number, operation, address, iccid);
|
||||
(*env)->CallBooleanMethod(env, notifications, add_notification, element);
|
||||
info = info->next;
|
||||
metadata = metadata->next;
|
||||
}
|
||||
out:
|
||||
es10b_notification_metadata_list_free_all(info);
|
||||
es10b_notification_metadata_list_free_all(metadata);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue