已合并
add getOsAccountNameByLocalId #31233
add getOsAccountNameByLocalId #31233
已合并
yeyuning创建于 3月10日
1 个文件变更+16-0
@@ -890,6 +890,22 @@ declare namespace osAccount {
890 */890 */
891 getOsAccountName(): Promise<string>;891 getOsAccountName(): Promise<string>;
892 892 
893+ /**
894+ * Gets the name of target OS account by its local ID.
895+ *
896+ * @permission ohos.permission.GET_LOCAL_ACCOUNT_IDENTIFIERS
897+ * @param { int } localId - Indicates the local ID of the target OS account.
898+ * @returns { Promise<string> } Returns the name of the target OS account.
899+ * @throws { BusinessError } 201 - Permission denied.
900+ * @throws { BusinessError } 12300001 - The system service works abnormally.
901+ * @throws { BusinessError } 12300003 - Account not found.
902+ * @throws { BusinessError } 12300008 - Restricted Account.
903+ * @syscap SystemCapability.Account.OsAccount
904+ * @stagemodelonly
905+ * @since 26.0.0 dynamic&static
906+ */
907+ getOsAccountNameByLocalId(localId: int): Promise<string>;
908+ 
893 /**909 /**
894 * Gets the local IDs of all non-system-level OS accounts.910 * Gets the local IDs of all non-system-level OS accounts.
895 *911 *