From 9763febf74f20fc46ed742904a8a2547da7a2187 Mon Sep 17 00:00:00 2001 From: heguokai <275503077@qq.com> Date: Thu, 28 Aug 2025 20:23:22 +0800 Subject: [PATCH] =?UTF-8?q?sts=5Fsubscribe=5Finfo=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: heguokai <275503077@qq.com> --- frameworks/ets/ani/src/sts_subscribe_info.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/frameworks/ets/ani/src/sts_subscribe_info.cpp b/frameworks/ets/ani/src/sts_subscribe_info.cpp index 9ec198f3e..36289d573 100644 --- a/frameworks/ets/ani/src/sts_subscribe_info.cpp +++ b/frameworks/ets/ani/src/sts_subscribe_info.cpp @@ -33,7 +33,7 @@ bool GetSlotTypes(ani_env *env, ani_object value, NotificationSubscribeInfo &inf for (auto slotTypeEnum : slotTypesEnum) { SlotType slotType = SlotType::OTHER; if (!SlotTypeEtsToC(env, slotTypeEnum, slotType)) { - ANS_LOGE("Enum conversion failed"); + ANS_LOGE("SlotTypeEtsToC failed"); return false; } slotTypes.push_back(slotType); @@ -46,9 +46,9 @@ bool GetSlotTypes(ani_env *env, ani_object value, NotificationSubscribeInfo &inf bool UnwarpNotificationSubscribeInfo(ani_env *env, ani_object value, NotificationSubscribeInfo &info) { - ANS_LOGD("enter"); + ANS_LOGD("UnwarpNotificationSubscribeInfo enter"); if (env == nullptr || value == nullptr) { - ANS_LOGE("invalid parameter value"); + ANS_LOGE("env or value is null"); return false; } std::vector res = {}; @@ -59,20 +59,20 @@ bool UnwarpNotificationSubscribeInfo(ani_env *env, ani_object value, Notificatio if (ANI_OK != GetPropertyStringArray(env, value, "bundleNames", isUndefined, res) || isUndefined == ANI_TRUE || res.empty()) { - ANS_LOGE("UnWarpStringArrayOrUndefinedByProperty faild"); + ANS_LOGE("GetPropertyStringArray bundleNames faild"); } std::vector bundleNames = {}; for (auto bundleName : res) { bundleNames.emplace_back(GetResizeStr(bundleName, STR_MAX_SIZE)); } if (ANI_OK != GetPropertyInt(env, value, "userId", isUndefined, userId) || isUndefined == ANI_TRUE) { - ANS_LOGE("GetPropertyInt faild"); + ANS_LOGE("GetPropertyInt userId faild"); } if (ANI_OK != GetPropertyString(env, value, "deviceType", isUndefined, deviceType) || isUndefined == ANI_TRUE) { - ANS_LOGE("GetStringOrUndefined faild"); + ANS_LOGE("GetPropertyString deviceType faild"); } if (ANI_OK != GetPropertyLong(env, value, "filterLimit", isUndefined, filterLimit) || isUndefined == ANI_TRUE) { - ANS_LOGE("GetPropertyLong faild"); + ANS_LOGE("GetPropertyLong filterLimit faild"); } if (!GetSlotTypes(env, value, info)) { ANS_LOGE("GetSlotTypes faild"); @@ -86,6 +86,5 @@ bool UnwarpNotificationSubscribeInfo(ani_env *env, ani_object value, Notificatio info.GetAppUserId(), info.GetDeviceType().c_str(), info.GetFilterType()); return true; } - } // namespace NotificationSts } // OHOS -- Gitee