From 39df3d0687b1b5621b289165dcb92f67cf53f280 Mon Sep 17 00:00:00 2001 From: lichenchen Date: Fri, 20 May 2022 15:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8F=B7=E5=AD=90=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E6=96=B0=E5=A2=9EjsAPI=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lichenchen --- api/@ohos.account.osAccount.d.ts | 84 ++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 20707b3af7..25f559d219 100644 --- a/api/@ohos.account.osAccount.d.ts +++ b/api/@ohos.account.osAccount.d.ts @@ -404,6 +404,39 @@ 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. + * @systemapi Hide this for inner system use. + */ + isMainOsAccount(callback: AsyncCallback): void; + isMainOsAccount(): Promise; + + /** + * Query the constraint source type list of the os account + * + * @since 9 + * @return Returns the constraint source type infos of the os account; + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS. + * @systemapi Hide this for inner system use. + */ + queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback>): void; + queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>; } /** @@ -1365,6 +1398,57 @@ declare namespace osAccount { */ FINGERPRINT_TIP_TOO_SLOW = 5 } + + /** + * Enumerates for constraint source types. + * + * @name ConstraintSourceType + * @since 9 + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + */ + enum ConstraintSourceType { + /** + * 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 source type info of an os account. + * + * @name ConstraintSourceTypeInfo + * @since 9 + * @syscap SystemCapability.Account.OsAccount + * @systemapi Hide this for inner system use. + */ + interface ConstraintSourceTypeInfo { + /** + * Indicates the id of an os account who set the constraint. + * When type is CONSTRAINT_NOT_EXIST or CONSTRAINT_TYPE_BASE, localId will be -1. + */ + localId: number; + + /** + * Indicates the source type of the constraint. + */ + type: ConstraintSourceType; + } } export default osAccount; \ No newline at end of file -- Gitee