提交 a573a80e 编写于 作者: L lanyi 提交者: Gitee

Merge branch 'master' of gitee.com:openharmony/docs into local_imagedata

Signed-off-by: Nlanyi <lanyi3@huawei.com>
...@@ -460,62 +460,64 @@ zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md @RaySh ...@@ -460,62 +460,64 @@ zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md @RaySh
zh-cn/application-dev/reference/apis/js-apis-service-extension-context.md @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingzhen zh-cn/application-dev/reference/apis/js-apis-service-extension-context.md @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingzhen zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingzhen
zh-cn/application-dev/reference/errorcodes/errcode-ability.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-ability.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-access-token.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-access-token.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-accessibility.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-accessibility.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-account.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-account.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-animator.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-animator.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-app-account.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-app-account.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-audio.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-audio.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-avsession.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-avsession.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-backgroundTaskMgr.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-backgroundTaskMgr.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-batteryStatistics.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-batteryStatistics.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-brightness.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-brightness.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-buffer.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-buffer.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-bundle.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-bundle.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-colorspace-manager.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-colorspace-manager.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-CommonEventService.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-CommonEventService.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-containers.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-containers.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-data-rdb.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-data-rdb.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-datashare.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-datashare.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-device-manager.md @qinxiaowang zh-cn/application-dev/reference/errorcodes/errorcode-device-manager.md @qinxiaowang
zh-cn/application-dev/reference/errorcodes/errcode-DeviceUsageStatistics.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-DeviceUsageStatistics.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-display.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-display.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-distributed-dataObject.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-distributed-dataObject.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-distributedKVStore.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-distributedKVStore.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-DistributedNotificationService.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-DistributedNotificationService.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-DistributedSchedule.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-DistributedSchedule.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-enterpriseDeviceManager.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-enterpriseDeviceManager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-faultlogger.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-faultlogger.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-filemanagement.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-filemanagement.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-geoLocationManager.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-geoLocationManager.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-hiappevent.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-hiappevent.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-hisysevent.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-hisysevent.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-hiviewdfx-hidebug.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-hiviewdfx-hidebug.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-huks.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-huks.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-i18n.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-i18n.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-inputmethod-framework.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-inputmethod-framework.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-multimodalinput.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-multimodalinput.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-nfc.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-nfc.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-pasteboard.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-pasteboard.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-power.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-power.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-preferences.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-preferences.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-promptAction.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-promptAction.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-reminderAgentManager.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-reminderAgentManager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-request.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-request.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-resource-manager.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-resource-manager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-router.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-router.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-rpc.md @qinxiaowang zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md @qinxiaowang
zh-cn/application-dev/reference/errorcodes/errcode-runninglock.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-runninglock.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-sensor.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-sensor.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-system-parameterV9.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-system-parameterV9.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-thermal.md @zengyawen zh-cn/application-dev/reference/errorcodes/errorcode-thermal.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-uitest.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-uitest.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-universal.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-universal.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-update.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-update.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-usb.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-usb.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-vibrator.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-useriam.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-webview.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-vibrator.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-window.md @ge-yafang zh-cn/application-dev/reference/errorcodes/errorcode-webview.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-workScheduler.md @HelloCrease zh-cn/application-dev/reference/errorcodes/errorcode-window.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-zlib.md @RayShih zh-cn/application-dev/reference/errorcodes/errorcode-workScheduler.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-zlib.md @RayShih
zh-cn/release-notes/changelogs @majiajun518
\ No newline at end of file
...@@ -64,6 +64,14 @@ Creates a standard color space object. ...@@ -64,6 +64,14 @@ Creates a standard color space object.
| ------------------ | ------------------------ | | ------------------ | ------------------------ |
| [ColorSpaceManager](#colorspacemanager) | Color space object created. | | [ColorSpaceManager](#colorspacemanager) | Color space object created. |
**Error codes**
For details about the error codes, see [colorSpaceManager Error Codes](../errorcodes/errorcode-colorspace-manager.md).
| ID| Error Message|
| ------- | ----------------------- |
| 18600001 | Parameter value is abnormal. |
**Example** **Example**
```js ```js
...@@ -96,6 +104,14 @@ Creates a custom color space object. ...@@ -96,6 +104,14 @@ Creates a custom color space object.
| ------------------ | ------------------------ | | ------------------ | ------------------------ |
| [ColorSpaceManager](#colorspacemanager) | Color space object created.<br>The color space type is **CUSTOM** of [ColorSpace](#colorspace).| | [ColorSpaceManager](#colorspacemanager) | Color space object created.<br>The color space type is **CUSTOM** of [ColorSpace](#colorspace).|
**Error codes**
For details about the error codes, see [colorSpaceManager Error Codes](../errorcodes/errorcode-colorspace-manager.md).
| ID| Error Message|
| ------- | ----------------------- |
| 18600001 | Parameter value is abnormal. |
**Example** **Example**
```js ```js
...@@ -138,11 +154,19 @@ Obtains the color space type. ...@@ -138,11 +154,19 @@ Obtains the color space type.
| ------------------ | ------------------------ | | ------------------ | ------------------------ |
| [ColorSpace](#colorspace) | Color space type.| | [ColorSpace](#colorspace) | Color space type.|
**Error codes**
For details about the error codes, see [colorSpaceManager Error Codes](../errorcodes/errorcode-colorspace-manager.md).
| ID| Error Message|
| ------- | ----------------------- |
| 18600001 | Parameter value is abnormal. |
**Example** **Example**
```js ```js
try { try {
let csType = colorSpace.getColorSpaceName(); colorSpace.getColorSpaceName();
} catch (err) { } catch (err) {
console.log(`Fail to get colorSpace's name. Cause: ` + JSON.stringify(err)); console.log(`Fail to get colorSpace's name. Cause: ` + JSON.stringify(err));
} }
...@@ -162,11 +186,19 @@ Obtains the coordinates of the white point of the color space. ...@@ -162,11 +186,19 @@ Obtains the coordinates of the white point of the color space.
| ------------------ | ------------------------ | | ------------------ | ------------------------ |
| Array\<number\> | Coordinates [x, y] of the white point.| | Array\<number\> | Coordinates [x, y] of the white point.|
**Error codes**
For details about the error codes, see [colorSpaceManager Error Codes](../errorcodes/errorcode-colorspace-manager.md).
| ID| Error Message|
| ------- | ----------------------- |
| 18600001 | Parameter value is abnormal. |
**Example** **Example**
```js ```js
try { try {
let wp = colorSpace.getWhitePoint(); colorSpace.getWhitePoint();
} catch (err) { } catch (err) {
console.log(`Failed to get white point. Cause: ` + JSON.stringify(err)); console.log(`Failed to get white point. Cause: ` + JSON.stringify(err));
} }
...@@ -186,11 +218,19 @@ Obtains the gamma of the color space. ...@@ -186,11 +218,19 @@ Obtains the gamma of the color space.
| ------------------ | ------------------------ | | ------------------ | ------------------------ |
| number | Gamma of the color space.| | number | Gamma of the color space.|
**Error codes**
For details about the error codes, see [colorSpaceManager Error Codes](../errorcodes/errorcode-colorspace-manager.md).
| ID| Error Message|
| ------- | ----------------------- |
| 18600001 | Parameter value is abnormal. |
**Example** **Example**
```js ```js
try { try {
let gamma = colorSpace.getGamma(); colorSpace.getGamma();
} catch (err) { } catch (err) {
console.log(`Failed to get gamma. Cause: ` + JSON.stringify(err)); console.log(`Failed to get gamma. Cause: ` + JSON.stringify(err));
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
The **Configuration** module provides environment configuration information. The **Configuration** module provides environment configuration information.
> **NOTE** > **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. > 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.
## Modules to Import ## Modules to Import
...@@ -16,11 +16,11 @@ import Configuration from '@ohos.application.Configuration'; ...@@ -16,11 +16,11 @@ import Configuration from '@ohos.application.Configuration';
**System capability**: SystemCapability.Ability.AbilityBase **System capability**: SystemCapability.Ability.AbilityBase
| Name| Type| Readable| Writable| Description| | Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| language | string | Yes| Yes| Language of the application.| | language | string | Yes| Yes| Language of the application.|
| colorMode | [ColorMode](js-apis-configurationconstant.md) | Yes| Yes| Color mode, which can be **COLOR_MODE_LIGHT** or **COLOR_MODE_DARK**. The default value is **COLOR_MODE_LIGHT**.| | colorMode | [ColorMode](js-apis-configurationconstant.md) | Yes| Yes| Color mode, which can be **COLOR_MODE_LIGHT** or **COLOR_MODE_DARK**. The default value is **COLOR_MODE_LIGHT**.|
| direction<sup>9+</sup> | Direction | Yes| No| Screen orientation, which can be **DIRECTION_HORIZONTAL** or **DIRECTION_VERTICAL**.| | direction<sup>9+</sup> | Direction | Yes| No| Screen orientation, which can be **DIRECTION_HORIZONTAL** or **DIRECTION_VERTICAL**.|
| screenDensity<sup>9+</sup> | ScreenDensity | Yes| No| Screen resolution, which can be **SCREEN_DENSITY_SDPI** (120), **SCREEN_DENSITY_MDPI** (160), **SCREEN_DENSITY_LDPI** (240), **SCREEN_DENSITY_XLDPI** (320), **SCREEN_DENSITY_XXLDPI** (480), or **SCREEN_DENSITY_XXXLDPI** (640).| | screenDensity<sup>9+</sup> | ScreenDensity | Yes| No| Screen resolution, which can be **SCREEN_DENSITY_SDPI** (120), **SCREEN_DENSITY_MDPI** (160), **SCREEN_DENSITY_LDPI** (240), **SCREEN_DENSITY_XLDPI** (320), **SCREEN_DENSITY_XXLDPI** (480), or **SCREEN_DENSITY_XXXLDPI** (640).|
| displayId<sup>9+</sup> | number | Yes| No| ID of the display where the application is located.| | displayId<sup>9+</sup> | number | Yes| No| ID of the display where the application is located.|
| hasPointerDevice<sup>9+</sup> | boolean | Yes| No| Whether the pointer device is connected.| | hasPointerDevice<sup>9+</sup> | boolean | Yes| No| Whether a pointer device, such as a keyboard, mouse, or touchpad, is connected.|
...@@ -22,10 +22,10 @@ import data_storage from '@ohos.data.storage'; ...@@ -22,10 +22,10 @@ import data_storage from '@ohos.data.storage';
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core **System capability**: SystemCapability.DistributedDataManager.Preferences.Core
| Name | Type | Readable | Writable | Description | | Name | Type| Readable| Writable| Description |
| ---------------- | ------ | -------- | -------- | ----------------------------------------------------------- | | ---------------- | -------- | ---- | ---- | ------------------------------------- |
| MAX_KEY_LENGTH | string | Yes | No | Maximum length of a key. It must be less than 80 bytes. | | MAX_KEY_LENGTH | number | Yes | No | Maximum length of a key. It must be less than 80 bytes. |
| MAX_VALUE_LENGTH | string | Yes | No | Maximum length of a value. It must be less than 8192 bytes. | | MAX_VALUE_LENGTH | number | Yes | No | Maximum length of a value. It must be less than 8192 bytes.|
## data_storage.getStorageSync ## data_storage.getStorageSync
...@@ -53,8 +53,8 @@ Reads the specified file and loads its data to the **Storage** instance for data ...@@ -53,8 +53,8 @@ Reads the specified file and loads its data to the **Storage** instance for data
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -86,8 +86,8 @@ Reads the specified file and loads its data to the **Storage** instance for data ...@@ -86,8 +86,8 @@ Reads the specified file and loads its data to the **Storage** instance for data
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -129,8 +129,8 @@ Reads the specified file and loads its data to the **Storage** instance for data ...@@ -129,8 +129,8 @@ Reads the specified file and loads its data to the **Storage** instance for data
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -165,8 +165,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete ...@@ -165,8 +165,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -195,8 +195,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete ...@@ -195,8 +195,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -237,8 +237,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete ...@@ -237,8 +237,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -271,8 +271,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed ...@@ -271,8 +271,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -302,8 +302,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed ...@@ -302,8 +302,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -344,8 +344,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed ...@@ -344,8 +344,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed
```js ```js
import featureAbility from '@ohos.ability.featureAbility'; import featureAbility from '@ohos.ability.featureAbility';
var path; let path;
var context = featureAbility.getContext(); let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => { context.getFilesDir().then((filePath) => {
path = filePath; path = filePath;
console.info("======================>getFilesDirPromise====================>"); console.info("======================>getFilesDirPromise====================>");
...@@ -864,15 +864,15 @@ Subscribes to data changes. The **StorageObserver** needs to be implemented. Whe ...@@ -864,15 +864,15 @@ Subscribes to data changes. The **StorageObserver** needs to be implemented. Whe
**Parameters** **Parameters**
| Name | Type | Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ---------------------------------------- | | -------- | --------------------------------------------------- | ------ |---------------------------------------- |
| type | string | Event type. The value **change** indicates data change events.| | type | string |Yes| Event type. The value **change** indicates data change events.|
| callback | Callback&lt;[StorageObserver](#storageobserver)&gt; | Callback used to return data changes. | | callback | Callback&lt;[StorageObserver](#storageobserver)&gt; | Yes|Callback used to return data changes. |
**Example** **Example**
```js ```js
var observer = function (key) { let observer = function (key) {
console.info("The key of " + key + " changed."); console.info("The key of " + key + " changed.");
} }
storage.on('change', observer); storage.on('change', observer);
...@@ -891,15 +891,15 @@ Unsubscribes from data changes. ...@@ -891,15 +891,15 @@ Unsubscribes from data changes.
**Parameters** **Parameters**
| Name | Type | Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ---------------------------------------- | | -------- | --------------------------------------------------- | ------ |---------------------------------------- |
| type | string | Event type. The value **change** indicates data change events.| | type | string |Yes| Event type. The value **change** indicates data change events.|
| callback | Callback&lt;[StorageObserver](#storageobserver)&gt; | Callback used to return data changes. | | callback | Callback&lt;[StorageObserver](#storageobserver)&gt; | Yes|Callback used to return data changes. |
**Example** **Example**
```js ```js
var observer = function (key) { let observer = function (key) {
console.info("The key of " + key + " changed."); console.info("The key of " + key + " changed.");
} }
storage.off('change', observer); storage.off('change', observer);
......
# HUKS # HUKS
The **HUKS** module provides KeyStore (KS) capabilities for applications, including key management and key cryptography operations.
The keys managed by OpenHarmony Universal KeyStore (HUKS) can be imported by applications or generated by calling the HUKS APIs.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br> > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
> >
> 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. > 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.
The **HUKS** module provides KeyStore (KS) capabilities for applications, including key management and key cryptography operations.
The keys managed by OpenHarmony Universal KeyStore (HUKS) can be imported by applications or generated by calling the HUKS APIs.
## Modules to Import ## Modules to Import
```js ```js
...@@ -75,7 +75,7 @@ Generates a key. This API uses an asynchronous callback to return the result. ...@@ -75,7 +75,7 @@ Generates a key. This API uses an asynchronous callback to return the result.
| -------- | --------------------------- | ---- | --------------------------------------------- | | -------- | --------------------------- | ---- | --------------------------------------------- |
| keyAlias | string | Yes | Alias of the key. | | keyAlias | string | Yes | Alias of the key. |
| options | [HuksOptions](#huksoptions) | Yes | Tags required for generating the key. | | options | [HuksOptions](#huksoptions) | Yes | Tags required for generating the key. |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.| | callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example** **Example**
...@@ -186,7 +186,7 @@ Deletes a key. This API uses an asynchronous callback to return the result. ...@@ -186,7 +186,7 @@ Deletes a key. This API uses an asynchronous callback to return the result.
| -------- | --------------------------- | ---- | --------------------------------------------- | | -------- | --------------------------- | ---- | --------------------------------------------- |
| keyAlias | string | Yes | Key alias passed in when the key was generated. | | keyAlias | string | Yes | Key alias passed in when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). | | options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.| | callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example** **Example**
...@@ -289,7 +289,7 @@ Imports a key in plaintext. This API uses an asynchronous callback to return the ...@@ -289,7 +289,7 @@ Imports a key in plaintext. This API uses an asynchronous callback to return the
| -------- | --------------------------- | ---- | --------------------------------------------- | | -------- | --------------------------- | ---- | --------------------------------------------- |
| keyAlias | string | Yes | Alias of the key. | | keyAlias | string | Yes | Alias of the key. |
| options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and key to import. | | options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and key to import. |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.| | callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example** **Example**
...@@ -553,7 +553,7 @@ Obtains the certificate used to verify a key. This API uses a promise to return ...@@ -553,7 +553,7 @@ Obtains the certificate used to verify a key. This API uses a promise to return
| Type | Description | | Type | Description |
| ---------------------------------------------- | --------------------------------------------- | | ---------------------------------------------- | --------------------------------------------- |
| Promise<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If **err** is not returned, the operation is successful. Otherwise, an error occurs.| | Promise<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.|
**Example** **Example**
...@@ -676,7 +676,7 @@ Imports a wrapped key. This API uses an asynchronous callback to return the resu ...@@ -676,7 +676,7 @@ Imports a wrapped key. This API uses an asynchronous callback to return the resu
| keyAlias | string | Yes | Alias of the wrapped key to import. | | keyAlias | string | Yes | Alias of the wrapped key to import. |
| wrappingKeyAlias | string | Yes | Alias of the data used to unwrap the key imported. | | wrappingKeyAlias | string | Yes | Alias of the data used to unwrap the key imported. |
| options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and the wrapped key to import.| | options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and the wrapped key to import.|
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.| | callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example** **Example**
...@@ -926,7 +926,7 @@ Exports a key. This API uses an asynchronous callback to return the result. ...@@ -926,7 +926,7 @@ Exports a key. This API uses an asynchronous callback to return the result.
| -------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. | | keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). | | options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback<[HuksReturnResult](#huksreturnresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs. **outData** contains the public key exported.| | callback | AsyncCallback<[HuksReturnResult](#huksreturnresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned and **outData** contains the public key exported. If the operation fails, an error code is returned. |
**Example** **Example**
...@@ -968,7 +968,7 @@ Exports a key. This API uses a promise to return the result. ...@@ -968,7 +968,7 @@ Exports a key. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ---------------------------------------------- | ------------------------------------------------------------ | | ---------------------------------------------- | ------------------------------------------------------------ |
| Promise<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If **err** is not returned, the operation is successful. Otherwise, an error occurs. **outData** contains the public key exported.| | Promise<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If the operation is successful, no **err** value is returned and **outData** contains the public key exported. If the operation fails, an error code is returned. |
**Example** **Example**
...@@ -1005,7 +1005,7 @@ Obtains key properties. This API uses an asynchronous callback to return the res ...@@ -1005,7 +1005,7 @@ Obtains key properties. This API uses an asynchronous callback to return the res
| -------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. | | keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). | | options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback<[HuksReturnResult](#huksreturnresult)> | Yes | Callback invoked to return the result. If **errorCode** is **HUKS_SUCCESS**, the operation is successful. Otherwise, an error occurs.| | callback | AsyncCallback<[HuksReturnResult](#huksreturnresult)> | Yes | Callback invoked to return the result. If the operation is successful, **errorCode** is **HUKS_SUCCESS**; otherwise, an error code is returned.|
**Example** **Example**
...@@ -1047,7 +1047,7 @@ Obtains key properties. This API uses a promise to return the result. ...@@ -1047,7 +1047,7 @@ Obtains key properties. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------------------------------------- | ------------------------------------------------------------ | | ----------------------------------------------- | ------------------------------------------------------------ |
| Promise\<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If **err** is not returned, the operation is successful. Otherwise, an error occurs. **properties** returns the parameters required for generating the key.| | Promise\<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If the operation is successful, no **err** value is returned and **properties** contains the parameters required for generating the key. If the operation fails, an error code is returned. |
**Example** **Example**
...@@ -1084,7 +1084,7 @@ Checks whether a key exists. This API uses an asynchronous callback to return th ...@@ -1084,7 +1084,7 @@ Checks whether a key exists. This API uses an asynchronous callback to return th
| -------- | --------------------------- | ---- | --------------------------------------- | | -------- | --------------------------- | ---- | --------------------------------------- |
| keyAlias | string | Yes | Alias of the key to check. | | keyAlias | string | Yes | Alias of the key to check. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). | | options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<boolean> | Yes | Callback invoked to return the result. The value **TRUE** means that the key exists, and **FALSE** means the opposite.| | callback | AsyncCallback\<boolean> | Yes | Callback invoked to return the result. **TRUE** means that the key exists; **FALSE** means the opposite.|
**Example** **Example**
...@@ -1126,7 +1126,7 @@ Checks whether a key exists. This API uses a promise to return the result. ...@@ -1126,7 +1126,7 @@ Checks whether a key exists. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------- | --------------------------------------- | | ----------------- | --------------------------------------- |
| Promise\<boolean> | Promise used to return the result. The value **TRUE** means that the key exists, and **FALSE** means the opposite.| | Promise\<boolean> | Promise used to return the result. **TRUE** means that the key exists; **FALSE** means the opposite.|
**Example** **Example**
...@@ -1315,7 +1315,7 @@ Aborts the use of the key. This API uses an asynchronous callback to return the ...@@ -1315,7 +1315,7 @@ Aborts the use of the key. This API uses an asynchronous callback to return the
| -------- | --------------------------- | ---- | ------------------------------------------- | | -------- | --------------------------- | ---- | ------------------------------------------- |
| handle | number | Yes | Handle of the **Abort** operation. | | handle | number | Yes | Handle of the **Abort** operation. |
| options | [HuksOptions](#huksoptions) | Yes | Parameters of the **Abort** operation. | | options | [HuksOptions](#huksoptions) | Yes | Parameters of the **Abort** operation. |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result.| | callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example** **Example**
...@@ -1465,7 +1465,7 @@ Aborts the use of the key. This API uses a promise to return the result. ...@@ -1465,7 +1465,7 @@ Aborts the use of the key. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------------------------- | -------------------------------------------------- | | ----------------------------------- | -------------------------------------------------- |
| Promise\<void> | Promise used to return the result.| | Promise\<void> | Promise that returns no value.|
**Example** **Example**
...@@ -1993,7 +1993,7 @@ Generates a key. This API uses an asynchronous callback to return the result. ...@@ -1993,7 +1993,7 @@ Generates a key. This API uses an asynchronous callback to return the result.
| -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Alias of the key. | | keyAlias | string | Yes | Alias of the key. |
| options | [HuksOptions](#huksoptions) | Yes | Tags required for generating the key. | | options | [HuksOptions](#huksoptions) | Yes | Tags required for generating the key. |
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. For details about other results, see HuksResult.| | callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code defined in **HuksResult** is returned.|
**Example** **Example**
...@@ -2050,7 +2050,7 @@ Generates a key. This API uses a promise to return the result. ...@@ -2050,7 +2050,7 @@ Generates a key. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------------------------- | -------------------------------------------------- | | ----------------------------------- | -------------------------------------------------- |
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.| | Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example** **Example**
...@@ -2099,7 +2099,7 @@ Deletes a key. This API uses an asynchronous callback to return the result. ...@@ -2099,7 +2099,7 @@ Deletes a key. This API uses an asynchronous callback to return the result.
| -------- | ----------------------------------------- | ---- | -------------------------------------------------- | | -------- | ----------------------------------------- | ---- | -------------------------------------------------- |
| keyAlias | string | Yes | Key alias passed in when the key was generated. | | keyAlias | string | Yes | Key alias passed in when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). | | options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.| | callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example** **Example**
...@@ -2133,7 +2133,7 @@ Deletes a key. This API uses a promise to return the result. ...@@ -2133,7 +2133,7 @@ Deletes a key. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------------------------- | -------------------------------------------------- | | ----------------------------------- | -------------------------------------------------- |
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.| | Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example** **Example**
...@@ -2163,7 +2163,7 @@ Imports a key in plaintext. This API uses an asynchronous callback to return the ...@@ -2163,7 +2163,7 @@ Imports a key in plaintext. This API uses an asynchronous callback to return the
| -------- | ------------------------ | ---- | ------------------------------------------------- | | -------- | ------------------------ | ---- | ------------------------------------------------- |
| keyAlias | string | Yes | Alias of the key.| | keyAlias | string | Yes | Alias of the key.|
| options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and key to import.| | options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and key to import.|
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.| | callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example** **Example**
...@@ -2228,7 +2228,7 @@ Imports a key in plaintext. This API uses a promise to return the result. ...@@ -2228,7 +2228,7 @@ Imports a key in plaintext. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------------------------- | -------------------------------------------------- | | ----------------------------------- | -------------------------------------------------- |
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.| | Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example** **Example**
...@@ -2291,7 +2291,7 @@ Exports a key. This API uses an asynchronous callback to return the result. ...@@ -2291,7 +2291,7 @@ Exports a key. This API uses an asynchronous callback to return the result.
| -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. | | keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). | | options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs. **outData** contains the public key exported.| | callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned and **outData** contains the public key exported. If the operation fails, an error code is returned.|
**Example** **Example**
...@@ -2325,7 +2325,7 @@ Exports a key. This API uses a promise to return the result. ...@@ -2325,7 +2325,7 @@ Exports a key. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------------------------- | ------------------------------------------------------------ | | ----------------------------------- | ------------------------------------------------------------ |
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs. **outData** contains the public key exported.| | Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If the operation is successful, **HUKS_SUCCESS** is returned and **outData** contains the public key exported. If the operation fails, an error code is returned. |
**Example** **Example**
...@@ -2355,7 +2355,7 @@ Obtains key properties. This API uses an asynchronous callback to return the res ...@@ -2355,7 +2355,7 @@ Obtains key properties. This API uses an asynchronous callback to return the res
| -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ | | -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. | | keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). | | options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **errorCode** is **HUKS_SUCCESS**, the operation is successful. Otherwise, an error occurs.| | callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **errorCode** is **HUKS_SUCCESS**; otherwise, an error code is returned.|
**Example** **Example**
...@@ -2389,7 +2389,7 @@ Obtains key properties. This API uses a promise to return the result. ...@@ -2389,7 +2389,7 @@ Obtains key properties. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ------------------ | ------------------------------------------------------------ | | ------------------ | ------------------------------------------------------------ |
| Promise\<[HuksResult](#huksoptions)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs. **properties** returns the parameters required for generating the key.| | Promise\<[HuksResult](#huksoptions)> | Promise used to return the result. If the operation is successful, **errorCode** is **HUKS_SUCCESS** and **properties** contains the parameters required for generating the key. If the operation fails, an error code is returned. |
**Example** **Example**
...@@ -2419,7 +2419,7 @@ Checks whether a key exists. This API uses an asynchronous callback to return th ...@@ -2419,7 +2419,7 @@ Checks whether a key exists. This API uses an asynchronous callback to return th
| -------- | ---------------------- | ---- | ------------------------------------- | | -------- | ---------------------- | ---- | ------------------------------------- |
| keyAlias | string | Yes | Alias of the key to check.| | keyAlias | string | Yes | Alias of the key to check.|
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty).| | options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty).|
| callback | AsyncCallback\<boolean> | Yes | Callback invoked to return the result. The value **TRUE** means that the key exists, and **FALSE** means the opposite.| | callback | AsyncCallback\<boolean> | Yes | Callback invoked to return the result. **TRUE** means that the key exists; **FALSE** means the opposite.|
**Example** **Example**
...@@ -2453,7 +2453,7 @@ Checks whether a key exists. This API uses a promise to return the result. ...@@ -2453,7 +2453,7 @@ Checks whether a key exists. This API uses a promise to return the result.
| Type | Description | | Type | Description |
| ----------------- | --------------------------------------- | | ----------------- | --------------------------------------- |
| Promise\<boolean> | Promise used to return the result. The value **TRUE** means that the key exists, and **FALSE** means the opposite.| | Promise\<boolean> | Promise used to return the result. **TRUE** means that the key exists; **FALSE** means the opposite.|
**Example** **Example**
......
# colorSpaceManager Error Codes
## 18600001 Abnormal Parameter Value
**Error Message**
Parameter value is abnormal.
**Description**
This error code is reported when a parameter value passed in the API does not meet the requirements.
**Possible Causes**
The parameter value exceeds the valid range. For example, an enumerated value exceeds the defined range.
**Solution**
Pass parameter values that meet the requirements in the API.
# RDB Error Codes
## 14800010 Invalid RDB Name
**Error Message**
Invalid database name.
**Description**
The RDB store name is invalid.
**Possible Causes**
The RDB store name is empty or exceeds 1024 bytes.
**Solution**
Check that the RDB store name is not empty and does not exceed 1024 bytes.
## 14800011 Database File Corrupted
**Error Message**
Database corrupted.
**Description**
The RDB store is corrupted when an API for adding, deleting, querying, or synchronizing data is invoked.
**Possible Causes**
The RDB store file has been corrupted.
**Solution**
1. Restore the RDB store using the backup file.
2. If no RDB backup file is available, delete the RDB store and create it again.
## 14800012 Empty Result Set or Invalid Position
**Error Message**
The result set is empty or the specified location is invalid.
**Description**
The result set is empty or the specified location is invalid.
**Possible Causes**
The result set is empty, or the specified row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
**Solution**
Check whether the result set is empty or whether the specified row number is out of range.
## 14800013 Null Column Value or Column Data Type Incompatible With the API Called
**Error Message**
The column value is null or the column type is incompatible.
**Description**
The column value is null, or the column data type is incompatible with the API called.
**Possible Causes**
1. The result set is empty.
2. The current row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
3. The column number is out of the range [0, n - 1]. **n** is **resultsetV9.columnCount**.
4. The API called does not support the type of the column data.
**Solution**
1. Check whether the result set is empty.
2. Check whether the row number and column number of the result set are out of range.
3. Check whether the column data type is supported.
# Preferences Error Codes
## 15500010 Failed to Delete Preferences
**Error Message**
Failed to delete preferences.
**Description**
Failed to delete the preference.
**Possible Causes**
The possible causes are as follows:
1. The file name is incorrect.
2. The file path is incorrect.
**Solution**
1. Check that the file name is correct.
2. Check that the file path is correct.
# WebGL Overview # WebGL Overview
Web Graphic Library (WebGL) is used for rendering interactive 2D and 3D graphics. WebGL used in OpenHarmony is based on OpenGL for Embedded Systems (OpenGL ES). It can be used in the **&lt;canvas&gt;** object of HTML5 without using plug-ins and supports cross-platform. WebGL is programmed by JavaScript code. Its APIs can implement graphics rendering and acceleration by using GPU hardware provided by the user equipment. Web Graphic Library (WebGL) is used for rendering interactive 2D and 3D graphics. WebGL used in OpenHarmony is based on OpenGL for Embedded Systems (OpenGL ES). It can be used in the **\<canvas>** object of HTML5 without using plug-ins and supports cross-platform. WebGL is programmed by JavaScript code. Its APIs can implement graphics rendering and acceleration by using GPU hardware provided by the user equipment. For more information, see [WebGL™](https://www.khronos.org/registry/webgl/specs/latest/1.0/).
## Basic Concepts ## Basic Concepts
...@@ -31,7 +31,7 @@ The WebGLProgram is a JavaScript object responsible for associating the shader w ...@@ -31,7 +31,7 @@ The WebGLProgram is a JavaScript object responsible for associating the shader w
## Working Principles ## Working Principles
**Figure 1** WebGL working principles **Figure 1** WebGL working principles
![en-us_image_0000001238544451](figures/en-us_image_0000001238544451.png) ![en-us_image_0000001238544451](figures/en-us_image_0000001238544451.png)
...@@ -40,7 +40,7 @@ The WebGLProgram is a JavaScript object responsible for associating the shader w ...@@ -40,7 +40,7 @@ The WebGLProgram is a JavaScript object responsible for associating the shader w
- Native APIs complete the interaction between JavaScript and C++ code. - Native APIs complete the interaction between JavaScript and C++ code.
- JavaScript engine is a graphics framework that provides the **Surface** object for the WebGL module. - JavaScript engine is the graphics framework that provides the **Surface** object for the WebGL module.
- The WebGL module exposes the GPU drawing APIs of OpenGL ES. - The WebGL module exposes the GPU drawing APIs of OpenGL ES.
......
# Kernel # Kernel
- Kernel - Kernel
- Mini-System Kernel
- [Kernel Overview](kernel-overview.md) - [Kernel Overview](kernel-overview.md)
- Mini-System Kernel (LiteOS-M) - Mini-System Kernel (LiteOS-M)
- [LiteOS-M Overview](kernel-mini-overview.md) - [LiteOS-M Overview](kernel-mini-overview.md)
- Basic Kernel - Base Kernel
- [Interrupt Management](kernel-mini-basic-interrupt.md) - [Interrupt Management](kernel-mini-basic-interrupt.md)
- [Task Management](kernel-mini-basic-task.md) - [Task Management](kernel-mini-basic-task.md)
- [Memory Management](kernel-mini-basic-memory.md) - [Memory Management](kernel-mini-basic-memory.md)
...@@ -16,6 +15,7 @@ ...@@ -16,6 +15,7 @@
- [Semaphore](kernel-mini-basic-ipc-sem.md) - [Semaphore](kernel-mini-basic-ipc-sem.md)
- [Time Management](kernel-basic-mini-time.md) - [Time Management](kernel-basic-mini-time.md)
- [Software Timer](kernel-mini-basic-soft.md) - [Software Timer](kernel-mini-basic-soft.md)
- [Doubly Linked List](kernel-mini-basic-list.md)
- Extended Components - Extended Components
- [C++ Support](kernel-mini-extend-support.md) - [C++ Support](kernel-mini-extend-support.md)
- [CPUP](kernel-mini-extend-cpup.md) - [CPUP](kernel-mini-extend-cpup.md)
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
- [LMS](kernel-mini-memory-lms.md) - [LMS](kernel-mini-memory-lms.md)
- Appendix - Appendix
- [Kernel Coding Specification](kernel-mini-appx-code.md) - [Kernel Coding Specification](kernel-mini-appx-code.md)
- [Doubly Linked List](kernel-mini-appx-data-list.md)
- [Standard Libraries](kernel-mini-appx-lib.md) - [Standard Libraries](kernel-mini-appx-lib.md)
- Small-System Kernel (LiteOS-A) - Small-System Kernel (LiteOS-A)
- [Kernel Overview](kernel-small-overview.md) - [Kernel Overview](kernel-small-overview.md)
...@@ -158,6 +157,7 @@ ...@@ -158,6 +157,7 @@
- [Compiling and Building the Linux Kernel](kernel-standard-build.md) - [Compiling and Building the Linux Kernel](kernel-standard-build.md)
- Enhanced Kernel Features - Enhanced Kernel Features
- [Enhanced Swap](kernel-standard-mm-eswap.md) - [Enhanced Swap](kernel-standard-mm-eswap.md)
- [NewIP Kernel Protocol Stack](kernel-standard-newip.md)
- Task Scheduling - Task Scheduling
- [Related Thread Group](kernel-standard-sched-rtg.md) - [Related Thread Group](kernel-standard-sched-rtg.md)
- [Lightweight CPU Isolation](kernel-standard-sched-cpuisolation.md) - [Lightweight CPU Isolation](kernel-standard-sched-cpuisolation.md)
\ No newline at end of file
此差异已折叠。
...@@ -8,19 +8,19 @@ During the compilation, select a build form factor based on the site requirement ...@@ -8,19 +8,19 @@ During the compilation, select a build form factor based on the site requirement
| Build Form Factor | Development Board| Main Chip| Kernel| System Type| | Build Form Factor | Development Board| Main Chip| Kernel| System Type|
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| [neptune100](https://gitee.com/openharmony/vendor_hihope/blob/master/neptune_iotlink_demo/config.json) | neptune100 | WinnerMicro | LiteOS-M | Mini | | [neptune100](https://gitee.com/openharmony/vendor_hihope/blob/master/neptune_iotlink_demo/config.json) | neptune100 | WinnerMicro | LiteOS-M | Mini |
| [rk3568](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/config.json) | rk3568 | Rockchip | Linux | standard | | [rk3568](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568/config.json) | rk3568 | Rockchip | Linux | Standard |
| [rk3568_Mini_system](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568_Mini_system/config.json) | rk3568 | Rockchip | Linux | Standard | | [rk3568_mini_system](https://gitee.com/openharmony/vendor_hihope/blob/master/rk3568_mini_system/config.json) | rk3568 | Rockchip | Linux | Standard |
| [bearpi_hm_micro](https://gitee.com/openharmony/vendor_bearpi/blob/master/bearpi_hm_micro/config.json) | bearpi_hm_micro | STM32MP1xx | LiteOS-A | small | | [bearpi_hm_micro](https://gitee.com/openharmony/vendor_bearpi/blob/master/bearpi_hm_micro/config.json) | bearpi_hm_micro | STM32MP1xx | LiteOS-A | small |
| [bearpi_hm_nano](https://gitee.com/openharmony/vendor_bearpi/blob/master/bearpi_hm_nano/config.json) | bearpi_hm_nano | Hi3861V100 | LiteOS-M | Mini | | [bearpi_hm_nano](https://gitee.com/openharmony/vendor_bearpi/blob/master/bearpi_hm_nano/config.json) | bearpi_hm_nano | Hi3861V100 | LiteOS-M | Mini |
| [wifiiot_hispark_pegasus](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_pegasus/config.json) | hispark_pegasus | Hi3861V100 | LiteOS-M | Mini | | [wifiiot_hispark_pegasus](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_pegasus/config.json) | hispark_pegasus | Hi3861V100 | LiteOS-M | Mini |
| [ipcamera_hispark_aries](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_aries/config.json) | hispark_aries | Hi3518EV300 | LiteOS-A | Small | | [ipcamera_hispark_aries](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_aries/config.json) | hispark_aries | Hi3518EV300 | LiteOS-A | Small |
| [ipcamera_hispark_taurus](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus/config.json) | hispark_taurus | Hi3516DV300 | LiteOS-A | Small | | [ipcamera_hispark_taurus](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus/config.json) | hispark_taurus | Hi3516DV300 | LiteOS-A | Small |
| [ipcamera_hispark_taurus_Linux](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_Linux/config.json) | hispark_taurus | Hi3516DV300 | Linux | Small | | [ipcamera_hispark_taurus_linux](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_linux/config.json) | hispark_taurus | Hi3516DV300 | Linux | Small |
| [hispark_taurus_Standard](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_Standard/config.json) | hispark_taurus | Hi3516DV300 | Linux | Standard | | [hispark_taurus_standard](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_standard/config.json) | hispark_taurus | Hi3516DV300 | Linux | Standard |
| [watchos](https://gitee.com/openharmony/vendor_hisilicon/blob/master/watchos/config.json) | hispark_taurus | Hi3516DV300 | Linux | Standard | | [watchos](https://gitee.com/openharmony/vendor_hisilicon/blob/master/watchos/config.json) | hispark_taurus | Hi3516DV300 | Linux | Standard |
| [hispark_phoenix](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_phoenix/config.json) | hispark_phoenix | Hi3751V350 | Linux | Standard | | [hispark_phoenix](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_phoenix/config.json) | hispark_phoenix | Hi3751V350 | Linux | Standard |
| [hispark_taurus_Mini_system](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_Mini_system/config.json) | hispark_taurus | Hi3516DV300 | LiteOS-A | Mini | | [hispark_taurus_mini_system](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_taurus_mini_system/config.json) | hispark_taurus | Hi3516DV300 | LiteOS-A | Mini |
| [hispark_pegasus_Mini_system](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_pegasus_Mini_system/config.json) | hispark_pegasus | Hi3861V100 | LiteOS-M | Mini | | [hispark_pegasus_mini_system](https://gitee.com/openharmony/vendor_hisilicon/blob/master/hispark_pegasus_mini_system/config.json) | hispark_pegasus | Hi3861V100 | LiteOS-M | Mini |
| [gr5515_sk_iotlink_demo](https://gitee.com/openharmony/vendor_goodix/blob/master/gr5515_sk_iotlink_demo/config.json) | gr5515_sk | GR551x | LiteOS-M | Mini | | [gr5515_sk_iotlink_demo](https://gitee.com/openharmony/vendor_goodix/blob/master/gr5515_sk_iotlink_demo/config.json) | gr5515_sk | GR551x | LiteOS-M | Mini |
| [gr5515_sk_xts_demo](https://gitee.com/openharmony/vendor_goodix/blob/master/gr5515_sk_xts_demo/config.json) | gr5515_sk | GR551x | LiteOS-M | Mini | | [gr5515_sk_xts_demo](https://gitee.com/openharmony/vendor_goodix/blob/master/gr5515_sk_xts_demo/config.json) | gr5515_sk | GR551x | LiteOS-M | Mini |
| [wifi_demo](https://gitee.com/openharmony/vendor_asrmicro/blob/master/wifi_demo/config.json) | dev_wifi_a | ASR582X | LiteOS-M | Mini | | [wifi_demo](https://gitee.com/openharmony/vendor_asrmicro/blob/master/wifi_demo/config.json) | dev_wifi_a | ASR582X | LiteOS-M | Mini |
...@@ -28,17 +28,17 @@ During the compilation, select a build form factor based on the site requirement ...@@ -28,17 +28,17 @@ During the compilation, select a build form factor based on the site requirement
| [display_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/display_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini | | [display_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/display_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [xts_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/xts_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini | | [xts_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/xts_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [iotlink_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/iotlink_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini | | [iotlink_demo](https://gitee.com/openharmony/vendor_bestechnic/blob/master/iotlink_demo/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [Mini_distributed_music_player](https://gitee.com/openharmony/vendor_bestechnic/blob/master/Mini_distributed_music_player/config.json) | v200zr | BES2600 | LiteOS-M | Mini | | [mini_distributed_music_player](https://gitee.com/openharmony/vendor_bestechnic/blob/master/mini_distributed_music_player/config.json) | v200zr | BES2600 | LiteOS-M | Mini |
| [niobe407](https://gitee.com/openharmony/vendor_talkweb/blob/master/niobe407/config.json) | niobe407 | STM32F4xx | LiteOS-M | Mini | | [niobe407](https://gitee.com/openharmony/vendor_talkweb/blob/master/niobe407/config.json) | niobe407 | STM32F4xx | LiteOS-M | Mini |
| [QEMU_Mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/QEMU_Mini_system_demo/config.json) | arm_mps2_an386 | QEMU | LiteOS-M | Mini | | [qemu_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_mini_system_demo/config.json) | arm_mps2_an386 | QEMU | LiteOS-M | Mini |
| [QEMU_csky_Mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/QEMU_csky_Mini_system_demo/config.json) | SmartL_E802 | QEMU | LiteOS-M | Mini | | [qemu_csky_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_csky_mini_system_demo/config.json) | SmartL_E802 | QEMU | LiteOS-M | Mini |
| [QEMU_cm55_Mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/QEMU_cm55_Mini_system_demo/config.json) | arm_mps3_an547 | QEMU | LiteOS-M | Mini | | [qemu_cm55_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_cm55_mini_system_demo/config.json) | arm_mps3_an547 | QEMU | LiteOS-M | Mini |
| [QEMU_xtensa_Mini_system_demo](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_xtensa_Mini_system_demo/config.json) | esp32 | QEMU | LiteOS-M | Mini | | [qemu_xtensa_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_xtensa_mini_system_demo/config.json) | esp32 | QEMU | LiteOS-M | Mini |
| [QEMU_riscv_Mini_system_demo](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_riscv32_Mini_system_demo/config.json) | ricsv32_virt | QEMU | LiteOS-M | Mini | | [qemu_riscv_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_riscv32_mini_system_demo/config.json) | ricsv32_virt | QEMU | LiteOS-M | Mini |
| [QEMU_ca7_Mini_system_demo](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_ca7_Mini_system_demo/config.json) | arm_virt | QEMU | LiteOS-A | Small | | [qemu_ca7_mini_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_ca7_mini_system_demo/config.json) | arm_virt | QEMU | LiteOS-A | Small |
| [QEMU_Small_system_demo](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_Small_system_demo/config.json) | arm_virt | QEMU | LiteOS-A | Small | | [qemu_small_system_demo](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_small_system_demo/config.json) | arm_virt | QEMU | LiteOS-A | Small |
| [QEMU_arm_Linux_min](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_arm_Linux_min/config.json) | QEMU-arm-Linux | QEMU | Linux | Standard | | [qemu_arm_inux_min](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_arm_linux_min/config.json) | qemu-arm-linux | QEMU | Linux | Standard |
| [QEMU_arm_Linux_headless](https://gitee.com/Rockchip/vendor_ohemu/blob/master/QEMU_arm_Linux_headless/config.json) | QEMU-arm-Linux | QEMU | Linux | Standard | | [qemu_arm_linux_headless](https://gitee.com/openharmony/vendor_ohemu/blob/master/qemu_arm_linux_headless/config.json) | qemu-arm-linux | QEMU | Linux | Standard |
| [iotlink_demo](https://gitee.com/Rockchip/vendor_Chipsea/blob/master/iotlink_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini | | [iotlink_demo](https://gitee.com/openharmony/vendor_chipsea/blob/master/iotlink_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
| [dsoftbus_demo](https://gitee.com/Rockchip/vendor_Chipsea/blob/master/dsoftbus_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini | | [dsoftbus_demo](https://gitee.com/openharmony/vendor_chipsea/blob/master/dsoftbus_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
| [xts_demo](https://gitee.com/Rockchip/vendor_Chipsea/blob/master/xts_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini | | [xts_demo](https://gitee.com/openharmony/vendor_chipsea/blob/master/xts_demo/config.json) | cst85_wblink | Chipsea | LiteOS-M | Mini |
...@@ -115,6 +115,6 @@ Next ...@@ -115,6 +115,6 @@ Next
Congratulations! You have finished all steps! Proceed to develop samples to better familiarize yourself with OpenHarmony development: Congratulations! You have finished all steps! Proceed to develop samples to better familiarize yourself with OpenHarmony development:
- [LED Peripheral Control](guide/device-wlan-led-control.md) - [LED Peripheral Control](../guide/device-wlan-led-control.md)
- [Third-Party SDK Integration](guide/device-wlan-sdk.md) - [Third-Party SDK Integration](../guide/device-wlan-sdk.md)
...@@ -53,8 +53,8 @@ The distributed database supports cross-device and cross-application sharing. Th ...@@ -53,8 +53,8 @@ The distributed database supports cross-device and cross-application sharing. Th
| Software/Tool| Version| Remarks| | Software/Tool| Version| Remarks|
| -------- | -------- | -------- | | -------- | -------- | -------- |
| OpenHarmony | 3.2 Beta3| NA | | OpenHarmony | 3.2 Beta3| NA |
| Public SDK | Ohos_sdk_public 3.2.7.5 (API Version 9 Beta3)| This toolkit is intended for application developers and does not contain system APIs that require system permissions.<br>It is provided as standard in DevEco Studio.| | Public SDK | Ohos_sdk_public 3.2.7.5 (API Version 9 Beta3)<br>Ohos_sdk_public&nbsp;3.2.7.6&nbsp;(API&nbsp;Version&nbsp;9&nbsp;Beta3) | This toolkit is intended for application developers and does not contain system APIs that require system permissions.<br>It is provided as standard in DevEco Studio.|
| Full SDK | Ohos_sdk_full 3.2.7.5 (API Version 9 Beta3)| This toolkit is intended for original equipment manufacturers (OEMs) and contains system APIs that require system permissions.<br>To use the full SDK, manually obtain it from the mirror and switch to it in DevEco Studio. For details, see [Guide to Switching to Full SDK](../application-dev/quick-start/full-sdk-switch-guide.md).| | Full SDK | Ohos_sdk_full 3.2.7.5 (API Version 9 Beta3)<br>Ohos_sdk_full&nbsp;3.2.7.6&nbsp;(API&nbsp;Version&nbsp;9&nbsp;Beta3) | This toolkit is intended for original equipment manufacturers (OEMs) and contains system APIs that require system permissions.<br>To use the full SDK, manually obtain it from the mirror and switch to it in DevEco Studio. For details, see [Guide to Switching to Full SDK](../application-dev/quick-start/full-sdk-switch-guide.md).|
| (Optional) HUAWEI DevEco Studio| 3.0 Release| Recommended for developing OpenHarmony applications.| | (Optional) HUAWEI DevEco Studio| 3.0 Release| Recommended for developing OpenHarmony applications.|
| (Optional) HUAWEI DevEco Device Tool| 3.0 Release| Recommended for developing OpenHarmony devices.| | (Optional) HUAWEI DevEco Device Tool| 3.0 Release| Recommended for developing OpenHarmony devices.|
...@@ -137,6 +137,10 @@ Use the **repo** tool to download the source code over HTTPS. ...@@ -137,6 +137,10 @@ Use the **repo** tool to download the source code over HTTPS.
| Full SDK package for the standard system (Windows/Linux) | 3.2.7.5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-windows_linux-full.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-windows_linux-full.tar.gz.sha256) | | Full SDK package for the standard system (Windows/Linux) | 3.2.7.5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-windows_linux-full.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-windows_linux-full.tar.gz.sha256) |
| Public SDK package for the standard system (macOS) | 3.2.7.5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-mac-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-mac-public.tar.gz.sha256) | | Public SDK package for the standard system (macOS) | 3.2.7.5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-mac-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-mac-public.tar.gz.sha256) |
| Public SDK package for the standard system (Windows/Linux) | 3.2.7.5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-windows_linux-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-windows_linux-public.tar.gz.sha256) | | Public SDK package for the standard system (Windows/Linux) | 3.2.7.5 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-windows_linux-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/ohos-sdk-windows_linux-public.tar.gz.sha256) |
| Full SDK package for the standard system (macOS) | 3.2.7.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/sdk-patch/mac-sdk-full.tar.gz)| [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/sdk-patch/mac-sdk-full.tar.gz.sha256)|
| Full SDK package for the standard system (Windows/Linux) | 3.2.7.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/sdk-patch/ohos-sdk-full.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/sdk-patch/ohos-sdk-full.tar.gz.sha256) |
| Public SDK package for the standard system (macOS) | 3.2.7.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/sdk-patch/mac-sdk-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/sdk-patch/mac-sdk-public.tar.gz.sha256) |
| Public SDK package for the standard system (Windows/Linux) | 3.2.7.6 | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/sdk-patch/ohos-sdk-public.tar.gz) | [Download](https://repo.huaweicloud.com/harmonyos/os/3.2-Beta3/sdk-patch/ohos-sdk-public.tar.gz.sha256) |
...@@ -167,10 +171,12 @@ This version has the following updates to OpenHarmony 3.2 Beta2. ...@@ -167,10 +171,12 @@ This version has the following updates to OpenHarmony 3.2 Beta2.
| Multi-language runtime subsystem| The front-end compilation performance is improved, for example, by using the es2abc component.<br>Runtime performance is improved through ISA reconstruction, assembly interpreter, and TS Ahead of Time (AOT) compiler.<br>New functions are added, such as ES2021 in strict mode, modularization, runtime debugging and tuning enhancement, and bytecode hot reload.<br>The following requirements are involved:<br>I5MYM9 [New specifications] Merging and adaptation of the abc file for multiple modules<br>I59TAQ [New specifications] Standard compilation lowering of the TS AOT compiler and pass description optimization<br>I5OJ8Q [New specifications] Displaying the attribute types defined ES2021 in DevEco Studio<br>I5ODV4 [New feature] Uninstalling bytecode patch files<br>I5OXSC [New feature] Installing bytecode patch files<br>I5HNNZ [New feature] Enabling the namespace of the loader<br>I5HVQE [New feature] Product-specific stack size setting of the thread, and stack page guard<br>I5MCUF [Enhanced feature] New CAPIs of libc and support for symbols such as pthread<br>I5HVNH [New feature] RM.006. Enhanced dynamic library symbol management<br>I5HVQ0 [New feature] RM.008. Fortify supported by musl<br>I5KT7X [New feature] RM.002. API detection for API header files<br>I5TB3Y [New feature] ABI using emutls by default<br>I5R119 [Enhanced feature] Separated use of memory for loader and libc<br>Open-source Clang toolchain<br>I5MYM9 [New specifications] Modular compilation supported by the front-end compiler toolchain<br>I5IKO1 [New specifications] Compiling Commonjs module with the es2abc component<br>I5RRAJ [New specifications] Patch file source code identification tool<br>I5PRFT [New specifications] Patch bytecode compiler<br>I5RHDH [New specifications] Hot loading of ArkCompiler bytecode<br>I5RA7C [New specifications] Support for ES2021 in strict mode<br>I5HRUY [New specifications] Converting from JS code to ArkCompiler bytecode by the es2abc component| NA | | Multi-language runtime subsystem| The front-end compilation performance is improved, for example, by using the es2abc component.<br>Runtime performance is improved through ISA reconstruction, assembly interpreter, and TS Ahead of Time (AOT) compiler.<br>New functions are added, such as ES2021 in strict mode, modularization, runtime debugging and tuning enhancement, and bytecode hot reload.<br>The following requirements are involved:<br>I5MYM9 [New specifications] Merging and adaptation of the abc file for multiple modules<br>I59TAQ [New specifications] Standard compilation lowering of the TS AOT compiler and pass description optimization<br>I5OJ8Q [New specifications] Displaying the attribute types defined ES2021 in DevEco Studio<br>I5ODV4 [New feature] Uninstalling bytecode patch files<br>I5OXSC [New feature] Installing bytecode patch files<br>I5HNNZ [New feature] Enabling the namespace of the loader<br>I5HVQE [New feature] Product-specific stack size setting of the thread, and stack page guard<br>I5MCUF [Enhanced feature] New CAPIs of libc and support for symbols such as pthread<br>I5HVNH [New feature] RM.006. Enhanced dynamic library symbol management<br>I5HVQ0 [New feature] RM.008. Fortify supported by musl<br>I5KT7X [New feature] RM.002. API detection for API header files<br>I5TB3Y [New feature] ABI using emutls by default<br>I5R119 [Enhanced feature] Separated use of memory for loader and libc<br>Open-source Clang toolchain<br>I5MYM9 [New specifications] Modular compilation supported by the front-end compiler toolchain<br>I5IKO1 [New specifications] Compiling Commonjs module with the es2abc component<br>I5RRAJ [New specifications] Patch file source code identification tool<br>I5PRFT [New specifications] Patch bytecode compiler<br>I5RHDH [New specifications] Hot loading of ArkCompiler bytecode<br>I5RA7C [New specifications] Support for ES2021 in strict mode<br>I5HRUY [New specifications] Converting from JS code to ArkCompiler bytecode by the es2abc component| NA |
| IAM account subsystem and program access control subsystem| User identity authentication is added to the IAM account subsystem. The permission service supports precise positioning and fuzzy positioning, and other capabilities are enhanced. The privacy management service is provided.<br>The following requirements are involved:<br>I5N90B [New specifications] Application accounts adaptation to sandbox applications<br>I5N90O [New specifications] User identity authentication of the IAM account subsystem<br>I5NOQI [New feature] Precise positioning and fuzzy positioning of the permission service<br>I5NT1X [New feature] Enhanced permission usage record management<br>I5NU8U [New feature] Improved UX effect for the permission request dialog box<br>I5P4IU [New feature] Privacy management<br>I5P530 [New feature] Location service usage status management| NA | | IAM account subsystem and program access control subsystem| User identity authentication is added to the IAM account subsystem. The permission service supports precise positioning and fuzzy positioning, and other capabilities are enhanced. The privacy management service is provided.<br>The following requirements are involved:<br>I5N90B [New specifications] Application accounts adaptation to sandbox applications<br>I5N90O [New specifications] User identity authentication of the IAM account subsystem<br>I5NOQI [New feature] Precise positioning and fuzzy positioning of the permission service<br>I5NT1X [New feature] Enhanced permission usage record management<br>I5NU8U [New feature] Improved UX effect for the permission request dialog box<br>I5P4IU [New feature] Privacy management<br>I5P530 [New feature] Location service usage status management| NA |
| Globalization subsystem| The pseudo-localization capability is added.<br>The following requirement is involved:<br>I4WLSJ [New feature] Pseudo-localization| NA | | Globalization subsystem| The pseudo-localization capability is added.<br>The following requirement is involved:<br>I4WLSJ [New feature] Pseudo-localization| NA |
| Misc services subsystem| The following basic module features are added: pasteboard, upload and download, screen lock, and input method framework.<br>The following requirements are involved:<br>I5JPMG [request] [download] Background task notification<br>I5NXHK [input_method_fwk] Binding of only the innerkits interface of the input method and the JS interface that independently controls the display and hiding of the soft keyboard<br>I5NG2X [theme_screenlock] Screen lock requested by specific system applications<br>I5IU1Z Adding image data to pasteboard data<br>I5OGA3 Cross-device pasteboard switch at the device level<br>I5NMKI [pasteboard] Adding binary data to pasteboard data<br>I5MAMN Limiting the pasteboard data range to within the application<br>I5OX20 [input_method_fwk] Added the API for obtaining the input method| NA | | Misc services subsystem| The following basic module features are added: pasteboard, upload and download, screen lock, and input method framework.<br>The following requirements are involved:<br>I5JPMG [request] [download] Background task notification<br>I5NXHK [input_method_fwk] Binding of only the innerkits interface of the input method and the JS interface that independently controls the display and hiding of the soft keyboard<br>I5NG2X [theme_screenlock] Screen lock requested by specific system applications<br>I5IU1Z Adding image data to pasteboard data<br>I5OGA3 Pasteboard plugin loading switch<br>I5NMKI [pasteboard] Adding binary data to pasteboard data<br>I5MAMN Limiting the pasteboard data range to within the application<br>I5OX20 [input_method_fwk] Added the API for obtaining the input method| NA |
| ArkUI development framework| The following capabilities are enhanced: ArkUI component, resource and media query, DFX, and toolchain. The memory and performance are optimized.<br>The following requirements are involved:<br>I5IZZ7 [ace_engine_standard] Separate **borderRadius** setting for each corner by the **\<panel>** component<br>I5JQ1R [ace_engine_standard] Image copy and paste<br>I5JQ3F [ace_engine_standard] Enhanced text box capabilities<br>I5JQ3J [ace_engine_standard] Event topology of the **\<stack>** component<br>I5JQ54 [ace_engine_standard] Specifying a component to get the focus<br>I5MX7J [ace_engine_standard] Left sliding, right sliding, and rebound effect of the **\<list>** component<br>I5MWS0 [ace_engine_standard] Height notification of the **\<panel>** component<br>I5IZVY [ace_engine_standard] Component refresh upon the keyboard and mouse connection<br>I5JQ5Y [ace_engine_standard] Enhanced focus navigation<br>I5IY7K [New requirement] [ace_engine_standard] Theme capability<br>I5MWTB [ace_engine_standard] vp query for media<br>I5IZU9 [ace_engine_standard] Optimization of the resident memory of ui_service<br>I5JQ26 [ace_engine_standard] Optimized Vsync request mechanism<br>I5JQ2O [ace_engine] Preloading of public resources<br>I5JQ2D [ace_engine_standard] Optimized resampling of move events<br>I5IZXS [toolchain] Display of the plaintext of the developer variable name in the DFX error stack print<br>I5IZYG [toolchain] Display of the plaintext of the developer variable name in the DFX error stack print<br>I5IZX0 [toolchain] Adding the **bundleName** and **moduleName** parameters to **$r** during compilation<br>I5J09I [toolchain] Export of \@Builder| NA | | ArkUI development framework| The following capabilities are enhanced: ArkUI component, resource and media query, DFX, and toolchain. The memory and performance are optimized.<br>The following requirements are involved:<br>I5IZZ7 [ace_engine_standard] Separate **borderRadius** setting for each corner by the **\<panel>** component<br>I5JQ1R [ace_engine_standard] Image copy and paste<br>I5JQ3F [ace_engine_standard] Enhanced text box capabilities<br>I5JQ3J [ace_engine_standard] Event topology of the **\<stack>** component<br>I5JQ54 [ace_engine_standard] Specifying a component to get the focus<br>I5MX7J [ace_engine_standard] Left sliding, right sliding, and rebound effect of the **\<list>** component<br>I5MWS0 [ace_engine_standard] Height notification of the **\<panel>** component<br>I5IZVY [ace_engine_standard] Component refresh upon the keyboard and mouse connection<br>I5JQ5Y [ace_engine_standard] Enhanced focus navigation<br>I5IY7K [New requirement] [ace_engine_standard] Theme capability<br>I5MWTB [ace_engine_standard] vp query for media<br>I5IZU9 [ace_engine_standard] Optimization of the resident memory of ui_service<br>I5JQ26 [ace_engine_standard] Optimized Vsync request mechanism<br>I5JQ2O [ace_engine] Preloading of public resources<br>I5JQ2D [ace_engine_standard] Optimized resampling of move events<br>I5IZXS [toolchain] Display of the plaintext of the developer variable name in the DFX error stack print<br>I5IZYG [toolchain] Display of the plaintext of the developer variable name in the DFX error stack print<br>I5IZX0 [toolchain] Adding the **bundleName** and **moduleName** parameters to **$r** during compilation<br>I5J09I [toolchain] Export of \@Builder| NA |
For details about the API changes, see the following:
[API Differences](api-change/v3.2-beta3/Readme-EN.md)
### Chip and Development Board Adaptation ### Chip and Development Board Adaptation
...@@ -186,7 +192,7 @@ For details about the adaptation status, see [SIG-Devboard](https://gitee.com/op ...@@ -186,7 +192,7 @@ For details about the adaptation status, see [SIG-Devboard](https://gitee.com/op
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| ArkUI development framework| [HealthyDiet](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/HealthyDiet)| This sample app helps you keep food records and view food information. After you add food records, including the food type, weight, and meal time, the app can calculate nutrition data (calories, proteins, fats, and carbon water) for the meals and display the data in a bar chart.| eTS | | ArkUI development framework| [HealthyDiet](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/HealthyDiet)| This sample app helps you keep food records and view food information. After you add food records, including the food type, weight, and meal time, the app can calculate nutrition data (calories, proteins, fats, and carbon water) for the meals and display the data in a bar chart.| eTS |
| ArkUI development framework| [MusicAlbum](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/MusicAlbum)| This sample shows the home page of a music album app. The adaptive layout and responsive layout are used to ensure that the app can be properly displayed on devices irrespective of screen sizes.| eTS | | ArkUI development framework| [MusicAlbum](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/MusicAlbum)| This sample shows the home page of a music album app. The adaptive layout and responsive layout are used to ensure that the app can be properly displayed on devices irrespective of screen sizes.| eTS |
| Ability framework and file management subsystem| [Share](https://gitee.com/openharmony/applications_app_samples/tree/master/Share/Share)| Using this sample app, you can share texts, links, and images with third-party applications and display them in these applications.| eTS | | Ability framework and file management subsystem| [Share](https://gitee.com/openharmony/applications_app_samples/tree/master/Share/CustomShare)| Using this sample app, you can share texts, links, and images with third-party applications and display them in these applications.| eTS |
| Ability framework| [GalleryForm](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/GalleryForm)| This sample demonstrates the display of **Gallery** images in a widget and periodic update of the widget.| eTS | | Ability framework| [GalleryForm](https://gitee.com/openharmony/applications_app_samples/tree/master/ability/GalleryForm)| This sample demonstrates the display of **Gallery** images in a widget and periodic update of the widget.| eTS |
| ArkUI development framework| [AppMarket](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/AppMarket)| This sample shows the home page of an application market, which contains the tab bar, banner, featured apps, and featured games.| eTS | | ArkUI development framework| [AppMarket](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/AppMarket)| This sample shows the home page of an application market, which contains the tab bar, banner, featured apps, and featured games.| eTS |
| ArkUI development framework| [Weather](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/Weather)| This sample demonstrates one-time development for multi-device deployment by showing how to develop a weather app and deploy it across different devices. The demo app includes the following: home page, **Manage City** page, **Add City** page, and **Update Time** page.| eTS | | ArkUI development framework| [Weather](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/Weather)| This sample demonstrates one-time development for multi-device deployment by showing how to develop a weather app and deploy it across different devices. The demo app includes the following: home page, **Manage City** page, **Add City** page, and **Update Time** page.| eTS |
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
- [设备使用信息统计](device-usage-statistics/Readme-CN.md) - [设备使用信息统计](device-usage-statistics/Readme-CN.md)
- [DFX](dfx/Readme-CN.md) - [DFX](dfx/Readme-CN.md)
- [国际化](internationalization/Readme-CN.md) - [国际化](internationalization/Readme-CN.md)
- [应用测试](application-test/Readme-CN.md)
- [一次开发,多端部署](key-features/multi-device-app-dev/Readme-CN.md) - [一次开发,多端部署](key-features/multi-device-app-dev/Readme-CN.md)
- [IDL工具规格及使用说明书](IDL/idl-guidelines.md) - [IDL工具规格及使用说明书](IDL/idl-guidelines.md)
- [Native API的相关指导](napi/Readme-CN.md) - [Native API的相关指导](napi/Readme-CN.md)
...@@ -65,4 +66,3 @@ ...@@ -65,4 +66,3 @@
- [常见问题](faqs/Readme-CN.md) - [常见问题](faqs/Readme-CN.md)
- 贡献 - 贡献
- [参与贡献](../contribute/贡献文档.md) - [参与贡献](../contribute/贡献文档.md)
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
- [设备使用信息统计](device-usage-statistics/Readme-CN.md) - [设备使用信息统计](device-usage-statistics/Readme-CN.md)
- [DFX](dfx/Readme-CN.md) - [DFX](dfx/Readme-CN.md)
- [国际化](internationalization/Readme-CN.md) - [国际化](internationalization/Readme-CN.md)
- [应用测试](application-test/Readme-CN.md)
- [IDL工具规格及使用说明书](IDL/idl-guidelines.md) - [IDL工具规格及使用说明书](IDL/idl-guidelines.md)
- [Native API的相关指导](napi/Readme-CN.md) - [Native API的相关指导](napi/Readme-CN.md)
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
- [设备使用信息统计](device-usage-statistics/device-usage-statistics-overview.md) - [设备使用信息统计](device-usage-statistics/device-usage-statistics-overview.md)
- [DFX](dfx/hiappevent-overview.md) - [DFX](dfx/hiappevent-overview.md)
- [国际化](internationalization/international-overview.md) - [国际化](internationalization/international-overview.md)
- [应用测试](application-test/Readme-CN.md)
- [IDL工具规格及使用说明书](IDL/idl-guidelines.md) - [IDL工具规格及使用说明书](IDL/idl-guidelines.md)
- [Native API的相关指导](napi/napi-guidelines.md) - [Native API的相关指导](napi/napi-guidelines.md)
......
...@@ -169,3 +169,105 @@ export default function abilityTest() { ...@@ -169,3 +169,105 @@ export default function abilityTest() {
测试执行完毕后可直接在DevEco Studio中查看测试结果,如下图示例所示: 测试执行完毕后可直接在DevEco Studio中查看测试结果,如下图示例所示:
![](figures/TestResult.PNG) ![](figures/TestResult.PNG)
## 常见问题
### 单元测试用例常见问题
**1、用例中增加的打印日志在用例结果之后才打印**
**问题描述**
用例中增加的日志打印信息,没有在用例执行过程中出现,而是在用例执行结束之后才出现。
**可能原因**
此类情况只会存在于用例中有调用异步接口的情况,原则上用例中所有的日志信息均在用例执行结束之前打印。
**解决方法**
当被调用的异步接口多于一个时,建议将接口调用封装成Promise方式调用。
**2、执行用例时报error:fail to start ability**
**问题描述**
执行测试用例时候,用例执行失败,控制台返回错误:fail to start ability。
**可能原因**
测试包打包过程中出现问题,未将测试框架依赖文件打包在测试包中。
**解决方法**
检查测试包中是否包含OpenHarmonyTestRunner.abc文件,如没有则重新编译打包后再次执行测试。
**3、执行用例时报用例超时错误**
**问题描述**
用例执行结束,控制台提示execute time XXms错误,即用例执行超时
**可能原因**
1.用例执行异步接口,但执行过程中没有执行到done函数,导致用例执行一直没有结束,直到超时结束。
2.用例调用函数耗时过长,超过用例执行设置的超时时间。
**解决方法**
1.检查用例代码逻辑,确保即使断言失败场景认可走到done函数,保证用例执行结束。
2.可在IDE中Run/Debug Configurations中修改用例执行超时配置参数,避免用例执行超时。
### UI测试用例常见问题
**1、失败日志有“Get windows failed/GetRootByWindow failed”错误信息**
**问题描述**
UI测试用例执行失败,查看hilog日志发现日志中有“Get windows failed/GetRootByWindow failed”错误信息。
**可能原因**
系统ArkUI开关未开启,导致被测试界面控件树信息未生成。
**解决方法**
执行如下命令,并重启设备再次执行用例。
```shell
hdc shell param set persist.ace.testmode.enabled 1
```
**2、失败日志有“uitest-api dose not allow calling concurrently”错误信息**
**问题描述**
UI测试用例执行失败,查看hilog日志发现日志中有“uitest-api dose not allow calling concurrently”错误信息。
**可能原因**
1.用例中UI测试框架提供异步接口没有增加await语法糖调用。
2.多进程执行UI测试用例,导致拉起多个UITest进程,框架不支持多进程调用。
**解决方法**
1.检查用例实现,异步接口增加await语法糖调用。
2.避免多进程执行UI测试用例。
**3、失败日志有“dose not exist on current UI! Check if the UI has changed after you got the widget object”错误信息**
**问题描述**
UI测试用例执行失败,查看hilog日志发现日志中有“dose not exist on current UI! Check if the UI has changed after you got the widget object”错误信息。
**可能原因**
在用例中代码查找到目标控件后,设备界面发生了变化,导致查找到的控件丢失,无法进行下一步的模拟操作。
**解决方法**
重新执行UI测试用例。
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
- 振动 - 振动
- [振动开发概述](vibrator-overview.md) - [振动开发概述](vibrator-overview.md)
- [振动开发指导](vibrator-guidelines.md) - [振动开发指导](vibrator-guidelines.md)
- 设备管理 - 多模输入
- [输入设备开发指导](inputdevice-guidelines.md) - [输入设备开发指导](inputdevice-guidelines.md)
- [鼠标光标开发指导](pointerstyle-guidelines.md) - [鼠标光标开发指导](pointerstyle-guidelines.md)
- 升级服务 - 升级服务
......
...@@ -14,17 +14,18 @@ ...@@ -14,17 +14,18 @@
## 接口说明 ## 接口说明
进行坐标和地理编码信息的相互转化,所使用的接口说明如下,详细信息参见:[位置服务](../reference/apis/js-apis-geoLocationManager.md) 进行坐标和地理编码信息的相互转化,所使用的接口说明如下,详细信息参见:[位置服务](../reference/apis/js-apis-geolocation.md)
**表1** 地理编码转化能力和逆地理编码转化能力的API功能介绍 **表1** 地理编码转化能力和逆地理编码转化能力的API功能介绍
| 接口名 | 功能描述 | | 接口名 | 功能描述 |
| -------- | -------- | | -------- | -------- |
| isGeocoderAvailable(): boolean; | 判断(逆)地理编码服务状态。 | | isGeoServiceAvailable(callback: AsyncCallback&lt;boolean&gt;) : void | 判断(逆)地理编码服务状态,使用callback回调异步返回结果。 |
| getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback&lt;Array&lt;GeoAddress&gt;&gt;): void | 调用逆地理编码服务,将坐标转换为地理描述,使用callback回调异步返回结果。 | | isGeoServiceAvailable() : Promise&lt;boolean&gt; | 判断(逆)地理编码服务状态,使用Promise方式异步返回结果。 |
| getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise&lt;Array&lt;GeoAddress&gt;&gt; | 调用逆地理编码服务,将坐标转换为地理描述,使用Promise方式异步返回结果。 | | getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback&lt;Array&lt;GeoAddress&gt;&gt;) : void | 调用逆地理编码服务,将坐标转换为地理描述,使用callback回调异步返回结果。 |
| getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback&lt;Array&lt;GeoAddress&gt;&gt;): void | 调用地理编码服务,将地理描述转换为具体坐标,使用callback回调异步返回结果。 | | getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise&lt;Array&lt;GeoAddress&gt;&gt; | 调用逆地理编码服务,将坐标转换为地理描述,使用Promise方式异步返回结果。 |
| getAddressesFromLocationName(request: GeoCodeRequest): Promise&lt;Array&lt;GeoAddress&gt;&gt; | 调用地理编码服务,将地理描述转换为具体坐标,使用Promise方式异步返回结果。 | | getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback&lt;Array&lt;GeoAddress&gt;&gt;) : void | 调用地理编码服务,将地理描述转换为具体坐标,使用callback回调异步返回结果。 |
| getAddressesFromLocationName(request: GeoCodeRequest) : Promise&lt;Array&lt;GeoAddress&gt;&gt; | 调用地理编码服务,将地理描述转换为具体坐标,使用Promise方式异步返回结果。 |
## 开发步骤 ## 开发步骤
...@@ -32,22 +33,23 @@ ...@@ -32,22 +33,23 @@
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> GeoConvert需要访问后端服务,请确保设备联网,以进行信息获取。 > GeoConvert需要访问后端服务,请确保设备联网,以进行信息获取。
1. 导入geoLocationManager模块,所有与(逆)地理编码转化能力相关的功能API,都是通过该模块提供的。 1. 导入geolocation模块,所有与(逆)地理编码转化能力相关的功能API,都是通过该模块提供的。
```ts ```ts
import geoLocationManager from '@ohos.geoLocationManager'; import geolocation from '@ohos.geolocation';
``` ```
2. 查询geoCoder服务是否可用。 2. 查询geoCoder服务是否可用。
- 调用isGeoServiceAvailable查询geoCoder服务是否可用,如果服务可用再继续进行步骤3。 - 调用isGeoServiceAvailable查询geoCoder服务是否可用,如果服务可用再继续进行步骤3。
```ts ```ts
import geoLocationManager from '@ohos.geoLocationManager'; geolocation.isGeoServiceAvailable((err, data) => {
try { if (err) {
var isAvailable = geoLocationManager.isGeocoderAvailable(); console.log('isGeoServiceAvailable err: ' + JSON.stringify(err));
} catch (err) { } else {
console.error("errCode:" + err.code + ",errMessage:" + err.message); console.log('isGeoServiceAvailable data: ' + JSON.stringify(data));
} }
});
``` ```
3. 获取转化结果。 3. 获取转化结果。
...@@ -55,7 +57,7 @@ ...@@ -55,7 +57,7 @@
```ts ```ts
var reverseGeocodeRequest = {"latitude": 31.12, "longitude": 121.11, "maxItems": 1}; var reverseGeocodeRequest = {"latitude": 31.12, "longitude": 121.11, "maxItems": 1};
geoLocationManager.getAddressesFromLocation(reverseGeocodeRequest, (err, data) => { geolocation.getAddressesFromLocation(reverseGeocodeRequest, (err, data) => {
if (err) { if (err) {
console.log('getAddressesFromLocation err: ' + JSON.stringify(err)); console.log('getAddressesFromLocation err: ' + JSON.stringify(err));
} else { } else {
...@@ -64,12 +66,12 @@ ...@@ -64,12 +66,12 @@
}); });
``` ```
参考接口API说明[位置服务](../reference/apis/js-apis-geoLocationManager.md),应用可以获得与此坐标匹配的GeoAddress列表,应用可以根据实际使用需求,读取相应的参数数据。 参考接口API说明[位置服务](../reference/apis/js-apis-geolocation.md),应用可以获得与此坐标匹配的GeoAddress列表,应用可以根据实际使用需求,读取相应的参数数据。
- 调用getAddressesFromLocationName位置描述转化坐标。 - 调用getAddressesFromLocationName位置描述转化坐标。
```ts ```ts
var geocodeRequest = {"description": "上海市浦东新区xx路xx号", "maxItems": 1}; var geocodeRequest = {"description": "上海市浦东新区xx路xx号", "maxItems": 1};
geoLocationManager.getAddressesFromLocationName(geocodeRequest, (err, data) => { geolocation.getAddressesFromLocationName(geocodeRequest, (err, data) => {
if (err) { if (err) {
console.log('getAddressesFromLocationName err: ' + JSON.stringify(err)); console.log('getAddressesFromLocationName err: ' + JSON.stringify(err));
} else { } else {
...@@ -78,6 +80,6 @@ ...@@ -78,6 +80,6 @@
}); });
``` ```
参考接口API说明[位置服务](../reference/apis/js-apis-geoLocationManager.md),应用可以获得与位置描述相匹配的GeoAddress列表,其中包含对应的坐标数据,请参考API使用。 参考接口API说明[位置服务](../reference/apis/js-apis-geolocation.md),应用可以获得与位置描述相匹配的GeoAddress列表,其中包含对应的坐标数据,请参考API使用。
如果需要查询的位置描述可能出现多地重名的请求,可以设置GeoCodeRequest,通过设置一个经纬度范围,以高效地获取期望的准确结果。 如果需要查询的位置描述可能出现多地重名的请求,可以设置GeoCodeRequest,通过设置一个经纬度范围,以高效地获取期望的准确结果。
...@@ -10,12 +10,12 @@ ...@@ -10,12 +10,12 @@
## 接口说明 ## 接口说明
获取设备的位置信息,所使用的接口说明参见:[位置服务](../reference/apis/js-apis-geoLocationManager.md) 获取设备的位置信息,所使用的接口说明参见:[位置服务](../reference/apis/js-apis-geolocation.md)
## 开发步骤 ## 开发步骤
如需要获取设备位置相关接口信息,请参考[位置服务](../reference/apis/js-apis-geoLocationManager.md) 如需要获取设备位置相关接口信息,请参考[位置服务](../reference/apis/js-apis-geolocation.md)
1. 应用在使用系统能力前,需要检查是否已经获取用户授权访问设备位置信息。如未获得授权,可以向用户申请需要的位置权限,申请方式请参考下文。 1. 应用在使用系统能力前,需要检查是否已经获取用户授权访问设备位置信息。如未获得授权,可以向用户申请需要的位置权限,申请方式请参考下文。
系统提供的定位权限有: 系统提供的定位权限有:
...@@ -42,10 +42,10 @@ ...@@ -42,10 +42,10 @@
开发者可以在应用配置文件中声明所需要的权限,具体可参考[授权申请指导](../security/accesstoken-guidelines.md) 开发者可以在应用配置文件中声明所需要的权限,具体可参考[授权申请指导](../security/accesstoken-guidelines.md)
2. 导入geoLocationManager模块,所有与基础定位能力相关的功能API,都是通过该模块提供的。 2. 导入geolocation模块,所有与基础定位能力相关的功能API,都是通过该模块提供的。
```ts ```
import geoLocationManager from '@ohos.geoLocationManager'; import geolocation from '@ohos.geolocation';
``` ```
3. 实例化LocationRequest对象,用于告知系统该向应用提供何种类型的位置服务,以及位置结果上报的频率。<br/> 3. 实例化LocationRequest对象,用于告知系统该向应用提供何种类型的位置服务,以及位置结果上报的频率。<br/>
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
以导航场景为例,实例化方式如下: 以导航场景为例,实例化方式如下:
```ts ```
var requestInfo = {'scenario': geoLocationManager.LocationRequestScenario.NAVIGATION, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0}; var requestInfo = {'scenario': geolocation.LocationRequestScenario.NAVIGATION, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0};
``` ```
**方式二:** **方式二:**
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
以定位精度优先策略为例,实例化方式如下: 以定位精度优先策略为例,实例化方式如下:
```ts ```ts
var requestInfo = {'priority': geoLocationManager.LocationRequestPriority.ACCURACY, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0}; var requestInfo = {'priority': geolocation.LocationRequestPriority.ACCURACY, 'timeInterval': 0, 'distanceInterval': 0, 'maxAccuracy': 0};
``` ```
4. 实例化Callback对象,用于向系统提供位置上报的途径。 4. 实例化Callback对象,用于向系统提供位置上报的途径。
...@@ -123,24 +123,25 @@ ...@@ -123,24 +123,25 @@
5. 启动定位。 5. 启动定位。
```ts ```ts
geoLocationManager.on('locationChange', requestInfo, locationChange); geolocation.on('locationChange', requestInfo, locationChange);
``` ```
6. (可选)结束定位。 6. (可选)结束定位。
```ts ```ts
geoLocationManager.off('locationChange', locationChange); geolocation.off('locationChange', locationChange);
``` ```
如果应用使用场景不需要实时的设备位置,可以获取系统缓存的最近一次历史定位结果。 如果应用使用场景不需要实时的设备位置,可以获取系统缓存的最近一次历史定位结果。
```ts ```ts
import geoLocationManager from '@ohos.geoLocationManager'; geolocation.getLastLocation((err, data) => {
try { if (err) {
var location = geoLocationManager.getLastLocation(); console.log('getLastLocation: err: ' + JSON.stringify(err));
} catch (err) { } else {
console.error("errCode:" + err.code + ",errMessage:" + err.message); console.log('getLastLocation: data: ' + JSON.stringify(data));
} }
});
``` ```
此接口的使用需要应用向用户申请ohos.permission.LOCATION权限。 此接口的使用需要应用向用户申请ohos.permission.LOCATION权限。
\ No newline at end of file
...@@ -16,10 +16,10 @@ import inputDevice from '@ohos.multimodalInput.inputDevice'; ...@@ -16,10 +16,10 @@ import inputDevice from '@ohos.multimodalInput.inputDevice';
| 实例名 | 接口名 | 说明 | | 实例名 | 接口名 | 说明 |
| ----------- | ------------------------------------------------------------ | -------------------------- | | ----------- | ------------------------------------------------------------ | -------------------------- |
| inputDevice | **function** getDeviceList(callback: AsyncCallback<Array<**number**>>): **void**; | 获取输入设备列表。 | | inputDevice | function getDeviceList(callback: AsyncCallback\<Array\<number>>): void; | 获取输入设备列表。 |
| inputDevice | **function** getKeyboardType(deviceId: **number**, callback: AsyncCallback<KeyboardType>): **void**; | 获取输入设备的键盘类型。 | | inputDevice | function getKeyboardType(deviceId: number, callback: AsyncCallback\<KeyboardType>): void; | 获取输入设备的键盘类型。 |
| inputDevice | **function** on(**type**: "change", listener: Callback<DeviceListener>): **void**; | 监听输入设备的热插拔事件。 | | inputDevice | function on(type: "change", listener: Callback\<DeviceListener>): void; | 监听输入设备的热插拔事件。 |
| inputDevice | **function** off(**type**: "change", listener?: Callback<DeviceListener>): **void**; | 取消监听输入设备的热插拔事件。 | | inputDevice | function off(type: "change", listener?: Callback\<DeviceListener>): void; | 取消监听输入设备的热插拔事件。 |
## 虚拟键盘弹出检测 ## 虚拟键盘弹出检测
......
...@@ -16,10 +16,10 @@ import inputDevice from '@ohos.multimodalInput.pointer'; ...@@ -16,10 +16,10 @@ import inputDevice from '@ohos.multimodalInput.pointer';
| 实例名 | 接口名 | 说明 | | 实例名 | 接口名 | 说明 |
| ------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | ------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| pointer | **function** isPointerVisible(callback: AsyncCallback<boolean>): **void**; | 获取鼠标指针显示或隐藏状态。 | | pointer | function isPointerVisible(callback: AsyncCallback\<boolean>): void; | 获取鼠标指针显示或隐藏状态。 |
| pointer | **function** setPointerVisible(visible: boolean, callback: AsyncCallback<**void**>): **void**; | 设置鼠标指针显示或隐藏状态,改接口会影响全局鼠标光标的显示状态。 | | pointer | function setPointerVisible(visible: boolean, callback: AsyncCallback\<void>): void; | 设置鼠标指针显示或隐藏状态,改接口会影响全局鼠标光标的显示状态。 |
| pointer | **function** setPointerStyle(windowId: **number**, pointerStyle: PointerStyle, callback: AsyncCallback<**void**>): **void**; | 设置鼠标光标样式,改接口会影响指定窗口鼠标光标样式。 | | pointer | function setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback\<void>): void; | 设置鼠标光标样式,改接口会影响指定窗口鼠标光标样式。 |
| pointer | **function** getPointerStyle(windowId: **number**, callback: AsyncCallback<PointerStyle>): **void**; | 查询鼠标光标样式。 | | pointer | function getPointerStyle(windowId: number, callback: AsyncCallback\<PointerStyle>): void; | 查询鼠标光标样式。 |
## 设置鼠标光标隐藏 ## 设置鼠标光标隐藏
......
...@@ -21,7 +21,7 @@ display.getDefaultDisplay((err, data) => { ...@@ -21,7 +21,7 @@ display.getDefaultDisplay((err, data) => {
}); });
``` ```
## 如何获取当前运行设备类型(穿戴、平板等) ## 如何获取当前运行设备类型
适用于:OpenHarmony SDK 3.2.2.5版本,API9 Stage模型 适用于:OpenHarmony SDK 3.2.2.5版本,API9 Stage模型
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
| 接口名 | 描述 | | 接口名 | 描述 |
|----------------------------------------------------------------------------------|-------------| |----------------------------------------------------------------------------------|-------------|
| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback<AVSession\>): void | 创建会话 | | createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback\<AVSession>): void | 创建会话 |
| setAVMetadata(data: AVMetadata, callback: AsyncCallback<void\>): void | 设置会话元数据 | | setAVMetadata(data: AVMetadata, callback: AsyncCallback\<void>): void | 设置会话元数据 |
| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback<void\>): void | 设置会话播放状态信息 | | setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\<void>): void | 设置会话播放状态信息 |
| setLaunchAbility(ability: WantAgent, callback: AsyncCallback<void\>): void | 设置启动ability | | setLaunchAbility(ability: WantAgent, callback: AsyncCallback\<void>): void | 设置启动ability |
| getController(callback: AsyncCallback<AVSessionController\>): void | 获取当前会话自身控制器 | | getController(callback: AsyncCallback\<AVSessionController>): void | 获取当前会话自身控制器 |
| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo\>): void | 获取音频输出设备信息 | | getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void | 获取音频输出设备信息 |
| activate(callback: AsyncCallback<void\>): void | 激活会话 | | activate(callback: AsyncCallback\<void>): void | 激活会话 |
| destroy(callback: AsyncCallback<void\>): void | 销毁会话 | | destroy(callback: AsyncCallback\<void>): void | 销毁会话 |
### 开发步骤 ### 开发步骤
1.导入模块接口 1.导入模块接口
...@@ -354,14 +354,14 @@ currentSession.deactivate().then(() => { ...@@ -354,14 +354,14 @@ currentSession.deactivate().then(() => {
| 接口名 | 描述 | | 接口名 | 描述 |
| ------------------------------------------------------------------------------------------------ | ----------------- | | ------------------------------------------------------------------------------------------------ | ----------------- |
| getAllSessionDescriptors(callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void | 获取所有会话的描述符 | | getAllSessionDescriptors(callback: AsyncCallback\<Array\<Readonly\<AVSessionDescriptor>>>): void | 获取所有会话的描述符 |
| createController(sessionId: string, callback: AsyncCallback<AVSessionController>): void | 创建控制器 | | createController(sessionId: string, callback: AsyncCallback\<AVSessionController>): void | 创建控制器 |
| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void\>): void | 发送按键命令 | | sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\<void>): void | 发送按键命令 |
| getLaunchAbility(callback: AsyncCallback<WantAgent\>): void | 拉起应用 | | getLaunchAbility(callback: AsyncCallback\<WantAgent>): void | 拉起应用 |
| sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void\>): void | 发送控制命令 | | sendControlCommand(command: AVControlCommand, callback: AsyncCallback\<void>): void | 发送控制命令 |
| sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | 发送系统按键命令 | | sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback\<void>): void | 发送系统按键命令 |
| sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void | 发送系统控制命令 | | sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback\<void>): void | 发送系统控制命令 |
| castAudio(session: SessionToken | 'all', audioDevices: Array<audio.AudioDeviceDescriptor>, callback: AsyncCallback<void>): void | 远端投播 | | castAudio(session: SessionToken | 'all', audioDevices: Array\<audio.AudioDeviceDescriptor>, callback: AsyncCallback\<void>): void | 远端投播 |
### 开发步骤 ### 开发步骤
1.导入模块接口 1.导入模块接口
......
...@@ -21,23 +21,27 @@ let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: { ...@@ -21,23 +21,27 @@ let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {
// 创建pixelmap对象 // 创建pixelmap对象
const color = new ArrayBuffer(96); const color = new ArrayBuffer(96);
let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: { height: 2, width: 3 } } let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: { height: 2, width: 3 } }
image.createPixelMap(color, opts, pixelmap => { image.createPixelMap(color, opts, (err, pixelmap) => {
console.log('Succeeded in creating pixelmap.'); console.log('Succeeded in creating pixelmap.');
}) })
// 用于读像素 // 用于读像素
pixelmap.readPixels(area,(data) => { const area = {
if(data !== null) { pixels: new ArrayBuffer(8),
var bufferArr = new Uint8Array(area.pixels); offset: 0,
var res = true; stride: 8,
for (var i = 0; i < bufferArr.length; i++) { region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
console.info(' buffer ' + bufferArr[i]); }
if(res) { pixelmap.readPixels(area,() => {
if(bufferArr[i] == 0) { var bufferArr = new Uint8Array(area.pixels);
res = false; var res = true;
console.log('readPixels end.'); for (var i = 0; i < bufferArr.length; i++) {
break; console.info(' buffer ' + bufferArr[i]);
} if(res) {
if(bufferArr[i] == 0) {
res = false;
console.log('readPixels end.');
break;
} }
} }
} }
...@@ -128,7 +132,7 @@ imageSourceApi.release(() => { ...@@ -128,7 +132,7 @@ imageSourceApi.release(() => {
const imagePackerApi = image.createImagePacker(); const imagePackerApi = image.createImagePacker();
const imageSourceApi = image.createImageSource(0); const imageSourceApi = image.createImageSource(0);
let packOpts = { format:"image/jpeg", quality:98 }; let packOpts = { format:"image/jpeg", quality:98 };
imagePackerApi.packing(imageSourceApi, packOpts, data => { imagePackerApi.packing(imageSourceApi, packOpts, (err, data) => {
console.log('Succeeded in packing'); console.log('Succeeded in packing');
}) })
...@@ -156,7 +160,7 @@ let decodingOptions = { ...@@ -156,7 +160,7 @@ let decodingOptions = {
}; };
// 用于回调方式创建pixelmap // 用于回调方式创建pixelmap
imageSourceApi.createPixelMap(decodingOptions, pixelmap => { imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => {
console.log('Succeeded in creating pixelmap.'); console.log('Succeeded in creating pixelmap.');
}) })
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
- [使用ArkTS语言开发(FA模型)](start-with-ets-fa.md) - [使用ArkTS语言开发(FA模型)](start-with-ets-fa.md)
- [使用JS语言开发(FA模型)](start-with-js-fa.md) - [使用JS语言开发(FA模型)](start-with-js-fa.md)
- 开发基础知识 - 开发基础知识
- [应用包结构说明(FA模型)](package-structure.md) - [应用包结构配置文件的说明(FA模型)](package-structure.md)
- [应用包结构说明(Stage模型)](stage-structure.md) - [应用包结构配置文件的说明(Stage模型)](stage-structure.md)
- [SysCap说明](syscap.md) - [SysCap说明](syscap.md)
- [资源分类与访问](resource-categories-and-access.md) - [资源分类与访问](resource-categories-and-access.md)
- 学习ArkTS语言 - 学习ArkTS语言
......
# SysCap使用指南 # 系统能力SystemCapability使用指南
## 概述 ## 概述
### 系统能力与 API ### 系统能力与 API
SysCap,全称SystemCapability,即系统能力,指操作系统中每一个相对独立的特性,如蓝牙,WIFI,NFC,摄像头等,都是系统能力之一。每个系统能力对应多个 API,这些 API 绑定在一起,随着目标设备是否支持该系统能力共同存在或消失,也会随着 IDE 一起提供给开发者做联想。 SysCap,全称SystemCapability,即系统能力,指操作系统中每一个相对独立的特性,如蓝牙,WIFI,NFC,摄像头等,都是系统能力之一。每个系统能力对应多个API,随着目标设备是否支持该系统能力共同存在或消失,也会随着DevEco Studio一起提供给开发者做联想。
![image-20220326064841782](figures/image-20220326064841782.png) ![image-20220326064841782](figures/image-20220326064841782.png)
开发者可以在[SysCap列表](../reference/syscap-list.md)中查询OpenHarmony的能力集。 开发者可以在[SysCap列表](../reference/syscap-list.md)中查询OpenHarmony的能力集。
### 支持能力集,联想能力集与要求能力集 ### 支持能力集,联想能力集与要求能力集
支持能力集,联想能力集与要求能力集都是系统能力的集合。 支持能力集,联想能力集与要求能力集都是系统能力的集合。
支持能力集描述的是设备能力,要求能力集描述的是应用能力。若应用A的要求能力集是设备N的支持能力集的子集,则应用A可分发到设备N上安装运行,否则不能分发。 支持能力集描述的是设备能力,要求能力集描述的是应用能力。若应用A的要求能力集是设备N的支持能力集的子集,则应用A可分发到设备N上安装运行,否则不能分发。
联想能力集是该应用开发时,IDE 可联想的 API 所在的系统能力集合。 联想能力集是该应用开发时,DevEco Studio可联想的API所在的系统能力集合。
![image-20220326064913834](figures/image-20220326064913834.png) ![image-20220326064913834](figures/image-20220326064913834.png)
### 设备与支持能力集 ### 设备与支持能力集
每个设备根据其硬件能力,对应不同的支持能力集。 每个设备根据其硬件能力,对应不同的支持能力集。
SDK 将设备分为两组,典型设备和自定义设备,典型设备的支持能力集由 OpenHarmony 来定义,自定义设备由设备厂商给出。 SDK将设备分为两组,典型设备和自定义设备,典型设备的支持能力集由OpenHarmony来定义,自定义设备由设备厂商给出。
![image-20220326064955505](figures/image-20220326064955505.png) ![image-20220326064955505](figures/image-20220326064955505.png)
### 设备与SDK能力的对应 ### 设备与SDK能力的对应
SDK 提供全量的 API 给 IDE,IDE 通过开发者的项目支持的设备,找到该设备的支持能力集,筛选支持能力集包含的 API 提供给开发者做联想。 SDK向DevEco Studio提供全量API,DevEco Studio识别开发者项目中选择的设备形态,找到该设备的支持能力集,筛选支持能力集包含的API并提供API联想。
![image-20220326065043006](figures/image-20220326065043006.png) ![image-20220326065043006](figures/image-20220326065043006.png)
## SysCap开发指导 ## SysCap开发指导
### PCID获取 ### PCID获取
PCID,全称 Product Compatibility ID,包含当前设备支持的 syscap 信息。获取所有设备 PCID 的认证中心正在建设中,目前需要找对应设备的厂商获取该设备的 PCID。 PCID,全称Product Compatibility ID,包含当前设备支持的SysCap信息。获取所有设备PCID的认证中心正在建设中,目前需要找对应设备的厂商获取该设备的PCID。
### PCID导入 ### PCID导入
DevEco Studio 工程支持 PCID 的导入。导入的 PCID 文件解码后输出的 syscap 会被写入 syscap.json 文件中。 DevEco Studio工程支持PCID的导入。导入的PCID文件解码后输出的SysCap会被写入syscap.json文件中。
在工程目录右键后选择 Import Product Compatibility ID,即可上传 PCID 文件并导入至 syscap.json 中。 在工程目录右键后选择Import Product Compatibility ID,即可上传PCID文件并导入至syscap.json中。
![20220329-103626](figures/20220329-103626.gif) ![20220329-103626](figures/20220329-103626.gif)
### 配置联想能力集和要求能力集 ### 配置联想能力集和要求能力集
IDE 会根据创建的工程所支持的设置自动配置联想能力集和要求能力集,开发者也可以自行修改。 DevEco Studio会根据创建的工程所支持的设置自动配置联想能力集和要求能力集,开发者也可以自行修改。
对于联想能力集,开发者通过添加更多的系统能力,在 IDE 中可以使用更多的 API,但要注意这些 API 可能在设备上不支持,使用前需要判断。 对于联想能力集,开发者通过添加更多的系统能力,在DevEco Studio中可以使用更多的API,但要注意这些API可能在设备上不支持,使用前需要判断。
对于要求能力集,开发者修改时要十分慎重,修改不当会导致应用无法分发到目标设备上。 对于要求能力集,开发者修改时要十分慎重,修改不当会导致应用无法分发到目标设备上。
```json ```json
...@@ -91,51 +79,44 @@ IDE 会根据创建的工程所支持的设置自动配置联想能力集和要 ...@@ -91,51 +79,44 @@ IDE 会根据创建的工程所支持的设置自动配置联想能力集和要
} }
``` ```
### 单设备应用开发 ### 单设备应用开发
默认应用的联想能力集,要求系统能力集和设备的支持系统能力集相等,开发者修改要求能力集需要慎重。 默认应用的联想能力集,要求系统能力集和设备的支持系统能力集相等,开发者修改要求能力集需要慎重。
![image-20220326065124911](figures/image-20220326065124911.png) ![image-20220326065124911](figures/image-20220326065124911.png)
### 跨设备应用开发 ### 跨设备应用开发
默认应用的联想能力集是多个设备支持能力集的并集,要求能力集则是交集。 默认应用的联想能力集是多个设备支持能力集的并集,要求能力集则是交集。
![image-20220326065201867](figures/image-20220326065201867.png) ![image-20220326065201867](figures/image-20220326065201867.png)
### 判断 API 是否可以使用 ### 判断 API 是否可以使用
首先我们定义了 API canIUse 帮助开发者来判断该工程是否支持某个特定的syscap。 - 方法1:OpenHarmony定义了API canIUse帮助开发者来判断该工程是否支持某个特定的syscap。
``` ```
if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) { if (canIUse("SystemCapability.ArkUI.ArkUI.Full")) {
console.log("该应用支持SystemCapability.ArkUI.ArkUI.Full"); console.log("该应用支持SystemCapability.ArkUI.ArkUI.Full");
} else { } else {
console.log("该应用不支持SystemCapability.ArkUI.ArkUI.Full"); console.log("该应用不支持SystemCapability.ArkUI.ArkUI.Full");
} }
``` ```
开发者可通过 import 的方式将模块导入,若当前设备不支持该模块,import 的结果为 undefined,开发者在使用其 API 时,需要判断其是否存在。
``` - 方法2:开发者可通过 import 的方式将模块导入,若当前设备不支持该模块,import 的结果为 undefined,开发者在使用其 API 时,需要判断其是否存在。
import geolocation from '@ohos.geolocation';
if (geolocation) {
geolocation.getCurrentLocation((location) => {
console.log(location.latitude, location.longitude);
});
} else {
console.log('该设备不支持位置信息');
}
```
```
import geolocation from '@ohos.geolocation';
if (geolocation) {
geolocation.getCurrentLocation((location) => {
console.log(location.latitude, location.longitude);
});
} else {
console.log('该设备不支持位置信息');
}
```
除此之外,开发者可以通过API参考文档查询API接口所属的SysCap。
### 不同设备相同能力的差异检查 ### 不同设备相同能力的差异检查
...@@ -159,7 +140,6 @@ authenticator.execute('FACE_ONLY', 'S1', (err, result) => { ...@@ -159,7 +140,6 @@ authenticator.execute('FACE_ONLY', 'S1', (err, result) => {
}) })
``` ```
### 设备间的SysCap差异如何产生的 ### 设备间的SysCap差异如何产生的
设备的SysCap因产品解决方案厂商拼装的部件组合不同而不同,整体流程如下图: 设备的SysCap因产品解决方案厂商拼装的部件组合不同而不同,整体流程如下图:
......
# 开发参考 # 开发参考
- [Syscap列表](syscap-list.md) - [Syscap列表](syscap-list.md)
- [组件参考(基于ArkTS的声明式开发范式)](arkui-ts/Readme-CN.md) - [组件参考(基于ArkTS的声明式开发范式)](arkui-ts/Readme-CN.md)
- [组件参考(兼容JS的类Web开发范式)](arkui-js/Readme-CN.md) - [组件参考(兼容JS的类Web开发范式)](arkui-js/Readme-CN.md)
- [JS服务卡片UI组件参考](js-service-widget-ui/Readme-CN.md) - [JS服务卡片UI组件参考](js-service-widget-ui/Readme-CN.md)
- [接口参考(JS及TS API)](apis/Readme-CN.md) - [接口参考(JS及TS API)](apis/Readme-CN.md)
- [错误码参考](errorcodes/Readme-CN.md)
- 接口参考(Native API) - 接口参考(Native API)
- [OpenHarmony Native API](native-apis/Readme-CN.md) - [OpenHarmony Native API](native-apis/Readme-CN.md)
- [Native API标准库](native-lib/Readme-CN.md) - [Native API标准库](native-lib/Readme-CN.md)
# 接口 # 接口
- [开发说明](development-intro.md) - [开发说明](development-intro.md)
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
- [@ohos.ability.dataUriUtils (DataUriUtils模块)](js-apis-DataUriUtils.md) - [@ohos.ability.dataUriUtils (DataUriUtils模块)](js-apis-DataUriUtils.md)
- [@ohos.ability.errorCode (ErrorCode)](js-apis-ability-errorCode.md) - [@ohos.ability.errorCode (ErrorCode)](js-apis-ability-errorCode.md)
- [@ohos.ability.wantConstant (wantConstant)](js-apis-ability-wantConstant.md) - [@ohos.ability.wantConstant (wantConstant)](js-apis-ability-wantConstant.md)
- [@ohos.app.ability.appRecovery (appRecovery)](js-apis-app-ability-appRecovery.md)
- [@ohos.application.abilityDelegatorRegistry (AbilityDelegatorRegistry)](js-apis-abilityDelegatorRegistry.md) - [@ohos.application.abilityDelegatorRegistry (AbilityDelegatorRegistry)](js-apis-abilityDelegatorRegistry.md)
- [@ohos.application.abilityManager (AbilityManager)](js-apis-application-abilityManager.md) - [@ohos.application.abilityManager (AbilityManager)](js-apis-application-abilityManager.md)
- [@ohos.application.appManager (appManager)](js-apis-appmanager.md) - [@ohos.application.appManager (appManager)](js-apis-appmanager.md)
...@@ -182,7 +183,6 @@ ...@@ -182,7 +183,6 @@
- [@ohos.net.http (数据请求)](js-apis-http.md) - [@ohos.net.http (数据请求)](js-apis-http.md)
- [@ohos.net.sharing (网络共享管理)](js-apis-net-sharing.md) - [@ohos.net.sharing (网络共享管理)](js-apis-net-sharing.md)
- [@ohos.net.socket (Socket连接)](js-apis-socket.md) - [@ohos.net.socket (Socket连接)](js-apis-socket.md)
- [@ohos.net.tlsSocket (TLSSocket连接)](js-apis-tlsSocket.md)
- [@ohos.net.webSocket (WebSocket连接)](js-apis-webSocket.md) - [@ohos.net.webSocket (WebSocket连接)](js-apis-webSocket.md)
- [@ohos.request (上传下载)](js-apis-request.md) - [@ohos.request (上传下载)](js-apis-request.md)
...@@ -249,6 +249,8 @@ ...@@ -249,6 +249,8 @@
- [@ohos.runningLock (Runninglock锁)](js-apis-runninglock.md) - [@ohos.runningLock (Runninglock锁)](js-apis-runninglock.md)
- [@ohos.sensor (传感器)](js-apis-sensor.md) - [@ohos.sensor (传感器)](js-apis-sensor.md)
- [@ohos.settings (设置数据项名称)](js-apis-settings.md) - [@ohos.settings (设置数据项名称)](js-apis-settings.md)
- [@ohos.stationary (设备状态感知框架)](js-apis-stationary.md)
- [@ohos.systemCapability (系统能力)](js-apis-system-capability.md)
- [@ohos.systemParameterV9 (系统属性)](js-apis-system-parameterV9.md) - [@ohos.systemParameterV9 (系统属性)](js-apis-system-parameterV9.md)
- [@ohos.thermal (热管理)](js-apis-thermal.md) - [@ohos.thermal (热管理)](js-apis-thermal.md)
- [@ohos.update (升级)](js-apis-update.md) - [@ohos.update (升级)](js-apis-update.md)
...@@ -261,7 +263,7 @@ ...@@ -261,7 +263,7 @@
- [@ohos.account.osAccount (系统帐号管理)](js-apis-osAccount.md) - [@ohos.account.osAccount (系统帐号管理)](js-apis-osAccount.md)
- 定制管理 - 定制管理
- [@ohos.configPolicy (配置策略)](js-apis-config-policy.md) - [@ohos.configPolicy (配置策略)](js-apis-configPolicy.md)
- [@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](js-apis-EnterpriseAdminExtensionAbility.md) - [@ohos.enterprise.EnterpriseAdminExtensionAbility (EnterpriseAdminExtensionAbility)](js-apis-EnterpriseAdminExtensionAbility.md)
- [@ohos.enterprise.adminManager (企业设备管理)](js-apis-enterprise-adminManager.md) - [@ohos.enterprise.adminManager (企业设备管理)](js-apis-enterprise-adminManager.md)
- [@ohos.enterprise.dateTimeManager(系统时间管理)](js-apis-enterprise-dateTimeManager.md) - [@ohos.enterprise.dateTimeManager(系统时间管理)](js-apis-enterprise-dateTimeManager.md)
...@@ -311,6 +313,7 @@ ...@@ -311,6 +313,7 @@
- [@ohos.reminderAgent (后台代理提醒)](js-apis-reminderAgent.md) - [@ohos.reminderAgent (后台代理提醒)](js-apis-reminderAgent.md)
- [@ohos.systemParameter (系统属性)](js-apis-system-parameter.md) - [@ohos.systemParameter (系统属性)](js-apis-system-parameter.md)
- [@ohos.usb (USB管理)](js-apis-usb-deprecated.md) - [@ohos.usb (USB管理)](js-apis-usb-deprecated.md)
- [@ohos.workScheduler (延迟任务调度)](js-apis-workScheduler.md)
- [@system.app (应用上下文)](js-apis-system-app.md) - [@system.app (应用上下文)](js-apis-system-app.md)
- [@system.battery (电量信息)](js-apis-system-battery.md) - [@system.battery (电量信息)](js-apis-system-battery.md)
- [@system.bluetooth (蓝牙)](js-apis-system-bluetooth.md) - [@system.bluetooth (蓝牙)](js-apis-system-bluetooth.md)
......
...@@ -46,7 +46,7 @@ SystemCapability.BundleManager.DistributedBundleFramework ...@@ -46,7 +46,7 @@ SystemCapability.BundleManager.DistributedBundleFramework
**参数:** **参数:**
| 名称 | 类型 | 必填 | 描述 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------------------------------------------------------------ | ---- | -------------------------------------------------- | | ----------- | ------------------------------------------------------------ | ---- | -------------------------------------------------- |
| elementName | [ElementName](js-apis-bundle-ElementName.md) | 是 | 获得的ElementName信息。 | | elementName | [ElementName](js-apis-bundle-ElementName.md) | 是 | 获得的ElementName信息。 |
| callback | AsyncCallback<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)> | 是 | 程序启动作为入参的回调函数,返回远程基本能力信息。 | | callback | AsyncCallback<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)> | 是 | 程序启动作为入参的回调函数,返回远程基本能力信息。 |
...@@ -75,7 +75,7 @@ SystemCapability.BundleManager.DistributedBundleFramework ...@@ -75,7 +75,7 @@ SystemCapability.BundleManager.DistributedBundleFramework
**参数:** **参数:**
| 名称 | 类型 | 必填 | 描述 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- | -------------------------------------------- | ---- | ----------------------- | | ----------- | -------------------------------------------- | ---- | ----------------------- |
| elementName | [ElementName](js-apis-bundle-ElementName.md) | 是 | 获得的ElementName信息。 | | elementName | [ElementName](js-apis-bundle-ElementName.md) | 是 | 获得的ElementName信息。 |
...@@ -107,10 +107,10 @@ SystemCapability.BundleManager.DistributedBundleFramework ...@@ -107,10 +107,10 @@ SystemCapability.BundleManager.DistributedBundleFramework
**参数:** **参数:**
| 名称 | 类型 | 必填 | 描述 | | 参数名 | 类型 | 必填 | 说明 |
| ------------ | ------------------------------------------------------------ | ---- | -------------------------------------------------- | | ------------ | ------------------------------------------------------------ | ---- | -------------------------------------------------- |
| elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)> | 是 | ElementName信息,最大数组长度为10 | | elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)> | 是 | ElementName信息,最大数组长度为10 |
| callback | AsyncCallback< Array<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)>> | 是 | 程序启动作为入参的回调函数,返回远程基本能力信息。 | | callback | AsyncCallback<Array<[RemoteAbilityInfo](js-apis-bundle-remoteAbilityInfo.md)>> | 是 | 程序启动作为入参的回调函数,返回远程基本能力信息。 |
...@@ -136,7 +136,7 @@ SystemCapability.BundleManager.DistributedBundleFramework ...@@ -136,7 +136,7 @@ SystemCapability.BundleManager.DistributedBundleFramework
**参数:** **参数:**
| 名称 | 类型 | 必填 | 描述 | | 参数名 | 类型 | 必填 | 说明 |
| ------------ | --------------------------------------------------- | ---- | ----------------------- | | ------------ | --------------------------------------------------- | ---- | ----------------------- |
| elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)> | 是 | ElementName信息,最大数组长度为10。 | | elementNames | Array<[ElementName](js-apis-bundle-ElementName.md)> | 是 | ElementName信息,最大数组长度为10。 |
......
...@@ -446,7 +446,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -446,7 +446,7 @@ SystemCapability.BundleManager.BundleFramework
| -------- | ------------------------------------------------------------ | ---- | ---------------- | | -------- | ------------------------------------------------------------ | ---- | ---------------- |
| callback | AsyncCallback<[BundleInstaller](js-apis-bundle-BundleInstaller.md)> | 是 | 安装应用程序包。 | | callback | AsyncCallback<[BundleInstaller](js-apis-bundle-BundleInstaller.md)> | 是 | 安装应用程序包。 |
## bundle.cleanBundleCacheFiles<sup>deprecated<sup> ## bundle.cleanBundleCacheFiles<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.cleanBundleCacheFiles](js-apis-bundleManager.md#bundlemanagercleanbundlecachefiles)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.cleanBundleCacheFiles](js-apis-bundleManager.md#bundlemanagercleanbundlecachefiles)替代。
...@@ -473,7 +473,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -473,7 +473,7 @@ SystemCapability.BundleManager.BundleFramework
| bundleName | string | 是 | 指示要清除其缓存数据的应用程序包名称. | | bundleName | string | 是 | 指示要清除其缓存数据的应用程序包名称. |
| callback | AsyncCallback\<void> | 是 | 为返回操作结果而调用的回调。 | | callback | AsyncCallback\<void> | 是 | 为返回操作结果而调用的回调。 |
## bundle.cleanBundleCacheFiles<sup>deprecated<sup> ## bundle.cleanBundleCacheFiles<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.cleanBundleCacheFiles](js-apis-bundleManager.md#bundlemanagercleanbundlecachefiles)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.cleanBundleCacheFiles](js-apis-bundleManager.md#bundlemanagercleanbundlecachefiles)替代。
...@@ -505,7 +505,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -505,7 +505,7 @@ SystemCapability.BundleManager.BundleFramework
| ------------- | ------------------------------------ | | ------------- | ------------------------------------ |
| Promise\<void> | 返回值为Promise对象,Promise中为空。 | | Promise\<void> | 返回值为Promise对象,Promise中为空。 |
## bundle.setApplicationEnabled<sup>deprecated<sup> ## bundle.setApplicationEnabled<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.setApplicationEnabled](js-apis-bundleManager.md#bundlemanagersetapplicationenabled)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.setApplicationEnabled](js-apis-bundleManager.md#bundlemanagersetapplicationenabled)替代。
...@@ -533,7 +533,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -533,7 +533,7 @@ SystemCapability.BundleManager.BundleFramework
| isEnable | boolean | 是 | 指定是否启用应用程序。true表示启用,false禁用。 | | isEnable | boolean | 是 | 指定是否启用应用程序。true表示启用,false禁用。 |
| callback | AsyncCallback\<void> | 是 | 为返回操作结果而调用的回调。 | | callback | AsyncCallback\<void> | 是 | 为返回操作结果而调用的回调。 |
## bundle.setApplicationEnabled<sup>deprecated<sup> ## bundle.setApplicationEnabled<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.setApplicationEnabled](js-apis-bundleManager.md#bundlemanagersetapplicationenabled)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.setApplicationEnabled](js-apis-bundleManager.md#bundlemanagersetapplicationenabled)替代。
...@@ -566,7 +566,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -566,7 +566,7 @@ SystemCapability.BundleManager.BundleFramework
| ------------- | ------------------------------------ | | ------------- | ------------------------------------ |
| Promise\<void> | 返回值为Promise对象,Promise中为空。 | | Promise\<void> | 返回值为Promise对象,Promise中为空。 |
## bundle.setAbilityEnabled<sup>deprecated<sup> ## bundle.setAbilityEnabled<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.setAbilityEnabled](js-apis-bundleManager.md#bundlemanagersetabilityenabled)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.setAbilityEnabled](js-apis-bundleManager.md#bundlemanagersetabilityenabled)替代。
...@@ -594,7 +594,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -594,7 +594,7 @@ SystemCapability.BundleManager.BundleFramework
| isEnable | boolean | 是 | 指定是否启用应用程序。true表示启用,false禁用。 | | isEnable | boolean | 是 | 指定是否启用应用程序。true表示启用,false禁用。 |
| callback | AsyncCallback\<void> | 是 | 为返回操作结果而调用的回调。 | | callback | AsyncCallback\<void> | 是 | 为返回操作结果而调用的回调。 |
## bundle.setAbilityEnabled<sup>deprecated<sup> ## bundle.setAbilityEnabled<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.setAbilityEnabled](js-apis-bundleManager.md#bundlemanagersetabilityenabled)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.setAbilityEnabled](js-apis-bundleManager.md#bundlemanagersetabilityenabled)替代。
...@@ -627,7 +627,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -627,7 +627,7 @@ SystemCapability.BundleManager.BundleFramework
| ------------- | ------------------------------------ | | ------------- | ------------------------------------ |
| Promise\<void> | 返回值为Promise对象,Promise中为空。 | | Promise\<void> | 返回值为Promise对象,Promise中为空。 |
## bundle.getPermissionDef<sup>deprecated<sup> ## bundle.getPermissionDef<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.getPermissionDef](js-apis-bundleManager.md#bundlemanagergetpermissiondef)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.getPermissionDef](js-apis-bundleManager.md#bundlemanagergetpermissiondef)替代。
...@@ -654,7 +654,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -654,7 +654,7 @@ SystemCapability.BundleManager.BundleFramework
| permissionName | string | 是 | 指定权限的名称。 | | permissionName | string | 是 | 指定权限的名称。 |
| callback | AsyncCallback<[PermissionDef](js-apis-bundle-PermissionDef)> | 是 | 程序启动作为入参的回调函数,返回定义的权限信息。 | | callback | AsyncCallback<[PermissionDef](js-apis-bundle-PermissionDef)> | 是 | 程序启动作为入参的回调函数,返回定义的权限信息。 |
## bundle.getPermissionDef<sup>deprecated<sup> ## bundle.getPermissionDef<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.getPermissionDef](js-apis-bundleManager.md#bundlemanagergetpermissiondef)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.getPermissionDef](js-apis-bundleManager.md#bundlemanagergetpermissiondef)替代。
...@@ -750,7 +750,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -750,7 +750,7 @@ SystemCapability.BundleManager.BundleFramework
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:参考[BundleFlag说明](#bundleflag)中应用信息相关flag | | bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:参考[BundleFlag说明](#bundleflag)中应用信息相关flag |
| userId | number | | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | | userId | number | | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
| callback | AsyncCallback<Array\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)>> | 是 | 程序启动作为入参的回调函数,返回应用信息列表。 | | callback | AsyncCallback<Array\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)>> | 是 | 程序启动作为入参的回调函数,返回应用信息列表。 |
**示例:** **示例:**
...@@ -956,7 +956,7 @@ bundle.getAbilityInfo(bundleName, abilityName, (err, data) => { ...@@ -956,7 +956,7 @@ bundle.getAbilityInfo(bundleName, abilityName, (err, data) => {
}) })
``` ```
## bundle.getAbilityLabel<sup>deprecated<sup> ## bundle.getAbilityLabel<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.getAbilityLabel](js-apis-bundleManager.md#bundlemanagergetabilitylabel)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.getAbilityLabel](js-apis-bundleManager.md#bundlemanagergetabilitylabel)替代。
...@@ -998,7 +998,7 @@ bundle.getAbilityLabel(bundleName, abilityName) ...@@ -998,7 +998,7 @@ bundle.getAbilityLabel(bundleName, abilityName)
}) })
``` ```
## bundle.getAbilityLabel<sup>deprecated<sup> ## bundle.getAbilityLabel<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.getAbilityLabel](js-apis-bundleManager.md#bundlemanagergetabilitylabel)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.getAbilityLabel](js-apis-bundleManager.md#bundlemanagergetabilitylabel)替代。
...@@ -1036,7 +1036,7 @@ bundle.getAbilityLabel(bundleName, abilityName, (err, data) => { ...@@ -1036,7 +1036,7 @@ bundle.getAbilityLabel(bundleName, abilityName, (err, data) => {
}) })
``` ```
## bundle.isAbilityEnabled<sup>deprecated<sup> ## bundle.isAbilityEnabled<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.isAbilityEnabled](js-apis-bundleManager.md#bundlemanagerisabilityenabled)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.isAbilityEnabled](js-apis-bundleManager.md#bundlemanagerisabilityenabled)替代。
...@@ -1074,7 +1074,7 @@ bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{ ...@@ -1074,7 +1074,7 @@ bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{
}) })
``` ```
## bundle.isAbilityEnabled<sup>deprecated<sup> ## bundle.isAbilityEnabled<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.isAbilityEnabled](js-apis-bundleManager.md#bundlemanagerisabilityenabled)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.isAbilityEnabled](js-apis-bundleManager.md#bundlemanagerisabilityenabled)替代。
...@@ -1109,7 +1109,7 @@ bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{ ...@@ -1109,7 +1109,7 @@ bundle.getAbilityInfo(bundleName, abilityName).then((abilityInfo)=>{
}) })
``` ```
## bundle.isApplicationEnabled<sup>deprecated<sup> ## bundle.isApplicationEnabled<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.isApplicationEnabled](js-apis-bundleManager.md#bundlemanagerisapplicationenabled)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.isApplicationEnabled](js-apis-bundleManager.md#bundlemanagerisapplicationenabled)替代。
...@@ -1145,7 +1145,7 @@ bundle.isApplicationEnabled(bundleName) ...@@ -1145,7 +1145,7 @@ bundle.isApplicationEnabled(bundleName)
}) })
``` ```
## bundle.isApplicationEnabled<sup>deprecated<sup> ## bundle.isApplicationEnabled<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.isApplicationEnabled](js-apis-bundleManager.md#bundlemanagerisapplicationenabled)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.isApplicationEnabled](js-apis-bundleManager.md#bundlemanagerisapplicationenabled)替代。
...@@ -1388,7 +1388,7 @@ bundle.getLaunchWantForBundle(bundleName, (err, data) => { ...@@ -1388,7 +1388,7 @@ bundle.getLaunchWantForBundle(bundleName, (err, data) => {
``` ```
## bundle.getNameForUid<sup>deprecated<sup> ## bundle.getNameForUid<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.getBundleNameByUid](js-apis-bundleManager.md#bundlemanagergetbundlenamebyuid)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.getBundleNameByUid](js-apis-bundleManager.md#bundlemanagergetbundlenamebyuid)替代。
...@@ -1423,7 +1423,7 @@ bundle.getNameForUid(uid) ...@@ -1423,7 +1423,7 @@ bundle.getNameForUid(uid)
}) })
``` ```
## bundle.getNameForUid<sup>deprecated<sup> ## bundle.getNameForUid<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.getBundleNameByUid](js-apis-bundleManager.md#bundlemanagergetbundlenamebyuid)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.getBundleNameByUid](js-apis-bundleManager.md#bundlemanagergetbundlenamebyuid)替代。
...@@ -1456,7 +1456,7 @@ bundle.getNameForUid(uid, (err, data) => { ...@@ -1456,7 +1456,7 @@ bundle.getNameForUid(uid, (err, data) => {
``` ```
## bundle.getAbilityIcon<sup>deprecated<sup> ## bundle.getAbilityIcon<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.getAbilityIcon](js-apis-bundleManager.md#bundlemanagergetabilityicon)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.getAbilityIcon](js-apis-bundleManager.md#bundlemanagergetabilityicon)替代。
...@@ -1497,7 +1497,7 @@ bundle.getAbilityIcon(bundleName, abilityName) ...@@ -1497,7 +1497,7 @@ bundle.getAbilityIcon(bundleName, abilityName)
}) })
``` ```
## bundle.getAbilityIcon<sup>deprecated<sup> ## bundle.getAbilityIcon<sup>8+</sup> <sup>deprecated<sup>
> 从API version 9开始不再维护,建议使用[bundleManager.getAbilityIcon](js-apis-bundleManager.md#bundlemanagergetabilityicon)替代。 > 从API version 9开始不再维护,建议使用[bundleManager.getAbilityIcon](js-apis-bundleManager.md#bundlemanagergetabilityicon)替代。
...@@ -1593,7 +1593,7 @@ bundle.getAbilityIcon(bundleName, abilityName, (err, data) => { ...@@ -1593,7 +1593,7 @@ bundle.getAbilityIcon(bundleName, abilityName, (err, data) => {
**系统能力:** SystemCapability.BundleManager.BundleFramework **系统能力:** SystemCapability.BundleManager.BundleFramework
| 参数名 | 类型 | 可读 | 可写 | 说明 | | 名称 | 类型 | 可读 | 可写 | 说明 |
| ------ | ------ | ---- | ---- | ----------------------------------------------------- | | ------ | ------ | ---- | ---- | ----------------------------------------------------- |
| userId | number | 是 | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | | userId | number | 是 | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 |
...@@ -1605,7 +1605,7 @@ Ability类型 ...@@ -1605,7 +1605,7 @@ Ability类型
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
| 参数名 | 类型 | 说明 | | 名称 | 值 | 说明 |
| ------- | ---- | --------------------------- | | ------- | ---- | --------------------------- |
| UNKNOWN | 无 | 未知Ability类型 | | UNKNOWN | 无 | 未知Ability类型 |
| PAGE | 无 | 表示基于Page模板开发的FA,用于提供与用户交互的能力 | | PAGE | 无 | 表示基于Page模板开发的FA,用于提供与用户交互的能力 |
...@@ -1620,7 +1620,7 @@ Ability类型 ...@@ -1620,7 +1620,7 @@ Ability类型
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
| 参数名 | 类型 | 说明 | | 名称 | 值 | 说明 |
| ------------- | ---- | ------------------------ | | ------------- | ---- | ------------------------ |
| UNSPECIFIED | 无 | 屏幕方向--不指定 | | UNSPECIFIED | 无 | 屏幕方向--不指定 |
| LANDSCAPE | 无 | 屏幕方向--横屏 | | LANDSCAPE | 无 | 屏幕方向--横屏 |
...@@ -1634,7 +1634,7 @@ Ability类型 ...@@ -1634,7 +1634,7 @@ Ability类型
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
| 参数名 | 类型 | 说明 | | 名称 | 值 | 说明 |
| --------- | ---- | ------------------- | | --------- | ---- | ------------------- |
| SINGLETON | 0 | Ability只有一个实例 | | SINGLETON | 0 | Ability只有一个实例 |
| STANDARD | 1 | Ability有多个实例 | | STANDARD | 1 | Ability有多个实例 |
...@@ -1646,7 +1646,7 @@ Ability的子类型 ...@@ -1646,7 +1646,7 @@ Ability的子类型
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
| 参数名 | 类型 | 说明 | | 名称 | 值 | 说明 |
| ----------- | ---- | ----------------------------- | | ----------- | ---- | ----------------------------- |
| UNSPECIFIED | 0 | 未定义Ability子类型 | | UNSPECIFIED | 0 | 未定义Ability子类型 |
| CA | 1 | Ability子类型是带有 UI 的服务 | | CA | 1 | Ability子类型是带有 UI 的服务 |
...@@ -1658,7 +1658,7 @@ Ability的子类型 ...@@ -1658,7 +1658,7 @@ Ability的子类型
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
| 参数名 | 类型 | 说明 | | 名称 | 值 | 说明 |
| ---------- | ---- | -------- | | ---------- | ---- | -------- |
| AUTO_MODE | -1 | 自动模式 | | AUTO_MODE | -1 | 自动模式 |
| DARK_MODE | 0 | 黑色模式 | | DARK_MODE | 0 | 黑色模式 |
...@@ -1673,7 +1673,7 @@ Ability的子类型 ...@@ -1673,7 +1673,7 @@ Ability的子类型
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
| 参数名 | 类型 | 说明 | | 名称 | 值 | 说明 |
| ------------------ | ---- | ------------ | | ------------------ | ---- | ------------ |
| PERMISSION_DENIED | -1 | 拒绝授予权限 | | PERMISSION_DENIED | -1 | 拒绝授予权限 |
| PERMISSION_GRANTED | 0 | 授予权限 | | PERMISSION_GRANTED | 0 | 授予权限 |
\ No newline at end of file
# AbilityRunningInfo # AbilityRunningInfo
AbilityRunningInfo模块提供对Ability运行的相关信息和状态进行设置和查询的能力 AbilityRunningInfo模块提供对Ability运行的相关信息和状态的定义
> **说明:** > **说明:**
> >
......
...@@ -27,6 +27,7 @@ create(options: AnimatorOptions): AnimatorResult ...@@ -27,6 +27,7 @@ create(options: AnimatorOptions): AnimatorResult
| options | [AnimatorOptions](#animatoroptions) | 是 | 定义动画选项。 | | options | [AnimatorOptions](#animatoroptions) | 是 | 定义动画选项。 |
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
| --------------------------------- | ------------- | | --------------------------------- | ------------- |
| [AnimatorResult](#animatorresult) | Animator结果接口。 | | [AnimatorResult](#animatorresult) | Animator结果接口。 |
...@@ -51,8 +52,6 @@ create(options: AnimatorOptions): AnimatorResult ...@@ -51,8 +52,6 @@ create(options: AnimatorOptions): AnimatorResult
定义Animator结果接口。 定义Animator结果接口。
<span id = "#resetsup9sup"></span>
### reset<sup>9+</sup> ### reset<sup>9+</sup>
reset(options: AnimatorOptions): void reset(options: AnimatorOptions): void
...@@ -71,7 +70,7 @@ reset(options: AnimatorOptions): void ...@@ -71,7 +70,7 @@ reset(options: AnimatorOptions): void
以下错误码的详细介绍请参见[ohos.animator(动画)](../errorcodes/errorcode-animator.md)错误码。 以下错误码的详细介绍请参见[ohos.animator(动画)](../errorcodes/errorcode-animator.md)错误码。
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| --------- | ------- | | --------- | ------- |
| 100001 | Internal error. | | 100001 | Internal error. |
...@@ -181,6 +180,7 @@ onframe: (progress: number) => void ...@@ -181,6 +180,7 @@ onframe: (progress: number) => void
| progress | number | 是 | 动画的当前进度。 | | progress | number | 是 | 动画的当前进度。 |
**示例:** **示例:**
```js ```js
let animatorResult = animator.create(options) let animatorResult = animator.create(options)
animatorResult.onframe = function(value) { animatorResult.onframe = function(value) {
...@@ -208,7 +208,7 @@ animatorResult.onfinish = function() { ...@@ -208,7 +208,7 @@ animatorResult.onfinish = function() {
### oncancel ### oncancel
oncancel: () => void oncancel: () => void
不再维护
动画被取消时回调。 动画被取消时回调。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full **系统能力:** SystemCapability.ArkUI.ArkUI.Full
...@@ -247,7 +247,7 @@ animatorResult.onrepeat = function() { ...@@ -247,7 +247,7 @@ animatorResult.onrepeat = function() {
**系统能力:** SystemCapability.ArkUI.ArkUI.Full **系统能力:** SystemCapability.ArkUI.ArkUI.Full
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
| ---------- | ---------------------------------------- | ---- | ---------------------------------------- | | ---------- | ---------------------------------------- | ---- | ---------------------------------------- |
| duration | number | 是 | 动画播放的时长,单位毫秒,默认为0。 | | duration | number | 是 | 动画播放的时长,单位毫秒,默认为0。 |
| easing | string | 是 | 动画插值曲线,默认为'ease'。 | | easing | string | 是 | 动画插值曲线,默认为'ease'。 |
......
...@@ -39,13 +39,13 @@ setDisposedStatus(appId: string, disposedWant: Want): Promise\<void> ...@@ -39,13 +39,13 @@ setDisposedStatus(appId: string, disposedWant: Want): Promise\<void>
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<void> | Promise对象。无返回结果的Promise对象。 | | Promise\<void> | Promise对象。无返回结果的Promise对象。 |
**错误码** **错误码**
以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md) 以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. | | 17700005 | The specified app ID is not found. |
**示例:** **示例:**
...@@ -85,13 +85,13 @@ setDisposedStatus(appId: string, disposedWant: Want, callback: AsyncCallback\<vo ...@@ -85,13 +85,13 @@ setDisposedStatus(appId: string, disposedWant: Want, callback: AsyncCallback\<vo
| disposedWant | Want | 是 | 对应用的处置意图。 | | disposedWant | Want | 是 | 对应用的处置意图。 |
| callback | AsyncCallback\<void> | 是 | 回调函数,当设置处置状态成功,err为undefined,否则为错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数,当设置处置状态成功,err为undefined,否则为错误对象。 |
**错误码** **错误码**
以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md) 以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. | | 17700005 | The specified app ID is not found. |
**示例:** **示例:**
...@@ -136,13 +136,13 @@ getDisposedStatus(appId: string): Promise\<Want>; ...@@ -136,13 +136,13 @@ getDisposedStatus(appId: string): Promise\<Want>;
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<Want> | Promise对象,返回应用的处置状态。 | | Promise\<Want> | Promise对象,返回应用的处置状态。 |
**错误码** **错误码**
以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md) 以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. | | 17700005 | The specified app ID is not found. |
**示例:** **示例:**
...@@ -180,13 +180,13 @@ getDisposedStatus(appId: string, callback: AsyncCallback\<Want>): void; ...@@ -180,13 +180,13 @@ getDisposedStatus(appId: string, callback: AsyncCallback\<Want>): void;
| appId | string | 是 | 要查询的应用的appId<br> appId是应用的唯一标识,由应用的包名和签名信息决定,获取方法参见[获取应用的appId](#获取应用的appid)。 | | appId | string | 是 | 要查询的应用的appId<br> appId是应用的唯一标识,由应用的包名和签名信息决定,获取方法参见[获取应用的appId](#获取应用的appid)。 |
| callback | AsyncCallback\<Want> | 是 | 回调函数。当获取应用的处置状态成功时,err为undefined,data为获取到的处置状态;否则为错误对象。 | | callback | AsyncCallback\<Want> | 是 | 回调函数。当获取应用的处置状态成功时,err为undefined,data为获取到的处置状态;否则为错误对象。 |
**错误码** **错误码**
以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md) 以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. | | 17700005 | The specified app ID is not found. |
**示例:** **示例:**
...@@ -230,13 +230,13 @@ deleteDisposedStatus(appId: string): Promise\<void> ...@@ -230,13 +230,13 @@ deleteDisposedStatus(appId: string): Promise\<void>
| ------------------------- | ------------------ | | ------------------------- | ------------------ |
| Promise\<void> | Promise对象,无返回结果的Promise对象 | | Promise\<void> | Promise对象,无返回结果的Promise对象 |
**错误码** **错误码**
以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md) 以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. | | 17700005 | The specified app ID is not found. |
**示例:** **示例:**
...@@ -274,13 +274,13 @@ deleteDisposedStatus(appId: string, callback: AsyncCallback\<void>) : void ...@@ -274,13 +274,13 @@ deleteDisposedStatus(appId: string, callback: AsyncCallback\<void>) : void
| appId | string | 是 | 要查询的应用的appId。<br> appId是应用的唯一标识,由应用的包名和签名信息决定,获取方法参见[获取应用的appId](#获取应用的appid)。 | | appId | string | 是 | 要查询的应用的appId。<br> appId是应用的唯一标识,由应用的包名和签名信息决定,获取方法参见[获取应用的appId](#获取应用的appid)。 |
| callback | AsyncCallback\<void> | 是 | 回调函数,当设置处置状态成功时,err返回undefined。否则回调函数返回具体错误对象。 | | callback | AsyncCallback\<void> | 是 | 回调函数,当设置处置状态成功时,err返回undefined。否则回调函数返回具体错误对象。 |
**错误码** **错误码**
以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md) 以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
| 错误码ID | 错误信息 | | 错误码ID | 错误信息 |
| ------ | -------------------------------------- | | ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. | | 17700005 | The specified app ID is not found. |
**示例:** **示例:**
......
...@@ -127,7 +127,7 @@ update?(uri: string, predicates: dataSharePredicates.DataSharePredicates, valueB ...@@ -127,7 +127,7 @@ update?(uri: string, predicates: dataSharePredicates.DataSharePredicates, valueB
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ------ | ------ | | ----- | ------ | ------ | ------ |
| uri | string | 是 | 指示要更新的数据的路径。 | | uri | string | 是 | 指示要更新的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。 | | predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。 |
| valueBucket | [ValuesBucket](js-apis-data-ValuesBucket.md#valuesbucket) | 是 | 指示要更新的数据。 | | valueBucket | [ValuesBucket](js-apis-data-ValuesBucket.md#valuesbucket) | 是 | 指示要更新的数据。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 回调函数。返回更新的数据记录数。 | | callback | AsyncCallback&lt;number&gt; | 是 | 回调函数。返回更新的数据记录数。 |
...@@ -170,7 +170,7 @@ delete?(uri: string, predicates: dataSharePredicates.DataSharePredicates, callba ...@@ -170,7 +170,7 @@ delete?(uri: string, predicates: dataSharePredicates.DataSharePredicates, callba
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------------------------------------------ | ---- | ---------------------------------- | | ---------- | ------------------------------------------------------------ | ---- | ---------------------------------- |
| uri | string | 是 | 指示要删除的数据的路径。 | | uri | string | 是 | 指示要删除的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。 | | predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 回调函数。返回已删除的数据记录数。 | | callback | AsyncCallback&lt;number&gt; | 是 | 回调函数。返回已删除的数据记录数。 |
**示例:** **示例:**
...@@ -212,7 +212,7 @@ query?(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns ...@@ -212,7 +212,7 @@ query?(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| ----- | ------ | ------ | ------ | | ----- | ------ | ------ | ------ |
| uri | string | 是 | 指示要查询的数据的路径。 | | uri | string | 是 | 指示要查询的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。 | | predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。 |
| columns | Array&lt;string&gt; | 是 | 指示要查询的列。如果此参数为空,则查询所有列。 | | columns | Array&lt;string&gt; | 是 | 指示要查询的列。如果此参数为空,则查询所有列。 |
| callback | AsyncCallback&lt;Object&gt; | 是 | 回调函数。返回查询到的结果集。 | | callback | AsyncCallback&lt;Object&gt; | 是 | 回调函数。返回查询到的结果集。 |
......
...@@ -339,13 +339,15 @@ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}) ...@@ -339,13 +339,15 @@ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any})
**示例:** **示例:**
```js ```js
class myAbility extends Ability { import AbilityConstant from '@ohos.application.AbilityConstant'
onSaveState(reason, wantParam) {
console.log('onSaveState'); class myAbility extends Ability {
wantParams["myData"] = "my1234567"; onSaveState(reason, wantParam) {
return AbilityConstant.OnSaveResult.RECOVERY_AGREE; console.log('onSaveState');
} wantParam["myData"] = "my1234567";
} return AbilityConstant.OnSaveResult.RECOVERY_AGREE;
}
}
``` ```
......
...@@ -156,16 +156,18 @@ onAbilityContinue(ability: Ability): void; ...@@ -156,16 +156,18 @@ onAbilityContinue(ability: Ability): void;
**示例:** **示例:**
```js ```js
import Ability from "@ohos.application.Ability"; import AbilityStage from "@ohos.application.AbilityStage";
export default class MyAbility extends Ability { var lifecycleid;
onCreate() {
console.log("MyAbility onCreate") export default class MyAbilityStage extends AbilityStage {
let AbilityLifecycleCallback = { onCreate() {
onAbilityCreate(ability){ console.log("MyAbilityStage onCreate")
console.log("AbilityLifecycleCallback onAbilityCreate ability:" + JSON.stringify(ability)); let AbilityLifecycleCallback = {
}, onAbilityCreate(ability){
console.log("AbilityLifecycleCallback onAbilityCreate ability:" + JSON.stringify(ability));
},
onWindowStageCreate(ability, windowStage){ onWindowStageCreate(ability, windowStage){
console.log("AbilityLifecycleCallback onWindowStageCreate ability:" + JSON.stringify(ability)); console.log("AbilityLifecycleCallback onWindowStageCreate ability:" + JSON.stringify(ability));
console.log("AbilityLifecycleCallback onWindowStageCreate windowStage:" + JSON.stringify(windowStage)); console.log("AbilityLifecycleCallback onWindowStageCreate windowStage:" + JSON.stringify(windowStage));
...@@ -182,30 +184,30 @@ onAbilityContinue(ability: Ability): void; ...@@ -182,30 +184,30 @@ onAbilityContinue(ability: Ability): void;
console.log("AbilityLifecycleCallback onWindowStageDestroy ability:" + JSON.stringify(ability)); console.log("AbilityLifecycleCallback onWindowStageDestroy ability:" + JSON.stringify(ability));
console.log("AbilityLifecycleCallback onWindowStageDestroy windowStage:" + JSON.stringify(windowStage)); console.log("AbilityLifecycleCallback onWindowStageDestroy windowStage:" + JSON.stringify(windowStage));
}, },
onAbilityDestroy(ability){ onAbilityDestroy(ability){
console.log("AbilityLifecycleCallback onAbilityDestroy ability:" + JSON.stringify(ability)); console.log("AbilityLifecycleCallback onAbilityDestroy ability:" + JSON.stringify(ability));
}, },
onAbilityForeground(ability){ onAbilityForeground(ability){
console.log("AbilityLifecycleCallback onAbilityForeground ability:" + JSON.stringify(ability)); console.log("AbilityLifecycleCallback onAbilityForeground ability:" + JSON.stringify(ability));
}, },
onAbilityBackground(ability){ onAbilityBackground(ability){
console.log("AbilityLifecycleCallback onAbilityBackground ability:" + JSON.stringify(ability)); console.log("AbilityLifecycleCallback onAbilityBackground ability:" + JSON.stringify(ability));
}, },
onAbilityContinue(ability){ onAbilityContinue(ability){
console.log("AbilityLifecycleCallback onAbilityContinue ability:" + JSON.stringify(ability)); console.log("AbilityLifecycleCallback onAbilityContinue ability:" + JSON.stringify(ability));
} }
} }
// 1.通过context属性获取applicationContext // 1.通过context属性获取applicationContext
let applicationContext = this.context.getApplicationContext(); let applicationContext = this.context.getApplicationContext();
// 2.通过applicationContext注册监听应用内生命周期 // 2.通过applicationContext注册监听应用内生命周期
let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback);
console.log("registerAbilityLifecycleCallback number: " + JSON.stringify(lifecycleid)); console.log("registerAbilityLifecycleCallback number: " + JSON.stringify(lifecycleid));
}, }
onDestroy() { onDestroy() {
let applicationContext = this.context.getApplicationContext(); let applicationContext = this.context.getApplicationContext();
applicationContext.unregisterAbilityLifecycleCallback(lifecycleid, (error, data) => { applicationContext.unregisterAbilityLifecycleCallback(lifecycleid, (error, data) => {
console.log("unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error)); console.log("unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error));
}); });
} }
} }
``` ```
\ No newline at end of file \ No newline at end of file
...@@ -67,17 +67,10 @@ createBundleContext(bundleName: string): Context; ...@@ -67,17 +67,10 @@ createBundleContext(bundleName: string): Context;
**示例:** **示例:**
```js ```js
import Ability from '@ohos.application.Ability' let test = "com.example.test";
let context = this.context.createBundleContext(test);
class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
let test = "com.example.test";
let context = this.context.createBundleContext(test);
}
}
``` ```
## Context.createModuleContext ## Context.createModuleContext
createModuleContext(moduleName: string): Context; createModuleContext(moduleName: string): Context;
...@@ -101,17 +94,10 @@ createModuleContext(moduleName: string): Context; ...@@ -101,17 +94,10 @@ createModuleContext(moduleName: string): Context;
**示例:** **示例:**
```js ```js
import Ability from '@ohos.application.Ability' let moduleName = "module";
let context = this.context.createModuleContext(moduleName);
class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
let moduleName = "module";
let context = this.context.createModuleContext(moduleName);
}
}
``` ```
## Context.createModuleContext ## Context.createModuleContext
createModuleContext(bundleName: string, moduleName: string): Context; createModuleContext(bundleName: string, moduleName: string): Context;
...@@ -138,15 +124,9 @@ createModuleContext(bundleName: string, moduleName: string): Context; ...@@ -138,15 +124,9 @@ createModuleContext(bundleName: string, moduleName: string): Context;
**示例:** **示例:**
```js ```js
import Ability from '@ohos.application.Ability' let bundleName = "com.example.bundle";
let moduleName = "module";
class MainAbility extends Ability { let context = this.context.createModuleContext(bundleName, moduleName);
onWindowStageCreate(windowStage) {
let bundleName = "com.example.bundle";
let moduleName = "module";
let context = this.context.createModuleContext(bundleName, moduleName);
}
}
``` ```
## Context.getApplicationContext ## Context.getApplicationContext
...@@ -166,16 +146,9 @@ getApplicationContext(): ApplicationContext; ...@@ -166,16 +146,9 @@ getApplicationContext(): ApplicationContext;
**示例:** **示例:**
```js ```js
import Ability from '@ohos.application.Ability' let applicationContext = this.context.getApplicationContext();
class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
let applicationContext = this.context.getApplicationContext();
}
}
``` ```
## AreaMode ## AreaMode
访问的文件分区,每个文件分区有对应自己的内容。 访问的文件分区,每个文件分区有对应自己的内容。
......
...@@ -9,7 +9,7 @@ quickFixManager模块提供快速修复的能力,快速修复是OpenHarmony提 ...@@ -9,7 +9,7 @@ quickFixManager模块提供快速修复的能力,快速修复是OpenHarmony提
## 导入模块 ## 导入模块
``` ```
import quickFixManager from '@ohos.application.quickFixManager'; import quickFixManager from '@ohos.app.ability.quickFixManager';
``` ```
## HapModuleQuickFixInfo ## HapModuleQuickFixInfo
...@@ -65,7 +65,7 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>, callback: AsyncCallback\<v ...@@ -65,7 +65,7 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>, callback: AsyncCallback\<v
**示例:** **示例:**
```js ```js
import quickFixManager from '@ohos.application.quickFixManager' import quickFixManager from '@ohos.app.ability.quickFixManager'
let hapModuleQuickFixFiles = ["/data/storage/el2/base/entry.hqf"] let hapModuleQuickFixFiles = ["/data/storage/el2/base/entry.hqf"]
quickFixManager.applyQuickFix(hapModuleQuickFixFiles, (error) => { quickFixManager.applyQuickFix(hapModuleQuickFixFiles, (error) => {
...@@ -104,7 +104,7 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>): Promise\<void>; ...@@ -104,7 +104,7 @@ applyQuickFix(hapModuleQuickFixFiles: Array\<string>): Promise\<void>;
**示例:** **示例:**
```js ```js
import quickFixManager from '@ohos.application.quickFixManager' import quickFixManager from '@ohos.app.ability.quickFixManager'
let hapModuleQuickFixFiles = ["/data/storage/el2/base/entry.hqf"] let hapModuleQuickFixFiles = ["/data/storage/el2/base/entry.hqf"]
quickFixManager.applyQuickFix(hapModuleQuickFixFiles).then(() => { quickFixManager.applyQuickFix(hapModuleQuickFixFiles).then(() => {
...@@ -136,7 +136,7 @@ getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback\<Applicat ...@@ -136,7 +136,7 @@ getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback\<Applicat
**示例:** **示例:**
```js ```js
import quickFixManager from '@ohos.application.quickFixManager' import quickFixManager from '@ohos.app.ability.quickFixManager'
let bundleName = "bundleName" let bundleName = "bundleName"
quickFixManager.getApplicationQuickFixInfo(bundleName, (error, data) => { quickFixManager.getApplicationQuickFixInfo(bundleName, (error, data) => {
...@@ -175,7 +175,7 @@ getApplicationQuickFixInfo(bundleName: string): Promise\<ApplicationQuickFixInfo ...@@ -175,7 +175,7 @@ getApplicationQuickFixInfo(bundleName: string): Promise\<ApplicationQuickFixInfo
**示例:** **示例:**
```js ```js
import quickFixManager from '@ohos.application.quickFixManager' import quickFixManager from '@ohos.app.ability.quickFixManager'
let bundleName = "bundleName" let bundleName = "bundleName"
quickFixManager.getApplicationQuickFixInfo(bundleName).then((data) => { quickFixManager.getApplicationQuickFixInfo(bundleName).then((data) => {
......
...@@ -25,7 +25,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -25,7 +25,7 @@ SystemCapability.BundleManager.BundleFramework
**参数:** **参数:**
| 名称 | 类型 | 必填 | 描述 | | 参数名 | 类型 | 必填 | 说明 |
| --------------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ | | --------------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
| bundleFilePaths | Array&lt;string&gt; | 是 | 指示存储应用程序包的路径。路径应该是当前应用程序的数据目录的相对路径。 | | bundleFilePaths | Array&lt;string&gt; | 是 | 指示存储应用程序包的路径。路径应该是当前应用程序的数据目录的相对路径。 |
| param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 | | param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 |
...@@ -51,7 +51,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -51,7 +51,7 @@ SystemCapability.BundleManager.BundleFramework
**参数:** **参数:**
| 名称 | 类型 | 必填 | 描述 | | 参数名 | 类型 | 必填 | 说明 |
| ---------- | ---------------------------------------------------- | ---- | ---------------------------------------------- | | ---------- | ---------------------------------------------------- | ---- | ---------------------------------------------- |
| bundleName | string | 是 | 包名 | | bundleName | string | 是 | 包名 |
| param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 | | param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 |
...@@ -77,7 +77,7 @@ SystemCapability.BundleManager.BundleFramework ...@@ -77,7 +77,7 @@ SystemCapability.BundleManager.BundleFramework
**参数:** **参数:**
| 名称 | 类型 | 必填 | 描述 | | 参数名 | 类型 | 必填 | 说明 |
| ---------- | ---------------------------------------------------- | ---- | ---------------------------------------------- | | ---------- | ---------------------------------------------------- | ---- | ---------------------------------------------- |
| bundleName | string | 是 | 包名 | | bundleName | string | 是 | 包名 |
| param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 | | param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 |
......
# ShortcutInfo<sup>(deprecated)<sup> # ShortcutInfo<sup>(deprecated)<sup>
> 从API version 9开始不再维护,建议使用[ShortcutInfo](js-apis-bundleManager-shortcutInfo.md)替代
> **说明:**
> > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 7 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 > 本模块首批接口从API version 7 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
...@@ -53,7 +53,7 @@ dataShareHelper.query(uri, da, columns).then((data) => { ...@@ -53,7 +53,7 @@ dataShareHelper.query(uri, da, columns).then((data) => {
**系统能力:** SystemCapability.DistributedDataManager.DataShare.Core **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core
| 名称 | 参数类型 | 必填 | 说明 | | 名称 | 类型 | 必填 | 说明 |
| ----------- | ------------- | ---- | ------------------------ | | ----------- | ------------- | ---- | ------------------------ |
| columnNames | Array&lt;string&gt; | 是 | 结果集中所有列的名称。 | | columnNames | Array&lt;string&gt; | 是 | 结果集中所有列的名称。 |
| columnCount | number | 是 | 结果集中的列数。 | | columnCount | number | 是 | 结果集中的列数。 |
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册