已合并
新增updateDesktopShortcutInfo接口 #33544
新增updateDesktopShortcutInfo接口 #33544
已合并
kael-zhang创建于 6月6日
1 个文件变更+23-0
Mapi/@ohos.bundle.shortcutManager.d.ts+23-0
@@ -77,6 +77,29 @@ declare namespace shortcutManager {
77 */77 */
78 function deleteDesktopShortcutInfo(shortcutInfo: ShortcutInfo, userId: int): Promise<void>;78 function deleteDesktopShortcutInfo(shortcutInfo: ShortcutInfo, userId: int): Promise<void>;
79 79 
80+ /**
81+ * Updates a shortcut for the given user. This API uses a promise to return the result.
82+ *
83+ * @permission ohos.permission.MANAGE_SHORTCUTS or
84+ * (ohos.permission.MANAGE_SHORTCUTS and ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS)
85+ * @param { ShortcutInfo } shortcutInfo - Shortcut information.
86+ * @param { int } userId - User ID, which can be obtained by calling
87+ * [getOsAccountLocalId]{@link @ohos.account.osAccount:osAccount.AccountManager.getOsAccountLocalId(callback: AsyncCallback<int>)}.
88+ * @returns { Promise<void> } Promise that returns no value.
89+ * @throws { BusinessError } 201 - Verify permission denied.
90+ * @throws { BusinessError } 202 - Permission denied, non-system app called system api.
91+ * @throws { BusinessError } 17700001 - The specified bundle name is not found.
92+ * @throws { BusinessError } 17700004 - The specified user ID is not found.
93+ * @throws { BusinessError } 17700026 - The specified bundle is disabled.
94+ * @throws { BusinessError } 17700061 - The specified app index is invalid.
95+ * @throws { BusinessError } 18100002 - The specified shortcut to be updated is not found.
96+ * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
97+ * @systemapi
H
Hhanfeng66月6日

stagemodelonly

likedislike
98+ * @stagemodelonly
99+ * @since 26.1.0 dynamic&static
100+ */
101+ function updateDesktopShortcutInfo(shortcutInfo: ShortcutInfo, userId: int): Promise<void>;
102+ 
80 /**103 /**
81 * Obtains the information about all shortcuts of the given user.104 * Obtains the information about all shortcuts of the given user.
82 *105 *