;
/**
* Obtains the distributed virtual device ID (DVID).
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
* through the distributed networking. On the connected devices, you can call this method to obtain the DVIDs.
* The same application running on different devices obtains the same DVID, whereas different applications
* obtain different DVIDs.
*
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { AsyncCallback } callback - Returns the DVID if obtained; returns an empty string if no OHOS account has logged in.
* @syscap SystemCapability.Account.OsAccount
* @since 7
* @deprecated since 9
* @useinstead osAccount.AccountManager#queryDistributedVirtualDeviceId
*/
getDistributedVirtualDeviceId(callback: AsyncCallback): void;
/**
* Obtains the distributed virtual device ID (DVID).
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
* through the distributed networking. On the connected devices, you can call this method to obtain the DVIDs.
* The same application running on different devices obtains the same DVID, whereas different applications
* obtain different DVIDs.
*
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns { Promise } Returns the DVID if obtained; returns an empty string if no OHOS account has logged in.
* @syscap SystemCapability.Account.OsAccount
* @since 7
* @deprecated since 9
* @useinstead osAccount.AccountManager#queryDistributedVirtualDeviceId
*/
getDistributedVirtualDeviceId(): Promise;
/**
* Queries the distributed virtual device ID (DVID).
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
* through the distributed networking. On the connected devices, you can call this method to obtain the DVIDs.
* The same application running on different devices obtains the same DVID, whereas different applications
* obtain different DVIDs.
*
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { AsyncCallback } callback - Returns the DVID if obtained; returns an empty string if no OHOS account has logged in.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @syscap SystemCapability.Account.OsAccount
* @since 9
*/
queryDistributedVirtualDeviceId(callback: AsyncCallback): void;
/**
* Queries the distributed virtual device ID (DVID).
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
* through the distributed networking. On the connected devices, you can call this method to obtain the DVIDs.
* The same application running on different devices obtains the same DVID, whereas different applications
* obtain different DVIDs.
*
*
* @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns { Promise } Returns the DVID if obtained; returns an empty string if no OHOS account has logged in.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @syscap SystemCapability.Account.OsAccount
* @since 9
*/
queryDistributedVirtualDeviceId(): Promise;
/**
* Obtains the profile photo of an OS account based on its local ID.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { number } localId - Indicates the local ID of the OS account.
* @param { AsyncCallback } callback - Returns the profile photo if obtained;
* returns {@code null} if the profile photo fails to be obtained.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid localId.
* @throws { BusinessError } 12300003 - Account not found.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 7
*/
getOsAccountProfilePhoto(localId: number, callback: AsyncCallback): void;
/**
* Obtains the profile photo of an OS account based on its local ID.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { number } localId - Indicates the local ID of the OS account.
* @returns { Promise } Returns the profile photo if obtained;
* returns {@code null} if the profile photo fails to be obtained.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid localId.
* @throws { BusinessError } 12300003 - Account not found.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 7
*/
getOsAccountProfilePhoto(localId: number): Promise;
/**
* Sets the profile photo for an OS account based on its local ID.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { number } localId - Indicates the local ID of the OS account.
* @param { string } photo - Indicates the profile photo to set for the OS account.
* @param { AsyncCallback } callback - Asynchronous callback interface.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid localId or photo.
* @throws { BusinessError } 12300003 - Account not found.
* @throws { BusinessError } 12300008 - Restricted Account.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 7
*/
setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback): void;
/**
* Sets the profile photo for an OS account based on its local ID.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { number } localId - Indicates the local ID of the OS account.
* @param { string } photo - Indicates the profile photo to set for the OS account.
* @returns { Promise } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid localId or photo.
* @throws { BusinessError } 12300003 - Account not found.
* @throws { BusinessError } 12300008 - Restricted Account.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 7
*/
setOsAccountProfilePhoto(localId: number, photo: string): Promise;
/**
* Obtain localId according to serial number
*
* @param { number } serialNumber - Indicates serial number.
* @param { AsyncCallback } callback - Returns localId.
* @syscap SystemCapability.Account.OsAccount
* @since 8
* @deprecated since 9
* @useinstead osAccount.AccountManager#getOsAccountLocalIdForSerialNumber
*/
getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback): void;
/**
* Obtain localId according to serial number
*
* @param { number } serialNumber - Indicates serial number.
* @returns { Promise } Returns localId.
* @syscap SystemCapability.Account.OsAccount
* @since 8
* @deprecated since 9
* @useinstead osAccount.AccountManager#getOsAccountLocalIdForSerialNumber
*/
getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise;
/**
* Gets the local ID of the OS account associated with the serial number.
*
* @param { number } serialNumber - Indicates serial number.
* @param { AsyncCallback } callback - Indicates the callback for getting the local ID of the OS account associated with the serial number.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid serialNumber.
* @throws { BusinessError } 12300003 - The account indicated by serialNumber dose not exist.
* @syscap SystemCapability.Account.OsAccount
* @since 9
*/
getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback): void;
/**
* Gets the local ID of the OS account associated with the serial number.
*
* @param { number } serialNumber - Indicates serial number.
* @returns { Promise } Returns the local ID of the OS account associated with the serial number.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid serialNumber.
* @throws { BusinessError } 12300003 - The account indicated by serialNumber dose not exist.
* @syscap SystemCapability.Account.OsAccount
* @since 9
*/
getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise;
/**
* Obtain serial number according to localId.
*
* @param { number } localId - Indicates the local ID of the OS account.
* @param { AsyncCallback } callback - Returns serial number.
* @syscap SystemCapability.Account.OsAccount
* @since 8
* @deprecated since 9
* @useinstead osAccount.AccountManager#getSerialNumberForOsAccountLocalId
*/
getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback): void;
/**
* Obtain serial number according to localId.
*
* @param { number } localId - Indicates the local ID of the OS account.
* @returns { Promise } Returns serial number.
* @syscap SystemCapability.Account.OsAccount
* @since 8
* @deprecated since 9
* @useinstead osAccount.AccountManager#getSerialNumberForOsAccountLocalId
*/
getSerialNumberByOsAccountLocalId(localId: number): Promise;
/**
* Gets the serial number for the specified os account local id.
*
* @param { number } localId - Indicates the local ID of the OS account.
* @param { AsyncCallback } callback - Indicates the callback for getting the serial number for the specified os account local id.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid localId.
* @throws { BusinessError } 12300003 - Account not found.
* @syscap SystemCapability.Account.OsAccount
* @since 9
*/
getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback): void;
/**
* Gets the serial number for the specified os account local id.
*
* @param { number } localId - Indicates the local ID of the OS account.
* @returns { Promise } Returns the serial number according to local ID.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid localId.
* @throws { BusinessError } 12300003 - Account not found.
* @syscap SystemCapability.Account.OsAccount
* @since 9
*/
getSerialNumberForOsAccountLocalId(localId: number): Promise;
/**
* Subscribes to the change events of accounts.
*
* When user change the account, the subscriber will receive a notification
* about the account change event.
*
* @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION
* @param { 'activate' | 'activating' } type - Event type.
* @param { string } name - Indicates the name of subscriber.
* @param { Callback } callback - Asynchronous callback interface.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid type or name.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 7
*/
on(type: 'activate' | 'activating', name: string, callback: Callback): void;
/**
* Unsubscribes from account events.
*
* @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION
* @param { 'activate' | 'activating' } type - Event type.
* @param { string } name - Indicates the name of subscriber.
* @param { Callback } callback - Asynchronous callback interface.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid type or name.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 7
*/
off(type: 'activate' | 'activating', name: string, callback?: Callback): void;
/**
* Gets the bundle ID associated with the specified UID.
*
* @param { number } uid - Indicates the target uid.
* @param { AsyncCallback } callback - Indicates the callback for getting the bundle ID associated with the specified UID.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid uid.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
getBundleIdForUid(uid: number, callback: AsyncCallback): void;
/**
* Gets the bundle ID associated with the specified UID.
*
* @param { number } uid - Indicates the target uid.
* @returns { Promise } Returns the bundle ID associated with the specified UID.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid uid.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
getBundleIdForUid(uid: number): Promise;
/**
* Gets the bundle ID associated with the specified UID synchronously.
*
* @param { number } uid - Indicates the target uid.
* @returns { number } Returns the bundle ID associated with the specified UID.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300002 - Invalid uid.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
getBundleIdForUidSync(uid: number): number;
/**
* Check whether current process belongs to the main account.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { AsyncCallback } callback - Returns {@code true} if current process belongs to the main os account;
* returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
isMainOsAccount(callback: AsyncCallback): void;
/**
* Check whether current process belongs to the main account.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns { Promise } Returns {@code true} if current process belongs to the main os account;
* returns {@code false} otherwise.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
isMainOsAccount(): Promise;
/**
* Gets a list of constraint source types for the specified os account.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { number } localId - Indicates the local ID of the OS account.
* @param { string } constraint - Indicates the constraint to query the source type.
* @param { AsyncCallback> } callback - Indicates the callback for
* getting a list of constraint source types for the specified os account.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid name or constraint.
* @throws { BusinessError } 12300003 - Account not found.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
getOsAccountConstraintSourceTypes(
localId: number,
constraint: string,
callback: AsyncCallback>
): void;
/**
* Gets a list of constraint source types for the specified os account.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { number } localId - Indicates the local ID of the OS account.
* @param { string } constraint - Indicates the constraint to query the source type.
* @returns { Promise> } Returns a list of constraint source types for the specified os account.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid name or constraint.
* @throws { BusinessError } 12300003 - Account not found.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>;
}
/**
* Provides information about OS accounts, including the local ID, local name, and type of an OS account.
*
* @interface OsAccountInfo
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
interface OsAccountInfo {
/**
* The local ID of an OS account.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
localId: number;
/**
* The local name of an OS account.
*
* @type { string }
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
localName: string;
/**
* Include: ADMIN, Normal, GUEST.
*
* @type { OsAccountType }
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
type: OsAccountType;
/**
* Account constraints information.
*
* @type { Array }
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
constraints: Array;
/**
* The account is verified or not.
*
* @type { boolean }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
isVerified: boolean;
/**
* OS account photo.
*
* @type { string }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
photo: string;
/**
* Os account create time.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
createTime: number;
/**
* The last time to log in.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
lastLoginTime: number;
/**
* Os account serial number.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
serialNumber: number;
/**
* Os account is activated or not.
*
* @type { boolean }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
isActived: boolean;
/**
* Os account create completed or not.
*
* @type { boolean }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
isCreateCompleted: boolean;
/**
* Distributed account info.
*
* @type { distributedAccount.DistributedInfo }
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
distributedInfo: distributedAccount.DistributedInfo;
/**
* Domain account info.
*
* @type { DomainAccountInfo }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
domainInfo: DomainAccountInfo;
}
/**
* Provides information about domain accounts.
*
* @interface DomainAccountInfo
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
interface DomainAccountInfo {
/**
* The domain name
*
* @type { string }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
domain: string;
/**
* The account name in the domain
*
* @type { string }
* @syscap SystemCapability.Account.OsAccount
* @since 8
*/
accountName: string;
/**
* The account identifier in the domain.
*
* @type { ?string }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
accountId?: string;
}
/**
* Enumerates OS account types.
*
* @enum { number } OsAccountType
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
enum OsAccountType {
/**
* Indicates the administrator account, which has the permission to manage other OS accounts.
*
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
ADMIN = 0,
/**
* Indicates a normal account, which has access to common functions of OS accounts.
*
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
NORMAL,
/**
* Indicates a guest account, which is used to temporarily access the device and may be deleted at any time.
*
* @syscap SystemCapability.Account.OsAccount
* @since 7
*/
GUEST
}
/**
* Provides the abilities for user authentication.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
* @name UserAuth
*/
class UserAuth {
/**
* Constructor to get the UserAuth class instance.
*
* @throws { BusinessError } 202 - Not system application.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
constructor();
/**
* Gets version information.
*
* @returns { number } Returns the version information.
* @throws { BusinessError } 202 - Not system application.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
getVersion(): number;
/**
* Checks whether the authentication capability is available.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { AuthType } authType - Indicates the credential type for authentication.
* @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result.
* @returns { number } Returns a status result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid authType or authTrustLevel.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
/**
* Gets the property based on the specified request information.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { GetPropertyRequest } request - Indicates the request information, including authentication type, and property type list.
* @param { AsyncCallback } callback - Returns an executor property.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid request.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
getProperty(request: GetPropertyRequest, callback: AsyncCallback): void;
/**
* Gets the property based on the specified request information.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { GetPropertyRequest } request - Indicates the request information, including authentication type, and property type list.
* @returns { Promise } Returns an executor property.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid request.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
getProperty(request: GetPropertyRequest): Promise;
/**
* Sets property that can be used to initialize algorithms.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { SetPropertyRequest } request - Indicates the request information, including authentication type and the key-value to be set.
* @param { AsyncCallback } callback - Asynchronous callback interface.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid request.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
setProperty(request: SetPropertyRequest, callback: AsyncCallback): void;
/**
* Sets property that can be used to initialize algorithms.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { SetPropertyRequest } request - Indicates the request information, including authentication type and the key-value to be set.
* @returns { Promise } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid request.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
setProperty(request: SetPropertyRequest): Promise;
/**
* Executes authentication.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { Uint8Array } challenge - Indicates the challenge value.
* @param { AuthType } authType - Indicates the authentication type.
* @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result.
* @param { IUserAuthCallback } callback - Indicates the callback to get result and acquireInfo.
* @returns { Uint8Array } Returns a context ID for cancellation.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid challenge, authType or authTrustLevel.
* @throws { BusinessError } 12300101 - Credential is incorrect.
* @throws { BusinessError } 12300102 - Credential not enrolled.
* @throws { BusinessError } 12300105 - Unsupported authTrustLevel.
* @throws { BusinessError } 12300106 - Unsupported authType.
* @throws { BusinessError } 12300109 - Authentication is canceled.
* @throws { BusinessError } 12300110 - Authentication is locked.
* @throws { BusinessError } 12300111 - Authentication timeout.
* @throws { BusinessError } 12300112 - Authentication service is busy.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
auth(
challenge: Uint8Array,
authType: AuthType,
authTrustLevel: AuthTrustLevel,
callback: IUserAuthCallback
): Uint8Array;
/**
* Executes user authentication.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { number } userId - Indicates the user identification.
* @param { Uint8Array } challenge - Indicates the challenge value.
* @param { AuthType } authType - Indicates the authentication type.
* @param { AuthTrustLevel } authTrustLevel - Indicates the trust level of authentication result.
* @param { IUserAuthCallback } callback - Indicates the callback to get result and acquireInfo.
* @returns { Uint8Array } Returns a context ID for cancellation.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid userId, challenge, authType or authTrustLevel.
* @throws { BusinessError } 12300101 - Credential is incorrect.
* @throws { BusinessError } 12300102 - Credential not enrolled.
* @throws { BusinessError } 12300105 - Unsupported authTrustLevel.
* @throws { BusinessError } 12300106 - Unsupported authType.
* @throws { BusinessError } 12300109 - Authentication is canceled.
* @throws { BusinessError } 12300110 - Authentication is locked.
* @throws { BusinessError } 12300111 - Authentication timeout.
* @throws { BusinessError } 12300112 - Authentication service is busy.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
authUser(
userId: number,
challenge: Uint8Array,
authType: AuthType,
authTrustLevel: AuthTrustLevel,
callback: IUserAuthCallback
): Uint8Array;
/**
* Cancels authentication with context ID.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { Uint8Array } contextID - Indicates the authentication context ID.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid contextId.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
cancelAuth(contextID: Uint8Array): void;
}
/**
* Provides the abilities for Pin code authentication.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
* @name PINAuth
*/
class PINAuth {
/**
* Constructor to get the PINAuth class instance.
*
* @throws { BusinessError } 202 - Not system application.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
constructor();
/**
* Register inputer.
*
* @permission ohos.permission.ACCESS_PIN_AUTH
* @param { IInputer } inputer - Indicates the password input box callback
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid inputer.
* @throws { BusinessError } 12300103 - Inputer already registered.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
registerInputer(inputer: IInputer): void;
/**
* Unregister inputer.
*
* @permission ohos.permission.ACCESS_PIN_AUTH
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
unregisterInputer(): void;
}
/**
* Provides the management of credential inputers.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
* @name InputerManager
*/
class InputerManager {
/**
* Register credential inputer by authentication type.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL or ohos.permission.MANAGE_USER_IDM
* @param { AuthType } authType - Indicates the authentication type.
* @param { IInputer } inputer - Indicates the credential input box callback.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid authType or inputer.
* @throws { BusinessError } 12300103 - The credential inputer has been registered.
* @throws { BusinessError } 12300106 - Unsupported authType.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
static registerInputer(authType: AuthType, inputer: IInputer): void;
/**
* Unregister credential inputer by authentication type.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL or ohos.permission.MANAGE_USER_IDM
* @param { AuthType } authType - Indicates the authentication type.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300002 - Invalid authType.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
static unregisterInputer(authType: AuthType): void;
}
/**
* Provides the AuthStatusInfo type.
*
* @interface AuthStatusInfo
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
interface AuthStatusInfo {
/**
* Indicates the remaining times that authentication can be performed.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
remainTimes: number;
/**
* Indicates the freezing time before performing the next authentication.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
freezingTime: number;
}
/**
* Provides the GetDomainAccessTokenOptions type.
*
* @typedef GetDomainAccessTokenOptions
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
interface GetDomainAccessTokenOptions {
/**
* Indicates the domain account information.
*
* @type { DomainAccountInfo }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
domainAccountInfo: DomainAccountInfo;
/**
* Indicates the domain account token.
*
* @type { Uint8Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
domainAccountToken: Uint8Array;
/**
* Indicates the business parameters.
*
* @type { object }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
businessParams: { [key: string]: object };
/**
* Indicates caller UID.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
callerUid: number;
}
/**
* Options for getting domain account information.
*
* @typedef GetDomainAccountInfoOptions
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
interface GetDomainAccountInfoOptions {
/**
* Indicates the account name.
*
* @type { string }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
accountName: string;
/**
* Indicates the domain to which the account belongs.
*
* @type { ?string }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
domain?: string;
}
/**
* Options for getting domain account information in the domain plugin.
*
* @typedef GetDomainAccountInfoPluginOptions
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
interface GetDomainAccountInfoPluginOptions extends GetDomainAccountInfoOptions {
/**
* Indicates the caller UID.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
callerUid: number;
}
/**
* Provides the definition of domain plugin.
*
* @interface DomainPlugin
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
interface DomainPlugin {
/**
* Authenticates the specified domain account.
*
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information for authentication.
* @param { Uint8Array } credential - Indicates the credential for authentication.
* @param { IUserAuthCallback } callback - Indicates the authentication callback.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUserAuthCallback): void;
/**
* Authenticates the specified domain account with a popup.
*
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information for authentication.
* @param { IUserAuthCallback } callback - Indicates the callback for notifying the authentication result.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
authWithPopup(domainAccountInfo: DomainAccountInfo, callback: IUserAuthCallback): void;
/**
* Authenticates the specified domain account with an authorization token.
*
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information for authentication.
* @param { Uint8Array } token - Indicates the authorization token generated when PIN or biometric authentication is successful.
* @param { IUserAuthCallback } callback - Indicates the callback for notifying the authentication result.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
authWithToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, callback: IUserAuthCallback): void;
/**
* Gets the domain account information with the specified options.
*
* @param { GetDomainAccountInfoPluginOptions } options - Indicates the options for getting domain account information.
* @param { AsyncCallback } callback - Indicates the callback for notifying the domain account information.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
getAccountInfo(options: GetDomainAccountInfoPluginOptions, callback: AsyncCallback): void;
/**
* Gets the domain authentication property for the specified domain account.
*
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information for authentication.
* @param { AsyncCallback } callback - Indicates the callback for notifying the domain authentication status information.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
getAuthStatusInfo(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback): void;
/**
* Binds the specified domain account with an OS account.
*
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { number } localId - Indicates the local ID of the OS account.
* @param { AsyncCallback } callback - Indicates the callback for notifying the binding result.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
bindAccount(domainAccountInfo: DomainAccountInfo, localId: number, callback: AsyncCallback): void;
/**
* Unbind the specified domain account.
*
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { AsyncCallback } callback - Indicates the callback for notifying the unbinding result.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback): void;
/**
* Checks whether the token of specified domain account is valid.
*
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { Uint8Array } token - Indicates the account token.
* @param { AsyncCallback } callback - Indicates the callback for notifying the checking result.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
isAccountTokenValid(
domainAccountInfo: DomainAccountInfo,
token: Uint8Array,
callback: AsyncCallback
): void;
/**
* Gets the access token based on the specified options.
*
* @param { GetDomainAccessTokenOptions } options - Indicates the options for getting th access token.
* @param { AsyncCallback } callback - Indicates the callback for returning the access token.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
getAccessToken(options: GetDomainAccessTokenOptions, callback: AsyncCallback): void;
}
/**
* Provides abilities for the management of domain account.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
class DomainAccountManager {
/**
* Registers the domain plugin, which provides the capabilities for domain authentication.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { DomainPlugin } plugin - Indicates the domain plugin.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300201 - The domain plugin has been registered.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
static registerPlugin(plugin: DomainPlugin): void;
/**
* Unregisters domain plugin.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
static unregisterPlugin(): void;
/**
* Authenticates the specified domain account with a credential.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { Uint8Array } credential - Indicates the credential for authentication.
* @param { IUserAuthCallback } callback - Indicates the callback for getting the authentication result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid domainAccountInfo or credential.
* @throws { BusinessError } 12300003 - Domain account does not exist.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300101 - Authentication failed.
* @throws { BusinessError } 12300109 - Authentication is canceled.
* @throws { BusinessError } 12300110 - Authentication is locked.
* @throws { BusinessError } 12300111 - Authentication timeout.
* @throws { BusinessError } 12300112 - Authentication service is busy.
* @throws { BusinessError } 12300113 - Authentication service does not exist.
* @throws { BusinessError } 12300114 - Authentication service exception.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUserAuthCallback): void;
/**
* Authenticates the domain account bound to the current OS account with a popup.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { IUserAuthCallback } callback - Indicates the callback for getting the authentication result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300003 - No domain account is bound.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300101 - Authentication failed.
* @throws { BusinessError } 12300109 - Authentication is canceled.
* @throws { BusinessError } 12300110 - Authentication is locked.
* @throws { BusinessError } 12300111 - Authentication timeout.
* @throws { BusinessError } 12300112 - Authentication service is busy.
* @throws { BusinessError } 12300113 - Authentication service does not exist.
* @throws { BusinessError } 12300114 - Authentication service exception.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static authWithPopup(callback: IUserAuthCallback): void;
/**
* Authenticates the domain account bound to the specified OS account with a popup.
*
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param { number } localId - Indicates the local ID of the specified OS account.
* @param { IUserAuthCallback } callback - Indicates the callback for getting the authentication result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid localId.
* @throws { BusinessError } 12300003 - No domain account is bound.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300101 - Authentication failed.
* @throws { BusinessError } 12300109 - Authentication is canceled.
* @throws { BusinessError } 12300110 - Authentication is locked.
* @throws { BusinessError } 12300111 - Authentication timeout.
* @throws { BusinessError } 12300112 - Authentication service is busy.
* @throws { BusinessError } 12300113 - Authentication service does not exist.
* @throws { BusinessError } 12300114 - Authentication service exception.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static authWithPopup(localId: number, callback: IUserAuthCallback): void;
/**
* Checks whether the specified domain account exists.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { AsyncCallback } callback Indicates - The callback for checking whether the specified domain account exists.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid domainAccountInfo.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300111 - Operation timeout.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static hasAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback): void;
/**
* Checks whether the specified domain account exists.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @returns { Promise } Returns whether the specified domain account exists.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid domainAccountInfo.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300111 - Operation timeout.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static hasAccount(domainAccountInfo: DomainAccountInfo): Promise;
/**
* Updates the token for the specified domain account.
* Only the registered domain plugin has the permission to call this function.
* An empty token indicates the token of the target domain account is invalid.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { Uint8Array } token - Indicates the domain account token.
* @param { AsyncCallback } callback - Indicates the result callback.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid token.
* @throws { BusinessError } 12300003 - Account not found.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static updateAccountToken(
domainAccountInfo: DomainAccountInfo,
token: Uint8Array,
callback: AsyncCallback
): void;
/**
* Updates the token for the specified domain account.
* Only the registered domain plugin has the permission to call this function.
* An empty token indicates the token of the target domain account is invalid.
*
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param { DomainAccountInfo } domainAccountInfo - Indicates the domain account information.
* @param { Uint8Array } token - Indicates the domain account token.
* @returns { Promise } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid token.
* @throws { BusinessError } 12300003 - Account not found.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static updateAccountToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array): Promise;
/**
* Gets the specified domain account information.
*
* @permission ohos.permission.GET_DOMAIN_ACCOUNTS
* @param { GetDomainAccountInfoOptions } options - Indicates the options for getting domain account information.
* @param { AsyncCallback } callback - Indicates the result callback.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300003 - Account not found.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300111 - Operation timeout.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static getAccountInfo(options: GetDomainAccountInfoOptions, callback: AsyncCallback): void;
/**
* Gets the specified domain account information.
*
* @permission ohos.permission.GET_DOMAIN_ACCOUNTS
* @param { GetDomainAccountInfoOptions } options - Indicates the options for getting domain account information.
* @returns { Promise } The promise returned by the function.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 801 - Capability not supported.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300003 - Account not found.
* @throws { BusinessError } 12300013 - Network exception.
* @throws { BusinessError } 12300111 - Operation timeout.
* @static
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
static getAccountInfo(options: GetDomainAccountInfoOptions): Promise;
}
/**
* Provides the abilities for managing user identity.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
* @name UserIdentityManager
*/
class UserIdentityManager {
/**
* Constructor to get the UserIdentityManager class instance.
*
* @throws { BusinessError } 202 - Not system application.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
constructor();
/**
* Opens session.
*
* Start an IDM operation to obtain challenge value.
* A challenge value of 0 indicates that opensession failed.
*
* @permission ohos.permission.MANAGE_USER_IDM
* @param { AsyncCallback } callback - Returns a challenge value.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
openSession(callback: AsyncCallback): void;
/**
* Opens session.
*
* Start an IDM operation to obtain challenge value.
* A challenge value of 0 indicates that opensession failed.
*
* @permission ohos.permission.MANAGE_USER_IDM
* @returns { Promise } Returns a challenge value.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
openSession(): Promise;
/**
* Adds credential.
*
* Add user credential information, pass in credential addition method and credential information
* (credential type, subclass, if adding user's non password credentials, pass in password authentication token),
* and get the result / acquireInfo callback.
*
* @permission ohos.permission.MANAGE_USER_IDM
* @param { CredentialInfo } credentialInfo - Indicates the credential information.
* @param { IIdmCallback } callback - Indicates the callback to get results and acquireInfo.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid credentialInfo, i.e. authType or authSubType.
* @throws { BusinessError } 12300101 - Token is invalid.
* @throws { BusinessError } 12300106 - Unsupported authType.
* @throws { BusinessError } 12300109 - Operation is canceled.
* @throws { BusinessError } 12300111 - Operation timeout.
* @throws { BusinessError } 12300115 - The number of credentials reaches the upper limit.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
/**
* Updates credential.
*
* @permission ohos.permission.MANAGE_USER_IDM
* @param { CredentialInfo } credentialInfo - Indicates the credential information.
* @param { IIdmCallback } callback - Indicates the callback to get results and acquireInfo.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid credentialInfo, i.e. authType or authSubType.
* @throws { BusinessError } 12300101 - Token is invalid.
* @throws { BusinessError } 12300102 - Credential not enrolled.
* @throws { BusinessError } 12300106 - Unsupported authType.
* @throws { BusinessError } 12300109 - Operation is canceled.
* @throws { BusinessError } 12300111 - Operation timeout.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
/**
* Closes session.
*
* End an IDM operation.
*
* @permission ohos.permission.MANAGE_USER_IDM
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
closeSession(): void;
/**
* Cancels entry with a challenge value.
*
* @permission ohos.permission.MANAGE_USER_IDM
* @param { Uint8Array } challenge - Indicates the challenge value.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid challenge.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
cancel(challenge: Uint8Array): void;
/**
* Deletes the user with the authentication token.
*
* @permission ohos.permission.MANAGE_USER_IDM
* @param { Uint8Array } token - Indicates the authentication token.
* @param { IIdmCallback } callback - Indicates the callback to get the deletion result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300101 - Token is invalid.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
delUser(token: Uint8Array, callback: IIdmCallback): void;
/**
* Deletes the user credential information.
*
* @permission ohos.permission.MANAGE_USER_IDM
* @param { Uint8Array } credentialId - Indicates the credential index.
* @param { Uint8Array } token - Indicates the authentication token.
* @param { IIdmCallback } callback - Indicates the callback to get the deletion result.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid credentialId.
* @throws { BusinessError } 12300101 - Token is invalid.
* @throws { BusinessError } 12300102 - Credential not enrolled.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): void;
/**
* Gets authentication information.
*
* @permission ohos.permission.USE_USER_IDM
* @param { AsyncCallback> } callback - Indicates the callback to get all registered credential information of
* the specified type for the current user.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300102 - Credential not enrolled.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
getAuthInfo(callback: AsyncCallback>): void;
/**
* Gets authentication information.
*
* @permission ohos.permission.USE_USER_IDM
* @param { AuthType } authType - Indicates the authentication type.
* @param { AsyncCallback> } callback - Indicates the callback to get all registered credential information of
* the specified type for the current user.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid authType.
* @throws { BusinessError } 12300102 - Credential not enrolled.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
getAuthInfo(authType: AuthType, callback: AsyncCallback>): void;
/**
* Gets authentication information.
*
* @permission ohos.permission.USE_USER_IDM
* @param { AuthType } authType - Indicates the authentication type.
* @returns { Promise> } Returns all registered credential information of
* the specified type for the current user.
* @throws { BusinessError } 201 - Permission denied.
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300001 - System service exception.
* @throws { BusinessError } 12300002 - Invalid authType.
* @throws { BusinessError } 12300102 - Credential not enrolled.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
getAuthInfo(authType?: AuthType): Promise>;
}
/**
* Password data callback.
*
* @interface IInputData
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface IInputData {
/**
* Notifies to set data.
*
* @throws { BusinessError } 202 - Not system application.
* @throws { BusinessError } 401 - The parameter check failed.
* @throws { BusinessError } 12300002 - Invalid pinSubType.
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
onSetData: (authSubType: AuthSubType, data: Uint8Array) => void;
}
/**
* Password input box callback.
*
* @interface IInputer
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface IInputer {
/**
* Notifies to get data.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
onGetData: (authSubType: AuthSubType, callback: IInputData) => void;
}
/**
* User authentication callback.
*
* @interface IUserAuthCallback
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface IUserAuthCallback {
/**
* The authentication result code is returned through the callback.
* If the authentication is passed, the authentication token is returned in extraInfo,
* If the authentication fails, the remaining authentication times are returned in extraInfo,
* If the authentication executor is locked, the freezing time is returned in extraInfo.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
onResult: (result: number, extraInfo: AuthResult) => void;
/**
* During an authentication, the TipsCode is returned through the callback.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
}
/**
* Identity manager callback.
*
* @interface IIdmCallback
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface IIdmCallback {
/**
* The authentication result code is returned through the callback.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
onResult: (result: number, extraInfo: RequestResult) => void;
/**
* During an authentication, the TipsCode is returned through the callback.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
}
/**
* Provides the information of the get property request.
*
* @interface GetPropertyRequest
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface GetPropertyRequest {
/**
* Indicates the authentication credential type.
*
* @type { AuthType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
authType: AuthType;
/**
* Indicates the array of property types to get.
*
* @type { Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
keys: Array;
}
/**
* Provides the information of the set property request.
*
* @interface SetPropertyRequest
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface SetPropertyRequest {
/**
* Indicates the authentication credential type.
*
* @type { AuthType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
authType: AuthType;
/**
* Indicates the property type to set.
*
* @type { SetPropertyType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
key: SetPropertyType;
/**
* Indicates the information to set.
*
* @type { Uint8Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
setInfo: Uint8Array;
}
/**
* Provides the property of executor.
*
* @interface ExecutorProperty
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface ExecutorProperty {
/**
* Indicates the result.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
result: number;
/**
* Indicates the authentication credential subtype.
*
* @type { AuthSubType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
authSubType: AuthSubType;
/**
* Indicates the remaining times.
*
* @type { ?number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
remainTimes?: number;
/**
* Indicates the freezing times.
*
* @type { ?number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
freezingTime?: number;
/**
* Indicates the enrollment progress.
*
* @type { ?string }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
enrollmentProgress?: string;
/**
* Indicates the sensor information.
*
* @type { ?string }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
sensorInfo?: string;
}
/**
* Indicates the information of authentication result.
*
* @interface AuthResult
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface AuthResult {
/**
* Indicates the authentication token.
*
* @type { ?Uint8Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
token?: Uint8Array;
/**
* Indicates the remaining times.
*
* @type { ?number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
remainTimes?: number;
/**
* Indicates the freezing times.
*
* @type { ?number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
freezingTime?: number;
}
/**
* Indicates the information of credential.
*
* @interface CredentialInfo
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface CredentialInfo {
/**
* Indicates the credential type.
*
* @type { AuthType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
credType: AuthType;
/**
* Indicates the credential subtype.
*
* @type { AuthSubType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
credSubType: AuthSubType;
/**
* Indicates the authentication token.
*
* @type { Uint8Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
token: Uint8Array;
}
/**
* Indicates the information of request result.
*
* @interface RequestResult
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface RequestResult {
/**
* Indicates the credential index.
*
* @type { ?Uint8Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
credentialId?: Uint8Array;
}
/**
* Indicates the information of enrolled credential.
*
* @interface EnrolledCredInfo
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
interface EnrolledCredInfo {
/**
* Indicates the credential index.
*
* @type { Uint8Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
credentialId: Uint8Array;
/**
* Indicates the authentication credential type.
*
* @type { AuthType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
authType: AuthType;
/**
* Indicates the authentication credential subtype.
*
* @type { AuthSubType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
authSubType: AuthSubType;
/**
* Indicates the credential template ID.
*
* @type { Uint8Array }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
templateId: Uint8Array;
}
/**
* Indicates the property type to get.
*
* @enum { number } GetPropertyType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum GetPropertyType {
/**
* Indicates the authentication subtype.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
AUTH_SUB_TYPE = 1,
/**
* Indicates the remain times.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
REMAIN_TIMES = 2,
/**
* Indicates the freezing time.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FREEZING_TIME = 3,
/**
* Indicates the enrollment progress.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
ENROLLMENT_PROGRESS = 4,
/**
* Indicates the sensor information.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
SENSOR_INFO = 5
}
/**
* Indicates the property type to set.
*
* @enum { number } SetPropertyType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum SetPropertyType {
/**
* Indicates the init algorithm.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
INIT_ALGORITHM = 1
}
/**
* Indicates the credential type for authentication.
*
* @enum { number } AuthType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum AuthType {
/**
* Indicates the PIN authentication type.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
PIN = 1,
/**
* Indicates the FACE authentication type.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE = 2,
/**
* Indicates the FINGERPRINT authentication type.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
FINGERPRINT = 4,
/**
* Indicates the DOMAIN authentication type.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
DOMAIN = 1024
}
/**
* Indicates the credential subtype for authentication.
*
* @enum { number } AuthSubType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum AuthSubType {
/**
* Indicates the 6-digit credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
PIN_SIX = 10000,
/**
* Indicates the self-defined digital credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
PIN_NUMBER = 10001,
/**
* Indicates the self-defined mixed credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
PIN_MIXED = 10002,
/**
* Indicates the 2D face credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_2D = 20000,
/**
* Indicates the 3D face credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_3D = 20001,
/**
* Indicates the capacitive fingerprint credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
FINGERPRINT_CAPACITIVE = 30000,
/**
* Indicates the optical fingerprint credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
FINGERPRINT_OPTICAL = 30001,
/**
* Indicates the ultrasonic fingerprint credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
FINGERPRINT_ULTRASONIC = 30002,
/**
* Indicates the mixed domain credential.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
DOMAIN_MIXED = 10240001
}
/**
* Indicates the trusted level of authentication results.
*
* @enum { number } AuthTrustLevel
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum AuthTrustLevel {
/**
* Indicates the trusted level 1.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
ATL1 = 10000,
/**
* Indicates the trusted level 2.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
ATL2 = 20000,
/**
* Indicates the trusted level 3.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
ATL3 = 30000,
/**
* Indicates the trusted level 4.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
ATL4 = 40000
}
/**
* Indicates the module of acquired information.
*
* @enum { number } Module
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum Module {
/**
* Indicates the information acquired from FaceAuth.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH = 1
}
/**
* Indicates the enumeration of authentication result code.
*
* @enum { number } ResultCode
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum ResultCode {
/**
* Indicates that authentication is success or ability is supported.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
SUCCESS = 0,
/**
* Indicates the authenticator fails to identify user.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FAIL = 1,
/**
* Indicates other errors.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
GENERAL_ERROR = 2,
/**
* Indicates that authentication has been canceled.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
CANCELED = 3,
/**
* Indicates that authentication has timed out.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
TIMEOUT = 4,
/**
* Indicates that this authentication type is not supported.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
TYPE_NOT_SUPPORT = 5,
/**
* Indicates that the authentication trust level is not supported.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
TRUST_LEVEL_NOT_SUPPORT = 6,
/**
* Indicates that the authentication task is busy. Wait for a few seconds and try again.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
BUSY = 7,
/**
* Indicates incorrect parameters.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
INVALID_PARAMETERS = 8,
/**
* Indicates that the authenticator is locked.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
LOCKED = 9,
/**
* Indicates that the user has not enrolled the authenticator.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
NOT_ENROLLED = 10
}
/**
* Indicates the enumeration of prompt codes in the process of face authentication.
*
* @enum { number } FaceTipsCode
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum FaceTipsCode {
/**
* Indicates that the obtained facial image is too bright due to high illumination.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_BRIGHT = 1,
/**
* Indicates that the obtained facial image is too dark due to low illumination.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_DARK = 2,
/**
* Indicates that the face is too close to the device.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_CLOSE = 3,
/**
* Indicates that the face is too far away from the device.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_FAR = 4,
/**
* Indicates that the device is too high, and that only the upper part of the face is captured.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_HIGH = 5,
/**
* Indicates that the device is too low, and that only the lower part of the face is captured.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_LOW = 6,
/**
* Indicates that the device is deviated to the right, and that only the right part of the face is captured.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_RIGHT = 7,
/**
* Indicates that the device is deviated to the left, and that only the left part of the face is captured.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_LEFT = 8,
/**
* Indicates that the face moves too fast during facial information collection.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_TOO_MUCH_MOTION = 9,
/**
* Indicates that the face is not facing the device.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_POOR_GAZE = 10,
/**
* Indicates that no face is detected.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FACE_AUTH_TIP_NOT_DETECTED = 11
}
/**
* Indicates the enumeration of prompt codes in the process of fingerprint authentication.
*
* @enum { number } FingerprintTips
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
enum FingerprintTips {
/**
* Indicates that the image acquired is good.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FINGERPRINT_TIP_GOOD = 0,
/**
* Indicates that the fingerprint image is too noisy due to suspected or detected dirt on the sensor.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FINGERPRINT_TIP_IMAGER_DIRTY = 1,
/**
* Indicates that the fingerprint image is too noisy to process due to a detected condition.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FINGERPRINT_TIP_INSUFFICIENT = 2,
/**
* Indicates that only a partial fingerprint image is detected.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FINGERPRINT_TIP_PARTIAL = 3,
/**
* Indicates that the fingerprint image is incomplete due to quick motion.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FINGERPRINT_TIP_TOO_FAST = 4,
/**
* Indicates that the fingerprint image is unreadable due to lack of motion.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 8
*/
FINGERPRINT_TIP_TOO_SLOW = 5,
/**
* Indicates that the finger is down.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
FINGERPRINT_TIP_FINGER_DOWN = 6,
/**
* Indicates that the finger is up.
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 10
*/
FINGERPRINT_TIP_FINGER_UP = 7
}
/**
* Enumerates for constraint source types.
*
* @enum { number } ConstraintSourceType
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
enum ConstraintSourceType {
/**
* No constraints are set
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
CONSTRAINT_NOT_EXIST = 0,
/**
* Constraint is set by setOsAccountConstraints
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
CONSTRAINT_TYPE_BASE = 1,
/**
* Constraint is set by device owner
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
CONSTRAINT_TYPE_DEVICE_OWNER = 2,
/**
* Constraint is set by profile owner
*
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
CONSTRAINT_TYPE_PROFILE_OWNER = 3
}
/**
* Provides information about the constraint source type info of an os account.
*
* @interface ConstraintSourceTypeInfo
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
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.
*
* @type { number }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
localId: number;
/**
* Indicates the source type of the constraint.
*
* @type { ConstraintSourceType }
* @syscap SystemCapability.Account.OsAccount
* @systemapi Hide this for inner system use.
* @since 9
*/
type: ConstraintSourceType;
}
}
export default osAccount;