已合并
add getOsAccountNameByLocalId #31233
yeyuning创建于 3月10日
add getOsAccountNameByLocalId #31233
已合并
共 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 | + * ohos.permission.GET_LOCAL_ACCOUNT_IDENTIFIERS | ||
| 897 | + * { int } localId - Indicates the local ID of the target OS account. | ||
| 898 | + * { Promise<string> } Returns the name of the target OS account. | ||
| 899 | + * { BusinessError } 201 - Permission denied. | ||
| 900 | + * { BusinessError } 12300001 - The system service works abnormally. | ||
| 901 | + * { BusinessError } 12300003 - Account not found. | ||
| 902 | + * { BusinessError } 12300008 - Restricted Account. | ||
| 903 | + * SystemCapability.Account.OsAccount | ||
| 904 | + * | ||
| 905 | + * 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 | * |