| ABILITY_NOT_RESPONDING | 1 | The ability does not respond.|
| ABILITY_NOT_RESPONDING | 1 | The ability does not respond. This enum is supported since API version 9 and deprecated since API version 10. You are advised to use **APP_FREEZE**.|
| NORMAL | 2 | The ability exits normally.|
| NORMAL | 2 | The ability exits normally because the user closes the application.|
| CPP_CRASH<sup>10+</sup> | 3 | The ability exits due to abnormal signals on the local host.|
| JS_ERROR<sup>10+</sup> | 4 | The ability exits due to a JS_ERROR fault triggered when an application has a JS syntax error that is not captured by developers.|
| APP_FREEZE<sup>10+</sup> | 5 | The ability exits because watchdog detects that the application is frozen.|
| PERFORMANCE_CONTROL<sup>10+</sup> | 6 | The ability exits due to system performance problems, for example, insufficient device memory.|
| RESOURCE_CONTROL<sup>10+</sup> | 7 | The ability exits because the system resource usage (CPU, I/O, or memory usage) exceeds the upper limit.|
| UPGRADE<sup>10+</sup> | 8 | The ability exits due to an update.|
**Example**
**Example**
...
@@ -218,3 +224,24 @@ class MyAbility extends UIAbility {
...
@@ -218,3 +224,24 @@ class MyAbility extends UIAbility {
}
}
}
}
```
```
## AbilityConstant.ContinueState<sup>10+</sup>
Enumerates the mission continuation states of the application. It is used in the [setMissionContinueState](js-apis-inner-application-uiAbilityContext.md#uiabilitycontextsetmissioncontinuestate10) API of [UIAbilityContext](js-apis-inner-application-uiAbilityContext.md).
For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels).
For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels).
...
@@ -115,7 +116,7 @@ Enumerates the types of Extension abilities.
...
@@ -115,7 +116,7 @@ Enumerates the types of Extension abilities.
| PRINT<sup>10+</sup> | 15 | PrintExtensionAbility: provides APIs for printing images. Printing documents is not supported yet.|
| PRINT<sup>10+</sup> | 15 | PrintExtensionAbility: provides APIs for printing images. Printing documents is not supported yet.|
| PUSH<sup>10+</sup> | 17 | PushExtensionAbility: provides APIs for pushing scenario-specific messages. This ability is reserved.|
| PUSH<sup>10+</sup> | 17 | PushExtensionAbility: provides APIs for pushing scenario-specific messages. This ability is reserved.|
| DRIVER<sup>10+</sup> | 18 | DriverExtensionAbility: provides APIs for the peripheral driver. This type of ability is not supported yet.|
| DRIVER<sup>10+</sup> | 18 | DriverExtensionAbility: provides APIs for the peripheral driver. This type of ability is not supported yet.|
| APP_ACCOUNT_AUTHORIZATION<sup>10+</sup> | 19 | AuthorizationExtensionAbility: provides APIs to process authorization requests for application accounts and allow account authorization from a third-party (relative to the operating system vendor) ecosystem platform.|
| APP_ACCOUNT_AUTHORIZATION<sup>10+</sup> | 19 | [AuthorizationExtensionAbility](js-apis-appAccount-authorizationExtensionAbility.md): provides APIs to process authorization requests for application accounts and allow account authorization from a third-party (relative to the operating system vendor) ecosystem platform.|
| UNSPECIFIED | 255 | No type is specified. It is used together with **queryExtensionAbilityInfo** to query all types of Extension abilities.|
| UNSPECIFIED | 255 | No type is specified. It is used together with **queryExtensionAbilityInfo** to query all types of Extension abilities.|
...
@@ -677,7 +678,7 @@ Obtains the information about all bundles based on the given bundle flags and us
...
@@ -677,7 +678,7 @@ Obtains the information about all bundles based on the given bundle flags and us
| info | [AbilityInfo](js-apis-bundleManager-abilityInfo.md) | Yes | Information about the target ability. |
| info | [AbilityInfo](js-apis-bundleManager-abilityInfo.md) | Yes | Information about the target ability. |
| isEnabled| boolean | Yes | Whether to enable the ability. The value **true** means to enable the ability, and **false** means to disable the ability.|
| isEnabled| boolean | Yes | Whether to enable the ability. The value **true** means to enable the ability, and **false** means to disable the application.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.|
| callback | AsyncCallback\<void> | Yes| Callback used to return the result. If the operation is successful, **err** is **null**. Otherwise, **err** is an error object.|
**Error codes**
**Error codes**
...
@@ -1814,7 +1815,7 @@ Enables or disables an ability. This API uses a promise to return the result.
...
@@ -1814,7 +1815,7 @@ Enables or disables an ability. This API uses a promise to return the result.
| info | [AbilityInfo](js-apis-bundleManager-abilityInfo.md) | Yes | Information about the target ability. |
| info | [AbilityInfo](js-apis-bundleManager-abilityInfo.md) | Yes | Information about the target ability. |
| isEnabled| boolean | Yes | Whether to enable the ability. The value **true** means to enable the ability, and **false** means to disable the ability.|
| isEnabled| boolean | Yes | Whether to enable the ability. The value **true** means to enable the ability, and **false** means to disable the application.|
Obtains the distribution type of a bundle in synchronous mode. The return value is the **specifiedDistributionType** field value in [InstallParam](./js-apis-installer.md#installparam) passed when **install** is called.
Obtains additional information about a bundle in synchronous mode. The return value is the **additionalInfo** field value in [InstallParam](./js-apis-installer.md#installparam) passed when **install** is called.
| inFile | string | Yes | Path of the file to decompress. The file name extension must be .zip. The path must be an application sandbox path, which can be obtained from the context. For details about the context, see [FA Model](js-apis-inner-app-context.md) and [Stage Model](js-apis-inner-application-context.md).|
| inFile | string | Yes | Path of the file to decompress. The file name extension must be .zip. The path must be an application sandbox path, which can be obtained from the context. For details about the context, see [FA Model](js-apis-inner-app-context.md) and [Stage Model](js-apis-inner-application-context.md).|
| outFile | string | Yes | Path of the decompressed file. The path must exist in the system. Otherwise, the decompression fails. The path must be an application sandbox path, which can be obtained from the context. For details about the context, see [FA Model](js-apis-inner-app-context.md) and [Stage Model](js-apis-inner-application-context.md).|
| outFile | string | Yes | Path of the decompressed file. The path must exist in the system. Otherwise, the decompression fails. The path must be an application sandbox path, which can be obtained from the context. For details about the context, see [FA Model](js-apis-inner-app-context.md) and [Stage Model](js-apis-inner-application-context.md). If a file or folder with the same name already exists in the path, they will be overwritten.|
| AsyncCallback<**void**> | callback | No | Callback used to return the result. If the operation is successful, **null** is returned; otherwise, a specific error code is returned. |
| AsyncCallback<**void**> | callback | No | Callback used to return the result. If the operation is successful, **null** is returned; otherwise, a specific error code is returned. |
...
@@ -259,9 +259,7 @@ import zlib from '@ohos.zlib';
...
@@ -259,9 +259,7 @@ import zlib from '@ohos.zlib';
| inFile | string | Yes | Path of the file to decompress. The file name extension must be .zip. The path must be an application sandbox path, which can be obtained from the context. For details about the context, see [FA Model](js-apis-inner-app-context.md) and [Stage Model](js-apis-inner-application-context.md).|
| inFile | string | Yes | Path of the file to decompress. The file name extension must be .zip. The path must be an application sandbox path, which can be obtained from the context. For details about the context, see [FA Model](js-apis-inner-app-context.md) and [Stage Model](js-apis-inner-application-context.md).|
| outFile | string | Yes | Path of the decompressed file. The path must exist in the system. Otherwise, the decompression fails. The path must be an application sandbox path, which can be obtained from the context. For details about the context, see [FA Model](js-apis-inner-app-context.md) and [Stage Model](js-apis-inner-application-context.md).|
| outFile | string | Yes | Path of the decompressed file. The path must exist in the system. Otherwise, the decompression fails. The path must be an application sandbox path, which can be obtained from the context. For details about the context, see [FA Model](js-apis-inner-app-context.md) and [Stage Model](js-apis-inner-application-context.md). If a file or folder with the same name already exists in the path, they will be overwritten.|
@@ -246,7 +246,7 @@ Check the functions required by the tasks executed by the task pool and add the
...
@@ -246,7 +246,7 @@ Check the functions required by the tasks executed by the task pool and add the
**Error Message**
**Error Message**
The task is not exist when cancel it.
The task does not exist when it is canceled.
**Description**
**Description**
...
@@ -258,13 +258,13 @@ The task to cancel does not exist in the task pool.
...
@@ -258,13 +258,13 @@ The task to cancel does not exist in the task pool.
**Solution**
**Solution**
Before canceling a task, ensure that the task is placed into the task pool by calling **taskpool.execute**.
Before canceling a task, ensure that the task has been placed in the task pool by calling **taskpool.execute** and is not finishing. If you are not sure, capture exceptions.
## 10200016 Failed to Cancel a Task Being Executed
## 10200016 Failed to Cancel a Task Being Executed
**Error Message**
**Error Message**
The task is running when cancel it.
The task is executing when it is canceled.
**Description**
**Description**
...
@@ -276,7 +276,7 @@ The task to cancel is being executed.
...
@@ -276,7 +276,7 @@ The task to cancel is being executed.
**Solution**
**Solution**
Before canceling a task, ensure that the task finishes execution.
Before canceling a task, ensure that the task has been placed in the task pool by calling **taskpool.execute** and has not started execution. If you are not sure, capture exceptions.
## 10200017 Failed to Delete an Element That Does Not Exist
## 10200017 Failed to Delete an Element That Does Not Exist
...
@@ -295,3 +295,21 @@ The element to delete does not exist in the container.
...
@@ -295,3 +295,21 @@ The element to delete does not exist in the container.
**Solution**
**Solution**
Before deleting an element, ensure that the element exists in this container.
Before deleting an element, ensure that the element exists in this container.
## 10200018 Failed to Cancel a Task Group That Does Not Exist
**Error Message**
The task group does not exist when it is canceled.
**Description**
This error code is reported when you attempt to cancel a task group that does not exist.
**Possible Causes**
The task group to cancel does not exist in the task pool.
**Solution**
Before canceling a task group, ensure that the task group is placed in the task pool by calling **taskpool.execute** and is not finishing. If you are not sure, capture exceptions.