提交 86fc13c8 编写于 作者: G Gloria

Update docs against 11804+11904+11956+11243+12009+12031+12114+12098+12250+12374

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 0ed48d81
# innerBundleManager<sup>(deprecated)</sup>
# @ohos.bundle.innerBundleManager
The **innerBundleManager** module provides APIs for the **Home Screen** application.
>
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> This module is deprecated since API version 9. You are advised to use [launcherBundleManager](js-apis-launcherBundleManager.md) and [bundleMonitor](js-apis-bundleMonitor.md) instead.
......@@ -41,7 +41,7 @@ This is a system API and cannot be called by third-party applications.
| Name | Type | Mandatory| Description |
| ---------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------- |
| bundleName | string | Yes | Bundle name of an application. |
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<Array<[LauncherAbilityInfo](js-apis-bundle-LauncherAbilityInfo.md)>> | Yes | Callback used to return an array of the launcher ability information. |
......@@ -69,7 +69,7 @@ This is a system API and cannot be called by third-party applications.
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ----------------------------------------------------- |
| bundleName | string | Yes | Bundle name of an application. |
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The value must be greater than or equal to 0.|
**Return value**
......@@ -216,7 +216,7 @@ This is a system API and cannot be called by third-party applications.
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ----------------------------------------------------- |
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<Array<[LauncherAbilityInfo](js-apis-bundle-LauncherAbilityInfo.md)>> | Yes | Callback used to return an array of the launcher ability information. |
## innerBundleManager.getAllLauncherAbilityInfos<sup>(deprecated)</sup>
......@@ -242,7 +242,7 @@ This is a system API and cannot be called by third-party applications.
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ----------------------------------------------------- |
| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.|
| userId | number | Yes | User ID. The value must be greater than or equal to 0.|
**Return value**
......
# AbilityInfo
Unless otherwise specified, ability information is obtained through **GET_BUNDLE_DEFAULT**.
The **AbilityInfo** module provides information about an ability. Unless otherwise specified, the information is obtained through [GET_BUNDLE_DEFAULT](js-apis-Bundle.md).
> **NOTE**
>
......@@ -8,13 +8,13 @@ Unless otherwise specified, ability information is obtained through **GET_BUNDLE
## AbilityInfo<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [AbilityInfo](js-apis-bundleManager-abilityInfo.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-AbilityInfo](js-apis-bundleManager-abilityInfo.md) instead.
**System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type | Readable| Writable| Description |
| --------------------- | -------------------------------------------------------- | ---- | ---- | ----------------------------------------- |
| bundleName | string | Yes | No | Bundle name of the application. |
| bundleName | string | Yes | No | Bundle name. |
| name | string | Yes | No | Ability name. |
| label | string | Yes | No | Ability name visible to users. |
| description | string | Yes | No | Ability description. |
......@@ -25,17 +25,17 @@ Unless otherwise specified, ability information is obtained through **GET_BUNDLE
| process | string | Yes | No | Process in which the ability runs. If this parameter is not set, the bundle name is used.|
| targetAbility | string | Yes | No | Target ability that the ability alias points to.<br>This attribute can be used only in the FA model.|
| backgroundModes | number | Yes | No | Background service mode of the ability.<br>This attribute can be used only in the FA model. |
| isVisible | boolean | Yes | No | Whether the ability can be called by other applications. |
| isVisible | boolean | Yes | No | Whether the ability can be called by other bundles. |
| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability.<br>This attribute can be used only in the FA model.|
| type | AbilityType | Yes | No | Ability type.<br>This attribute can be used only in the FA model. |
| orientation | DisplayOrientation | Yes | No | Ability display orientation. |
| launchMode | LaunchMode | Yes | No | Ability launch mode. |
| orientation | [DisplayOrientation](js-apis-Bundle.md#displayorientationdeprecated) | Yes | No | Ability display orientation. |
| launchMode | [LaunchMode](js-apis-Bundle.md#launchmodedeprecated) | Yes | No | Ability launch mode. |
| permissions | Array\<string> | Yes | No | Permissions required for other applications to call the ability.<br>The value is obtained by passing **GET_ABILITY_INFO_WITH_PERMISSION**.|
| deviceTypes | Array\<string> | Yes | No | Device types supported by the ability. |
| deviceCapabilities | Array\<string> | Yes | No | Device capabilities required for the ability. |
| readPermission | string | Yes | No | Permission required for reading the ability data.<br>This attribute can be used only in the FA model.|
| writePermission | string | Yes | No | Permission required for writing data to the ability.<br>This attribute can be used only in the FA model.|
| applicationInfo | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md) | Yes | No | Application configuration information.<br>The value is obtained by passing **GET_ABILITY_INFO_WITH_APPLICATION**.|
| applicationInfo | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md) | Yes | No | Application configuration information.<br>The value is obtained by passing [GET_ABILITY_INFO_WITH_APPLICATION](js-apis-Bundle.md).|
| uri | string | Yes | No | URI of the ability.<br>This attribute can be used only in the FA model.|
| labelId | number | Yes | No | Ability label ID. |
| subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability.<br>This attribute can be used only in the FA model.|
......
# ApplicationInfo
The **ApplicationInfo** module provides application information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**.
The **ApplicationInfo** module provides application information. Unless otherwise specified, the information is obtained through [GET_BUNDLE_DEFAULT](js-apis-Bundle.md).
> **NOTE**
>
......@@ -8,30 +8,30 @@ The **ApplicationInfo** module provides application information. Unless otherwis
## ApplicationInfo<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [ApplicationInfo](js-apis-bundleManager-applicationInfo.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-ApplicationInfo](js-apis-bundleManager-applicationInfo.md) instead.
**System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type | Readable| Writable| Description |
| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
| name | string | Yes | No | Application name. |
| description | string | Yes | No | Application description. |
| descriptionId | number | Yes | No | Application description ID. |
| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. |
| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. |
| label | string | Yes | No | Application label. |
| labelId<sup>(deprecated)</sup> | string | Yes | No | Application label ID.<br>\- **NOTE**: This attribute is deprecated from API version 9. Use **labelIndex** instead.|
| icon | string | Yes | No | Application icon. |
| iconId<sup>(deprecated)</sup> | string | Yes | No | Application icon ID.<br>\- **NOTE**: This attribute is deprecated from API version 9. Use **iconIndex** instead.|
| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used. |
| supportedModes | number | Yes | No | Running modes supported by the application. |
| moduleSourceDirs | Array\<string> | Yes | No | Relative paths for storing application resources. |
| permissions | Array\<string> | Yes | No | Permissions required for accessing the application.<br>The value is obtained by passing **GET_APPLICATION_INFO_WITH_PERMISSION**.|
| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | Yes | No | Application module information. |
| entryDir | string | Yes | No | Path for storing application files. |
| codePath<sup>8+</sup> | string | Yes | No | Installation directory of the application. |
| metaData<sup>8+</sup> | Map\<string, Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)>> | Yes | No | Custom metadata of the application.<br>The value is obtained by passing **GET_APPLICATION_INFO_WITH_METADATA**.|
| removable<sup>8+</sup> | boolean | Yes | No | Whether the application is removable. |
| accessTokenId<sup>8+</sup> | number | Yes | No | Access token ID of the application. |
| uid<sup>8+</sup> | number | Yes | No | UID of the application. |
| entityType<sup>8+</sup> | string | Yes | No | Entity type of the application. |
| Name | Type | Readable | Writable | Description |
|----------------------------|------------------------------------------------------------------------|-----|-----|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | string | Yes | No | Application name. |
| description | string | Yes | No | Application description. |
| descriptionId | number | Yes | No | Application description ID. |
| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. |
| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. |
| label | string | Yes | No | Application label. |
| labelId | string | Yes | No | Application label ID. |
| icon | string | Yes | No | Application icon. |
| iconId | string | Yes | No | Application icon ID. |
| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used. |
| supportedModes | number | Yes | No | Modes supported by the application. Currently, only the **drive** mode is defined. This attribute applies only to head units. |
| moduleSourceDirs | Array\<string> | Yes | No | Relative paths for storing application resources. |
| permissions | Array\<string> | Yes | No | Permissions required for accessing the application.<br>The value is obtained by passing [GET_APPLICATION_INFO_WITH_PERMISSION](js-apis-Bundle.md). |
| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | Yes | No | Application module information. |
| entryDir | string | Yes | No | Path for storing application files. |
| codePath<sup>8+</sup> | string | Yes | No | Installation directory of the application. |
| metaData<sup>8+</sup> | Map\<string, Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)>> | Yes | No | Custom metadata of the application.<br>The value is obtained by passing [GET_APPLICATION_INFO_WITH_METADATA](js-apis-Bundle.md). |
| removable<sup>8+</sup> | boolean | Yes | No | Whether the application is removable. |
| accessTokenId<sup>8+</sup> | number | Yes | No | Access token ID of the application. |
| uid<sup>8+</sup> | number | Yes | No | UID of the application. |
| entityType<sup>8+</sup> | string | Yes | No | Category of the application, which can be **game**, **media**, **communication**, **news**, **travel**, **utility**, **shopping**, **education**, **kids**, **business**, and **photography**.|
# BundleInfo
The **BundleInfo** module provides bundle information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**.
The **BundleInfo** module provides bundle information. Unless otherwise specified, the information is obtained through [GET_BUNDLE_DEFAULT](js-apis-Bundle.md).
> **NOTE**
>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## BundleInfo<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [BundleInfo](js-apis-bundleManager-bundleInfo.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-BundleInfo](js-apis-bundleManager-bundleInfo.md) instead.
**System capability**: SystemCapability.BundleManager.BundleFramework
**System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type | Readable| Writable| Description |
| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
......@@ -25,7 +23,7 @@ The **BundleInfo** module provides bundle information. Unless otherwise specifie
| appInfo | [ApplicationInfo](js-apis-bundle-ApplicationInfo.md) | Yes | No | Application configuration information. |
| abilityInfos | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | No | Ability configuration information.<br>The value is obtained by passing **GET_BUNDLE_WITH_ABILITIES**.|
| reqPermissions | Array\<string> | Yes | No | Permissions to request from the system for running the application.<br>The value is obtained by passing **GET_BUNDLE_WITH_REQUESTED_PERMISSION**.|
| reqPermissionDetails | Array\<[ReqPermissionDetail](#reqpermissiondetail)> | Yes | No | Detailed information of the permissions to request from the system.<br>The value is obtained by passing **GET_BUNDLE_WITH_REQUESTED_PERMISSION**.|
| reqPermissionDetails | Array\<[ReqPermissionDetail](#reqpermissiondetaildeprecated)> | Yes | No | Detailed information of the permissions to request from the system.<br>The value is obtained by passing **GET_BUNDLE_WITH_REQUESTED_PERMISSION**.|
| vendor | string | Yes | No | Vendor of the bundle. |
| versionCode | number | Yes | No | Version number of the bundle. |
| versionName | string | Yes | No | Version description of the bundle. |
......@@ -38,7 +36,7 @@ The **BundleInfo** module provides bundle information. Unless otherwise specifie
| isSilentInstallation | string | Yes | No | Whether the application can be installed in silent mode. |
| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. |
| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. |
| reqPermissionStates<sup>8+</sup> | Array\<number> | Yes | No | Permission grant state. |
| reqPermissionStates<sup>8+</sup> | Array\<number> | Yes | No | Permission grant state. The value **0** means that the request is successful, and **-1** means the opposite. |
......@@ -54,7 +52,7 @@ Provides the detailed information of the permissions to request from the system.
| --------------------- | ----------------------- | ---- | ---- | ---------------------- |
| name | string | Yes | Yes | Name of the permission to request. |
| reason | string | Yes | Yes | Reason for requesting the permission. |
| usedScene | [UsedScene](#usedscene) | Yes | Yes | Application scenario and timing for using the permission.|
| usedScene | [UsedScene](#usedscenedeprecated) | Yes | Yes | Application scenario and timing for using the permission.|
......
......@@ -12,7 +12,7 @@ The **BundleInstaller** module provides APIs for you to install, uninstall, and
install(bundleFilePaths: Array&lt;string&gt;, param: InstallParam, callback: AsyncCallback&lt;InstallStatus&gt;): void;
Installs a bundle. This API uses an asynchronous callback to return the result.
Installs a bundle. Multiple HAP files can be installed. This API uses an asynchronous callback to return the result.
**Required permissions**
......@@ -28,9 +28,33 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description |
| --------------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
| bundleFilePaths | Array&lt;string&gt; | Yes | Paths where the HAP files of the bundle are stored. Each path should point to a relative directory of the current bundle's data directory.|
| param | [InstallParam](#installparam) | Yes | Parameters required for bundle installation. |
| callback | AsyncCallback&lt;[InstallStatus](#installstatus)&gt; | Yes | Callback used to return the installation status. |
| bundleFilePaths | Array&lt;string&gt; | Yes | Sandbox path where the HAP files of the bundle are stored. For details about how to obtain the sandbox path, see [Obtaining the Sandbox Path](#obtaining-the-sandbox-path).|
| param | [InstallParam](#installparamdeprecated) | Yes | Parameters required for bundle installation. |
| callback | AsyncCallback&lt;[InstallStatus](#installstatusdeprecated)&gt; | Yes | Callback used to return the installation status. |
**Example**
```ts
import bundle from '@ohos.bundle';
let hapFilePaths = ['/data/storage/el2/base/haps/entry/files/'];
let installParam = {
userId: 100,
isKeepData: false,
installFlag: 1,
};
bundle.getBundleInstaller().then(installer=>{
installer.install(hapFilePaths, installParam, err => {
if (err) {
console.error('install failed:' + JSON.stringify(err));
} else {
console.info('install successfully.');
}
});
}).catch(error => {
console.error('getBundleInstaller failed. Cause: ' + error.message);
});
```
## BundleInstaller.uninstall<sup>(deprecated)<sup>
......@@ -55,16 +79,39 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description |
| ---------- | ---------------------------------------------------- | ---- | ---------------------------------------------- |
| bundleName | string | Yes | Bundle name. |
| param | [InstallParam](#installparam) | Yes | Parameters required for bundle uninstall. |
| callback | AsyncCallback&lt;[InstallStatus](#installstatus)&gt; | Yes | Callback used to return the installation status.|
| param | [InstallParam](#installparamdeprecated) | Yes | Parameters required for bundle uninstall. |
| callback | AsyncCallback&lt;[InstallStatus](#installstatusdeprecated)&gt; | Yes | Callback used to return the installation status.|
**Example**
```ts
import bundle from '@ohos.bundle';
let bundleName = 'com.example.myapplication';
let installParam = {
userId: 100,
isKeepData: false,
installFlag: 1,
};
bundle.getBundleInstaller().then(installer=>{
installer.uninstall(bundleName, installParam, err => {
if (err) {
console.error('uninstall failed:' + JSON.stringify(err));
} else {
console.info('uninstall successfully.');
}
});
}).catch(error => {
console.error('getBundleInstaller failed. Cause: ' + error.message);
});
```
## BundleInstaller.recover<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [recover](js-apis-installer.md) instead.
recover(bundleName: string, param: InstallParam, callback: AsyncCallback&lt;InstallStatus&gt;): void;
Recovers a bundle. This API uses an asynchronous callback to return the result.
Recovers a bundle. This API uses an asynchronous callback to return the result. After a pre-installed bundle is uninstalled, you can call this API to recover it.
**Required permissions**
......@@ -81,12 +128,37 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory| Description |
| ---------- | ---------------------------------------------------- | ---- | ---------------------------------------------- |
| bundleName | string | Yes | Bundle name. |
| param | [InstallParam](#installparam) | Yes | Parameters required for bundle recovering. |
| callback | AsyncCallback&lt;[InstallStatus](#installstatus)&gt; | Yes | Callback used to return the installation status.|
| param | [InstallParam](#installparamdeprecated) | Yes | Parameters required for bundle recovery. |
| callback | AsyncCallback&lt;[InstallStatus](#installstatusdeprecated)&gt; | Yes | Callback used to return the recovery status.|
**Example**
```ts
import bundle from '@ohos.bundle';
let bundleName = 'com.example.myapplication';
let installParam = {
userId: 100,
isKeepData: false,
installFlag: 1,
};
bundle.getBundleInstaller().then(installer=>{
installer.recover(bundleName, installParam, err => {
if (err) {
console.error('recover failed:' + JSON.stringify(err));
} else {
console.info('recover successfully.');
}
});
}).catch(error => {
console.error('getBundleInstaller failed. Cause: ' + error.message);
});
```
## InstallParam<sup>(deprecated)<sup>
Describes the parameters required for bundle installation or uninstall.
Describes the parameters required for bundle installation, recovery, or uninstall.
**System capability**: SystemCapability.BundleManager.BundleFramework
......@@ -100,7 +172,7 @@ Describes the parameters required for bundle installation or uninstall.
## InstallStatus<sup>(deprecated)<sup>
Describes the bundle installation status.
Describes the bundle installation or uninstall status.
**System capability**: SystemCapability.BundleManager.BundleFramework
......@@ -110,3 +182,27 @@ Describes the bundle installation status.
| ------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------ |
| status | bundle.[InstallErrorCode](js-apis-Bundle.md#installerrorcode) | Yes | No | Installation or uninstall error code. |
| statusMessage | string | Yes | No | Installation or uninstall status message.|
## Obtaining the Sandbox Path
For the FA model, the sandbox path of a bundle can be obtained using the APIs in [Context](js-apis-inner-app-context.md). For the sage model, the sandbox path can be obtained using the attribute in [Context](js-apis-ability-context.md#abilitycontext). The following describes how to obtain the sandbox path.
**Example**
``` ts
// Stage model
import Ability from '@ohos.application.Ability';
class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
let context = this.context;
let pathDir = context.filesDir;
console.info('sandbox path is ' + pathDir);
}
}
// FA model
import featureAbility from '@ohos.ability.featureAbility';
let context = featureAbility.getContext();
context.getFilesDir().then((data) => {
let pathDir = data;
console.info('sandbox path is ' + pathDir);
});
```
......@@ -14,6 +14,6 @@ The **CustomizeData** module provides custom metadata.
| Name | Type | Readable| Writable| Description |
| ------------------ | ------ | ---- | ---- | ---------------- |
| name | string | Yes | Yes | Custom metadata name.|
| value | string | Yes | Yes | Custom metadata value. |
| extra<sup>8+</sup> | string | Yes | Yes | Custom metadata resources. |
| name | string | Yes | Yes | Key that identifies a data element.|
| value | string | Yes | Yes | Value of the data element. |
| extra<sup>8+</sup> | string | Yes | Yes | Custom format of the data element. The value is an index to the resource that identifies the data. |
# ElementName
The **ElementName** module provides the element name information, which can be obtained through [Context.getElementName](js-apis-Context.md).
The **ElementName** module provides element name information, which can be obtained through [Context.getElementName](js-apis-inner-app-context.md).
> **NOTE**
>
......@@ -8,7 +8,9 @@ The **ElementName** module provides the element name information, which can be o
## ElementName<sup>(deprecated)</sup>
> This API is deprecated since API version 9. You are advised to use [ElementName](js-apis-bundleManager-elementName.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-ElementName](js-apis-bundleManager-elementName.md) instead.
Describes the element name information, which identifies the basic information about an ability and is obtained through [Context.getElementName](js-apis-inner-app-context.md).
**System capability**: SystemCapability.BundleManager.BundleFramework
......
# HapModuleInfo
The **HapModuleInfo** module provides module information. Unless otherwise specified, all attributes are obtained through **GET_BUNDLE_DEFAULT**.
The **HapModuleInfo** module provides information about an HAP module. Unless otherwise specified, the information is obtained through [GET_BUNDLE_DEFAULT](js-apis-Bundle.md).
> **NOTE**
>
......@@ -8,7 +8,7 @@ The **HapModuleInfo** module provides module information. Unless otherwise speci
## HapModuleInfo<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) instead.
**System capability**: SystemCapability.BundleManager.BundleFramework
......
......@@ -7,10 +7,9 @@ The **ModuleInfo** module provides module information of an application.
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## ModuleInfo<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-HapModuleInfo](js-apis-bundleManager-hapModuleInfo.md) instead.
**System capability**: SystemCapability.BundleManager.BundleFramework
| Name | Type | Readable| Writable| Description |
| --------------- | ------ | ---- | ---- | -------- |
| moduleName | string | Yes | No | Module name.|
......
......@@ -8,7 +8,7 @@ The **PermissionDef** module provides permission details defined in the configur
## **PermissionDef**<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [PermissionDef](js-apis-bundleManager-permissionDef.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-PermissionDef](js-apis-bundleManager-permissionDef.md) instead.
**System capability**: SystemCapability.BundleManager.BundleFramework
......@@ -17,6 +17,6 @@ The **PermissionDef** module provides permission details defined in the configur
| Name | Type | Readable| Writable| Description |
| -------------- | ------ | ---- | ---- | -------------- |
| permissionName | string | Yes | No | Name of the permission. |
| grantMode | number | Yes | No | Grant mode of the permission.|
| grantMode | number | Yes | No | Grant mode of the permission. The value **0** means that the system automatically grants the permission after the application installation, and **1** means that the application needs to dynamically request the permission from the user.|
| labelId | number | Yes | No | Label ID of the permission. |
| descriptionId | number | Yes | No | Description ID of the permission. |
# ShortcutInfo<sup>(deprecated)<sup>
# shortcutInfo
The **ShortcutInfo** module provides shortcut information defined in the configuration file. For details about the configuration in the FA model, see [config.json](../../quick-start/package-structure.md). For details about the configuration in the stage model, see [Internal Structure of the shortcuts Attribute](../../quick-start/stage-structure.md#internal-structure-of-the-shortcuts-attribute).
The **shortcutInfo** module defines shortcut information configured in the configuration file. For the FA model, the shortcut information is configured in the [config.json](../../quick-start/application-configuration-file-overview-fa.md) file. For the stage model, the information is configured in the configuration file under **resources/base/profile** in the development view.
> **NOTE**
>
> This module is deprecated since API version 9. You are advised to use [ShortcutInfo](js-apis-bundleManager-shortcutInfo.md) instead.
>
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## ShortcutWant<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [ShortcutWant](js-apis-bundleManager-shortcutInfo.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-ShortcutWant](js-apis-bundleManager-shortcutInfo.md) instead.
**System capability**: SystemCapability.BundleManager.BundleFramework
......@@ -23,7 +21,7 @@ The **ShortcutInfo** module provides shortcut information defined in the configu
## ShortcutInfo<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [ShortcutInfo](js-apis-bundleManager-shortcutInfo.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-ShortcutInfo](js-apis-bundleManager-shortcutInfo.md) instead.
**System capability**: SystemCapability.BundleManager.BundleFramework
......@@ -35,10 +33,12 @@ The **ShortcutInfo** module provides shortcut information defined in the configu
| hostAbility | string | Yes | No | Local ability information of the shortcut. |
| icon | string | Yes | No | Icon of the shortcut. |
| iconId<sup>8+</sup> | number | Yes | No | Icon ID of the shortcut. |
| label | string | Yes | No | Label of the shortcut. |
| labelId<sup>8+</sup> | number | Yes | No | Label ID of the shortcut. |
| label | string | Yes | No | Name of the shortcut. |
| labelId<sup>8+</sup> | number | Yes | No | Name ID of the shortcut. |
| disableMessage | string | Yes | No | Message displayed when the shortcut is disabled. |
| wants | Array&lt;[ShortcutWant](#shortcutwant)&gt; | Yes | No | Want information required for the shortcut. |
| wants | Array&lt;[ShortcutWant](#shortcutwant)&gt; | Yes | No | Want list for the shortcut. |
| isStatic | boolean | Yes | No | Whether the shortcut is static. |
| isHomeShortcut | boolean | Yes | No | Whether the shortcut is a home shortcut.|
| isEnabled | boolean | Yes | No | Whether the shortcut is enabled. |
<!--no_check-->
\ No newline at end of file
......@@ -8,7 +8,7 @@ The **RemoteAbilityInfo** module provides information about a remote ability.
## RemoteAbilityInfo<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md) instead.
> This API is deprecated since API version 9. You are advised to use [bundleManager-RemoteAbilityInfo](js-apis-bundleManager-remoteAbilityInfo.md) instead.
**System capability**: SystemCapability.BundleManager.DistributedBundleFramework
......@@ -16,6 +16,6 @@ The **RemoteAbilityInfo** module provides information about a remote ability.
| Name | Type | Readable| Writable| Description |
| ----------- | -------------------------------------------- | ---- | ---- | ----------------------- |
| elementName | [ElementName](js-apis-bundle-ElementName.md) | Yes | No | Element name of the ability. |
| label | string | Yes | No | Label of the ability. |
| elementName | [ElementName](js-apis-bundle-ElementName.md) | Yes | No | Element name information of the ability. |
| label | string | Yes | No | Ability name. |
| icon | string | Yes | No | Icon of the ability.|
# ElementName
The **ElementName** module provides information about an element name. The information can be obtained through [Context.getElementName](js-apis-Context.md).
The **ElementName** module provides element name information, which can be obtained through [Context.getElementName](js-apis-inner-app-context.md).
> **NOTE**
......
# ShortcutInfo
The **ShortcutInfo** module provides shortcut information defined in the configuration file. For details about the configuration in the FA model, see [config.json](../../quick-start/package-structure.md). For details about the configuration in the stage model, see [Internal Structure of the shortcuts Attribute](../../quick-start/stage-structure.md#internal-structure-of-the-shortcuts-attribute).
The **ShortcutInfo** module defines shortcut information configured in the configuration file. The information can be obtained through [getShortcutInfo](js-apis-launcherBundleManager.md#launcherbundlemanagergetshortcutinfo9).
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> For the FA model, the shortcut information is configured in the [config.json](../../quick-start/module-structure.md) file. For details about the shortcut information in the stage model, see [shortcuts](../../quick-start/module-configuration-file.md#shortcuts).
## ShortcutWant
......@@ -16,7 +18,7 @@ The **ShortcutInfo** module provides shortcut information defined in the configu
| ------------------------- | ------ | ---- | ---- | -------------------- |
| targetBundle | string | Yes | No | Target bundle name of the shortcut.|
| targetModule | string | Yes | No | Target module name of the shortcut. |
| targetAbility | string | Yes | No | Target ability name of the shortcut.|
| targetAbility | string | Yes | No | Target ability name of the shortcut.|
## ShortcutInfo
......@@ -35,3 +37,5 @@ The **ShortcutInfo** module provides shortcut information defined in the configu
| label | string | Yes | No | Label of the shortcut. |
| labelId | number | Yes | No | Label ID of the shortcut. |
| wants | Array\<[ShortcutWant](#shortcutwant)> | Yes | No | Want information required for the shortcut. |
<!--no_check-->
\ No newline at end of file
# bundleManager
# @ohos.bundle.bundleManager
The **bundleManager** module provides APIs for querying information about bundles, applications, abilities, Extension abilities, and more.
......@@ -96,10 +96,10 @@ Enumerates the types of Extension abilities.
| Name| Value| Description|
|:----------------:|:---:|-----|
| FORM | 0 | [FormExtensionAbility](../../ability/stage-formextension.md): provides APIs for widget development.|
| FORM | 0 | [FormExtensionAbility](../../application-models/widget-development-stage.md): provides APIs for widget development.|
| WORK_SCHEDULER | 1 | [WorkSchedulerExtensionAbility](../../task-management/work-scheduler-dev-guide.md): enables applications to execute non-real-time tasks when the system is idle.|
| INPUT_METHOD | 2 | [InputMethodExtensionAbility](js-apis-inputmethod-extension-ability.md): provides APIs for developing input method applications.|
| SERVICE | 3 | [ServiceExtensionAbility](../../ability/stage-serviceextension.md): enables applications to run in the background and provide services.|
| SERVICE | 3 | [ServiceExtensionAbility](../../application-models/serviceextensionability.md): enables applications to run in the background and provide services.|
| ACCESSIBILITY | 4 | [AccessibilityExtensionAbility](js-apis-application-accessibilityExtensionAbility.md): provides accessibility for access to and operations on the UI.|
| DATA_SHARE | 5 | [DataShareExtensionAbility](../../database/database-datashare-guidelines.md): enables applications to read and write data.|
| FILE_SHARE | 6 | FileShareExtensionAbility: enables file sharing between applications. This ability is reserved.|
......@@ -2181,8 +2181,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified abilityName is not existed. |
| 17700002 | The specified moduleName does not exist. |
| 17700003 | The specified abilityName does not exist. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. |
| 17700029 | The specified ability is disabled. |
......@@ -2236,8 +2236,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified abilityName is not existed. |
| 17700002 | The specified moduleName does not exist. |
| 17700003 | The specified abilityName does not exist. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. |
| 17700029 | The specified ability is disabled. |
......@@ -2299,7 +2299,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName is not existed. |
| 17700002 | The specified moduleName does not exist. |
| 17700003 | The specified extensionAbilityName not existed. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. |
......@@ -2353,7 +2353,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName is not existed. |
| 17700002 | The specified moduleName does not exist. |
| 17700003 | The specified extensionAbilityName not existed. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. |
......@@ -2903,3 +2903,5 @@ try {
console.error('getBundleInfoSync failed:' + err.message);
}
```
<!--no_check-->
\ No newline at end of file
# Bundle.bundleMonitor
# @ohos.bundle.bundleMonitor
The **Bundle.bundleMonitor** module provides APIs for listens for bundle installation, uninstall, and updates.
......@@ -18,7 +18,7 @@ import bundleMonitor from '@ohos.bundle.bundleMonitor';
| ------------------------------------ | ----------- | ------------------------------ |
| ohos.permission.LISTEN_BUNDLE_CHANGE | system_core | Permission to listen for bundle installation, uninstall, and updates.|
For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels).
For details, see [Permission Levels](../../security/accesstoken-overview.md).
## BundleChangeInfo
......@@ -50,10 +50,6 @@ Subscribes to bundle installation, uninstall, and update events.
| BundleChangedEvent | string | Yes | Type of the event to subscribe to.|
| Callback\<BundleChangedInfo> | callback | Yes | Callback used for the subscription.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
**Example**
```ts
......@@ -87,10 +83,6 @@ Unsubscribes from bundle installation, uninstall, and update events.
| BundleChangedEvent | string | Yes | Type of the event to unsubscribe from. |
| Callback\<BundleChangedInfo> | callback | Yes | Callback used for the unsubscription. If this parameter is left empty, all callbacks of the current event are unsubscribed from.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
**Example**
```ts
......
# DefaultAppManager
# @ohos.bundle.defaultAppManager (Default Application Management)
The **DefaultAppManager** module provides APIs to query whether the current application is the default application of a specific type.
......@@ -18,25 +18,25 @@ import defaultAppMgr from '@ohos.bundle.defaultAppManager';
| --------------------------------------- | ----------- | ---------------- |
| ohos.permission.GET_DEFAULT_APPLICATION | system_core | Permission related to the default application.|
For details, see in [Permission Levels](../../security/accesstoken-overview.md#permission-levels).
For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels).
## defaultAppMgr.ApplicationType
Enumerates the application types.
Enumerates the default application types.
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
| Name | Type | Value | Description |
| -------- | -------- | -------------------------------------- | -------------------------------------- |
| BROWSER | string | Web Browser | Default browser. |
| IMAGE | string | Image Gallery | Default image viewer. |
| AUDIO | string | Audio Player | Default audio player. |
| VIDEO | string | Video Player | Default video player. |
| PDF | string | PDF Viewer | Default PDF reader. |
| WORD | string | Word Viewer | Default Word viewer. |
| EXCEL | string | Excel Viewer | Default Excel viewer. |
| PPT | string | PPT Viewer | Default PowerPoint viewer. |
| Name | Value| Description |
| -------- | -------------------------------------- | -------------------------------------- |
| BROWSER | "Web Browser" | Default browser. |
| IMAGE | "Image Gallery" | Default image viewer. |
| AUDIO | "Audio Player" | Default audio player. |
| VIDEO | "Video Player" | Default video player. |
| PDF | "PDF Viewer" | Default PDF reader. |
| WORD | "Word Viewer" | Default Word viewer. |
| EXCEL | "Excel Viewer" | Default Excel viewer. |
| PPT | "PPT Viewer" | Default PowerPoint viewer. |
## defaultAppMgr.isDefaultApplication
......@@ -58,10 +58,6 @@ Checks whether this application is the default application of a system-defined a
| ------------------------- | ------------------ |
| Promise\<boolean> | Promise used to return the result. If the application is the default application, `true` is returned; otherwise, `false` is returned.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
**Example**
......@@ -90,13 +86,9 @@ Checks whether this application is the default application of a system-defined a
| type | string | Yes | Type of the target application. It must be set to a value defined by [ApplicationType](#defaultappmgrapplicationtype). |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return the result. If the application is the default application, `true` is returned; otherwise, `false` is returned.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
**Example**
```js
```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, (err, data) => {
if (err) {
......@@ -144,7 +136,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example**
```js
```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER)
.then((data) => {
......@@ -195,7 +187,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example**
```js
```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
let userId = 100;
defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId, (err, data) => {
......@@ -246,7 +238,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example**
```js
```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, (err, data) => {
if (err) {
......@@ -302,7 +294,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example**
```js
```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
bundleName: "com.test.app",
......@@ -369,7 +361,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example**
```js
```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
let userId = 100;
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, {
......@@ -486,7 +478,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example**
```js
```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
let userId = 100;
defaultAppMgr.resetDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId)
......@@ -537,7 +529,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
**Example**
```js
```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager';
let userId = 100;
defaultAppMgr.resetDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId, (err, data) => {
......
# distributedBundle
# @ohos.bundle.distributedBundle
The **distributedBundle** module provides APIs for managing distributed bundles.
......
# Bundle.freeInstall
# @ohos.bundle.freeInstall
The **Bundle.freeInstall** module provides APIs for setting and obtaining installation-free information and APIs for obtaining **BundlePackInfo** and **DispatchInfo**.
......
# BundleInstaller
# @ohos.bundle.installer
The **BundleInstaller** module provides APIs for you to install, uninstall, and recover bundles on devices.
The **bundle.installer** module provides APIs for you to install, uninstall, and recover bundles on devices.
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
......
# Bundle.launcherBundleManager
# @ohos.bundle.launcherBundleManager
The **Bundle.launcherBundleManager** module providers APIs for the **Home Screen** application to obtain the launcher ability information and shortcut information.
The **bundle.launcherBundleManager** module providers APIs for the **Home Screen** application to obtain the launcher ability information and shortcut information.
> **NOTE**
>
......@@ -27,7 +27,7 @@ Obtains the launcher ability information based on the given bundle name and user
**Parameters**
| Name | Type | Mandatory| Description |
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the application.|
| userId | number | Yes | User ID.|
......@@ -78,7 +78,7 @@ Obtains the launcher ability information based on the given bundle name and user
**Parameters**
| Name | Type | Mandatory| Description |
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the application.|
| userId | number | Yes | User ID.|
......@@ -128,7 +128,7 @@ Obtains the launcher ability information of all applications based on the given
**Parameters**
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------- |
| userId | number | Yes | User ID.|
......@@ -176,7 +176,7 @@ Obtains the launcher ability information of all applications based on the given
**Parameters**
| Name| Type | Mandatory| Description |
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------- |
| userId | number | Yes | User ID.|
......@@ -222,7 +222,7 @@ Obtains the shortcut information of the current user based on the given bundle n
**System capability**: SystemCapability.BundleManager.BundleFramework.Launcher
| Name | Type | Mandatory| Description |
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the application.|
......@@ -269,13 +269,13 @@ Obtains the shortcut information of the current user based on the given bundle n
**System capability**: SystemCapability.BundleManager.BundleFramework.Launcher
| Name | Type | Mandatory| Description |
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the application.|
**Return value**
| Template | Description |
| Type | Description |
| ---------------------- | ----------------------------------------------- |
| Promise\<Array<[ShortcutInfo](js-apis-bundleManager-shortcutInfo.md)>> | Promise used to return the **ShortcutInfo** object obtained.|
......
# Application Management
# @system.package (Bundle Management)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **Note:**
> **NOTE**
>
> - The APIs of this module are no longer maintained since API version 7. It is recommended that you use [`@ohos.bundle`](js-apis-Bundle.md) instead.
> - This module is deprecated since API version 9. You are advised to use [@ohos.bundle.bundleManager](js-apis-bundleManager.md) instead.
>
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......@@ -12,11 +12,12 @@
```
import pkg from '@system.package';
import package from '@system.package';
```
## package.hasInstalled
## package.hasInstalled<sup>(deprecated)</sup>
> This API is deprecated since API version 9. You are advised to use [@ohos.bundle.bundleManager](js-apis-bundleManager.md) instead.
hasInstalled(Object): void
......@@ -26,35 +27,57 @@ Checks whether an application exists, or whether a native application has been i
**System capability**: SystemCapability.BundleManager.BundleFramework
**Parameter**
**Parameters**
| Name | Type | Mandatory | Description |
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes | Application&nbsp;bundle&nbsp;name |
| success | Function | No | Called&nbsp;when&nbsp;the&nbsp;check&nbsp;result&nbsp;is&nbsp;obtained |
| fail | Function | No | Called&nbsp;when&nbsp;the&nbsp;check&nbsp;result&nbsp;fails&nbsp;to&nbsp;be&nbsp;obtained |
| complete | Function | No | Called&nbsp;when&nbsp;the&nbsp;execution&nbsp;is&nbsp;complete |
|options | [CheckPackageHasInstalledOptions](#checkpackagehasinstalledoptions) | Yes| Options.|
The following value will be returned when the check result is obtained.
**Return value**
| Name | Type | Description |
| Name| Type| Description|
| -------- | -------- | -------- |
| result | boolean | Whether&nbsp;the&nbsp;application&nbsp;exists,&nbsp;or&nbsp;whether&nbsp;the&nbsp;native&nbsp;application&nbsp;has&nbsp;been&nbsp;installed |
| result | boolean | The value **true** means that the application exists or the native application has been installed, and **false** means the opposite.|
**Example**
```
export default {
hasInstalled() {
pkg.hasInstalled({
bundleName: 'com.example.bundlename',
success: function(data) {
console.log('package has installed: ' + data);
},
fail: function(data, code) {
console.log('query package fail, code: ' + code + ', data: ' + data);
},
});
``` ts
export default {
hasInstalled() {
package.hasInstalled({
bundleName: 'com.example.bundlename',
success: function(data) {
console.log('package has installed: ' + data);
},
fail: function(data, code) {
console.log('query package fail, code: ' + code + ', data: ' + data);
},
});
},
}
```
\ No newline at end of file
```
## CheckPackageHasInstalledResponse
> This API is deprecated since API version 9.
Checks whether a bundle has been installed.
**System capability**: SystemCapability.BundleManager.BundleFramework
| Name| Type| Description|
| --- | --- | ---- |
| result | boolean | The value **true** means that the bundle has been installed, and **false** means the opposite.|
## CheckPackageHasInstalledOptions
> This API is deprecated since API version 9.
Defines the options used for checking whether a bundle has been installed.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.|
| success | Function | No| Called when API call is successful.|
| fail | Function | No| Called when API call has failed.|
| complete | Function | No| Called when API call is complete.|
# zlib
# @ohos.zlib
The **zlib** module provides APIs for file compression and decompression.
......@@ -25,7 +25,7 @@ Zips a file. This API uses a promise to return the result.
| Name | Type | Mandatory| Description |
| ------- | ------------------- | ---- | ------------------------------------------------------------ |
| inFile | string | Yes | Path of the folder or file to zip. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
| inFile | string | Yes | Path of the folder or file to zip. For details about the path, see [FA Model](js-apis-inner-app-context.md) or [Stage Model](js-apis-application-context.md).|
| outFile | string | Yes | Path of the zipped file. The file name extension is .zip. |
| options | [Options](#options) | Yes | Optional parameters for the zip operation. |
......@@ -89,7 +89,7 @@ Unzips a file. This API uses a promise to return the result.
| Name | Type | Mandatory| Description |
| ------- | ------------------- | ---- | ------------------------------------------------------------ |
| inFile | string | Yes | Path of the folder or file to unzip. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
| inFile | string | Yes | Path of the folder or file to unzip. For details about the path, see [FA Model](js-apis-inner-app-context.md) or [Stage Model](js-apis-application-context.md).|
| outFile | string | Yes | Path of the unzipped file. |
| options | [Options](#options) | Yes | Optional parameters for the unzip operation. |
......@@ -131,7 +131,7 @@ Compresses a file. This API uses an asynchronous callback to return the result.
| Name | Type | Mandatory| Description |
| ----------------------- | ------------------- | ---- | ------------------------------------------------------------ |
| inFile | string | Yes | Path of the folder or file to compress. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
| inFile | string | Yes | Path of the folder or file to compress. For details about the path, see [FA Model](js-apis-inner-app-context.md) or [Stage Model](js-apis-application-context.md).|
| outFile | string | Yes | Path of the compressed file. |
| options | [Options](#options) | Yes | Compression parameters. |
| 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. |
......@@ -179,7 +179,7 @@ Compresses a file. This API uses a promise to return the result.
| Name | Type | Mandatory| Description |
| ------- | ------------------- | ---- | ------------------------------------------------------------ |
| inFile | string | Yes | Path of the folder or file to compress. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
| inFile | string | Yes | Path of the folder or file to compress. For details about the path, see [FA Model](js-apis-inner-app-context.md) or [Stage Model](js-apis-application-context.md).|
| outFile | string | Yes | Path of the compressed file. |
| options | [Options](#options) | Yes | Compression parameters. |
......@@ -229,7 +229,7 @@ Decompresses a file. This API uses an asynchronous callback to return the result
| Name | Type | Mandatory| Description |
| ----------------------- | ------------------- | ---- | ------------------------------------------------------------ |
| inFile | string | Yes | Path of the file to decompress. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
| inFile | string | Yes | Path of the file to decompress. For details about the path, see [FA Model](js-apis-inner-app-context.md) or [Stage Model](js-apis-application-context.md).|
| outFile | string | Yes | Path of the decompressed file. |
| options | [Options](#options) | Yes | Decompression parameters. |
| 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. |
......@@ -278,7 +278,7 @@ Decompress a file. This API uses a promise to return the result.
| Name | Type | Mandatory| Description |
| ------- | ------------------- | ---- | ------------------------------------------------------------ |
| inFile | string | Yes | Path of the file to decompress. For details about the path, see [FA Model](js-apis-Context.md) or [Stage Model](js-apis-application-context.md).|
| inFile | string | Yes | Path of the file to decompress. For details about the path, see [FA Model](js-apis-inner-app-context.md) or [Stage Model](js-apis-application-context.md).|
| outFile | string | Yes | Path of the decompressed file. |
| options | [Options](#options) | Yes | Decompression parameters. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册