提交 b5caf80b 编写于 作者: G Gloria

Update docs against 13938

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 72b2d7eb
......@@ -45,7 +45,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. |
| 17700005 | The specified app ID is empty string. |
**Example**
......@@ -91,7 +91,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. |
| 17700005 | The specified app ID is empty string. |
**Example**
......@@ -142,7 +142,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. |
| 17700005 | The specified app ID is empty string. |
**Example**
......@@ -186,7 +186,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. |
| 17700005 | The specified app ID is empty string. |
**Example**
......@@ -236,7 +236,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. |
| 17700005 | The specified app ID is empty string. |
**Example**
......@@ -280,7 +280,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700005 | The specified app ID is not found. |
| 17700005 | The specified app ID is empty string. |
**Example**
......
......@@ -147,7 +147,7 @@ Enumerates the launch types of the ability.
| Name| Value| Description|
|:----------------:|:---:|:---:|
| 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.|
### AbilityType
......@@ -2236,8 +2236,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName does not exist. |
| 17700003 | The specified abilityName does not exist. |
| 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified abilityName is not existed. |
| 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. |
......@@ -2292,8 +2292,8 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName does not exist. |
| 17700003 | The specified abilityName does not exist. |
| 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified abilityName is not existed. |
| 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. |
......@@ -2357,7 +2357,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName does not exist. |
| 17700002 | The specified moduleName is not existed. |
| 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. |
......@@ -2412,7 +2412,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName does not exist. |
| 17700002 | The specified moduleName is not existed. |
| 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. |
......@@ -2655,119 +2655,6 @@ 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 = 'MainAbility';
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 = 'MainAbility';
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
getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: number) : [ApplicationInfo](js-apis-bundleManager-applicationInfo.md);
......
......@@ -116,8 +116,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| 17700015 | Failed to install the HAPs because they have different configuration information. |
| 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. |
| 17700101 | The system service is excepted. |
| 17700103 | I/O operation is failed. |
| 17700018 | Failed to install because the dependent module does not exist. |
**Example**
......
......@@ -19,11 +19,11 @@ import package from '@system.package';
## 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
hasInstalled(options: CheckPackageHasInstalledOptions): void
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
......@@ -65,9 +65,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.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
|result | boolean | Yes| The value **true** means that the bundle has been installed, and **false** means the opposite.|
## CheckPackageHasInstalledOptions
......@@ -75,6 +75,8 @@ Checks 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|
| -------- | -------- | -------- | -------- |
| bundleName | string | Yes| Bundle name.|
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册