From b0c8972ec3b531a827ca31206da495d08f514565 Mon Sep 17 00:00:00 2001 From: ming-yue-liu1 Date: Mon, 30 Jun 2025 21:12:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9ShortcutInfo=E9=9D=9E?= =?UTF-8?q?=E6=B3=95=E6=97=B6=E7=9A=84=E9=94=99=E8=AF=AF=E7=A0=81=E6=8F=8F?= =?UTF-8?q?=E8=BF=B01.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ming-yue-liu1 Change-Id: Iaf3782a023cdf4e6d49987737264e6434af18675 --- .../kits/ani/shortcut_manager/ani_shortcut_manager.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp b/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp index 2ebcca46e7..c43b1737c9 100644 --- a/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp +++ b/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp @@ -27,7 +27,8 @@ namespace OHOS { namespace AppExecFwk { namespace { -constexpr const char* PARSE_SHORTCUT_INFO = "ParseShortCutInfo"; +constexpr const char* INVALID_SHORTCUT_INFO_ERROR = + "invalid ShortcutInfo: parameter type error, or appIndex is less than 0"; constexpr const char* NS_NAME_SHORTCUTMANAGER = "@ohos.bundle.shortcutManager.shortcutManager"; } @@ -45,7 +46,7 @@ static void AniAddDesktopShortcutInfo(ani_env* env, ani_object info, ani_double ShortcutInfo shortcutInfo; if (!CommonFunAni::ParseShortcutInfo(env, info, shortcutInfo) || !CommonFunc::CheckShortcutInfo(shortcutInfo)) { - BusinessErrorAni::ThrowError(env, ERROR_PARAM_CHECK_ERROR, PARSE_SHORTCUT_INFO); + BusinessError::ThrowError(env, ERROR_PARAM_CHECK_ERROR, INVALID_SHORTCUT_INFO_ERROR); APP_LOGE("Parse shortcutInfo err. userId:%{public}d", userId); return; } @@ -79,7 +80,7 @@ static void AniDeleteDesktopShortcutInfo(ani_env* env, ani_object info, ani_doub if (!CommonFunAni::ParseShortcutInfo(env, info, shortcutInfo) || !CommonFunc::CheckShortcutInfo(shortcutInfo)) { APP_LOGE("Parse shortcutInfo err. userId:%{public}d", userId); - BusinessErrorAni::ThrowError(env, ERROR_PARAM_CHECK_ERROR, PARSE_SHORTCUT_INFO); + BusinessError::ThrowError(env, ERROR_PARAM_CHECK_ERROR, INVALID_SHORTCUT_INFO_ERROR); return; } -- Gitee From b214d4b9211d6a4b7e077c4b8371ec291efc4347 Mon Sep 17 00:00:00 2001 From: liumingyue Date: Tue, 1 Jul 2025 12:26:43 +0000 Subject: [PATCH 2/2] update Signed-off-by: liumingyue --- interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp b/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp index c43b1737c9..7fd3496c98 100644 --- a/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp +++ b/interfaces/kits/ani/shortcut_manager/ani_shortcut_manager.cpp @@ -46,7 +46,7 @@ static void AniAddDesktopShortcutInfo(ani_env* env, ani_object info, ani_double ShortcutInfo shortcutInfo; if (!CommonFunAni::ParseShortcutInfo(env, info, shortcutInfo) || !CommonFunc::CheckShortcutInfo(shortcutInfo)) { - BusinessError::ThrowError(env, ERROR_PARAM_CHECK_ERROR, INVALID_SHORTCUT_INFO_ERROR); + BusinessErrorAni::ThrowError(env, ERROR_PARAM_CHECK_ERROR, INVALID_SHORTCUT_INFO_ERROR); APP_LOGE("Parse shortcutInfo err. userId:%{public}d", userId); return; } @@ -80,7 +80,7 @@ static void AniDeleteDesktopShortcutInfo(ani_env* env, ani_object info, ani_doub if (!CommonFunAni::ParseShortcutInfo(env, info, shortcutInfo) || !CommonFunc::CheckShortcutInfo(shortcutInfo)) { APP_LOGE("Parse shortcutInfo err. userId:%{public}d", userId); - BusinessError::ThrowError(env, ERROR_PARAM_CHECK_ERROR, INVALID_SHORTCUT_INFO_ERROR); + BusinessErrorAni::ThrowError(env, ERROR_PARAM_CHECK_ERROR, INVALID_SHORTCUT_INFO_ERROR); return; } -- Gitee