未验证 提交 a5799ca6 编写于 作者: O openharmony_ci 提交者: Gitee

!7868 翻译完成:6577 包管理缺陷扫描修改

Merge pull request !7868 from wusongqing/TR6577
...@@ -40,7 +40,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -40,7 +40,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | --------------------------------------- | | ----------- | ------ | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
...@@ -84,7 +84,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -84,7 +84,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------------------- | ---- | --------------------------------------- | | ----------- | ------------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| 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 default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. | | callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. |
...@@ -123,7 +123,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -123,7 +123,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------------------------------- | ---- | --------------------------------------- | | ----------- | ------------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. | | callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. |
...@@ -275,7 +275,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -275,7 +275,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------------- | ---- | --------------------------------------- | | ----------- | ------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| options | [BundleOptions](#bundleoptions) | No | Includes **userId**. | | options | [BundleOptions](#bundleoptions) | No | Includes **userId**. |
...@@ -321,7 +321,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -321,7 +321,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------- | ---- | --------------------------------------- | | ----------- | -------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. | | callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. |
...@@ -358,7 +358,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -358,7 +358,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | -------------------------- | ---- | --------------------------------------- | | ----------- | -------------------------- | ---- | --------------------------------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.|
| options | [BundleOptions](#bundleoptions) | Yes | Includes **userId**. | | options | [BundleOptions](#bundleoptions) | Yes | Includes **userId**. |
| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. | | callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. |
...@@ -579,7 +579,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -579,7 +579,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- | | ----------- | ------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| abilityName | string | Yes | Ability name.| | abilityName | string | Yes | Ability name.|
**Return value** **Return value**
...@@ -619,7 +619,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -619,7 +619,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------------ | ---- | ---------------- | | ----------- | ------------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| abilityName | string | Yes | Ability name.| | abilityName | string | Yes | Ability name.|
| callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | Callback used to return the ability information.| | callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | Callback used to return the ability information.|
...@@ -655,7 +655,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -655,7 +655,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ---------------- | | ----------- | ------ | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| abilityName | string | Yes | Ability name.| | abilityName | string | Yes | Ability name.|
**Return value** **Return value**
...@@ -695,7 +695,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -695,7 +695,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------- | ---- | ---------------- | | ----------- | ---------------------- | ---- | ---------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| abilityName | string | Yes | Ability name.| | abilityName | string | Yes | Ability name.|
| callback | AsyncCallback\<string> | Yes | Callback used to return the application name. | | callback | AsyncCallback\<string> | Yes | Callback used to return the application name. |
...@@ -797,7 +797,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -797,7 +797,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------ | | ---------- | ------ | ---- | ------------ |
| bundleName | string | Yes | Bundle name of the application.| | bundleName | string | Yes | Bundle name of an application.|
**Return value** **Return value**
...@@ -831,7 +831,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -831,7 +831,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ----------------------- | ---- | --------------- | | ---------- | ----------------------- | ---- | --------------- |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| callback | AsyncCallback\<boolean> | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.| | callback | AsyncCallback\<boolean> | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.|
**Example** **Example**
...@@ -912,7 +912,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -912,7 +912,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------------- | ---- | ------------------------------------- | | ----------- | ---------------------------------- | ---- | ------------------------------------- |
| want | [Want](js-apis-application-Want.md)| Yes | Want that contains the bundle name. | | want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| 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 default value is the user ID of the caller. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Yes | Callback used to return the ability information. | | callback | AsyncCallback<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Yes | Callback used to return the ability information. |
...@@ -953,7 +953,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -953,7 +953,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ----------- | ---------------------------------- | ---- | ------------------------------------- | | ----------- | ---------------------------------- | ---- | ------------------------------------- |
| want | [Want](js-apis-application-Want.md)| Yes | Want that contains the bundle name. | | want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. |
| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.|
| callback | AsyncCallback<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Yes | Callback used to return the ability information. | | callback | AsyncCallback<Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)>> | Yes | Callback used to return the ability information. |
...@@ -994,7 +994,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -994,7 +994,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | ------ | ---- | ------------ | | ---------- | ------ | ---- | ------------ |
| bundleName | string | Yes | Bundle name of the application.| | bundleName | string | Yes | Bundle name of an application.|
**Return value** **Return value**
| Type | Description | | Type | Description |
...@@ -1031,7 +1031,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1031,7 +1031,7 @@ SystemCapability.BundleManager.BundleFramework
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ---------- | -------------------- | ---- | ------------------------------ | | ---------- | -------------------- | ---- | ------------------------------ |
| bundleName | string | Yes | Bundle name of the application. | | bundleName | string | Yes | Bundle name of an application. |
| callback | AsyncCallback\<[Want](js-apis-application-Want.md)> | Yes | Callback used to return the **Want** object.| | callback | AsyncCallback\<[Want](js-apis-application-Want.md)> | Yes | Callback used to return the **Want** object.|
**Example** **Example**
...@@ -1116,7 +1116,7 @@ bundle.getNameForUid(uid, (err, data) => { ...@@ -1116,7 +1116,7 @@ bundle.getNameForUid(uid, (err, data) => {
getAbilityIcon(bundleName: string, abilityName: string): Promise\<image.PixelMap>; getAbilityIcon(bundleName: string, abilityName: string): Promise\<image.PixelMap>;
Obtains the [PixelMap](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result. Obtains the [pixel map](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result.
**Required permissions** **Required permissions**
...@@ -1136,7 +1136,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1136,7 +1136,7 @@ SystemCapability.BundleManager.BundleFramework
**Return value** **Return value**
| Type | Description | | Type | Description |
| --------------------- | ------------------------------------------------------------ | | --------------------- | ------------------------------------------------------------ |
| Promise\<image.PixelMap> | Promise used to return the [PixelMap](js-apis-image.md).| | Promise\<image.PixelMap> | Promise used to return the [pixel map](js-apis-image.md).|
**Example** **Example**
...@@ -1155,7 +1155,7 @@ bundle.getAbilityIcon(bundleName, abilityName) ...@@ -1155,7 +1155,7 @@ bundle.getAbilityIcon(bundleName, abilityName)
getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\<image.PixelMap>): void; getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\<image.PixelMap>): void;
Obtains the [PixelMap](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result. Obtains the [pixel map](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result.
**Required permissions** **Required permissions**
...@@ -1171,7 +1171,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -1171,7 +1171,7 @@ SystemCapability.BundleManager.BundleFramework
| ----------- | ---------------------------------------- | ---- | ---------------------------------------- | | ----------- | ---------------------------------------- | ---- | ---------------------------------------- |
| bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. | | bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. |
| abilityName | string | Yes | Ability name based on which the pixel map is to obtain. | | abilityName | string | Yes | Ability name based on which the pixel map is to obtain. |
| callback | AsyncCallback\<image.PixelMap> | Yes | Callback used to return the [PixelMap](js-apis-image.md).| | callback | AsyncCallback\<image.PixelMap> | Yes | Callback used to return the [pixel map](js-apis-image.md).|
**Example** **Example**
...@@ -1187,134 +1187,6 @@ bundle.getAbilityIcon(bundleName, abilityName, (err, data) => { ...@@ -1187,134 +1187,6 @@ bundle.getAbilityIcon(bundleName, abilityName, (err, data) => {
}) })
``` ```
## bundle.queryExtensionAbilityInfosByWant<sup>9+</sup>
queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise<Array\<ExtensionAbilityInfo>>
Obtains the Extension ability information based on a given want. This API uses a promise to return the result.
**Required permissions**
ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
**System capability**
SystemCapability.BundleManager.BundleFramework
**Parameters**
| Name | Type | Mandatory | Description |
| -------------- | ------ | ---- | ---------------------------------------- |
| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. |
| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0. |
| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. |
**Return value**
| Type | Description |
| ------------------------------------- | ------------------------------ |
| Promise<Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)>> | Promise used to return the Extension ability information.|
**Example**
```js
let extensionFlags = 0;
let userId = 100;
let want = {
bundleName : "com.example.myapplication",
abilityName : "com.example.myapplication.MainAbility"
};
bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, userId)
.then((data) => {
console.info('Operation successful. Data: ' + JSON.stringify(data));
}).catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
})
```
## bundle.queryExtensionAbilityInfosByWant<sup>9+</sup>
queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback<Array\<ExtensionAbilityInfo>>): void
Obtains the Extension ability information of the specified user based on a given want. This API uses an asynchronous callback to return the result.
**Required permissions**
ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
**System capability**
SystemCapability.BundleManager.BundleFramework
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. |
| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0. |
| 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. |
| callback | AsyncCallback<Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)>> | Yes | Callback used to return the Extension ability information. |
**Example**
```js
let extensionFlags = 0;
let userId = 100;
let want = {
bundleName : "com.example.myapplication",
abilityName : "com.example.myapplication.MainAbility"
};
bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, userId, (err, data) => {
if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err));
return;
}
console.info('Operation successful. Data:' + JSON.stringify(data));
})
```
## bundle.queryExtensionAbilityInfosByWant<sup>9+</sup>
queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback<Array\<ExtensionAbilityInfo>>): void;
Obtains the Extension ability information based on a given want. This API uses an asynchronous callback to return the result.
**Required permissions**
ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
**System capability**
SystemCapability.BundleManager.BundleFramework
**Parameters**
| Name | Type | Mandatory | Description |
| -------------- | ---------------------------------------- | ---- | ---------------------------------------- |
| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. |
| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0. |
| callback | AsyncCallback<Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)>> | Yes | Callback used to return the Extension ability information. |
**Example**
```js
let extensionFlags = 0;
let want = {
bundleName : "com.example.myapplication",
abilityName : "com.example.myapplication.MainAbility"
};
bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => {
if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err));
return;
}
console.info('Operation successful. Data:' + JSON.stringify(data));
})
```
## InstallErrorCode ## InstallErrorCode
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
......
# Metadata # Metadata
The **Metadata** module provides the metadata information.
> **NOTE** > **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. > 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.
> >
> API version 9 is a canary version for trial use. The APIs of this version may be unstable. > API version 9 is a canary version for trial use. The APIs of this version may be unstable.
Provides the metadata information.
## Metadata ## Metadata
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
......
...@@ -136,7 +136,7 @@ zlib.unzipFile(inFile, outFile, options).then((data) => { ...@@ -136,7 +136,7 @@ zlib.unzipFile(inFile, outFile, options).then((data) => {
| Name | Value | Description | | Name | Value | Description |
| ----------------- | ---- | -------------------------------- | | ----------------- | ---- | -------------------------------- |
| MEM_LEVEL_MIN | 1 | Minimum memory used by the **zip** API during compression.| | MEM_LEVEL_MIN | 1 | Minimum memory used by the **zip** API during compression.|
| MEM_LEVEL_MIN | 9 | Maximum memory used by the **zip** API during compression.| | MEM_LEVEL_MAX | 9 | Maximum memory used by the **zip** API during compression.|
| MEM_LEVEL_DEFAULT | 8 | Default memory used by the **zip** API during compression.| | MEM_LEVEL_DEFAULT | 8 | Default memory used by the **zip** API during compression.|
## zip.CompressLevel ## zip.CompressLevel
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册