diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts index 20707b3af7b297c36ada4ee6bf0dae3c1f099f26..25f559d21904f303f76a84baf05d134b2aa1e30d 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