diff --git a/frameworks/ets/ani/src/sts_subscribe_info.cpp b/frameworks/ets/ani/src/sts_subscribe_info.cpp index fca7d8f56cb9a516c145437af3158f9214ade120..36289d57320c2d394eae919fa6373ff921252047 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); @@ -43,11 +43,12 @@ bool GetSlotTypes(ani_env *env, ani_object value, NotificationSubscribeInfo &inf return true; } + 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 = {}; @@ -58,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"); @@ -85,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