): void;
@@ -197,7 +198,7 @@ declare namespace appAccount {
* through the distributed networking. On the connected devices, you can call this method to check
* whether application data can be synchronized.
*
- * @permission ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param name Indicates the name of the application account.
* @returns Returns {@code true} if application data synchronization is allowed; returns {@code false} otherwise.
* @since 7
@@ -214,7 +215,7 @@ declare namespace appAccount {
* through the distributed networking. On the connected devices, you can call this method to check
* whether application data can be synchronized.
*
- * @permission ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param name Indicates the name of the application account.
* @returns Returns {@code true} if application data synchronization is allowed; returns {@code false} otherwise.
* @throws {BusinessError} 201 - permission denied.
@@ -249,7 +250,7 @@ declare namespace appAccount {
* @returns void.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid name or credentialType.
+ * @throws {BusinessError} 12300002 - invalid name, credentialType or credential.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
* @since 9
*/
@@ -267,6 +268,7 @@ declare namespace appAccount {
* @returns void.
* @since 7
* @deprecated since 9
+ * @useinstead appAccount.AppAccountManager#setCustomData
*/
setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback): void;
setAccountExtraInfo(name: string, extraInfo: string): Promise;
@@ -275,7 +277,7 @@ declare namespace appAccount {
* Sets whether a specified application account allows application data synchronization.
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
- * through the distributed networking. On the networked devices, you can call this method to set whether to
+ * through the distributed networking. On the connected devices, you can call this method to set whether to
* allow cross-device data synchronization. If synchronization is allowed, application data can be synchronized
* among these devices in the event of any changes related to the application account.
* If synchronization is not allowed, the application data is stored only on the local device.
@@ -286,7 +288,7 @@ declare namespace appAccount {
* Application data that can be synchronized: application account name, token,
* and data associated with this application account
*
- * @permission ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param name Indicates the name of the application account.
* @param isEnable Specifies whether to allow application data synchronization.
* @returns void.
@@ -301,7 +303,7 @@ declare namespace appAccount {
* Sets whether a specified application account enables application data synchronization.
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
- * through the distributed networking. On the networked devices, you can call this method to set whether to
+ * through the distributed networking. On the connected devices, you can call this method to set whether to
* enable cross-device data synchronization. If synchronization is enabled, application data can be synchronized
* among these devices in the event of any changes related to the application account.
* If synchronization is not enabled, the application data is stored only on the local device.
@@ -312,7 +314,7 @@ declare namespace appAccount {
* Application data that can be synchronized: application account name, token,
* and data associated with this application account
*
- * @permission ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param name Indicates the name of the application account.
* @param isEnabled Specifies whether to enable application data synchronization.
* @returns void.
@@ -349,7 +351,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, key or value.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12400008 - the number of customized data has reached the upper limit.
+ * @throws {BusinessError} 12400003 - the number of customized data has reached the upper limit.
* @since 9
*/
setCustomData(name: string, key: string, value: string, callback: AsyncCallback): void;
@@ -364,7 +366,7 @@ declare namespace appAccount {
* Accounts of third-party applications. To obtain such information,
* your application must have gained authorization from the third-party applications.
*
- * @permission ohos.permission.GET_ALL_APP_ACCOUNTS.
+ * @permission ohos.permission.GET_ALL_APP_ACCOUNTS
* @returns Returns a list of application accounts.
* @since 7
* @deprecated since 9
@@ -382,7 +384,7 @@ declare namespace appAccount {
* Accounts of third-party applications. To obtain such information,
* your application must have gained authorization from the third-party applications.
*
- * @permission ohos.permission.GET_ALL_APP_ACCOUNTS.
+ * @permission ohos.permission.GET_ALL_APP_ACCOUNTS
* @returns Returns a list of application accounts.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -401,7 +403,7 @@ declare namespace appAccount {
* Accounts of third-party applications. To obtain such information,
* your application must have gained authorization from the third-party applications.
*
- * @permission ohos.permission.GET_ALL_APP_ACCOUNTS.
+ * @permission ohos.permission.GET_ALL_APP_ACCOUNTS
* @param owner Indicates the account owner of your application or third-party applications.
* @returns Returns a list of application accounts.
* @since 7
@@ -420,14 +422,14 @@ declare namespace appAccount {
* Accounts of third-party applications. To obtain such information,
* your application must have gained authorization from the third-party applications.
*
- * @permission ohos.permission.GET_ALL_APP_ACCOUNTS.
+ * @permission ohos.permission.GET_ALL_APP_ACCOUNTS
* @param owner Indicates the account owner of your application or third-party applications.
* @returns Returns a list of application accounts.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid owner.
- * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
+ * @throws {BusinessError} 12400001 - the application indicated by bundle name does not exist.
* @since 9
*/
getAccountsByOwner(owner: string, callback: AsyncCallback>): void;
@@ -454,7 +456,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or credentialType.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300102 - credential does not exist.
* @since 9
*/
getCredential(name: string, credentialType: string, callback: AsyncCallback): void;
@@ -467,6 +469,7 @@ declare namespace appAccount {
* for example, if the account does not exist.
* @since 7
* @deprecated since 9
+ * @useinstead appAccount.AppAccountManager#getCustomData
*/
getAccountExtraInfo(name: string, callback: AsyncCallback): void;
getAccountExtraInfo(name: string): Promise;
@@ -492,7 +495,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or key.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12400009 - the customData does not exist.
+ * @throws {BusinessError} 12400002 - the customData does not exist.
* @since 9
*/
getCustomData(name: string, key: string, callback: AsyncCallback): void;
@@ -507,6 +510,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or key.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
+ * @throws {BusinessError} 12400002 - the customData does not exist.
* @since 9
*/
getCustomDataSync(name: string, key: string): string;
@@ -536,8 +540,8 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid type or owners.
- * @throws {BusinessError} 12300003 - the account indicated by owners dose not exist.
- * @throws {BusinessError} 12300005 - the listener has been registered.
+ * @throws {BusinessError} 12300011 - the callback has been registered.
+ * @throws {BusinessError} 12400001 - the application indicated by owner does not exist.
* @since 9
*/
on(type: 'accountChange', owners: Array, callback: Callback>): void;
@@ -557,7 +561,7 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid type.
- * @throws {BusinessError} 12300005 - the listener has been registered.
+ * @throws {BusinessError} 12300012 - the callback has not been registered.
* @since 9
*/
off(type: 'accountChange', callback?: Callback>): void;
@@ -588,10 +592,9 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner, authType or options.
* @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12300016 - authentication timeout.
- * @throws {BusinessError} 12300017 - authentication service is busy.
- * @throws {BusinessError} 12300018 - authentication service is locked.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
auth(name: string, owner: string, authType: string, callback: AuthCallback): void;
@@ -620,8 +623,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner or authType.
* @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
* @since 9
*/
getAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback): void;
@@ -654,9 +656,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner, authType or token.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
- * @throws {BusinessError} 12400007 - the number of token has reached the upper limit.
+ * @throws {BusinessError} 12400004 - the number of token has reached the upper limit.
* @since 9
*/
setAuthToken(name: string, authType: string, token: string, callback: AsyncCallback): void;
@@ -691,8 +691,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner, authType or token.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
* @since 9
*/
deleteAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback): void;
@@ -727,8 +726,9 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, authType or bundleName.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
+ * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
+ * @throws {BusinessError} 12400005 - the size of authorization list reaches the upper limit.
* @since 9
*/
setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean, callback: AsyncCallback): void;
@@ -761,8 +761,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, authType or bundleName.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
* @since 9
*/
checkAuthTokenVisibility(name: string, authType: string, bundleName: string, callback: AsyncCallback): void;
@@ -795,7 +794,7 @@ declare namespace appAccount {
getAllAuthTokens(name: string, owner: string): Promise>;
/**
- * Gets the open authorization list with a specified authentication type for a paticular application account.
+ * Gets the open authorization list with a specified authentication type for a particular application account.
*
* Only the owner of the application account has the permission to call this method.
* @param name Indicates the account name of your application.
@@ -809,7 +808,7 @@ declare namespace appAccount {
getOAuthList(name: string, authType: string): Promise>;
/**
- * Gets the open authorization list with a specified authentication type for a paticular application account.
+ * Gets the open authorization list with a specified authentication type for a particular application account.
*
* Only the owner of the application account has the permission to call this method.
* @param name Indicates the account name of your application.
@@ -819,8 +818,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or authType.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
* @since 9
*/
getAuthList(name: string, authType: string, callback: AsyncCallback>): void;
@@ -847,7 +845,8 @@ declare namespace appAccount {
* @returns Returns the authenticator callback related to the session id.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12400005 - the session indicated by sessionId does not exist.
+ * @throws {BusinessError} 12300002 - invalid session id.
+ * @throws {BusinessError} 12300108 - the session indicated by sessionId does not exist.
* @since 9
*/
getAuthCallback(sessionId: string, callback: AsyncCallback): void;
@@ -871,23 +870,25 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid owner.
- * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
* @since 9
*/
queryAuthenticatorInfo(owner: string, callback: AsyncCallback): void;
queryAuthenticatorInfo(owner: string): Promise;
/**
- * Checks whether a paticular account has all specified labels.
+ * Checks whether a particular account has all specified labels.
* @param name Indicates the account name.
* @param owner Indicates the account owner.
* @param labels Indicates an array of labels to check.
* @returns boolean
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid name or owner.
+ * @throws {BusinessError} 12300002 - invalid name, owner or labels.
* @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
checkAccountLabels(name: string, owner: string, labels: Array, callback: AsyncCallback): void;
@@ -901,9 +902,9 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or credentialType.
- * @throws {BusinessError} 12300019 - credential does not exist.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
- * since 9
+ * @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
+ * @throws {BusinessError} 12300102 - credential does not exist.
+ * @since 9
*/
deleteCredential(name: string, credentialType: string, callback: AsyncCallback): void;
deleteCredential(name: string, credentialType: string): Promise;
@@ -915,6 +916,8 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid options.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
selectAccountsByOptions(options: SelectAccountsOptions, callback: AsyncCallback>): void;
@@ -931,8 +934,9 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner or options.
* @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
- * @throws {BusinessError} 12400002 - he account authenticator service does not exist.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
verifyCredential(name: string, owner: string, callback: AuthCallback): void;
@@ -949,8 +953,9 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid owner or options.
- * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12400002 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
setAuthenticatorProperties(owner: string, callback: AuthCallback): void;
@@ -1063,7 +1068,7 @@ declare namespace appAccount {
*/
interface AuthResult {
/**
- * The account infomation.
+ * The account information.
* @since 9
*/
account?: AppAccountInfo;
@@ -1154,7 +1159,7 @@ declare namespace appAccount {
*/
interface VerifyCredentialOptions {
/**
- * The credentail type to be verified.
+ * The credential type to be verified.
* @since 9
*/
credentialType?: string;
@@ -1281,7 +1286,7 @@ declare namespace appAccount {
KEY_ACTION = "action",
/**
- * Indicates the key of authentiaction type.
+ * Indicates the key of authentication type.
*
* @since 8
*/
@@ -1441,6 +1446,8 @@ declare namespace appAccount {
* @param callback Indicates the authenticator callback.
* @returns void.
* @since 8
+ * @deprecated since 9
+ * @useinstead appAccount.Authenticator#createAccountImplicitly
*/
addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void;
@@ -1462,6 +1469,8 @@ declare namespace appAccount {
* @param callback Indicates the authenticator callback.
* @returns void.
* @since 8
+ * @deprecated since 9
+ * @useinstead appAccount.Authenticator#auth
*/
authenticate(name: string, authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void;
diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts
index 3e3b41439a0e946fb2ed98c435a39123283fd218..c5deff6f2bd92be14a5bd39595805bc29fc8b4bb 100644
--- a/api/@ohos.account.distributedAccount.d.ts
+++ b/api/@ohos.account.distributedAccount.d.ts
@@ -51,7 +51,7 @@ declare namespace distributedAccount {
/**
* Gets the distributed information of the current OS account.
- * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.GET_DISTRIBUTED_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.GET_DISTRIBUTED_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC
* @returns The distributed information of the current OS account.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -63,7 +63,7 @@ declare namespace distributedAccount {
/**
* Updates the distributed information of the OS account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param accountInfo Indicates the information of the OS account used for a distributed system.
* @returns void
* @since 7
@@ -75,13 +75,14 @@ declare namespace distributedAccount {
/**
* Sets the distributed information of the OS account.
- * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS
* @param accountInfo Indicates the information of the OS account used for a distributed system.
* @returns void
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid accountInfo.
+ * @throws {BusinessError} 12300003 - the account indicated by accountInfo dose not exist.
* @since 9
*/
setOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallback): void;
diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts
index 92a81d4b44d572743e76639447886445cdae8e48..c9ab2e19017cb3e0f8081f5fc5599c62abc1c9f1 100644
--- a/api/@ohos.account.osAccount.d.ts
+++ b/api/@ohos.account.osAccount.d.ts
@@ -44,7 +44,7 @@ declare namespace osAccount {
* to run in the foreground. Then, the OS account originally running in the foreground will be
* switched to the background.
*
- * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION.
+ * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION
* @param localId Indicates the local ID of the OS account.
* @returns void.
* @throws {BusinessError} 201 - permission denied.
@@ -52,8 +52,8 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300003 - the account indicated by localId has been activated.
- * @throws {BusinessError} 12300010 - account service is busy.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
+ * @throws {BusinessError} 12300009 - the account indicated by localId has been activated.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -94,7 +94,7 @@ declare namespace osAccount {
/**
* Checks whether an OS account is activated based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns void
* @throws {BusinessError} 201 - permission denied.
@@ -109,7 +109,7 @@ declare namespace osAccount {
/**
* Checks whether a constraint has been enabled for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param constraint Indicates the constraint to check. The value can be:
*
@@ -132,7 +132,7 @@ declare namespace osAccount {
/**
* Checks whether a constraint has been enabled for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param constraint Indicates the constraint to check. The value can be:
*
@@ -151,7 +151,6 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId or constraint.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
* @since 9
*/
checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void;
@@ -179,7 +178,7 @@ declare namespace osAccount {
/**
* Checks whether an OS account has been verified based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns {@code true} if the OS account has been verified successfully;
* returns {@code false} otherwise.
@@ -194,7 +193,7 @@ declare namespace osAccount {
/**
* Checks whether an OS account has been verified based on its ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns {@code true} if the OS account has been verified successfully;
* returns {@code false} otherwise.
@@ -211,7 +210,7 @@ declare namespace osAccount {
/**
* Removes an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns void.
* @throws {BusinessError} 201 - permission denied.
@@ -219,7 +218,7 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -228,7 +227,7 @@ declare namespace osAccount {
/**
* Sets constraints for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param constraints Indicates the constraints to set for the OS account. The value can be:
*
@@ -247,7 +246,7 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId or constraints.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -257,7 +256,7 @@ declare namespace osAccount {
/**
* Sets the local name for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param localName Indicates the local name to set for the OS account.
* @returns void.
@@ -266,7 +265,7 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId or localName.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -275,7 +274,7 @@ declare namespace osAccount {
/**
* Obtains the number of all OS accounts created on a device.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns the number of created OS accounts.
* @since 7
* @deprecated since 9
@@ -286,7 +285,7 @@ declare namespace osAccount {
/**
* Obtains the number of all OS accounts created on a device.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns the number of created OS accounts.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -341,7 +340,7 @@ declare namespace osAccount {
/**
* Queries the local ID of an OS account which is bound to the specified domain account
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param domainInfo Indicates the domain account info.
* @returns Returns the local ID of the OS account.
* @since 8
@@ -354,7 +353,7 @@ declare namespace osAccount {
/**
* Queries the ID of an account which is bound to the specified domain account
*
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param domainInfo Indicates the domain account info.
* @returns Returns the local ID of the OS account.
* @throws {BusinessError} 201 - permission denied.
@@ -379,7 +378,7 @@ declare namespace osAccount {
/**
* Obtains all constraints of an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns a list of constraints.
* @since 7
@@ -391,7 +390,7 @@ declare namespace osAccount {
/**
* Obtains all constraints of an account based on its ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns a list of constraints.
* @throws {BusinessError} 201 - permission denied.
@@ -399,7 +398,6 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
* @since 9
*/
getOsAccountConstraints(localId: number, callback: AsyncCallback>): void;
@@ -407,7 +405,7 @@ declare namespace osAccount {
/**
* Queries the list of all the OS accounts that have been created in the system.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns a list of OS accounts.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -440,7 +438,7 @@ declare namespace osAccount {
/**
* Creates an OS account using the local name and account type.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localName Indicates the local name of the OS account to create.
* @param type Indicates the type of the OS account to create.
* {@link OsAccountType} specifies the account types available in the system.
@@ -449,7 +447,9 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localName.
- * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
+ * @throws {BusinessError} 12300005 - multi-user not supported.
+ * @throws {BusinessError} 12300006 - unsupported account type.
+ * @throws {BusinessError} 12300007 - the number of account reaches the upper limit.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -458,7 +458,7 @@ declare namespace osAccount {
/**
* Creates an OS account using the account type and domain account info.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param type Indicates the type of the OS account to create.
* {@link OsAccountType} specifies the account types available in the system.
* @param domainInfo Indicates the domain account info.
@@ -467,6 +467,9 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid type or domainInfo.
+ * @throws {BusinessError} 12300005 - multi-user not supported.
+ * @throws {BusinessError} 12300006 - unsupported account type.
+ * @throws {BusinessError} 12300007 - the number of account reaches the upper limit.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -475,7 +478,7 @@ declare namespace osAccount {
/**
* Queries information about the current OS account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns information about the current OS account; returns {@code null} if the query fails.
* @since 7
* @deprecated since 9
@@ -486,7 +489,7 @@ declare namespace osAccount {
/**
* Gets information about the current OS account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns information about the current OS account; returns {@code null} if the query fails.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -499,7 +502,7 @@ declare namespace osAccount {
/**
* Queries OS account information based on the local ID.
*
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION
* @param localId Indicates the local ID of the OS account.
* @returns Returns the OS account information; returns {@code null} if the query fails.
* @throws {BusinessError} 201 - permission denied.
@@ -539,7 +542,7 @@ declare namespace osAccount {
* 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 networked devices, you can call this method to obtain the DVIDs.
+ * 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.
*
@@ -556,11 +559,11 @@ declare namespace osAccount {
* 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 networked devices, you can call this method to obtain the DVIDs.
+ * 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.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns 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.
@@ -572,7 +575,7 @@ declare namespace osAccount {
/**
* Obtains the profile photo of an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns the profile photo if obtained;
* returns {@code null} if the profile photo fails to be obtained.
@@ -589,7 +592,7 @@ declare namespace osAccount {
/**
* Sets the profile photo for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param photo Indicates the profile photo to set for the OS account.
* @returns void.
@@ -598,6 +601,7 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId or photo.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -621,6 +625,8 @@ declare namespace osAccount {
* @returns localId.
* @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.
* @since 9
*/
queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback): void;
@@ -662,7 +668,8 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300005 - the listener has been registered.
+ * @throws {BusinessError} 12300002 - invalid type or name.
+ * @throws {BusinessError} 12300011 - the callback has been registered.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -677,7 +684,8 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300006 - the listener has not been registered.
+ * @throws {BusinessError} 12300002 - invalid type or name.
+ * @throws {BusinessError} 12300012 - the callback has not been registered.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -698,7 +706,7 @@ declare namespace osAccount {
/**
* Check whether current process belongs to the main account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns {@code true} if current process belongs to the main os account;
* returns {@code false} otherwise.
* @throws {BusinessError} 201 - permission denied.
@@ -712,7 +720,7 @@ declare namespace osAccount {
/**
* Query the constraint source type list of the OS account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns the constraint source type infos of the os account;
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -882,8 +890,6 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid authType or authTrustLevel.
- * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -931,12 +937,12 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid challenge, authType or authTrustLevel.
- * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300016 - authentication timeout.
- * @throws {BusinessError} 12300017 - authentication service is busy.
- * @throws {BusinessError} 12300018 - authentication service is locked.
- * @throws {BusinessError} 12300019 - the credential does not exist.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300105 - unsupported authTrustLevel.
+ * @throws {BusinessError} 12300106 - unsupported authType.
+ * @throws {BusinessError} 12300110 - authentication is locked.
+ * @throws {BusinessError} 12300111 - authentication timeout.
+ * @throws {BusinessError} 12300112 - authentication service is busy.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -955,13 +961,12 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid userId, challenge, authType or authTrustLevel.
- * @throws {BusinessError} 12300003 - the account indicated by userId dose not exist.
- * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300016 - authentication timeout.
- * @throws {BusinessError} 12300017 - authentication service is busy.
- * @throws {BusinessError} 12300018 - authentication service is locked.
- * @throws {BusinessError} 12300019 - the credential does not exist.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300105 - unsupported authTrustLevel.
+ * @throws {BusinessError} 12300106 - unsupported authType.
+ * @throws {BusinessError} 12300110 - authentication is locked.
+ * @throws {BusinessError} 12300111 - authentication timeout.
+ * @throws {BusinessError} 12300112 - authentication service is busy.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -974,7 +979,7 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid contexId.
+ * @throws {BusinessError} 12300002 - invalid contextId.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1003,7 +1008,7 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300007 - PIN inputer has been registered.
+ * @throws {BusinessError} 12300103 - the credential inputer has been registered.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1054,7 +1059,7 @@ declare namespace osAccount {
*
* 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.
+ * and get the result / acquireInfo callback.
* @permission ohos.permission.MANAGE_USER_IDM
* @param credentialInfo Indicates the credential information.
* @param callback Indicates the callback to get results and acquireInfo.
@@ -1062,6 +1067,8 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid credentialInfo.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300106 - unsupported authType.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1076,6 +1083,8 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid credentialInfo.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300106 - unsupported authType.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1112,7 +1121,7 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid token.
+ * @throws {BusinessError} 12300101 - token is invalid.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1127,7 +1136,9 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid credentialId or token.
+ * @throws {BusinessError} 12300002 - invalid credentialId.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300102 - credential not found.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1143,11 +1154,7 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid authType.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300016 - authentication timeout.
- * @throws {BusinessError} 12300017 - authentication service is busy.
- * @throws {BusinessError} 12300018 - authentication service is locked.
- * @throws {BusinessError} 12300019 - the credential does not exist.
+ * @throws {BusinessError} 12300102 - credential not found.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1207,9 +1214,9 @@ declare namespace osAccount {
* The authentication result code is returned through the callback.
* @param result Indicates the authentication result code.
* @param extraInfo Indicates the specific information for different situation.
- * 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.
+ * 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.
* @systemapi Hide this for inner system use.
* @since 8
*/
diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a29250be373eb853fd6f75ee6b44349d42bc323b
--- /dev/null
+++ b/api/@ohos.app.ability.Ability.d.ts
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import AbilityConstant from "./@ohos.app.ability.AbilityConstant";
+import { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * The class of an ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+export default class Ability {
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } newConfig - Indicates the updated configuration.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onConfigurationUpdate(newConfig: Configuration): void;
+
+ /**
+ * Called when the system has determined to trim the memory, for example, when the ability is running in the
+ * background and there is no enough memory for running as many background processes as possible.
+ * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory
+ * usage status.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
+
+ /**
+ * Called back when an ability prepares to save.
+ * @param reason state type when save.
+ * @param wantParam Indicates the want parameter.
+ * @return 0 if ability agrees to save data successfully, otherwise errcode.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult;
+}
diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..3709949ca5f5facb5e085ff2d87713a3e2367d57
--- /dev/null
+++ b/api/@ohos.app.ability.AbilityConstant.d.ts
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * The definition of AbilityConstant.
+ * @namespace AbilityConstant
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+declare namespace AbilityConstant {
+ /**
+ * Interface of launch param.
+ * @typedef LaunchParam
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export interface LaunchParam {
+ /**
+ * Indicates launch reason.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ launchReason: LaunchReason;
+
+ /**
+ * Indicates last exit reason.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ lastExitReason: LastExitReason;
+ }
+
+ /**
+ * Type of launch reason.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export enum LaunchReason {
+ UNKNOWN = 0,
+ START_ABILITY = 1,
+ CALL = 2,
+ CONTINUATION = 3,
+ APP_RECOVERY = 4,
+ }
+
+ /**
+ * Type of last exit reason.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export enum LastExitReason {
+ UNKNOWN = 0,
+ ABILITY_NOT_RESPONDING = 1,
+ NORMAL = 2,
+ }
+
+ /**
+ * Type of onContinue result.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export enum OnContinueResult {
+ AGREE = 0,
+ REJECT = 1,
+ MISMATCH = 2,
+ }
+
+ /**
+ * Type of memory level.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export enum MemoryLevel {
+ MEMORY_LEVEL_MODERATE = 0,
+ MEMORY_LEVEL_LOW = 1,
+ MEMORY_LEVEL_CRITICAL = 2,
+ }
+
+ /**
+ * Type of window mode.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export enum WindowMode {
+ WINDOW_MODE_UNDEFINED = 0,
+ WINDOW_MODE_FULLSCREEN = 1,
+ WINDOW_MODE_SPLIT_PRIMARY = 100,
+ WINDOW_MODE_SPLIT_SECONDARY = 101,
+ WINDOW_MODE_FLOATING = 102,
+ }
+
+ /**
+ * Type of onSave result.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export enum OnSaveResult {
+ ALL_AGREE = 0,
+ CONTINUATION_REJECT = 1,
+ CONTINUATION_MISMATCH = 2,
+ RECOVERY_AGREE = 3,
+ RECOVERY_REJECT = 4,
+ ALL_REJECT,
+ }
+
+ /**
+ * Type of save state.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export enum StateType {
+ CONTINUATION = 0,
+ APP_RECOVERY = 1,
+ }
+}
+
+export default AbilityConstant;
diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..7f62e30feaf347dd772f8877d8ca279bd9e31f95
--- /dev/null
+++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import UIAbility from "./@ohos.app.ability.UIAbility";
+import dataAbility from "./@ohos.data.dataAbility";
+import window from './@ohos.window';
+
+/**
+ * The ability lifecycle callback.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+export default class AbilityLifecycleCallback {
+ /**
+ * Called back when an ability is started for initialization.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onAbilityCreate(ability: UIAbility): void;
+
+ /**
+ * Called back when a window stage is created.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @param { window.WindowStage } windowStage - window stage to create
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when a window stage is actived.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @param { window.WindowStage } windowStage - window stage to active
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onWindowStageActive(ability: UIAbility, windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when a window stage is inactived.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @param { window.WindowStage } windowStage - window stage to inactive
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onWindowStageInactive(ability: UIAbility, windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when a window stage is destroyed.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @param { window.WindowStage } windowStage - window stage to destroy
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when an ability is destroyed.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onAbilityDestroy(ability: UIAbility): void;
+
+ /**
+ * Called back when the state of an ability changes to foreground.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onAbilityForeground(ability: UIAbility): void;
+
+ /**
+ * Called back when the state of an ability changes to background.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onAbilityBackground(ability: UIAbility): void;
+
+ /**
+ * Called back when an ability prepares to continue.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onAbilityContinue(ability: UIAbility): void;
+}
\ No newline at end of file
diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..8aa0201a3f3c1ad0e0d2e394e8970ecccb3bbcef
--- /dev/null
+++ b/api/@ohos.app.ability.AbilityStage.d.ts
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import AbilityConstant from "./@ohos.app.ability.AbilityConstant";
+import AbilityStageContext from "./application/AbilityStageContext";
+import Want from './@ohos.app.ability.Want';
+import { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * The class of an ability stage.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+export default class AbilityStage {
+ /**
+ * Indicates configuration information about context.
+ * @type { AbilityStageContext }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ context: AbilityStageContext;
+
+ /**
+ * Called back when an ability stage is started for initialization.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ onCreate(): void;
+
+ /**
+ * Called back when start specified ability.
+ * @param { Want } want - Indicates the want info of startd ability.
+ * @return { string } The user returns an ability string ID. If the ability of this ID has been started before,
+ * do not create a new instance and pull it back to the top of the stack.
+ * Otherwise, create a new instance and start it.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ onAcceptWant(want: Want): string;
+
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } newConfig - Indicates the updated configuration.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ onConfigurationUpdate(newConfig: Configuration): void;
+
+ /**
+ * Called when the system has determined to trim the memory, for example, when the ability is running in the
+ * background and there is no enough memory for running as many background processes as possible.
+ * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory usage status.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
+}
diff --git a/api/@ohos.app.ability.Configuration.d.ts b/api/@ohos.app.ability.Configuration.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b5f11c28d254a422316cb7a48353ad53dc13344f
--- /dev/null
+++ b/api/@ohos.app.ability.Configuration.d.ts
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import ConfigurationConstant from "./@ohos.app.ability.ConfigurationConstant";
+
+/**
+ * configuration item.
+ * @typedef Configuration
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+export interface Configuration {
+ /**
+ * Indicates the current language of the application.
+ * @type { string }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ language?: string;
+
+ /**
+ * Indicates the current colorMode of the application.
+ * @type { ConfigurationConstant.ColorMode }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ colorMode?: ConfigurationConstant.ColorMode;
+
+ /**
+ * Indicates the screen direction of the current device.
+ * @type { ConfigurationConstant.Direction }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ direction?: ConfigurationConstant.Direction;
+
+ /**
+ * Indicates the screen density of the current device.
+ * @type { ConfigurationConstant.ScreenDensity }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ screenDensity?: ConfigurationConstant.ScreenDensity;
+
+ /**
+ * Indicates the displayId of the current device.
+ * @type { number }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ displayId?: number;
+
+ /**
+ * Indicates whether a pointer type device has connected.
+ * @type { boolean }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ hasPointerDevice?: boolean;
+}
diff --git a/api/@ohos.app.ability.ConfigurationConstant.d.ts b/api/@ohos.app.ability.ConfigurationConstant.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..303647c93b6833a7286bb4c86b5de53172822a13
--- /dev/null
+++ b/api/@ohos.app.ability.ConfigurationConstant.d.ts
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * The definition of ConfigurationConstant.
+ * @namespace ConfigurationConstant
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ declare namespace ConfigurationConstant {
+ /**
+ * ColorMode
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ export enum ColorMode {
+ COLOR_MODE_NOT_SET = -1,
+ COLOR_MODE_DARK = 0,
+ COLOR_MODE_LIGHT = 1,
+ }
+
+ /**
+ * Direction
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ export enum Direction {
+ DIRECTION_NOT_SET = -1,
+ DIRECTION_VERTICAL = 0,
+ DIRECTION_HORIZONTAL = 1,
+ }
+
+ /**
+ * ScreenDensity
+ * @name ScreenDensity
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ export enum ScreenDensity {
+ SCREEN_DENSITY_NOT_SET = 0,
+ SCREEN_DENSITY_SDPI = 120,
+ SCREEN_DENSITY_MDPI = 160,
+ SCREEN_DENSITY_LDPI = 240,
+ SCREEN_DENSITY_XLDPI = 320,
+ SCREEN_DENSITY_XXLDPI = 480,
+ SCREEN_DENSITY_XXXLDPI = 640,
+ }
+}
+
+export default ConfigurationConstant
diff --git a/api/@ohos.app.ability.EnvironmentCallback.d.ts b/api/@ohos.app.ability.EnvironmentCallback.d.ts
new file mode 100755
index 0000000000000000000000000000000000000000..03ccc013c37461487b4f203be3cd28940f895697
--- /dev/null
+++ b/api/@ohos.app.ability.EnvironmentCallback.d.ts
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * The environment callback.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+export default class EnvironmentCallback {
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } config - Indicates the updated configuration.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onConfigurationUpdated(config: Configuration): void;
+}
diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a64ecb161e9887aca48ece2a3f75be8bd3373247
--- /dev/null
+++ b/api/@ohos.app.ability.ExtensionAbility.d.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ability from "./@ohos.app.ability.Ability";
+
+/**
+ * class of extension.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+export default class ExtensionAbility extends Ability {
+}
diff --git a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d4eaab2f12079d274012c15d2d4b5c9b5a8ae94d
--- /dev/null
+++ b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import rpc from "./@ohos.rpc";
+import ServiceExtensionContext from "./application/ServiceExtensionContext";
+import Want from './@ohos.app.ability.Want';
+import { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * class of service extension ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+export default class ServiceExtensionAbility {
+ /**
+ * Indicates service extension ability context.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ context: ServiceExtensionContext;
+
+ /**
+ * Called back when a service extension is started for initialization.
+ * @param { Want } want - Indicates the want of created service extension.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onCreate(want: Want): void;
+
+ /**
+ * Called back before a service extension is destroyed.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onDestroy(): void;
+
+ /**
+ * Called back when a service extension is started.
+ * @param { Want } want - Indicates the want of service extension to start.
+ * @param { number } startId - Indicates the number of times the service extension has been started.
+ * The {@code startId} is incremented by 1 every time the service extension is started.
+ * For example, if the service extension has been started for six times.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onRequest(want: Want, startId: number): void;
+
+ /**
+ * Called back when a service extension is first connected to an ability.
+ * @param { Want } want - Indicates connection information about the Service ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onConnect(want: Want): rpc.RemoteObject;
+
+ /**
+ * Called back when all abilities connected to a service extension are disconnected.
+ * @param { Want } want - Indicates disconnection information about the service extension.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onDisconnect(want: Want): void;
+
+ /**
+ * Called when a new client attempts to connect to a service extension after all previous client connections to it
+ * are disconnected.
+ * @param { Want } want - Indicates the want of the service extension being connected.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onReconnect(want: Want): void;
+
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } newConfig - Indicates the updated configuration.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onConfigurationUpdate(newConfig: Configuration): void;
+
+ /**
+ * Called when dump client information is required.
+ * It is recommended that developers don't DUMP sensitive information.
+ * @param { Array } params - Indicates the params from command.
+ * @return { Array } The dump info array.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onDump(params: Array): Array;
+}
diff --git a/api/bundle/dispatchInfo.d.ts b/api/@ohos.app.ability.StartOptions.d.ts
similarity index 59%
rename from api/bundle/dispatchInfo.d.ts
rename to api/@ohos.app.ability.StartOptions.d.ts
index 2538eb4c831ea6986e6501eec53294e77820b8ba..2650fce27a14a68529ff154d9b2f25d1f6c55f56 100644
--- a/api/bundle/dispatchInfo.d.ts
+++ b/api/@ohos.app.ability.StartOptions.d.ts
@@ -14,23 +14,25 @@
*/
/**
- * @name The dispatch info class.
+ * StartOptions is the basic communication component of the system.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
* @since 9
- * @syscap SystemCapability.BundleManager.BundleFramework
- * @systemapi hide this for inner system use
*/
- export interface DispatchInfo {
+export default class StartOptions {
/**
- * @default Indicates the dispatchInfo version
+ * windowMode
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
* @since 9
- * @syscap SystemCapability.BundleManager.BundleFramework
*/
- readonly version: string;
-
+ windowMode?: number;
+
/**
- * @default Indicates the free install interface version number
+ * displayId
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
* @since 9
- * @syscap SystemCapability.BundleManager.BundleFramework
*/
- readonly dispatchAPI: string;
+ displayId?: number;
}
\ No newline at end of file
diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts
new file mode 100755
index 0000000000000000000000000000000000000000..2f1612dc5ce69bb797ea67d11ebb3f21b5f17544
--- /dev/null
+++ b/api/@ohos.app.ability.UIAbility.d.ts
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import Ability from "./@ohos.app.ability.Ability";
+import AbilityConstant from "./@ohos.app.ability.AbilityConstant";
+import UIAbilityContext from "./application/UIAbilityContext";
+import rpc from './@ohos.rpc';
+import Want from './@ohos.app.ability.Want';
+import window from './@ohos.window';
+
+/**
+ * The prototype of the listener function interface registered by the Caller.
+ * @typedef OnReleaseCallback
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+export interface OnReleaseCallback {
+ (msg: string): void;
+}
+
+/**
+ * The prototype of the message listener function interface registered by the Callee.
+ * @typedef CalleeCallback
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+export interface CalleeCallback {
+ (indata: rpc.MessageParcel): rpc.Sequenceable;
+}
+
+/**
+ * The interface of a Caller.
+ * @interface
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+export interface Caller {
+ /**
+ * Notify the server of Sequenceable type data.
+ * @param { string } method - The notification event string listened to by the callee.
+ * @param { rpc.Sequenceable } data - Notification data to the callee.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ call(method: string, data: rpc.Sequenceable): Promise;
+
+ /**
+ * Notify the server of Sequenceable type data and return the notification result.
+ * @param { string } method - The notification event string listened to by the callee.
+ * @param { rpc.Sequenceable } data - Notification data to the callee.
+ * @returns { Promise } Returns the callee's notification result data.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ callWithResult(method: string, data: rpc.Sequenceable): Promise;
+
+ /**
+ * Clear service records.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ release(): void;
+
+ /**
+ * Register death listener notification callback.
+ * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onRelease(callback: OnReleaseCallback): void;
+
+ /**
+ * Register death listener notification callback.
+ * @param { string } type - release.
+ * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ on(type: "release", callback: OnReleaseCallback): void;
+
+ /**
+ * Unregister death listener notification callback.
+ * @param { string } type - release.
+ * @param { OnReleaseCallback } callback - Unregister a callback function for listening for notifications.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ off(type: "release", callback: OnReleaseCallback): void;
+
+ /**
+ * Unregister all death listener notification callback.
+ * @param { string } type - release.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ off(type: "release"): void;
+}
+
+/**
+ * The interface of a Callee.
+ * @interface
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+export interface Callee {
+ /**
+ * Register data listener callback.
+ * @param { string } method - A string registered to listen for notification events.
+ * @param { CalleeCallback } callback - Register a callback function that listens for notification events.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ on(method: string, callback: CalleeCallback): void;
+
+ /**
+ * Unregister data listener callback.
+ * @param { string } method - A string registered to listen for notification events.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ off(method: string): void;
+}
+
+/**
+ * The class of a UI ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+export default class UIAbility extends Ability {
+ /**
+ * Indicates configuration information about an ability context.
+ * @type { UIAbilityContext }
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ context: UIAbilityContext;
+
+ /**
+ * Indicates ability launch want.
+ * @type { Want }
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ launchWant: Want;
+
+ /**
+ * Indicates ability last request want.
+ * @type { Want }
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ lastRequestWant: Want;
+
+ /**
+ * Call Service Stub Object.
+ * @type { Callee }
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ callee: Callee;
+
+ /**
+ * Called back when an ability is started for initialization.
+ * @param { Want } want - Indicates the want info of the created ability.
+ * @param { AbilityConstant.LaunchParam } param - Indicates the launch param.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
+
+ /**
+ * Called back when an ability window stage is created.
+ * @param { window.WindowStage } windowStage - Indicates the created WindowStage.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onWindowStageCreate(windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when an ability window stage is destroyed.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onWindowStageDestroy(): void;
+
+ /**
+ * Called back when an ability window stage is restored.
+ * @param { window.WindowStage } windowStage - window stage to restore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onWindowStageRestore(windowStage: window.WindowStage): void;
+
+ /**
+ * Called back before an ability is destroyed.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onDestroy(): void;
+
+ /**
+ * Called back when the state of an ability changes to foreground.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onForeground(): void;
+
+ /**
+ * Called back when the state of an ability changes to background.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onBackground(): void;
+
+ /**
+ * Called back when an ability prepares to continue.
+ * @param { {[key: string]: any} } wantParam - Indicates the want parameter.
+ * @returns { AbilityConstant.OnContinueResult } Return the result of onContinue.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onContinue(wantParam: { [key: string]: any }): AbilityConstant.OnContinueResult;
+
+ /**
+ * Called when the launch mode of an ability is set to singleton.
+ * This happens when you re-launch an ability that has been at the top of the ability stack.
+ * @param { Want } want - Indicates the want info of ability.
+ * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
+
+ /**
+ * Called when dump client information is required.
+ * It is recommended that developers don't DUMP sensitive information.
+ * @param { Array } params - Indicates the params from command.
+ * @returns { Array } Return the dump info array.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @stagemodelonly
+ * @since 9
+ */
+ onDump(params: Array): Array;
+}
diff --git a/api/@ohos.app.ability.Want.d.ts b/api/@ohos.app.ability.Want.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..39f02017e5703848cbd06d7cd865bc758eea8d3e
--- /dev/null
+++ b/api/@ohos.app.ability.Want.d.ts
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * Want is the basic communication component of the system.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+export default class Want {
+ /**
+ * device id
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ deviceId?: string;
+
+ /**
+ * bundle name
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ bundleName?: string;
+
+ /**
+ * ability name
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ abilityName?: string;
+
+ /**
+ * The description of a URI in a Want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ uri?: string;
+
+ /**
+ * The description of the type in this Want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ type?: string;
+
+ /**
+ * The options of the flags in this Want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ flags?: number;
+
+ /**
+ * The description of an action in an want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ action?: string;
+
+ /**
+ * The description of the WantParams object in an Want
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ parameters?: {[key: string]: any};
+
+ /**
+ * The description of a entities in a Want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ entities?: Array;
+
+ /**
+ * The description of an module name in an want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ moduleName?: string;
+}
diff --git a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a3177d986c0fc589bbfc0769d8b6ec098d8c5206
--- /dev/null
+++ b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AbilityDelegator as _AbilityDelegator } from './application/abilityDelegator';
+import { AbilityDelegatorArgs as _AbilityDelegatorArgs } from './application/abilityDelegatorArgs';
+import { AbilityMonitor as _AbilityMonitor } from './application/abilityMonitor';
+import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult';
+
+/**
+ * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered
+ * during application startup.
+ * @namespace abilityDelegatorRegistry
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+declare namespace abilityDelegatorRegistry {
+ /**
+ * Get the AbilityDelegator object of the application.
+ * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getAbilityDelegator(): AbilityDelegator;
+
+ /**
+ * Get unit test arguments stored in the AbilityDelegatorArgs object.
+ * @returns { AbilityDelegator } Return the previously registered AbilityDelegatorArgs object.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getArguments(): AbilityDelegatorArgs;
+
+ /**
+ * Describes all lifecycle states of an ability.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export enum AbilityLifecycleState {
+ UNINITIALIZED,
+ CREATE,
+ FOREGROUND,
+ BACKGROUND,
+ DESTROY,
+ }
+
+ /**
+ * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type AbilityDelegator = _AbilityDelegator
+
+ /**
+ * Store unit testing-related parameters, including test case names, and test runner name.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type AbilityDelegatorArgs = _AbilityDelegatorArgs
+
+ /**
+ * Provide methods for matching monitored Ability objects that meet specified conditions.
+ * The most recently matched Ability objects will be saved in the AbilityMonitor object.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type AbilityMonitor = _AbilityMonitor
+
+ /**
+ * A object that records the result of shell command executes.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type ShellCmdResult = _ShellCmdResult
+}
+
+export default abilityDelegatorRegistry;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b7775354d941dea6afb4fe6692f84056445ab1b8
--- /dev/null
+++ b/api/@ohos.app.ability.abilityManager.d.ts
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AsyncCallback } from './basic';
+import { Configuration } from './@ohos.app.ability.Configuration';
+import { AbilityRunningInfo as _AbilityRunningInfo } from './application/AbilityRunningInfo';
+import { ExtensionRunningInfo as _ExtensionRunningInfo } from './application/ExtensionRunningInfo';
+import { ElementName } from './bundleManager/elementName';
+
+/**
+ * The class of an ability manager.
+ * @namespace abilityManager
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+declare namespace abilityManager {
+ /**
+ * Enum for the ability state
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export enum AbilityState {
+ INITIAL = 0,
+ FOREGROUND = 9,
+ BACKGROUND = 10,
+ FOREGROUNDING = 11,
+ BACKGROUNDING = 12
+ }
+
+ /**
+ * Updates the configuration by modifying the configuration.
+ * @permission ohos.permission.UPDATE_CONFIGURATION
+ * @param { Configuration } config - Indicates the new configuration.
+ * @param { AsyncCallback } callback - The callback of updateConfiguration.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function updateConfiguration(config: Configuration, callback: AsyncCallback): void;
+
+ /**
+ * Updates the configuration by modifying the configuration.
+ * @permission ohos.permission.UPDATE_CONFIGURATION
+ * @param { Configuration } config - Indicates the new configuration.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function updateConfiguration(config: Configuration): Promise;
+
+ /**
+ * Get information about running abilities
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @returns { Promise> } Returns the array of AbilityRunningInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getAbilityRunningInfos(): Promise>;
+
+ /**
+ * Get information about the running ability
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { AsyncCallback> } callback - The callback is used to return the array of AbilityRunningInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getAbilityRunningInfos(callback: AsyncCallback>): void;
+
+ /**
+ * Get information about running extensions
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { number } upperLimit - Get the maximum limit of the number of messages.
+ * @returns { Promise> } Returns the array of ExtensionRunningInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getExtensionRunningInfos(upperLimit: number): Promise>;
+
+ /**
+ * Get information about running extensions
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { number } upperLimit - Get the maximum limit of the number of messages.
+ * @param { AsyncCallback> } callback - The callback is used to return the array of ExtensionRunningInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void;
+
+ /**
+ * Get the top ability information of the display.
+ * @returns { Promise } Returns the elementName info of the top ability.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getTopAbility(): Promise;
+
+ /**
+ * Get the top ability information of the display.
+ * @param { AsyncCallback } callback - The callback is used to return the elementName info of the top ability.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getTopAbility(callback: AsyncCallback): void;
+
+ /**
+ * The class of an ability running information.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type AbilityRunningInfo = _AbilityRunningInfo
+
+ /**
+ * The class of an extension running information.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type ExtensionRunningInfo = _ExtensionRunningInfo
+}
+
+export default abilityManager;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.appManager.d.ts b/api/@ohos.app.ability.appManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ebc1872c806476003af7a702ab638aa3c065cb1a
--- /dev/null
+++ b/api/@ohos.app.ability.appManager.d.ts
@@ -0,0 +1,325 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AsyncCallback } from './basic';
+import * as _ApplicationStateObserver from './application/ApplicationStateObserver';
+import * as _AbilityStateData from './application/AbilityStateData';
+import * as _AppStateData from './application/AppStateData';
+import { ProcessRunningInfo as _ProcessRunningInfo } from './application/ProcessRunningInfo';
+import { ProcessRunningInformation as _ProcessRunningInformation } from './application/ProcessRunningInformation';
+
+/**
+ * This module provides the function of app manager service.
+ * @namespace appManager
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ *
+ */
+declare namespace appManager {
+ /**
+ * Enum for the application state
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export enum ApplicationState {
+ STATE_CREATE,
+ STATE_FOREGROUND,
+ STATE_ACTIVE,
+ STATE_BACKGROUND,
+ STATE_DESTROY
+ }
+
+ /**
+ * Enum for the process state
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export enum ProcessState {
+ STATE_CREATE,
+ STATE_FOREGROUND,
+ STATE_ACTIVE,
+ STATE_BACKGROUND,
+ STATE_DESTROY
+ }
+
+ /**
+ * Register application state observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
+ * @param { string } type - applicationState.
+ * @param { ApplicationStateObserver } observer - The application state observer.
+ * @return { number } Returns the number code of the observer.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function on(type: "applicationState", observer: ApplicationStateObserver): number;
+
+ /**
+ * Register application state observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
+ * @param { string } type - applicationState.
+ * @param { ApplicationStateObserver } observer - The application state observer.
+ * @param { Array } bundleNameList - The list of bundleName. The max length is 128.
+ * @return { number } Returns the number code of the observer.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array): number;
+
+ /**
+ * Unregister application state observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
+ * @param { string } type - applicationState.
+ * @param { number } observerId - Indicates the number code of the observer.
+ * @param { AsyncCallback } callback - The callback of off.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function off(type: "applicationState", observerId: number, callback: AsyncCallback): void;
+
+ /**
+ * Unregister application state observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
+ * @param { string } type - applicationState.
+ * @param { number } observerId - Indicates the number code of the observer.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function off(type: "applicationState", observerId: number): Promise;
+
+ /**
+ * getForegroundApplications.
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { AsyncCallback> } callback - The callback is used to return the list of AppStateData.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getForegroundApplications(callback: AsyncCallback>): void;
+
+ /**
+ * getForegroundApplications.
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @returns { Promise> } Returns the list of AppStateData.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getForegroundApplications(): Promise>;
+
+ /**
+ * Kill process with account.
+ * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES
+ * @param { string } bundleName - The process bundle name.
+ * @param { number } accountId - The account id.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function killProcessWithAccount(bundleName: string, accountId: number): Promise;
+
+ /**
+ * Kill process with account.
+ * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES
+ * @param { string } bundleName - The process bundle name.
+ * @param { number } accountId - The account id.
+ * @param { AsyncCallback } callback - The callback of killProcessWithAccount.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void;
+
+ /**
+ * Is user running in stability test.
+ * @param { AsyncCallback } callback - The callback is used to return true if user is running stability test.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function isRunningInStabilityTest(callback: AsyncCallback): void;
+
+ /**
+ * Is user running in stability test.
+ * @returns { Promise } Returns true if user is running stability test.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function isRunningInStabilityTest(): Promise;
+
+ /**
+ * Kill processes by bundle name
+ * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES
+ * @param { string } bundleName - bundle name.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function killProcessesByBundleName(bundleName: string): Promise;
+
+ /**
+ * Kill processes by bundle name
+ * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES
+ * @param { string } bundleName - bundle name.
+ * @param { AsyncCallback } callback - The callback of killProcessesByBundleName.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function killProcessesByBundleName(bundleName: string, callback: AsyncCallback);
+
+ /**
+ * Clear up application data by bundle name
+ * @permission ohos.permission.CLEAN_APPLICATION_DATA
+ * @param { string } bundleName - bundle name.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function clearUpApplicationData(bundleName: string): Promise;
+
+ /**
+ * Clear up application data by bundle name
+ * @permission ohos.permission.CLEAN_APPLICATION_DATA
+ * @param { string } bundleName - bundle name.
+ * @param { AsyncCallback } callback - The callback of clearUpApplicationData.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function clearUpApplicationData(bundleName: string, callback: AsyncCallback);
+
+ /**
+ * Is it a ram-constrained device
+ * @returns { Promise } Returns true if the device is ram-constrained.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function isRamConstrainedDevice(): Promise;
+
+ /**
+ * Is it a ram-constrained device
+ * @param { AsyncCallback } callback - The callback is used to return true if the device is ram-constrained.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function isRamConstrainedDevice(callback: AsyncCallback): void;
+
+ /**
+ * Get the memory size of the application
+ * @returns { Promise } Returns the application memory size.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getAppMemorySize(): Promise;
+
+ /**
+ * Get the memory size of the application
+ * @param { AsyncCallback } callback - The callback is used to return the application memory size.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getAppMemorySize(callback: AsyncCallback): void;
+
+ /**
+ * Get information about running processes
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @returns { Promise> } Returns the array of {@link ProcessRunningInformation}.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getProcessRunningInformation(): Promise>;
+
+ /**
+ * Get information about running processes
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { AsyncCallback> } callback - The callback is used to return the array of {@link ProcessRunningInformation}.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getProcessRunningInformation(callback: AsyncCallback>): void;
+
+ /**
+ * The ability or extension state data.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type AbilityStateData = _AbilityStateData.default
+
+ /**
+ * The application state data.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type AppStateData = _AppStateData.default
+
+ /**
+ * The application state observer.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type ApplicationStateObserver = _ApplicationStateObserver.default
+
+ /**
+ * The class of an process running information.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type ProcessRunningInfo = _ProcessRunningInfo
+
+ /**
+ * The class of a process running information.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type ProcessRunningInformation = _ProcessRunningInformation
+}
+
+export default appManager;
diff --git a/api/@ohos.app.ability.appRecovery.d.ts b/api/@ohos.app.ability.appRecovery.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a9c1cad363145933e7b7fe486906ea252737a17c
--- /dev/null
+++ b/api/@ohos.app.ability.appRecovery.d.ts
@@ -0,0 +1,121 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * This module provides the capability to app receovery.
+ * @import appReceovery from '@ohos.app.ability.appRecovery'
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+declare namespace appReceovery {
+ /**
+ * The type of no restart mode.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ enum RestartFlag {
+ /**
+ * NONE: no restart restrictions
+ */
+ ALWAYS_RESTART = 0,
+
+ /**
+ * CPP_CRASH_NO_RESTART: Do not restart if process terminates due to cpp exception
+ */
+ CPP_CRASH_NO_RESTART = 0x0001,
+
+ /**
+ * JS_CRASH_NO_RESTART: Do not restart if process terminates due to js/ts/ets exception
+ */
+ JS_CRASH_NO_RESTART = 0x0002,
+
+ /**
+ * APP_FREEZE_NO_RESTART: Do not restart if process terminates due to appliction not respondong
+ */
+ APP_FREEZE_NO_RESTART = 0x0004,
+
+ /**
+ * NO_RESTART: Do not restart
+ */
+ NO_RESTART = 0xFFFF,
+ }
+
+ /**
+ * The type of when to save.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ enum SaveOccasionFlag {
+ /**
+ * SAVE_WHEN_ERROR is saving when an error occurs.
+ */
+ SAVE_WHEN_ERROR = 0x0001,
+
+ /**
+ * SAVE_WHEN_CREATE is saving on background.
+ */
+ SAVE_WHEN_BACKGROUND = 0x0002,
+ }
+
+ /**
+ * The type of where to save.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ enum SaveModeFlag {
+ /**
+ * SAVE_WITH_FILE is saving to file.
+ */
+ SAVE_WITH_FILE = 0x0001,
+
+ /**
+ * SAVE_WITH_SHARED_MEMORY is saving to shared memory.
+ */
+ SAVE_WITH_SHARED_MEMORY = 0x0002,
+ }
+
+ /**
+ * Enable appRecovery and app supports save and restore
+ * @param restart no restart mode
+ * @param saveOccasion The type of When to save
+ * @param saveMode The type of where to save
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ function enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMode?: SaveModeFlag) : void;
+
+ /**
+ * Restart App when called
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ function restartApp(): void;
+
+ /**
+ * Save App state data when called
+ * @return true if save data successfully, otherwise false
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ function saveAppState(): boolean;
+}
+
+export default appReceovery;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts
new file mode 100755
index 0000000000000000000000000000000000000000..cd0a1046cbfb1237c4824ace68739dd011e38119
--- /dev/null
+++ b/api/@ohos.app.ability.common.d.ts
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import * as _UIAbilityContext from './application/UIAbilityContext';
+import * as _AbilityStageContext from './application/AbilityStageContext';
+import * as _ApplicationContext from './application/ApplicationContext';
+import * as _BaseContext from './application/BaseContext';
+import * as _Context from './application/Context';
+import * as _ExtensionContext from './application/ExtensionContext';
+import * as _FormExtensionContext from './application/FormExtensionContext';
+import * as _EventHub from './application/EventHub';
+import * as _PermissionRequestResult from './application/PermissionRequestResult';
+import { PacMap as _PacMap } from "./ability/dataAbilityHelper";
+import { AbilityResult as _AbilityResult } from "./ability/abilityResult";
+import { ConnectOptions as _ConnectOptions } from "./ability/connectOptions";
+
+/**
+ * The context of an application. It allows access to application-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+declare namespace common {
+
+ /**
+ * The context of an ability. It allows access to ability-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type UIAbilityContext = _UIAbilityContext.default
+
+ /**
+ * The context of an abilityStage. It allows access to abilityStage-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type AbilityStageContext = _AbilityStageContext.default
+
+ /**
+ * The context of an application. It allows access to application-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type ApplicationContext = _ApplicationContext.default
+
+ /**
+ * The base context of 'app.Context' for FA Mode or 'application.Context' for Stage Mode.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type BaseContext = _BaseContext.default
+
+ /**
+ * The base context of an ability or an application. It allows access to
+ * application-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type Context = _Context.default
+
+ /**
+ * The context of an extension. It allows access to extension-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type ExtensionContext = _ExtensionContext.default
+
+ /**
+ * The context of form extension. It allows access to
+ * formExtension-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type FormExtensionContext = _FormExtensionContext.default
+
+ /**
+ * File area mode
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export enum AreaMode {
+ /**
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ EL1 = 0,
+ /**
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ EL2 = 1
+ }
+
+ /**
+ * The event center of a context, support the subscription and publication of events.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type EventHub = _EventHub.default
+
+ /**
+ * The result of requestPermissionsFromUser with asynchronous callback.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type PermissionRequestResult = _PermissionRequestResult.default
+
+ /**
+ * Defines a PacMap object for storing a series of values.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type PacMap = _PacMap
+
+ /**
+ * Indicates the result of startAbility.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type AbilityResult = _AbilityResult
+
+ /**
+ * Indicates the callback of connection
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @stagemodelonly
+ * @since 9
+ */
+ export type ConnectOptions = _ConnectOptions
+}
+
+export default common;
diff --git a/api/@ohos.uiAppearance.d.ts b/api/@ohos.app.ability.contextConstant.d.ts
similarity index 40%
rename from api/@ohos.uiAppearance.d.ts
rename to api/@ohos.app.ability.contextConstant.d.ts
index 5a65a569d5106e0c737b7aa6d57bfb22f4bfea58..fef30c258137c93aa886274469405968c2b1e884 100644
--- a/api/@ohos.uiAppearance.d.ts
+++ b/api/@ohos.app.ability.contextConstant.d.ts
@@ -13,45 +13,35 @@
* limitations under the License.
*/
-import { AsyncCallback, Callback } from './basic';
-
/**
- * Provide APIs to set system uiAppearance.
- * @syscap SystemCapability.ArkUI.UiAppearance
- * @import import uiAppearance from '@ohos.uiAppearance';
+ * The context of an application. It allows access to application-specific resources.
+ *
* @since 9
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
*/
-declare namespace uiAppearance {
+ declare namespace contextConstant {
+
/**
- * Enumerates dark-mode.
+ * File area mode
+ *
+ * @since 9
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
*/
- enum DarkMode {
+ export enum AreaMode {
/**
- * Always display with dark mode.
+ * System level device encryption area
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
*/
- ALWAYS_DARK = 0,
+ EL1 = 0,
/**
- * Always display with light mode.
+ * User credential encryption area
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
*/
- ALWAYS_LIGHT = 1
+ EL2 = 1
}
-
- /**
- * Set the system dark-mode.
- * @param mode Indicates the dark-mode to set
- * @permission ohos.permission.UPDATE_CONFIGURATION
- * @systemapi Hide this for inner system use
- */
- function setDarkMode(mode: DarkMode, callback: AsyncCallback): void;
- function setDarkMode(mode: DarkMode): Promise;
-
- /**
- * Acquire the current dark-mode.
- * @return current dark-mode.
- * @permission ohos.permission.UPDATE_CONFIGURATION
- * @systemapi Hide this for inner system use
- */
- function getDarkMode(): DarkMode;
}
-export default uiAppearance;
\ No newline at end of file
+
+export default contextConstant;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.errorManager.d.ts b/api/@ohos.app.ability.errorManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..10573f876d2656e024b895b74ab3b8210e0b2bad
--- /dev/null
+++ b/api/@ohos.app.ability.errorManager.d.ts
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AsyncCallback } from './basic';
+import * as _ErrorObserver from './application/ErrorObserver';
+
+/**
+ * This module provides the function of error manager.
+ * @namespace errorManager
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+declare namespace errorManager {
+ /**
+ * Register error observer.
+ * @param { string } type - error.
+ * @param { ErrorObserver } observer - The error observer.
+ * @returns { number } Returns the number code of the observer.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function on(type: "error", observer: ErrorObserver): number;
+
+ /**
+ * Unregister error observer.
+ * @param { string } type - error.
+ * @param { number } observerId - Indicates the number code of the observer.
+ * @param { AsyncCallback } callback - The callback of off.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function off(type: "error", observerId: number, callback: AsyncCallback): void;
+
+ /**
+ * Unregister error observer.
+ * @param { string } type - error.
+ * @param { number } observerId - Indicates the number code of the observer.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function off(type: "error", observerId: number): Promise;
+
+ /**
+ * The observer will be called by system when an error occurs.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type ErrorObserver = _ErrorObserver.default
+}
+
+export default errorManager;
diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..efbed8686fd8d8b3373662f62c44f30e296334ac
--- /dev/null
+++ b/api/@ohos.app.ability.missionManager.d.ts
@@ -0,0 +1,287 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AsyncCallback } from './basic';
+import { MissionInfo as _MissionInfo } from './application/MissionInfo';
+import { MissionListener as _MissionListener } from './application/MissionListener';
+import { MissionSnapshot as _MissionSnapshot } from './application/MissionSnapshot';
+import StartOptions from "./@ohos.app.ability.StartOptions";
+
+/**
+ * This module provides the capability to manage abilities and obtaining system task information.
+ * @permission ohos.permission.MANAGE_MISSIONS
+ * @namespace missionManager
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @systemapi
+ * @since 9
+ */
+declare namespace missionManager {
+ /**
+ * Register the missionListener to ams.
+ * @param { string } type - mission.
+ * @param { MissionListener } listener - Indicates the MissionListener to be registered.
+ * @returns { number } Returns the index number of the MissionListener.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function on(type: "mission", listener: MissionListener): number;
+
+ /**
+ * Unrgister the missionListener to ams.
+ * @param { string } type - mission.
+ * @param { number } listenerId - Indicates the listener id to be unregistered.
+ * @param { AsyncCallback } callback - The callback of off.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function off(type: "mission", listenerId: number, callback: AsyncCallback): void;
+
+ /**
+ * Unrgister the missionListener to ams.
+ * @param { string } type - mission.
+ * @param { number } listenerId - Indicates the listener id to be unregistered.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function off(type: "mission", listenerId: number): Promise;
+
+ /**
+ * Get the missionInfo with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @param { AsyncCallback } callback - The callback is used to return the MissionInfo of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Get the missionInfo with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @returns { Promise } Returns the MissionInfo of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionInfo(deviceId: string, missionId: number): Promise;
+
+ /**
+ * Get the missionInfo with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } numMax - Indicates the maximum number of returned missions.
+ * @param { AsyncCallback> } callback - The callback is used to return the array of the MissionInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void;
+
+ /**
+ * Get the missionInfo with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } numMax - Indicates the maximum number of returned missions.
+ * @returns { Promise> } Returns the array of the MissionInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionInfos(deviceId: string, numMax: number): Promise>;
+
+ /**
+ * Get the mission snapshot with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @param { AsyncCallback } callback - The callback is used to return the MissionSnapshot of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Get the mission snapshot with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @returns { Promise } Returns the MissionSnapshot of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionSnapShot(deviceId: string, missionId: number): Promise;
+
+ /**
+ * Get the mission low resolution snapshot with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @param { AsyncCallback } callback - The callback is used to return the MissionSnapshot of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Get the mission low resolution snapshot with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @returns { Promise } Returns the MissionSnapshot of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise;
+
+ /**
+ * Lock the mission.
+ * @param { number } missionId - Indicates mission id to be locked.
+ * @param { AsyncCallback } callback - The callback of lockMission.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function lockMission(missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Lock the mission.
+ * @param { number } missionId - Indicates mission id to be locked.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function lockMission(missionId: number): Promise;
+
+ /**
+ * Unlock the mission.
+ * @param { number } missionId - Indicates mission id to be unlocked.
+ * @param { AsyncCallback } callback - The callback of unlockMission.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function unlockMission(missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Unlock the mission.
+ * @param { number } missionId - Indicates mission id to be unlocked.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function unlockMission(missionId: number): Promise;
+
+ /**
+ * Clear the given mission in the ability manager service.
+ * @param { number } missionId - Indicates mission id to be cleared.
+ * @param { AsyncCallback } callback - The callback of clearMission.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function clearMission(missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Clear the given mission in the ability manager service.
+ * @param { number } missionId - Indicates mission id to be cleared.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function clearMission(missionId: number): Promise;
+
+ /**
+ * Clear all missions in the ability manager service.
+ * @param { AsyncCallback } callback - The callback of clearAllMissions.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function clearAllMissions(callback: AsyncCallback): void;
+
+ /**
+ * Clear all missions in the ability manager service.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function clearAllMissions(): Promise;
+
+ /**
+ * Schedule the given mission to foreground.
+ * @param { number } missionId - Indicates mission id to be moved to foreground.
+ * @param { AsyncCallback } callback - The callback of moveMissionToFront.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function moveMissionToFront(missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Schedule the given mission to foreground.
+ * @param { number } missionId - Indicates mission id to be moved to foreground.
+ * @param { StartOptions } options - Indicates the start options.
+ * @param { AsyncCallback } callback - The callback of moveMissionToFront.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback): void;
+
+ /**
+ * Schedule the given mission to foreground.
+ * @param { number } missionId - Indicates mission id to be moved to foreground.
+ * @param { StartOptions } options - Indicates the start options.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function moveMissionToFront(missionId: number, options?: StartOptions): Promise;
+
+ /**
+ * Mission information corresponding to ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @systemapi
+ * @since 9
+ */
+ export type MissionInfo = _MissionInfo
+
+ /**
+ * MissionListener registered by app.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @systemapi
+ * @since 9
+ */
+ export type MissionListener = _MissionListener
+
+ /**
+ * Mission snapshot corresponding to mission.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @systemapi
+ * @since 9
+ */
+ export type MissionSnapshot = _MissionSnapshot
+}
+
+export default missionManager;
\ No newline at end of file
diff --git a/api/@ohos.application.quickFixManager.d.ts b/api/@ohos.app.ability.quickFixManager.d.ts
similarity index 58%
rename from api/@ohos.application.quickFixManager.d.ts
rename to api/@ohos.app.ability.quickFixManager.d.ts
index d30e16fe0359d8994441e76fc13321cff46eaf58..89cf51bc871e11911812bfe0513f681c01cf14f4 100644
--- a/api/@ohos.application.quickFixManager.d.ts
+++ b/api/@ohos.app.ability.quickFixManager.d.ts
@@ -17,137 +17,160 @@ import { AsyncCallback } from "./basic";
/**
* Interface of quickFixManager.
- *
- * @name quickFixManager
- * @since 9
+ * @namespace quickFixManager
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
declare namespace quickFixManager {
/**
* Quick fix info of hap module.
- *
- * @since 9
+ * @typedef HapModuleQuickFixInfo
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
export interface HapModuleQuickFixInfo {
/**
* Indicates hap module name.
- *
- * @since 9
+ * @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly moduleName: string;
/**
* Indicates hash value of a hap.
- *
- * @since 9
+ * @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly originHapHash: string;
/**
* Indicates installed path of quick fix file.
- *
- * @since 9
+ * @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly quickFixFilePath: string;
}
/**
* Quick fix info of application.
- *
- * @since 9
+ * @typedef ApplicationQuickFixInfo
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
export interface ApplicationQuickFixInfo {
/**
* Bundle name.
- *
- * @since 9
+ * @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly bundleName: string;
/**
* The version number of the bundle.
- *
- * @since 9
+ * @type { number }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly bundleVersionCode: number;
/**
* The version name of the bundle.
- *
- * @since 9
+ * @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly bundleVersionName: string;
/**
* The version number of the quick fix.
- *
- * @since 9
+ * @type { number }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly quickFixVersionCode: number;
/**
* The version name of the quick fix.
- *
- * @since 9
+ * @type { string }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly quickFixVersionName: string;
/**
* Hap module quick fix info.
- *
- * @since 9
+ * @type { Array }
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @systemapi Hide this for inner system use.
+ * @systemapi
+ * @since 9
*/
readonly hapModuleQuickFixInfo: Array;
}
/**
* Apply quick fix files.
- *
- * @since 9
- * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @param hapModuleQuickFixFiles Quick fix files need to apply, this value should include file path and file name.
- * @systemapi Hide this for inner system use.
- * @return -
* @permission ohos.permission.INSTALL_BUNDLE
+ * @param { Array } hapModuleQuickFixFiles - Quick fix files need to apply, this value should include file
+ * path and file name.
+ * @param { AsyncCallback } callback - The callback of applyQuickFix.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
+ * @systemapi
+ * @since 9
*/
function applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void;
+
+ /**
+ * Apply quick fix files.
+ * @permission ohos.permission.INSTALL_BUNDLE
+ * @param { Array } hapModuleQuickFixFiles - Quick fix files need to apply, this value should include file
+ * path and file name.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
+ * @systemapi
+ * @since 9
+ */
function applyQuickFix(hapModuleQuickFixFiles: Array): Promise;
/**
* Get application quick fix info by bundle name.
- *
- * @since 9
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
+ * @param { string } bundleName - Bundle name wish to query.
+ * @param { AsyncCallback } callback - The callback is used to return the ApplicationQuickFixInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
- * @param bundleName Bundle name wish to query.
- * @systemapi Hide this for inner system use.
- * @return Returns the {@link ApplicationQuickFixInfo}.
+ * @systemapi
+ * @since 9
+ */
+ function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void;
+
+ /**
+ * Get application quick fix info by bundle name.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
+ * @param { string } bundleName - Bundle name wish to query.
+ * @returns { Promise } Returns the ApplicationQuickFixInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.QuickFix
+ * @systemapi
+ * @since 9
*/
- function getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void;
- function getApplicationQuickFixInfo(bundleName: string): Promise;
+ function getApplicationQuickFixInfo(bundleName: string): Promise;
}
export default quickFixManager;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.wantAgent.d.ts b/api/@ohos.app.ability.wantAgent.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ace81f0b4464298d5876d152a614b66e5bda32da
--- /dev/null
+++ b/api/@ohos.app.ability.wantAgent.d.ts
@@ -0,0 +1,350 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AsyncCallback , Callback} from './basic';
+import Want from './@ohos.app.ability.Want';
+import { WantAgentInfo as _WantAgentInfo } from './wantAgent/wantAgentInfo';
+import { TriggerInfo as _TriggerInfo } from './wantAgent/triggerInfo';
+
+/**
+ * Provide the method obtain trigger, cancel, and compare and to obtain
+ * the bundle name, UID of an {@link WantAgent} object.
+ * @namespace wantAgent
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+declare namespace wantAgent {
+ /**
+ * Obtains the bundle name of a WantAgent.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { AsyncCallback } callback - The callback is used to return the bundle name.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getBundleName(agent: WantAgent, callback: AsyncCallback): void;
+
+ /**
+ * Obtains the bundle name of a WantAgent.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @returns { Promise } Returns the bundle name.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getBundleName(agent: WantAgent): Promise;
+
+ /**
+ * Obtains the UID of a WantAgent.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { AsyncCallback } callback - The callback is used to return the UID.
+ * @returns { Promise } Returns the UID.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getUid(agent: WantAgent, callback: AsyncCallback): void;
+ function getUid(agent: WantAgent): Promise;
+
+ /**
+ * Obtains the {@link Want} of an {@link WantAgent}.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { AsyncCallback } callback - The callback is used to return the Want.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getWant(agent: WantAgent, callback: AsyncCallback): void;
+
+ /**
+ * Obtains the {@link Want} of an {@link WantAgent}.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @returns { Promise } Returns the Want.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getWant(agent: WantAgent): Promise;
+
+ /**
+ * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { AsyncCallback } callback - The callback of cancel.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function cancel(agent: WantAgent, callback: AsyncCallback): void;
+
+ /**
+ * Cancels a WantAgent. Only the application that creates the WantAgent can cancel it.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function cancel(agent: WantAgent): Promise;
+
+ /**
+ * Triggers a WantAgent.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { TriggerInfo } triggerInfo - Indicates the information required for triggering a WantAgent.
+ * @param { Callback } callback - The callback is used to return the CompleteData.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback): void;
+
+ /**
+ * Triggers a WantAgent.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { TriggerInfo } triggerInfo - Indicates the information required for triggering a WantAgent.
+ * @param { AsyncCallback } callback - The callback is used to return the CompleteData.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback): void;
+
+ /**
+ * Checks whether two WantAgent objects are equal.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { WantAgent } otherAgent - Indicates the other WantAgent.
+ * @param { AsyncCallback } callback - Returns true if the two WantAgents are the same.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function equal(agent: WantAgent, otherAgent: WantAgent, callback: AsyncCallback): void;
+
+ /**
+ * Checks whether two WantAgent objects are equal.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { WantAgent } otherAgent - Indicates the other WantAgent.
+ * @returns { Promise } Returns true if the two WantAgents are the same.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function equal(agent: WantAgent, otherAgent: WantAgent): Promise;
+
+ /**
+ * Obtains a WantAgent object.
+ * @param { WantAgentInfo } info - Information about the WantAgent object to obtain.
+ * @param { AsyncCallback } callback - The callback is used to return the created WantAgent.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getWantAgent(info: WantAgentInfo, callback: AsyncCallback): void;
+
+ /**
+ * Obtains a WantAgent object.
+ * @param { WantAgentInfo } info - Information about the WantAgent object to obtain.
+ * @returns { Promise } Returns the created WantAgent.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getWantAgent(info: WantAgentInfo): Promise;
+
+ /**
+ * Obtains the {@link OperationType} of a {@link WantAgent}.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @param { AsyncCallback } callback - The callback is used to return the OperationType of the WantAgent.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getOperationType(agent: WantAgent, callback: AsyncCallback): void;
+
+ /**
+ * Obtains the {@link OperationType} of a {@link WantAgent}.
+ * @param { WantAgent } agent - Indicates the WantAgent.
+ * @returns { Promise } Returns the OperationType of the WantAgent.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getOperationType(agent: WantAgent): Promise;
+
+ /**
+ * Enumerates flags for using a WantAgent.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export enum WantAgentFlags {
+ /**
+ * Indicates that the WantAgent can be used only once.
+ * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
+ */
+ ONE_TIME_FLAG = 0,
+
+ /**
+ * Indicates that null is returned if the WantAgent does not exist.
+ * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
+ */
+ NO_BUILD_FLAG,
+
+ /**
+ * Indicates that the existing WantAgent should be canceled before a new object is generated.
+ * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
+ */
+ CANCEL_PRESENT_FLAG,
+
+ /**
+ * Indicates that the system only replaces the extra data of the existing WantAgent with that of the new object.
+ * This flag is valid only when OperationType is set to START_ABILITY, START_SERVICE, or SEND_COMMON_EVENT.
+ */
+ UPDATE_PRESENT_FLAG,
+
+ /**
+ * Indicates that the created WantAgent should be immutable.
+ */
+ CONSTANT_FLAG,
+
+ /**
+ * Indicates that the current value of element can be replaced when the WantAgent is triggered.
+ */
+ REPLACE_ELEMENT,
+
+ /**
+ * Indicates that the current value of action can be replaced when the WantAgent is triggered.
+ */
+ REPLACE_ACTION,
+
+ /**
+ * Indicates that the current value of uri can be replaced when the WantAgent is triggered.
+ */
+ REPLACE_URI,
+
+ /**
+ * Indicates that the current value of entities can be replaced when the WantAgent is triggered.
+ */
+ REPLACE_ENTITIES,
+
+ /**
+ * Indicates that the current value of packageName can be replaced when the WantAgent is triggered.
+ */
+ REPLACE_BUNDLE
+ }
+
+ /**
+ * Identifies the operation for using a WantAgent, such as starting an ability or sending a common event.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export enum OperationType {
+ /**
+ * Unknown operation.
+ */
+ UNKNOWN_TYPE = 0,
+
+ /**
+ * Starts an ability with a UI.
+ */
+ START_ABILITY,
+
+ /**
+ * Starts multiple abilities with a UI.
+ */
+ START_ABILITIES,
+
+ /**
+ * Starts an ability without a UI.
+ */
+ START_SERVICE,
+
+ /**
+ * Sends a common event.
+ */
+ SEND_COMMON_EVENT
+ }
+
+ /**
+ * Describes the data returned by after wantAgent.trigger is called.
+ * @typedef CompleteData
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export interface CompleteData {
+ /**
+ * Triggered WantAgent.
+ * @type { WantAgent }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ info: WantAgent;
+
+ /**
+ * Existing Want that is triggered.
+ * @type { Want }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ want: Want;
+
+ /**
+ * Request code used to trigger the WantAgent.
+ * @type { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ finalCode: number;
+
+ /**
+ * Final data collected by the common event.
+ * @type { string }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ finalData: string;
+
+ /**
+ * Extra data collected by the common event.
+ * @type { { [key: string]: any } }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ extraInfo?: { [key: string]: any };
+ }
+
+ /**
+ * Provides the information required for triggering a WantAgent.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type TriggerInfo = _TriggerInfo
+
+ /**
+ * Provides the information required for triggering a WantAgent.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type WantAgentInfo = _WantAgentInfo
+}
+
+/**
+ * WantAgent object.
+ */
+export type WantAgent = object;
+
+export default wantAgent;
diff --git a/api/@ohos.app.ability.wantConstant.d.ts b/api/@ohos.app.ability.wantConstant.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..05e563cd9f72d0d1db14468f5ddcf6fe2ea0eaa5
--- /dev/null
+++ b/api/@ohos.app.ability.wantConstant.d.ts
@@ -0,0 +1,439 @@
+/*
+ * Copyright (c) 2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * the constant for action and entity in the want
+ * @namespace wantConstant
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+declare namespace wantConstant {
+ /**
+ * the constant for action of the want
+ * @enum { string }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ export enum Action {
+ /**
+ * Indicates the action of backing home.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_HOME = "ohos.want.action.home",
+
+ /**
+ * Indicates the action of starting a Page ability that displays a keypad.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_DIAL = "ohos.want.action.dial",
+
+ /**
+ * Indicates the action of starting a Page ability for search.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SEARCH = "ohos.want.action.search",
+
+ /**
+ * Indicates the action of starting a Page ability that provides wireless network settings, for example,
+ * Wi-Fi options.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_WIRELESS_SETTINGS = "ohos.settings.wireless",
+
+ /**
+ * Indicates the action of starting a Page ability that manages installed applications.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_MANAGE_APPLICATIONS_SETTINGS = "ohos.settings.manage.applications",
+
+ /**
+ * Indicates the action of starting a Page ability that displays details of a specified application.
+ *
+ * You must specify the application bundle name in the {@code package} attribute of the {@code Intent}
+ * containing this action.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_APPLICATION_DETAILS_SETTINGS = "ohos.settings.application.details",
+
+ /**
+ * Indicates the action of starting a Page ability for setting an alarm clock.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SET_ALARM = "ohos.want.action.setAlarm",
+
+ /**
+ * Indicates the action of starting a Page ability that displays all alarm
+ * clocks.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SHOW_ALARMS = "ohos.want.action.showAlarms",
+
+ /**
+ * Indicates the action of starting a Page ability for snoozing an alarm clock.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SNOOZE_ALARM = "ohos.want.action.snoozeAlarm",
+
+ /**
+ * Indicates the action of starting a Page ability for deleting an alarm clock.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_DISMISS_ALARM = "ohos.want.action.dismissAlarm",
+
+ /**
+ * Indicates the action of starting a Page ability for dismissing a timer.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_DISMISS_TIMER = "ohos.want.action.dismissTimer",
+
+ /**
+ * Indicates the action of starting a Page ability for sending a sms.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SEND_SMS = "ohos.want.action.sendSms",
+
+ /**
+ * Indicates the action of starting a Page ability for opening contacts or pictures.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_CHOOSE = "ohos.want.action.choose",
+
+ /**
+ * Indicates the action of starting a Page ability for take a picture.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_IMAGE_CAPTURE = "ohos.want.action.imageCapture",
+
+ /**
+ * Indicates the action of starting a Page ability for Take a video.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_VIDEO_CAPTURE = "ohos.want.action.videoCapture",
+
+ /**
+ * Indicates the action of showing the application selection dialog box.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SELECT = "ohos.want.action.select",
+
+ /**
+ * Indicates the action of sending a single data record.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SEND_DATA = "ohos.want.action.sendData",
+
+ /**
+ * Indicates the action of sending multiple data records.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SEND_MULTIPLE_DATA = "ohos.want.action.sendMultipleData",
+
+ /**
+ * Indicates the action of requesting the media scanner to scan files and adding the files to the media library.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_SCAN_MEDIA_FILE = "ohos.want.action.scanMediaFile",
+
+ /**
+ * Indicates the action of viewing data.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_VIEW_DATA = "ohos.want.action.viewData",
+
+ /**
+ * Indicates the action of editing data.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_EDIT_DATA = "ohos.want.action.editData",
+
+ /**
+ * Indicates the choices you will show with {@link #ACTION_PICKER}.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ INTENT_PARAMS_INTENT = "ability.want.params.INTENT",
+
+ /**
+ * Indicates the CharSequence dialog title when used with a {@link #ACTION_PICKER}.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ INTENT_PARAMS_TITLE = "ability.want.params.TITLE",
+
+ /**
+ * Indicates the action of select file.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_FILE_SELECT = "ohos.action.fileSelect",
+
+ /**
+ * Indicates the URI holding a stream of data associated with the Intent when used with a {@link #ACTION_SEND_DATA}.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ PARAMS_STREAM = "ability.params.stream",
+
+ /**
+ * Indicates the action of providing auth service.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth",
+
+ /**
+ * Indicates the action of an application downloaded from the application market.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ ACTION_MARKET_DOWNLOAD = "ohos.want.action.marketDownload",
+
+ /**
+ * Indicates the action of an application crowdtested from the application market.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ ACTION_MARKET_CROWDTEST = "ohos.want.action.marketCrowdTest",
+
+ /**
+ * Indicates the param of sandbox flag.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ DLP_PARAMS_SANDBOX = "ohos.dlp.params.sandbox",
+
+ /**
+ * Indicates the param of dlp bundle name.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ DLP_PARAMS_BUNDLE_NAME = "ohos.dlp.params.bundleName",
+
+ /**
+ * Indicates the param of dlp module name.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ DLP_PARAMS_MODULE_NAME = "ohos.dlp.params.moduleName",
+
+ /**
+ * Indicates the param of dlp ability name.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ DLP_PARAMS_ABILITY_NAME = "ohos.dlp.params.abilityName",
+
+ /**
+ * Indicates the param of dlp bundle index.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ DLP_PARAMS_INDEX = "ohos.dlp.params.index"
+ }
+
+ /**
+ * the constant for Entity of the want
+ * @enum { string }
+ * @name Entity
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ export enum Entity {
+ /**
+ * Indicates the default entity, which is used if the entity is not specified.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ENTITY_DEFAULT = "entity.system.default",
+
+ /**
+ * Indicates the home screen entity.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ENTITY_HOME = "entity.system.home",
+
+ /**
+ * Indicates the voice interaction entity.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ENTITY_VOICE = "entity.system.voice",
+
+ /**
+ * Indicates the browser category.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ENTITY_BROWSABLE = "entity.system.browsable",
+
+ /**
+ * Indicates the video category.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ ENTITY_VIDEO = "entity.system.video"
+ }
+
+ export enum Flags {
+ /**
+ * Indicates the grant to perform read operations on the URI.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_AUTH_READ_URI_PERMISSION = 0x00000001,
+
+ /**
+ * Indicates the grant to perform write operations on the URI.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002,
+
+ /**
+ * Returns the result to the source ability.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_ABILITY_FORWARD_RESULT = 0x00000004,
+
+ /**
+ * Determines whether an ability on the local device can be migrated to a remote device.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_ABILITY_CONTINUATION = 0x00000008,
+
+ /**
+ * Specifies whether a component does not belong to OHOS.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_NOT_OHOS_COMPONENT = 0x00000010,
+
+ /**
+ * Specifies whether an ability is started.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_ABILITY_FORM_ENABLED = 0x00000020,
+
+ /**
+ * Indicates the grant for possible persisting on the URI.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040,
+
+ /**
+ * Returns the result to the source ability slice.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ FLAG_AUTH_PREFIX_URI_PERMISSION = 0x00000080,
+
+ /**
+ * Supports multi-device startup in the distributed scheduling system.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_ABILITYSLICE_MULTI_DEVICE = 0x00000100,
+
+ /**
+ * Indicates that an ability using the Service template is started regardless of whether the host application has
+ * been started.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_START_FOREGROUND_ABILITY = 0x00000200,
+
+ /**
+ * Indicates the continuation is reversible.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @systemapi
+ * @since 9
+ */
+ FLAG_ABILITY_CONTINUATION_REVERSIBLE = 0x00000400,
+
+ /**
+ * Install the specified ability if it's not installed.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_INSTALL_ON_DEMAND = 0x00000800,
+
+ /**
+ * Install the specifiedi ability with background mode if it's not installed.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_INSTALL_WITH_BACKGROUND_MODE = 0x80000000,
+
+ /**
+ * Indicates the operation of clearing other missions. This flag can be set for the {@code Intent} passed to
+ * {@link ohos.app.Context#startAbility} and must be used together with {@link FLAG_ABILITY_NEW_MISSION}.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_ABILITY_CLEAR_MISSION = 0x00008000,
+
+ /**
+ * Indicates the operation of creating a task on the historical mission stack.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_ABILITY_NEW_MISSION = 0x10000000,
+
+ /**
+ * Indicates that the existing instance of the ability to start will be reused if it is already at the top of
+ * the mission stack. Otherwise, a new ability instance will be created.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ FLAG_ABILITY_MISSION_TOP = 0x20000000
+ }
+}
+
+export default wantConstant;
diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..aeed2002d1196653393922c27658130ee075a84c
--- /dev/null
+++ b/api/@ohos.app.form.FormExtensionAbility.d.ts
@@ -0,0 +1,138 @@
+/*
+ * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License"),
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import formBindingData from './@ohos.app.form.formBindingData';
+import formInfo from "./@ohos.app.form.formInfo";
+import FormExtensionContext from "./application/FormExtensionContext";
+import Want from './@ohos.app.ability.Want';
+import { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * class of form extension.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+export default class FormExtensionAbility {
+ /**
+ * Indicates form extension context.
+ * @type { FormExtensionContext }
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ context: FormExtensionContext;
+
+ /**
+ * Called to return a {@link formBindingData#FormBindingData} object.
+ * @param { Want } want - Indicates the detailed information for creating a {@link formBindingData#FormBindingData}.
+ * The {@code Want} object must include the form ID, form name, and grid style of the form.
+ * Such form information must be managed as persistent data for further form
+ * acquisition, update, and deletion.
+ * @return { formBindingData.FormBindingData } Returns the created {@link formBindingData#FormBindingData} object.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ onAddForm(want: Want): formBindingData.FormBindingData;
+
+ /**
+ * Called when the form provider is notified that a temporary form is successfully converted to a normal form.
+ * @param { string } formId - Indicates the ID of the form.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ onCastToNormalForm(formId: string): void;
+
+ /**
+ * Called to notify the form provider to update a specified form.
+ * @param { string } formId - Indicates the ID of the form to update.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ onUpdateForm(formId: string): void;
+
+ /**
+ * Called when the form provider receives form events from the system.
+ * @param { { [key: string]: number } } newStatus - Indicates the form events occurred. The key in the {@code Map}
+ * object indicates the form ID, and the value indicates the event type, which can be either
+ * {@link formInfo#VisibilityType#FORM_VISIBLE} or {@link formInfo#VisibilityType#FORM_INVISIBLE}.
+ * {@link formInfo#VisibilityType#FORM_VISIBLE} means that the form becomes visible, and
+ * {@link formInfo#VisibilityType#FORM_INVISIBLE} means that the form becomes invisible.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ onChangeFormVisibility(newStatus: { [key: string]: number }): void;
+
+ /**
+ * Called when a specified message event defined by the form provider is triggered. This method is valid only for
+ * JS forms.
+ * @param { string } formId - Indicates the ID of the form on which the message event is triggered, which is
+ * provided by the client to the form provider.
+ * @param { string } message - Indicates the value of the {@code params} field of the message event. This parameter
+ * is used to identify the specific component on which the event is triggered.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ onFormEvent(formId: string, message: string): void;
+
+ /**
+ * Called to notify the form provider that a specified form has been destroyed. Override this method if
+ * you want your application, as the form provider, to be notified of form deletion.
+ * @param { string } formId - Indicates the ID of the destroyed form.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ onRemoveForm(formId: string): void;
+
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } newConfig - Indicates the system configuration, such as language and color mode.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ onConfigurationUpdate(newConfig: Configuration): void;
+
+ /**
+ * Called to return a {@link FormState} object.
+ *
You must override this callback if you want this ability to return the actual form state. Otherwise,
+ * this method returns {@link FormState#DEFAULT} by default.
+ * @param { Want } want - Indicates the description of the form for which the {@link formInfo#FormState}
+ * is obtained. The description covers the bundle name, ability name, module name,
+ * form name, and form dimensions.
+ * @return { formInfo.FormState } Returns the {@link formInfo#FormState} object.
+ * @syscap SystemCapability.Ability.Form
+ * @stagemodelonly
+ * @since 9
+ */
+ onAcquireFormState?(want: Want): formInfo.FormState;
+
+ /**
+ * Called when the system shares the form.
+ * @param { string } formId - Indicates the ID of the form.
+ * @return { { [key: string]: any } } Returns the wantParams object.
+ * @syscap SystemCapability.Ability.Form
+ * @systemapi
+ * @stagemodelonly
+ * @since 9
+ */
+ onShareForm?(formId: string): { [key: string]: any };
+}
diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts
index 4e066920eb4431adadb9b56d4489e516ec58bee8..96d204f779240bf6004b80f7a28d00bab714a0ec 100644
--- a/api/@ohos.app.form.formHost.d.ts
+++ b/api/@ohos.app.form.formHost.d.ts
@@ -15,8 +15,8 @@
import { AsyncCallback } from "./basic";
import { Callback } from "./basic";
-import Want from './@ohos.application.Want';
-import formInfo from './@ohos.application.formInfo'
+import Want from './@ohos.app.ability.Want';
+import formInfo from './@ohos.app.form.formInfo';
/**
* Interface of formHost.
@@ -137,13 +137,13 @@ declare namespace formHost {
* Converts a specified temporary form that has been obtained by the application into a normal form.
* @permission ohos.permission.REQUIRE_FORM
* @param { string } formId - Indicates the ID of the temporary form to convert.
- * @param { AsyncCallback } callback - The callback of castTempForm.
+ * @param { AsyncCallback } callback - The callback of castToNormalForm.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 9
*/
- function castTempForm(formId: string, callback: AsyncCallback): void;
+ function castToNormalForm(formId: string, callback: AsyncCallback): void;
/**
* Converts a specified temporary form that has been obtained by the application into a normal form.
@@ -155,7 +155,7 @@ declare namespace formHost {
* @systemapi
* @since 9
*/
- function castTempForm(formId: string): Promise;
+ function castToNormalForm(formId: string): Promise;
/**
* Sends a notification to the form framework to make the specified forms visible.
@@ -490,13 +490,50 @@ declare namespace formHost {
* @param { string } formId - Indicates the form ID.
* @param { string } deviceId - Indicates the remote device ID.
* @param { AsyncCallback } callback - The callback of shareForm.
- * @returns { Promise } The promise returned by the function.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 9
*/
function shareForm(formId: string, deviceId: string, callback: AsyncCallback): void;
+
+ /**
+ * Share form by formId and deviceId.
+ * @permission ohos.permission.REQUIRE_FORM and ohos.permission.DISTRIBUTED_DATASYNC
+ * @param { string } formId - Indicates the form ID.
+ * @param { string } deviceId - Indicates the remote device ID.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.Form
+ * @systemapi
+ * @since 9
+ */
function shareForm(formId: string, deviceId: string): Promise;
+
+ /**
+ * Notify form that privacy whether to be protected.
+ * @permission ohos.permission.REQUIRE_FORM.
+ * @param { Array } formIds - Indicates the specified form id.
+ * @param { boolean } isProtected - Indicates whether to be protected.
+ * @param { AsyncCallback } callback - The callback of notifyFormsPrivacyProtected.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.Form
+ * @systemapi
+ * @since 9
+ */
+ function notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback