提交 be35d02d 编写于 作者: G Gloria

Update docs against 16775+17339+17236+17064+17164+16765+17330

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 148438ff
......@@ -3,14 +3,13 @@
The **BundleStatusCallback** module provides callbacks for bundle status changes. The changes can be obtained through [innerBundleManager.on](js-apis-Bundle-InnerBundleManager.md).
> **NOTE**
>
>
> 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.
## BundleStatusCallback<sup>(deprecated)<sup>
> This API is deprecated since API version 9. You are advised to use [bundleMonitor](js-apis-bundleMonitor.md) instead.
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**System capability**: SystemCapability.BundleManager.BundleFramework
......
......@@ -34,7 +34,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -62,7 +62,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -94,7 +94,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -121,7 +121,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -153,7 +153,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -179,7 +179,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -210,7 +210,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -236,7 +236,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -267,7 +267,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -293,7 +293,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......
......@@ -42,7 +42,7 @@ SystemCapability.BundleManager.DistributedBundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -71,7 +71,7 @@ SystemCapability.BundleManager.DistributedBundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -103,7 +103,7 @@ SystemCapability.BundleManager.DistributedBundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -132,7 +132,7 @@ SystemCapability.BundleManager.DistributedBundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......
......@@ -426,7 +426,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Return value**
......@@ -462,7 +462,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -499,7 +499,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -540,7 +540,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -584,7 +584,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -626,7 +626,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -671,7 +671,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -699,7 +699,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -754,7 +754,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......@@ -794,7 +794,7 @@ SystemCapability.BundleManager.BundleFramework
**System API**
This is a system API and cannot be called by third-party applications.
This is a system API.
**Parameters**
......
......@@ -24,7 +24,7 @@ Sets the disposed status for an application. This API uses a promise to return t
**System capability**: SystemCapability.BundleManager.BundleFramework.AppControl
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -75,7 +75,7 @@ Sets the disposed status for an application. This API uses an asynchronous callb
**System capability**: SystemCapability.BundleManager.BundleFramework.AppControl
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -122,7 +122,7 @@ Obtains the disposed status of an application. This API uses a promise to return
**System capability**: SystemCapability.BundleManager.BundleFramework.AppControl
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -171,7 +171,7 @@ Obtains the disposed status of an application. This API uses an asynchronous cal
**System capability**: SystemCapability.BundleManager.BundleFramework.AppControl
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -216,7 +216,7 @@ Deletes the disposed status for an application. This API uses a promise to retur
**System capability**: SystemCapability.BundleManager.BundleFramework.AppControl
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -265,7 +265,7 @@ Deletes the disposed status for an application. This API uses an asynchronous ca
**System capability**: SystemCapability.BundleManager.BundleFramework.AppControl
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......
......@@ -3,7 +3,7 @@
The **BundleInstaller** 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 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## BundleInstaller.install<sup>(deprecated)<sup>
......@@ -22,7 +22,7 @@ ohos.permission.INSTALL_BUNDLE
SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -72,7 +72,7 @@ ohos.permission.INSTALL_BUNDLE
SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -121,7 +121,7 @@ ohos.permission.INSTALL_BUNDLE
SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -162,7 +162,7 @@ Describes the parameters required for bundle installation, recovery, or uninstal
**System capability**: SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Readable| Writable| Description |
| ----------- | ------- | ---- | ---- | ------------------ |
......@@ -176,12 +176,12 @@ Describes the bundle installation or uninstall status.
**System capability**: SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Readable| Writable| Description |
| ------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------ |
| status | bundle.[InstallErrorCode](js-apis-Bundle.md#installerrorcode) | Yes | No | Installation or uninstall error code. The value must be defined in [InstallErrorCode](js-apis-Bundle.md#installerrorcode)|
| statusMessage | string | Yes | No | Installation or uninstall status message. <br>**SUCCESS**: install_succeed<br>**STATUS_INSTALL_FAILURE**: Installation failed (no installation file exists).<br>**STATUS_INSTALL_FAILURE_ABORTED**: Installation aborted.<br>**STATUS_INSTALL_FAILURE_INVALID**: Invalid installation parameter.<br>**STATUS_INSTALL_FAILURE_CONFLICT**: Installation conflict. (The basic information of the application to update is inconsistent with that of the existing application.)<br>**STATUS_INSTALL_FAILURE_STORAGE**: Failed to store the bundle information.<br>**STATUS_INSTALL_FAILURE_INCOMPATIBLE**: Installation incompatibility. (A downgrade occurs or the signature information is incorrect.)<br>**STATUS_UNINSTALL_FAILURE**: Uninstallation failed. (The application to be uninstalled is not found.)<br>**STATUS_UNINSTALL_FAILURE_ABORTED**: Uninstallation aborted. (This error code is not in use.)<br>**STATUS_UNINSTALL_FAILURE_ABORTED**: Uninstallation conflict. (Failed to uninstall a system application or end the application process.)<br>**STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT**: Installation failed. (Download timed out.)<br>**STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED**: Installation failed. (Download failed.)<br>**STATUS_RECOVER_FAILURE_INVALID**: Failed to restore the pre-installed application.<br>**STATUS_ABILITY_NOT_FOUND**: Ability not found.<br>**STATUS_BMS_SERVICE_ERROR**: BMS service error.<br>**STATUS_FAILED_NO_SPACE_LEFT**: Insufficient device space.<br>**STATUS_GRANT_REQUEST_PERMISSIONS_FAILED**: Application authorization failed.<br>**STATUS_INSTALL_PERMISSION_DENIED**: No installation permission.<br>**STATUS_UNINSTALL_PERMISSION_DENIED**: No uninstallation permission. |
| statusMessage | string | Yes | No | Installation or uninstall status message. <br>**SUCCESS**: install_succeed<br>**STATUS_INSTALL_FAILURE**: Installation failed (no installation file exists).<br>**STATUS_INSTALL_FAILURE_ABORTED**: Installation aborted.<br>**STATUS_INSTALL_FAILURE_INVALID**: Invalid installation parameter.<br>**STATUS_INSTALL_FAILURE_CONFLICT**: Installation conflict. (The basic information of the application to update is inconsistent with that of the existing application.)<br>**STATUS_INSTALL_FAILURE_STORAGE**: Failed to store the bundle information.<br>**STATUS_INSTALL_FAILURE_INCOMPATIBLE**: Installation incompatibility. (A downgrade occurs or the signature information is incorrect.)<br>**STATUS_UNINSTALL_FAILURE**: Uninstallation failed. (The application to be uninstalled is not found.)<br>**STATUS_UNINSTALL_FAILURE_ABORTED**: Uninstallation aborted. (This error code is not in use.)<br>**STATUS_UNINSTALL_FAILURE_ABORTED**: Uninstallation conflict. (Failed to uninstall a system application or end the application process.)<br>**STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT**: Installation failed. (Download timed out.)<br>**STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED**: Installation failed. (Download failed.)<br>**STATUS_RECOVER_FAILURE_INVALID**: Failed to restore the pre-installed application.<br>**STATUS_ABILITY_NOT_FOUND**: Ability not found.<br>**STATUS_BMS_SERVICE_ERROR**: BMS service error.<br>**STATUS_FAILED_NO_SPACE_LEFT**: Insufficient device space.<br>**STATUS_GRANT_REQUEST_PERMISSIONS_FAILED**: Application authorization failed.<br>**STATUS_INSTALL_PERMISSION_DENIED**: No installation permission.<br>**STATUS_UNINSTALL_PERMISSION_DENIED**: No uninstallation permission.|
## 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 stage model, the sandbox path can be obtained using the attribute in [Context](js-apis-inner-application-uiAbilityContext.md#abilitycontext). The following describes how to obtain the sandbox path.
......
......@@ -3,7 +3,7 @@
The **LauncherAbilityInfo** module provides information about the launcher ability, which is obtained through [innerBundleManager.getLauncherAbilityInfos](js-apis-Bundle-InnerBundleManager.md).
> **NOTE**
>
>
> 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.
## LauncherAbilityInfo<sup>(deprecated)<sup>
......@@ -12,7 +12,7 @@ The **LauncherAbilityInfo** module provides information about the launcher abili
**System capability**: SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Readable| Writable| Description |
| --------------- | ---------------------------------------------------- | ---- | ---- | -------------------------------------- |
......
......@@ -12,11 +12,11 @@ The **PermissionDef** module provides permission details defined in the configur
**System capability**: SystemCapability.BundleManager.BundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Readable| Writable| Description |
| -------------- | ------ | ---- | ---- | -------------- |
| permissionName | string | Yes | No | Name 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 | ID of the permission label. |
| descriptionId | number | Yes | No | ID of the permission description. |
| labelId | number | Yes | No | ID of the permission label. |
| descriptionId | number | Yes | No | ID of the permission description. |
......@@ -12,11 +12,10 @@ The **RemoteAbilityInfo** module provides information about a remote ability.
**System capability**: SystemCapability.BundleManager.DistributedBundleFramework
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Readable| Writable| Description |
| ----------- | -------------------------------------------- | ---- | ---- | ----------------------- |
| 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.|
......@@ -10,7 +10,7 @@ The **LauncherAbilityInfo** module defines the ability information of the home s
**System capability**: SystemCapability.BundleManager.BundleFramework.Launcher
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Type | Readable| Writable| Description |
| --------------- | ----------------------------------------------------------- | ---- | ---- | ------------------------------------ |
......
......@@ -98,12 +98,12 @@ Enumerates the types of Extension abilities.
| Name| Value| Description|
|:----------------:|:---:|-----|
| FORM | 0 | [FormExtensionAbility](../../application-models/widget-development-stage.md): provides APIs for widget development.|
| FORM | 0 | [FormExtensionAbility](../../application-models/service-widget-overview.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](../../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.|
| DATA_SHARE | 5 | [DataShareExtensionAbility](../../database/share-data-by-datashareextensionability.md): enables applications to read and write data.|
| FILE_SHARE | 6 | FileShareExtensionAbility: enables file sharing between applications. This ability is reserved.|
| STATIC_SUBSCRIBER| 7 | [StaticSubscriberExtensionAbility](js-apis-application-staticSubscriberExtensionAbility.md): provides APIs for processing static events, such as the startup event.|
| WALLPAPER | 8 | WallpaperExtensionAbility: provides APIs to implement the home screen wallpaper. This ability is reserved.|
......@@ -113,6 +113,7 @@ Enumerates the types of Extension abilities.
| THUMBNAIL | 13 | ThumbnailExtensionAbility: provides thumbnails for files. This ability is reserved.|
| PREVIEW | 14 | PreviewExtensionAbility: provides APIs for file preview so that other applications can be embedded and displayed in the current application. This ability is reserved.|
| PRINT<sup>10+</sup> | 15 | PrintExtensionAbility: provides APIs for printing images. Printing documents is not supported yet.|
| DRIVER<sup>10+</sup> | 18 | DriverExtensionAbility: provides APIs for the peripheral driver. This type of ability is not supported yet.|
| UNSPECIFIED | 255 | No type is specified. It is used together with **queryExtensionAbilityInfo** to query all types of Extension abilities.|
......@@ -187,7 +188,7 @@ Enumerates the display orientations of the ability. This attribute applies only
| AUTO_ROTATION_PORTRAIT_RESTRICTED |11|Switched-determined auto rotation in the vertical direction.|
| LOCKED |12|Locked.|
### CompatiblePolicy
### CompatiblePolicy<sup>10+</sup>
Defines the version compatibility type of the shared library.
......@@ -3069,3 +3070,167 @@ try {
hilog.error(0x0000, 'testTag', 'getAllSharedBundleInfo failed. Cause: %{public}s', err.message);
}
```
### bundleManager.getAppProvisionInfo<sup>10+</sup>
getAppProvisionInfo(bundleName: string, callback: AsyncCallback\<[AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)\>): void;
Obtains the provision configuration file information based on the given bundle 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
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Bundle name.|
| callback | AsyncCallback\<[AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)\> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is the provision configuration file information obtained.|
**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. |
**Example**
```ts
import bundleManager from '@ohos.bundle.bundleManager';
import hilog from '@ohos.hilog';
let bundleName = "com.ohos.myapplication";
try {
bundleManager.getAppProvisionInfo(bundleName, (err, data) => {
if (err) {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed: %{public}s', err.message);
} else {
hilog.info(0x0000, 'testTag', 'getAppProvisionInfo successfully: %{public}s', JSON.stringify(data));
}
});
} catch (err) {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed: %{public}s', err.message);
}
```
### bundleManager.getAppProvisionInfo<sup>10+</sup>
getAppProvisionInfo(bundleName: string, userId: number, callback: AsyncCallback\<[AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)\>): void;
Obtains the provision configuration file information based on the given bundle name and user ID. 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
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes | Bundle name.|
| userId | number | Yes| User ID, which can be obtained by calling [getOsAccountLocalId](js-apis-osAccount.md#getosaccountlocalid9).|
| callback | AsyncCallback\<[AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)\> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **null** and **data** is the provision configuration file information obtained.|
**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. |
| 17700004 | The specified user ID is not found. |
**Example**
```ts
import bundleManager from '@ohos.bundle.bundleManager';
import hilog from '@ohos.hilog';
let bundleName = "com.ohos.myapplication";
let userId = 100;
try {
bundleManager.getAppProvisionInfo(bundleName, userId, (err, data) => {
if (err) {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed: %{public}s', err.message);
} else {
hilog.info(0x0000, 'testTag', 'getAppProvisionInfo successfully: %{public}s', JSON.stringify(data));
}
});
} catch (err) {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed: %{public}s', err.message);
}
```
### bundleManager.getAppProvisionInfo<sup>10+</sup>
getAppProvisionInfo(bundleName: string, userId?: number): Promise\<[AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)\>;
Obtains the provision configuration file information based on the given bundle name and user ID. This API uses a promise to return the result.
**System API**: This is a system API.
**Required permissions**: ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| bundleName | string | Yes| Bundle name.|
| userId | number | No| User ID, which can be obtained by calling [getOsAccountLocalId](js-apis-osAccount.md#getosaccountlocalid9).|
**Return value**
| Type | Description |
| ------------------------------------------------------------ | ----------------------------------- |
| Promise\<[AppProvisionInfo](js-apis-bundleManager-AppProvisionInfo.md)\> | Promise used to return the provision configuration file obtained.|
**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. |
| 17700004 | The specified user ID is not found. |
**Example**
```ts
import bundleManager from '@ohos.bundle.bundleManager';
import hilog from '@ohos.hilog';
let bundleName = "com.ohos.myapplication";
let userId = 100;
try {
bundleManager.getAppProvisionInfo(bundleName).then((data) => {
hilog.info(0x0000, 'testTag', 'getAppProvisionInfo successfully. Data: %{public}s', JSON.stringify(data));
}).catch(err => {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed. Cause: %{public}s', err.message);
});
} catch (err) {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed. Cause: %{public}s', err.message);
}
try {
bundleManager.getAppProvisionInfo(bundleName, userId).then((data) => {
hilog.info(0x0000, 'testTag', 'getAppProvisionInfo successfully. Data: %{public}s', JSON.stringify(data));
}).catch(err => {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed. Cause: %{public}s', err.message);
});
} catch (err) {
hilog.error(0x0000, 'testTag', 'getAppProvisionInfo failed. Cause: %{public}s', err.message);
}
```
<!--no_check-->
\ No newline at end of file
......@@ -24,7 +24,7 @@ For details, see [Permission Levels](../../security/accesstoken-overview.md).
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
| Name | Template | Readable| Writable| Description |
| ---------- | ------ | ---- | ---- | -------------------------- |
......@@ -39,7 +39,7 @@ Subscribes to bundle installation, uninstall, and update events.
**Required permissions**: ohos.permission.LISTEN_BUNDLE_CHANGE
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
......@@ -72,7 +72,7 @@ Unsubscribes from bundle installation, uninstall, and update events.
**Required permissions**: ohos.permission.LISTEN_BUNDLE_CHANGE
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**System capability**: SystemCapability.BundleManager.BundleFramework.Core
......
......@@ -109,7 +109,7 @@ Obtains the default application based on a system-defined application type or a
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -165,7 +165,7 @@ Obtains the default application of a user based on a system-defined application
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -217,7 +217,7 @@ Obtains the default application based on a system-defined application type or a
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -266,7 +266,7 @@ Sets the default application based on a system-defined application type or a fil
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -338,7 +338,7 @@ Sets the default application for a user based on a system-defined application ty
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -399,7 +399,7 @@ Sets the default application based on a system-defined application type or a fil
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -458,7 +458,7 @@ Resets the default application based on a system-defined application type or a f
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -508,7 +508,7 @@ Resets the default application for a user based on a system-defined application
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......@@ -559,7 +559,7 @@ Resets the default application based on a system-defined application type or a f
**System capability**: SystemCapability.BundleManager.BundleFramework.DefaultApp
**System API**: This is a system API and cannot be called by third-party applications.
**System API**: This is a system API.
**Parameters**
......
......@@ -29,7 +29,7 @@ Obtains the launcher ability information based on the given bundle name and user
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the application.|
| bundleName | string | Yes | Bundle name.|
| userId | number | Yes | User ID.|
**Return value**
......@@ -45,7 +45,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
| 17700001 | The specified bundle name is not found. |
| 17700004 | The specified userId is not found. |
| 17700004 | The specified user ID is not found. |
**Example**
......@@ -55,12 +55,13 @@ import launcherBundleManager from '@ohos.bundle.launcherBundleManager';
try {
launcherBundleManager.getLauncherAbilityInfo('com.example.demo', 100, (errData, data) => {
if (errData !== null) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
} else {
console.log("data is " + JSON.stringify(data));
}
console.log("data is " + JSON.stringify(data));
})
} catch (errData) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
}
```
......@@ -80,7 +81,7 @@ Obtains the launcher ability information based on the given bundle name and user
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the application.|
| bundleName | string | Yes | Bundle name.|
| userId | number | Yes | User ID.|
**Return value**
......@@ -96,7 +97,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
| 17700001 | The specified bundle name is not found. |
| 17700004 | The specified userId is not found. |
| 17700004 | The specified user ID is not found. |
**Example**
......@@ -107,10 +108,10 @@ try {
launcherBundleManager.getLauncherAbilityInfo("com.example.demo", 100).then(data => {
console.log("data is " + JSON.stringify(data));
}).catch (errData => {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
})
} catch (errData) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
}
```
......@@ -144,7 +145,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
| 17700004 | The specified userId is not found. |
| 17700004 | The specified user ID is not found. |
Example
......@@ -154,12 +155,13 @@ import launcherBundleManager from '@ohos.bundle.launcherBundleManager';
try {
launcherBundleManager.getAllLauncherAbilityInfo(100, (errData, data) => {
if (errData !== null) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
} else {
console.log("data is " + JSON.stringify(data));
}
console.log("data is " + JSON.stringify(data));
});
} catch (errData) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
}
```
## launcherBundlemanager.getAllLauncherAbilityInfo<sup>9+</sup>
......@@ -192,7 +194,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| -------- | ---------------------------------------- |
| 17700004 | The specified userId is not found. |
| 17700004 | The specified user ID is not found. |
**Example**
......@@ -203,10 +205,10 @@ try {
launcherBundleManager.getAllLauncherAbilityInfo(100).then(data => {
console.log("data is " + JSON.stringify(data));
}).catch (errData => {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
});
} catch (errData) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
}
```
......@@ -224,7 +226,7 @@ Obtains the shortcut information of the current user based on the given bundle n
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the application.|
| bundleName | string | Yes | Bundle name.|
**Return value**
......@@ -248,12 +250,13 @@ import launcherBundleManager from '@ohos.bundle.launcherBundleManager';
try {
launcherBundleManager.getShortcutInfo("com.example.demo", (errData, data) => {
if (errData !== null) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
} else {
console.log("data is " + JSON.stringify(data));
}
console.log("data is " + JSON.stringify(data));
});
} catch (errData) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
}
```
......@@ -271,7 +274,7 @@ Obtains the shortcut information of the current user based on the given bundle n
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | -------------- |
| bundleName | string | Yes | Bundle name of the application.|
| bundleName | string | Yes | Bundle name.|
**Return value**
......@@ -296,9 +299,9 @@ try {
launcherBundleManager.getShortcutInfo("com.example.demo").then(data => {
console.log("data is " + JSON.stringify(data));
}).catch (errData => {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
});
} catch (errData) {
console.log(`errData is errCode:${errData.code} message:${errData.message}`);
console.error(`errData is errCode:${errData.code} message:${errData.message}`);
}
```
......@@ -239,7 +239,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700002 | The specified module name is not found. |
| 17700032 | he specified bundle does not contain any overlay module. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
**Example**
......@@ -415,7 +415,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
......@@ -462,7 +462,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
......@@ -511,7 +511,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700032 | The specified bundle does not contain any overlay module. |
| 17700033 | The specified module is not an overlay module. |
......@@ -557,7 +557,7 @@ Obtains the information about modules with the overlay feature in another applic
| Type | Description |
| ------------------------- | ------------------ |
| Promise\<Array\<OverlayModuleInfo>> | Promise used to return the array of overlay module information obtained.|
| Promise\<Array\<OverlayModuleInfo>> | Promise used to return the result, which is an array of **OverlayModuleInfo** objects.|
**Error codes**
......@@ -565,7 +565,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
| 17700035 | The specified bundle is an overlay bundle. |
......@@ -612,7 +612,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
| 17700035 | The specified bundle is an overlay bundle. |
......@@ -661,7 +661,7 @@ For details about the error codes, see [Bundle Error Codes](../errorcodes/errorc
| ID| Error Message |
| ------ | -------------------------------------- |
| 17700001 | The specified bundleName is not found |
| 17700001 | The specified bundleName is not found. |
| 17700002 | The specified module name is not found. |
| 17700034 | The specified module is an overlay module. |
| 17700035 | The specified bundle is an overlay bundle. |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册