From 804e0294abe6cb77c522fb0507b0bc1f3331372c Mon Sep 17 00:00:00 2001 From: Gloria Date: Thu, 8 Jun 2023 20:31:02 +0800 Subject: [PATCH] Update docs against 18999+18884+19100+18734+18918+19113 Signed-off-by: wusongqing --- ...plication-component-configuration-stage.md | 2 +- .../serviceextensionability.md | 2 +- .../windowextensionability.md | 6 +- .../apis/js-apis-app-ability-uiAbility.md | 8 +- .../js-apis-bundleManager-applicationInfo.md | 7 +- .../reference/apis/js-apis-installer.md | 97 ++++++++++++++++++- 6 files changed, 108 insertions(+), 14 deletions(-) diff --git a/en/application-dev/application-models/application-component-configuration-stage.md b/en/application-dev/application-models/application-component-configuration-stage.md index b50d40b4a6..db1f4b9f82 100644 --- a/en/application-dev/application-models/application-component-configuration-stage.md +++ b/en/application-dev/application-models/application-component-configuration-stage.md @@ -6,7 +6,7 @@ Icons and labels are usually configured together. There is the application icon, The application icon and label are used in **Settings**. For example, they are displayed in the application list in **Settings**. The entry icon is displayed on the device's home screen after the application is installed. The entry icon maps to a [UIAbility](uiability-overview.md) component. Therefore, an application can have multiple entry icons and entry labels. When you touch one of them, the corresponding UIAbility page is displayed. -**Figure 1** Icons and labels +**Figure 1** Icons and labels ![application-component-configuration-stage](figures/application-component-configuration-stage.png) diff --git a/en/application-dev/application-models/serviceextensionability.md b/en/application-dev/application-models/serviceextensionability.md index 3f9e96cf03..37f5d31a34 100644 --- a/en/application-dev/application-models/serviceextensionability.md +++ b/en/application-dev/application-models/serviceextensionability.md @@ -401,7 +401,7 @@ When ServiceExtensionAbility is used to provide sensitive services, the client i console.info(TAG, 'getBundleNameByUid: ' + callerBundleName); // Identify the bundle name of the client. if (callerBundleName != 'com.example.connectextapp') { // The verification fails. - console.info(TAG, 'The caller bundle is not in whitelist, reject'); + console.info(TAG, 'The caller bundle is not in trustlist, reject'); return; } // The verification is successful, and service logic is executed normally. diff --git a/en/application-dev/application-models/windowextensionability.md b/en/application-dev/application-models/windowextensionability.md index 3c1d364cd5..bf593acef9 100644 --- a/en/application-dev/application-models/windowextensionability.md +++ b/en/application-dev/application-models/windowextensionability.md @@ -1,4 +1,4 @@ -# WindowExtensionAbility +# WindowExtensionAbility (for System Applications Only) [WindowExtensionAbility](../reference/apis/js-apis-application-windowExtensionAbility.md) is a type of ExtensionAbility component that allows a system application to be embedded in and displayed over another application. @@ -15,7 +15,7 @@ the context is [WindowExtensionContext](../reference/apis/js-apis-inner-applicat > -## Setting an Embedded UIAbility (for System Applications Only) +## Setting an Embedded UIAbility The **WindowExtensionAbility** class provides **onConnect()**, **onDisconnect()**, and **onWindowReady()** lifecycle callbacks, which can be overridden. @@ -79,7 +79,7 @@ To implement an embedded application, manually create a WindowExtensionAbility i ``` -## Starting an Embedded UIAbility (for System Applications Only) +## Starting an Embedded UIAbility System applications can load the created WindowExtensionAbility through the AbilityComponent. diff --git a/en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md b/en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md index 0e8d9ef45d..cfd08c64b6 100644 --- a/en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md +++ b/en/application-dev/reference/apis/js-apis-app-ability-uiAbility.md @@ -315,7 +315,7 @@ class MyUIAbility extends UIAbility { onShare(wantParam:{ [key: string]: Object }): void; -Called when an ability shares data. +Called when this UIAbility sets data to share. **ohos.extra.param.key.contentTitle** indicates the title of the content to share in the sharing box, and **ohos.extra.param.key.shareAbstract** provides an abstract description of the content, **ohos.extra.param.key.shareUrl** indicates the online address of the service. You need to set these three items as objects, with the key set to **title**, **abstract**, and **url**, respectively. **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore @@ -332,9 +332,9 @@ import AbilityConstant from '@ohos.app.ability.AbilityConstant'; class MyUIAbility extends UIAbility { onShare(wantParams) { console.log('onShare'); - wantParams['ohos.extra.param.key.contentTitle'] = {title: "W3"}; - wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for huawei employee"}; - wantParams['ohos.extra.param.key.shareUrl'] = {url: "w3.huawei.com"}; + wantParams['ohos.extra.param.key.contentTitle'] = {title: "OA"}; + wantParams['ohos.extra.param.key.shareAbstract'] = {abstract: "communication for company employee"}; + wantParams['ohos.extra.param.key.shareUrl'] = {url: "oa.example.com"}; } } ``` diff --git a/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md b/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md index ac9aa9841e..ec3b9fa9e3 100644 --- a/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundleManager-applicationInfo.md @@ -9,7 +9,6 @@ The **ApplicationInfo** module defines the application information. A system app ## ApplicationInfo **System capability**: SystemCapability.BundleManager.BundleFramework.Core - | Name | Type | Readable| Writable| Description | | -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ | | name | string | Yes | No | Application name. | @@ -27,9 +26,9 @@ The **ApplicationInfo** module defines the application information. A system app | removable | boolean | Yes | No | Whether the application is removable. | | accessTokenId | number | Yes | No | Access token ID of the application. | | uid | number | Yes | No | UID of the application. | -| iconResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details. | -| labelResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details. | -| descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts) to obtain the resource details.| +| iconResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application icon. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details. | +| labelResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application label. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details. | +| descriptionResource | [Resource](js-apis-resource-manager.md#resource9) | Yes| No| Resource information of the application description. The resource information obtained contains the bundle name, module name, and ID of the resource. You can call **getMediaContent** in [@ohos.resourceManager.d.ts](js-apis-resource-manager.md#getmediacontent9) to obtain the resource details.| | appDistributionType | string | Yes | No | Distribution type of the application signing certificate. The options are **app_gallery**, **enterprise**, **os_integration**, and **crowdtesting**. | | appProvisionType | string | Yes | No | Type of the application signing certificate file. The options are **debug** and **release**. | | systemApp | boolean | Yes | No | Whether the application is a system application. | diff --git a/en/application-dev/reference/apis/js-apis-installer.md b/en/application-dev/reference/apis/js-apis-installer.md index 146996b853..a10b567a9c 100644 --- a/en/application-dev/reference/apis/js-apis-installer.md +++ b/en/application-dev/reference/apis/js-apis-installer.md @@ -17,6 +17,7 @@ import installer from '@ohos.bundle.installer'; | Permission | Permission Level | Description | | ------------------------------ | ----------- | ---------------- | | ohos.permission.INSTALL_BUNDLE | system_core | Permission to install or uninstall bundles.| +| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | Permission to query information about all bundles.| For details, see [Permission Levels](../../security/accesstoken-overview.md#permission-levels). @@ -747,6 +748,98 @@ try { console.error('getBundleInstaller failed. Cause: ' + error.message); } ``` + +## BundleInstaller.getSpecifiedDistributionType10+ +getSpecifiedDistributionType(bundleName: string): string; + +Obtains the distribution type of a bundle in synchronous mode. The return value is the **specifiedDistributionType** field value in **InstallParam** passed when **install** is called. + +**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.| + +**Return value** + +| Type | Description | +| ------------- | -------------------------------------- | +| string | Distribution type of the bundle.| + +**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 installer from '@ohos.bundle.installer'; +let bundleName = "com.example.myapplication"; + +try { + let type = installer.getSpecifiedDistributionType(bundleName); + console.info('getSpecifiedDistributionType successfully, type:' + type); +} catch (error) { + console.error('getSpecifiedDistributionType failed. Cause: ' + error.message); +} +``` + + +## BundleInstaller.getAdditionalInfo10+ + +getAdditionalInfo(bundleName: string): string; + +Obtains additional information about a bundle in synchronous mode. The return value is the **additionalInfo** field value in **InstallParam** passed when **install** is called. + +**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.| + +**Return value** + +| Type | Description | +| ------------- | -------------------------------------- | +| string | Additional information about the bundle.| + +**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 installer from '@ohos.bundle.installer'; +let bundleName = "com.example.myapplication"; + +try { + let info = installer.getAdditionalInfo(bundleName); + console.info('getAdditionalInfo successfully, additionInfo:' + info); +} catch (error) { + console.error('getAdditionalInfo failed. Cause: ' + error.message); +} +``` + ## HashParam Defines the hash parameters for bundle installation and uninstall. @@ -774,8 +867,10 @@ Defines the parameters that need to be specified for bundle installation, uninst | installFlag | number | No | Installation flag. The value **0** means initial installation and **1** means overwrite installation. The default value is **0**.| | isKeepData | boolean | No | Whether to retain the data directory during bundle uninstall. The default value is **false**.| | hashParams | Array<[HashParam](#hashparam)> | No| Hash parameters. By default, no value is passed. | -| crowdtestDeadline| number | No |End date of crowdtesting. The default value is **-1**.| +| crowdtestDeadline| number | No | End date of crowdtesting. The default value is **-1**, indicating that no end date is specified for crowdtesting.| | sharedBundleDirPaths10+ | Array\ | No|Paths of the shared bundle files. By default, no value is passed.| +| specifiedDistributionType10+ | string | No|Distribution type specified during application installation. By default, no value is passed. The maximum length is 128 bytes. This field is usually specified by the application market of the operating system operator.| +| additionalInfo10+ | string | No|Additional information during application installation (usually an enterprise application). By default, no value is passed. The maximum length is 3,000 bytes. This field is usually specified by the application market of the operating system operator.| ## UninstallParam10+ -- GitLab