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

!15050 翻译完成:13912 包管理资料整改

Merge pull request !15050 from wusongqing/TR13912
...@@ -45,7 +45,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -45,7 +45,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. | | 17700005 | The specified app ID is empty string. |
**Example** **Example**
...@@ -91,7 +91,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -91,7 +91,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. | | 17700005 | The specified app ID is empty string. |
**Example** **Example**
...@@ -142,7 +142,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -142,7 +142,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. | | 17700005 | The specified app ID is empty string. |
**Example** **Example**
...@@ -186,7 +186,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -186,7 +186,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. | | 17700005 | The specified app ID is empty string. |
**Example** **Example**
...@@ -236,7 +236,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -236,7 +236,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. | | 17700005 | The specified app ID is empty string. |
**Example** **Example**
...@@ -280,7 +280,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -280,7 +280,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. | | 17700005 | The specified app ID is empty string. |
**Example** **Example**
......
...@@ -147,7 +147,7 @@ Enumerates the launch types of the ability. ...@@ -147,7 +147,7 @@ Enumerates the launch types of the ability.
| Name| Value| Description| | Name| Value| Description|
|:----------------:|:---:|:---:| |:----------------:|:---:|:---:|
| SINGLETON | 0 | The ability can have only one instance.| | SINGLETON | 0 | The ability can have only one instance.|
| STANDARD | 1 | The ability can have multiple instances.| | MULTITON | 1 | The ability can have multiple instances.|
| SPECIFIED | 2 | The ability can have one or multiple instances, depending on the internal service of the ability.| | SPECIFIED | 2 | The ability can have one or multiple instances, depending on the internal service of the ability.|
### AbilityType ### AbilityType
...@@ -2236,8 +2236,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -2236,8 +2236,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| -------- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName does not exist. | | 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified abilityName does not exist. | | 17700003 | The specified abilityName is not existed. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. | | 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. | | 17700026 | The specified bundle is disabled. |
| 17700029 | The specified ability is disabled. | | 17700029 | The specified ability is disabled. |
...@@ -2292,8 +2292,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -2292,8 +2292,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| -------- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName does not exist. | | 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified abilityName does not exist. | | 17700003 | The specified abilityName is not existed. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. | | 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. | | 17700026 | The specified bundle is disabled. |
| 17700029 | The specified ability is disabled. | | 17700029 | The specified ability is disabled. |
...@@ -2357,7 +2357,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -2357,7 +2357,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| -------- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName does not exist. | | 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified extensionAbilityName not existed. | | 17700003 | The specified extensionAbilityName not existed. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. | | 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. | | 17700026 | The specified bundle is disabled. |
...@@ -2412,7 +2412,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -2412,7 +2412,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message | | ID| Error Message |
| -------- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName does not exist. | | 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified extensionAbilityName not existed. | | 17700003 | The specified extensionAbilityName not existed. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. | | 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. | | 17700026 | The specified bundle is disabled. |
...@@ -2655,122 +2655,11 @@ try { ...@@ -2655,122 +2655,11 @@ try {
} }
``` ```
### bundleManager.getAbilityIcon
getAbilityIcon(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)>): void;
Obtains the ability icon based on the given bundle name, module name, and ability name. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
**System capability**: SystemCapability.BundleManager.BundleFramework.Resource
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Bundle name. |
| moduleName | string | Yes | Module name. |
| abilityName | string | Yes | Ability name. |
| callback | AsyncCallback<[image.PixelMap](js-apis-image.md#pixelmap7)> | Yes | Callback used to return the result. If the operation is successful, **err** is **null** and **data** is the **PixelMap** object of the icon. Otherwise, **err** is an error object.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
| ID| Error Message |
| -------- | -------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified moduleName is not found. |
| 17700003 | The specified abilityName is not found. |
| 17700026 | The specified bundle is disabled. |
| 17700029 | The specified ability is disabled. |
**Example**
```ts
import bundleManager from '@ohos.bundle.bundleManager';
import hilog from '@ohos.hilog';
let bundleName = 'com.example.myapplication';
let moduleName = 'entry';
let abilityName = 'EntryAbility';
try {
bundleManager.getAbilityIcon(bundleName, moduleName, abilityName, (err, data) => {
if (err) {
hilog.error(0x0000, 'testTag', 'getAbilityIcon failed: %{public}s', err.message);
} else {
hilog.info(0x0000, 'testTag', 'getAbilityIcon successfully: %{public}s', JSON.stringify(data));
}
});
} catch (err) {
hilog.error(0x0000, 'testTag', 'getAbilityIcon failed: %{public}s', err.message);
}
```
### bundleManager.getAbilityIcon
getAbilityIcon(bundleName: string, moduleName: string, abilityName: string): Promise<[image.PixelMap](js-apis-image.md#pixelmap7)>;
Obtains the ability icon based on the given bundle name, module name, and ability name. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO
**System capability**: SystemCapability.BundleManager.BundleFramework.Resource
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ------ | ---- | ------------------------- |
| bundleName | string | Yes | Bundle name. |
| moduleName | string | Yes | Module name. |
| abilityName | string | Yes | Ability name.|
**Return value**
| Type | Description |
| ----------------------------------------------------- | ------------------------------------------- |
| Promise<[image.PixelMap](js-apis-image.md#pixelmap7)> | Promise used to return the **PixelMap** object of the icon.|
**Error codes**
For details about the error codes, see [Bundle Error Codes](../errorcodes/errorcode-bundle.md).
| ID| Error Message |
| -------- | -------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified moduleName is not found. |
| 17700003 | The specified abilityName is not found. |
| 17700026 | The specified bundle is disabled. |
| 17700029 | The specified ability is disabled. |
**Example**
```ts
import bundleManager from '@ohos.bundle.bundleManager';
import hilog from '@ohos.hilog';
let bundleName = 'com.example.myapplication';
let moduleName = 'entry';
let abilityName = 'EntryAbility';
try {
bundleManager.getAbilityIcon(bundleName, moduleName, abilityName).then((data) => {
hilog.info(0x0000, 'testTag', 'getAbilityIcon successfully. Data: %{public}s', JSON.stringify(data));
}).catch(err => {
hilog.error(0x0000, 'testTag', 'getAbilityIcon failed. Cause: %{public}s', err.message);
});
} catch (err) {
hilog.error(0x0000, 'testTag', 'getAbilityIcon failed. Cause: %{public}s', err.message);
}
```
### bundleManager.getApplicationInfoSync ### bundleManager.getApplicationInfoSync
getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number) : [ApplicationInfo](js-apis-bundleManager-applicationInfo.md); getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number) : [ApplicationInfo](js-apis-bundleManager-applicationInfo.md);
getApplicationInfoSync(bundleName: string, applicationFlags: number) : [ApplicationInfo](js-apis-bundleManager-applicationInfo.md);
Synchronously obtains the application information based on the given bundle name, application flags, and user ID. Synchronously obtains the application information based on the given bundle name, application flags, and user ID.
...@@ -2786,7 +2675,7 @@ Synchronously obtains the application information based on the given bundle name ...@@ -2786,7 +2675,7 @@ Synchronously obtains the application information based on the given bundle name
| ----------- | ------ | ---- | ----------------------------------------------------------| | ----------- | ------ | ---- | ----------------------------------------------------------|
| bundleName | string | Yes | Bundle name. | | bundleName | string | Yes | Bundle name. |
| applicationFlags | [number](#applicationflag) | Yes | Type of the application information to obtain. | | applicationFlags | [number](#applicationflag) | Yes | Type of the application information to obtain. |
| userId | number | No | User ID. | | userId | number | Yes | User ID. |
**Return value** **Return value**
...@@ -2838,6 +2727,7 @@ try { ...@@ -2838,6 +2727,7 @@ try {
### bundleManager.getBundleInfoSync ### bundleManager.getBundleInfoSync
getBundleInfoSync(bundleName: string, bundleFlags: [number](#bundleflag), userId: number): [BundleInfo](js-apis-bundleManager-bundleInfo.md); getBundleInfoSync(bundleName: string, bundleFlags: [number](#bundleflag), userId: number): [BundleInfo](js-apis-bundleManager-bundleInfo.md);
getBundleInfoSync(bundleName: string, bundleFlags: [number](#bundleflag)): [BundleInfo](js-apis-bundleManager-bundleInfo.md);
Synchronously obtains the bundle information based on the given bundle name, bundle flags, and user ID. Synchronously obtains the bundle information based on the given bundle name, bundle flags, and user ID.
......
...@@ -116,8 +116,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc ...@@ -116,8 +116,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700015 | Failed to install the HAPs because they have different configuration information. | | 17700015 | Failed to install the HAPs because they have different configuration information. |
| 17700016 | Failed to install the HAP because of insufficient system disk space. | | 17700016 | Failed to install the HAP because of insufficient system disk space. |
| 17700017 | Failed to install the HAP since the version of the HAP to install is too early. | | 17700017 | Failed to install the HAP since the version of the HAP to install is too early. |
| 17700101 | The system service is excepted. | | 17700018 | Failed to install because the dependent module does not exist. |
| 17700103 | I/O operation is failed. | | 17700031 | Failed to install the HAP because the overlay check of the HAP is failed. |
**Example** **Example**
......
...@@ -19,11 +19,11 @@ import package from '@system.package'; ...@@ -19,11 +19,11 @@ import package from '@system.package';
## package.hasInstalled<sup>(deprecated)</sup> ## 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. > This API is deprecated since API version 9. You are advised to use [@ohos.bundle.bundleManager](js-apis-bundleManager.md) instead.
hasInstalled(Object): void hasInstalled(options: CheckPackageHasInstalledOptions): void
Checks whether an application exists, or whether a native application has been installed. Checks whether an application exists, or whether a native application has been installed.
**Required permissions**: ohos.permission.GET_BUNDLE_INFO **Required permissions**: none
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
...@@ -65,9 +65,9 @@ Checks whether a bundle has been installed. ...@@ -65,9 +65,9 @@ Checks whether a bundle has been installed.
**System capability**: SystemCapability.BundleManager.BundleFramework **System capability**: SystemCapability.BundleManager.BundleFramework
| Name| Type| Description| | Name| Type| Mandatory| Description|
| --- | --- | ---- | | -------- | -------- | -------- | -------- |
| result | boolean | The value **true** means that the bundle has been installed, and **false** means the opposite.| |result | boolean | Yes| The value **true** means that the bundle has been installed, and **false** means the opposite.|
## CheckPackageHasInstalledOptions ## CheckPackageHasInstalledOptions
...@@ -75,6 +75,8 @@ Checks whether a bundle has been installed. ...@@ -75,6 +75,8 @@ Checks whether a bundle has been installed.
Defines the options used for checking whether a bundle has been installed. Defines the options used for checking whether a bundle has been installed.
**System capability**: SystemCapability.BundleManager.BundleFramework
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.| | bundleName | string | Yes| Bundle name.|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册