diff --git a/frameworks/ets/ani/include/sts_common.h b/frameworks/ets/ani/include/sts_common.h index 10a56d84a53dded1bd208b31684fd801e5a3368a..a6ebc9053bd61ab72b624603e3105b327554c264 100644 --- a/frameworks/ets/ani/include/sts_common.h +++ b/frameworks/ets/ani/include/sts_common.h @@ -82,7 +82,7 @@ static bool CallSetter(ani_env* env, ani_class cls, ani_object object, const cha if (env == nullptr || cls == nullptr || object == nullptr) { return false; } - std::string setterName(""); + std::string setterName("%%set-"); setterName.append(propertyName); ani_method setter; ani_status status = env->Class_FindMethod(cls, setterName.c_str(), nullptr, &setter); @@ -223,4 +223,4 @@ static bool EnumConvertNativeToAni(ani_env *env, const char *enumName, const T e } // namespace NotificationSts } // OHOS -#endif \ No newline at end of file +#endif diff --git a/frameworks/ets/ani/src/sts_subscribe.cpp b/frameworks/ets/ani/src/sts_subscribe.cpp index 11f2dd82c54a9897ad67b6c8f62a790e883657b8..b1abf5573c9bbbd50f3d5da1c2d826f324d87723 100644 --- a/frameworks/ets/ani/src/sts_subscribe.cpp +++ b/frameworks/ets/ani/src/sts_subscribe.cpp @@ -713,7 +713,7 @@ bool UnWarpNotificationKey(ani_env *env, const ani_object obj, NotificationKey & ani_boolean isUndefined = ANI_TRUE; ani_double idDouble = 0.0; if (!GetDoubleValueByClassName(env, obj, - "L@ohos/notificationSubscribe/notificationSubscribe/NotificationKeyInner;", "id", idDouble)) { + "L@ohos/notificationSubscribe/notificationSubscribe/NotificationKeyInner;", "%%get-id", idDouble)) { ANS_LOGD("GetDoubleValueByClassName id fail"); return false; } diff --git a/frameworks/ets/ani/src/sts_template.cpp b/frameworks/ets/ani/src/sts_template.cpp index 6c4f5fc4f82603fe295482d3f16f9245913db28a..6c17b4acf49e39ac7b876880a0d4cd1f78ca6393 100644 --- a/frameworks/ets/ani/src/sts_template.cpp +++ b/frameworks/ets/ani/src/sts_template.cpp @@ -31,7 +31,7 @@ ani_status UnwrapNotificationTemplate(ani_env *env, ani_object aniObj, Notificat } ani_status status = ANI_ERROR; ani_ref nameRef; - if (ANI_OK != (status = env->Object_CallMethodByName_Ref(aniObj, "name", ":Lstd/core/String;", &nameRef))) { + if (ANI_OK != (status = env->Object_CallMethodByName_Ref(aniObj, "%%get-name", ":Lstd/core/String;", &nameRef))) { ANS_LOGE("Object_CallMethodByName_Ref faild. status %{public}d", status); return status; }