From 35bbda20cce135fa9d4653cc3b30cd7b8876bc02 Mon Sep 17 00:00:00 2001 From: zhangalong Date: Thu, 5 May 2022 19:37:03 +0800 Subject: [PATCH] add interfaces for api9 Signed-off-by:zhang_along Signed-off-by: zhangalong --- api/@ohos.account.osAccount.d.ts | 86 ++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 20707b3af7..d31a68d14b 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -404,6 +404,41 @@ declare namespace osAccount { * @systemapi Hide this for inner system use. */ off(type: 'activate' | 'activating', name: string, callback?: Callback): void; + + /** + * Obtain bundle id from uid. + * + * @since 9 + * @param uid Indicates the target uid. + * @return bundle id. + * @systemapi Hide this for inner system use. + */ + getBundleIdFromUid(uid: number, callback: AsyncCallback): void; + getBundleIdFromUid(uid: number): Promise; + + /** + * Check whether current process belongs to the main os account + * + * @since 9 + * @return Returns {@code true} if current process belongs to the main os account; + * returns {@code false} otherwise. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @systemapi Hide this for inner system use. + */ + isMainOsAccount(callback: AsyncCallback): void; + isMainOsAccount(): Promise; + + /** + * Queries the constraint type list of the os account + * + * @since 9 + * @return Returns {@code true} if current process belongs to the main os account; + * returns {@code false} otherwise. + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @systemapi Hide this for inner system use. + */ + queryOsAccountConstraintTypes(localId: number, constraint: string, callback: AsyncCallback>): void; + queryOsAccountConstraintTypes(localId: number, constraint: string): Promise>; } /** @@ -1365,6 +1400,57 @@ declare namespace osAccount { */ FINGERPRINT_TIP_TOO_SLOW = 5 } + + /** + * Enumerates for constraint types. + * + * @name ConstraintType + * @since 9 + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + */ + enum ConstraintType { + /** + * No constraints are set + */ + CONSTRAINT_NOT_EXIST = 0, + + /** + * Constraint is set by setOsAccountConstraints + */ + CONSTRAINT_TYPE_BASE = 1, + + /** + * Constraint is set by device owner + */ + CONSTRAINT_TYPE_DEVICE_OWNER = 2, + + /** + * Constraint is set by profile owner + */ + CONSTRAINT_TYPE_PROFILE_OWNER = 3 + } + + /** + * Provides information about the constraint type info of an os account. + * + * @name ConstraintTypeInfo + * @since 9 + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + */ + interface ConstraintTypeInfo { + /** + * Indicates the id of an os account who set the constraint. + * When type is CONSTRAINT_TYPE_BASE, localId will be -1. + */ + localId: number; + + /** + * Indicates the type of the constraint. + */ + type: ConstraintType; + } } export default osAccount; \ No newline at end of file -- Gitee