diff --git a/en/OpenHarmony-Overview.md b/en/OpenHarmony-Overview.md index 7f61ce7dd8eefb4617c5baeaed025a6fc3ca1fe3..685c1cd2bbb103470cd21df3150ffe948e51e769 100644 --- a/en/OpenHarmony-Overview.md +++ b/en/OpenHarmony-Overview.md @@ -197,7 +197,7 @@ For details about how to contribute, see [How to Contribute](contribute/how-to- OpenHarmony complies with Apache License Version 2.0. For details, see the LICENSE in each repository. -OpenHarmony uses third-party open-source software and licenses. For details, see [Third-Party Open-Source Software](contribute/third-party-open-source-software-and-license-notice.md). +OpenHarmony uses third-party open-source software and licenses. For details, see [Third-Party Open-Source Software](https://gitee.com/openharmony/docs/blob/master/en/contribute/third-party-open-source-software-and-license-notice.md). ## Contact Info diff --git a/en/application-dev/ability/stage-call.md b/en/application-dev/ability/stage-call.md index 0226a349fe6c0eb581f0c7c79d5e91266a9c5876..36efd3076702ef26c37cd304794ea2caf36e053d 100644 --- a/en/application-dev/ability/stage-call.md +++ b/en/application-dev/ability/stage-call.md @@ -18,13 +18,13 @@ The table below describes the ability call APIs. For details, see [Ability](../r **Table 1** Ability call APIs |API|Description| |:------|:------| -|Promise startAbilityByCall(want: Want)|Obtains the caller interface of the specified ability and, if the specified ability is not running, starts the ability in the background.| -|void on(method: string, callback: CalleeCallBack)|Callee.on: callback invoked when the callee registers a method.| -|void off(method: string)|Callee.off: callback invoked when the callee deregisters a method.| -|Promise call(method: string, data: rpc.Sequenceable)|Caller.call: sends agreed sequenceable data to the callee.| -|Promise callWithResult(method: string, data: rpc.Sequenceable)|Caller.callWithResult: sends agreed sequenceable data to the callee and returns the agreed sequenceable data.| -|void release()|Caller.release: releases the caller interface.| -|void onRelease(callback: OnReleaseCallBack)|Caller.onRelease: registers a callback that is invoked when the caller is disconnected.| +|startAbilityByCall(want: Want): Promise|Obtains the caller interface of the specified ability and, if the specified ability is not running, starts the ability in the background.| +|on(method: string, callback: CaleeCallBack): void|Callback invoked when the callee registers a method.| +|off(method: string): void|Callback invoked when the callee deregisters a method.| +|call(method: string, data: rpc.Sequenceable): Promise|Sends agreed sequenceable data to the callee.| +|callWithResult(method: string, data: rpc.Sequenceable): Promise|Sends agreed sequenceable data to the callee and returns the agreed sequenceable data.| +|release(): void|Releases the caller interface.| +|onRelease(callback: OnReleaseCallBack): void|Registers a callback that is invoked when the caller is disconnected.| ## How to Develop > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
@@ -202,7 +202,7 @@ context.requestPermissionsFromUser(permissions).then((data) => { ``` 3. Send agreed sequenceable data. -The sequenceable data can be sent to the callee with or without a return value. The method and sequenceable data must be consistent with those of the callee. The following example describes how to invoke the **Call** API to send data to the callee. The sample code snippet is as follows: + The sequenceable data can be sent to the callee with or without a return value. The method and sequenceable data must be consistent with those of the callee. The following example describes how to invoke the **Call** API to send data to the callee. The sample code snippet is as follows: ```ts const MSG_SEND_METHOD: string = 'CallSendMsg' async onButtonCall() { @@ -237,7 +237,7 @@ async onButtonCallWithResult(originMsg, backMsg) { ``` 4. Release the caller interface. -When the caller interface is no longer required, call the **release** API to release it. The sample code snippet is as follows: + When the caller interface is no longer required, call the **release** API to release it. The sample code snippet is as follows: ```ts try { this.caller.release() diff --git a/en/application-dev/background-task-management/background-task-dev-guide.md b/en/application-dev/background-task-management/background-task-dev-guide.md index f3ccfe01062a1238cd360cb05cd42b85c225a216..74874b31163501aa7347264824842437a2f10008 100644 --- a/en/application-dev/background-task-management/background-task-dev-guide.md +++ b/en/application-dev/background-task-management/background-task-dev-guide.md @@ -41,7 +41,7 @@ If a service needs to be continued when the application or service module is run backgroundTaskManager.getRemainingDelayTime(id).then( res => { console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); }).catch( err => { - console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data); + console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code); }); ``` @@ -74,7 +74,7 @@ console.info("The actualDelayTime is: " + time); backgroundTaskManager.getRemainingDelayTime(id).then( res => { console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); }).catch( err => { - console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data); + console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code); }); // Cancel the suspension delay. @@ -187,7 +187,7 @@ For details about how to use the Service ability in the FA model, see [Service A If an application does not need to interact with a continuous task in the background, you can use **startAbility()** to start the Service ability. In the **onStart** callback of the Service ability, call **startBackgroundRunning()** to declare that the Service ability needs to run in the background for a long time. After the task execution is complete, call **stopBackgroundRunning()** to release resources. -If an application needs to interact with a continuous task in the background (for example, an application related to music playback), you can use **connectAbility()** to start and connect to the Service ability. After obtaining the proxy of the Service ability, the application can communicate with the Service ability and control the application and cancellation of continuous tasks. +If an application needs to interact with a continuous task in the background (for example, an application related to music playback), you can use **connectAbility()** to start and connect to the Service ability. After obtaining the proxy of the Service ability, the application can communicate with the Service ability and control the request and cancellation of continuous tasks. ```js import backgroundTaskManager from '@ohos.backgroundTaskManager'; @@ -284,3 +284,9 @@ export default { } }; ``` + +## Samples + +The following sample is provided to help you better understand how to develop background task management: + +- [BackgroundTaskManager: Background Task Management (eTS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager) diff --git a/en/application-dev/internationalization/i18n-guidelines.md b/en/application-dev/internationalization/i18n-guidelines.md index 4b1d2c4998f74700553127216fe48354d13dce6a..4aa32c4ea6c69775867d86747b56e3ee17c8ec7b 100644 --- a/en/application-dev/internationalization/i18n-guidelines.md +++ b/en/application-dev/internationalization/i18n-guidelines.md @@ -23,7 +23,7 @@ APIs are provided to access the system language and region information. ### How to Develop 1. Obtain the system language.
- Call the **getSystemLanguage** method to obtain the system language (**i18n** is the name of the imported module). + Call the **getSystemLanguage** method to obtain the system language (**i18n** is the name of the imported module). ``` @@ -31,21 +31,21 @@ APIs are provided to access the system language and region information. ``` 2. Obtain the system region.
- Call the **getSystemRegion** method to obtain the system region. + Call the **getSystemRegion** method to obtain the system region. ``` var region = i18n.getSystemRegion(); ``` 3. Obtain the system locale.
- Call the **getSystemLocale** method to obtain the system locale. + Call the **getSystemLocale** method to obtain the system locale. ``` var locale = i18n.getSystemLocale(); ``` 4. Check whether the locale's language is RTL.
- Call the **isRTL** method to check whether the locale's language is RTL. + Call the **isRTL** method to check whether the locale's language is RTL. ``` @@ -53,14 +53,14 @@ APIs are provided to access the system language and region information. ``` 5. Check whether the system uses a 24-hour clock.
- Call the **is24HourClock** method to check whether the system uses a 24-hour clock. + Call the **is24HourClock** method to check whether the system uses a 24-hour clock. ``` var hourClock = i18n.is24HourClock(); ``` 6. Obtain the localized display of a language.
- Call the **getDisplayLanguage** method to obtain the localized display of a language. **language** indicates the language to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized. + Call the **getDisplayLanguage** method to obtain the localized display of a language. **language** indicates the language to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized. ``` var language = "en"; @@ -70,7 +70,7 @@ APIs are provided to access the system language and region information. ``` 7. Obtain the localized display of a country.
- Call the **getDisplayCountry** method to obtain the localized display of a country. **country** indicates the country to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized. + Call the **getDisplayCountry** method to obtain the localized display of a country. **country** indicates the country to be localized, **locale** indicates the locale, and **sentenceCase** indicates whether the first letter of the result must be capitalized. ``` var country = "US"; @@ -106,7 +106,7 @@ APIs are provided to access the system language and region information. ### How to Develop 1. Instantiate a **Calendar** object.
- Call the **getCalendar** method to obtain the time zone object of a specific locale and type (**i18n** is the name of the imported module). **type** indicates the valid calendar type, for example, **buddhist**, **chinese**, **coptic**, **ethiopic**, **hebrew**, **gregory**, **indian**, **islamic_civil**, **islamic_tbla**, **islamic_umalqura**, **japanese**, and **persian**. If **type** is left unspecified, the default calendar type of the locale is used. + Call the **getCalendar** method to obtain the time zone object of a specific locale and type (**i18n** is the name of the imported module). **type** indicates the valid calendar type, for example, **buddhist**, **chinese**, **coptic**, **ethiopic**, **hebrew**, **gregory**, **indian**, **islamic_civil**, **islamic_tbla**, **islamic_umalqura**, **japanese**, and **persian**. If **type** is left unspecified, the default calendar type of the locale is used. ``` @@ -114,7 +114,7 @@ APIs are provided to access the system language and region information. ``` 2. Set the time for the **Calendar** object.
- Call the **setTime** method to set the time of the **Calendar** object. This method receives two types of parameters. One is a **Date** object, and the other is a value indicating the number of milliseconds elapsed since January 1, 1970, 00:00:00 GMT. + Call the **setTime** method to set the time of the **Calendar** object. This method receives two types of parameters. One is a **Date** object, and the other is a value indicating the number of milliseconds elapsed since January 1, 1970, 00:00:00 GMT. ``` var date1 = new Date(); @@ -124,14 +124,14 @@ APIs are provided to access the system language and region information. ``` 3. Set the year, month, day, hour, minute, and second for the **Calendar** object.
- Call the **set** method to set the year, month, day, hour, minute, and second for the **Calendar** object. + Call the **set** method to set the year, month, day, hour, minute, and second for the **Calendar** object. ``` calendar.set(2021, 12, 21, 6, 0, 0) ``` 4. Set and obtain the time zone for the **Calendar** object.
- Call the **setTimeZone** and **getTimeZone** methods to set and obtain the time zone for the **Calendar** object. The **setTimeZone** method requires an input string to indicate the time zone to be set. + Call the **setTimeZone** and **getTimeZone** methods to set and obtain the time zone for the **Calendar** object. The **setTimeZone** method requires an input string to indicate the time zone to be set. ``` @@ -140,7 +140,7 @@ APIs are provided to access the system language and region information. ``` 5. Set and obtain the first day of a week for the **Calendar** object.
- Call the **setFirstDayOfWeek** and **getFirstDayOfWeek** methods to set and obtain the first day of a week for the **Calendar** object. **setFirstDayOfWeek** must be set to a value indicating the first day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday. + Call the **setFirstDayOfWeek** and **getFirstDayOfWeek** methods to set and obtain the first day of a week for the **Calendar** object. **setFirstDayOfWeek** must be set to a value indicating the first day of a week. The value **1** indicates Sunday, and the value **7** indicates Saturday. ``` @@ -149,7 +149,7 @@ APIs are provided to access the system language and region information. ``` 6. Set and obtain the minimum count of days in the first week for the **Calendar** object.
- Call the **setMinimalDaysInFirstWeek** and **getMinimalDaysInFirstWeek** methods to set and obtain the minimum count of days in the first week for the **Calendar** object. + Call the **setMinimalDaysInFirstWeek** and **getMinimalDaysInFirstWeek** methods to set and obtain the minimum count of days in the first week for the **Calendar** object. ``` calendar.setMinimalDaysInFirstWeek(3); @@ -157,7 +157,7 @@ APIs are provided to access the system language and region information. ``` 7. Obtain the localized display of the **Calendar** object.
- Call the **getDisplayName** method to obtain the localized display of the **Calendar** object. + Call the **getDisplayName** method to obtain the localized display of the **Calendar** object. ``` @@ -165,7 +165,7 @@ APIs are provided to access the system language and region information. ``` 8. Check whether a date is a weekend.
- Call the **isWeekend** method to determine whether the input date is a weekend. + Call the **isWeekend** method to determine whether the input date is a weekend. ``` @@ -191,22 +191,22 @@ APIs are provided to access the system language and region information. ### How to Develop 1. Instantiate a **PhoneNumberFormat** object.
- Call the **PhoneNumberFormat** constructor to instantiate a **PhoneNumberFormat** object. The country code and formatting options of the phone number need to be passed into this constructor. The formatting options are optional, including a style option. Values of this option include: **E164**, **INTERNATIONAL**, **NATIONAL**, and **RFC3966**. + Call the **PhoneNumberFormat** constructor to instantiate a **PhoneNumberFormat** object. The country code and formatting options of the phone number need to be passed into this constructor. The formatting options are optional, including a style option. Values of this option include: **E164**, **INTERNATIONAL**, **NATIONAL**, and **RFC3966**. ``` - var phoneNumberFormat = new i18n.PhoneNubmerFormat("CN", {type: "E164"}); + var phoneNumberFormat = new i18n.PhoneNumberFormat("CN", {type: "E164"}); ``` 2. Check whether the phone number format is correct. - Call the **isValidNumber** method to check whether the format of the input phone number is correct. + Call the **isValidNumber** method to check whether the format of the input phone number is correct. ``` var validNumber = phoneNumberFormat.isValidNumber("15812341234"); ``` 3. Format a phone number. - Call the **format** method of **PhoneNumberFormat** to format the input phone number. + Call the **format** method of **PhoneNumberFormat** to format the input phone number. ``` var formattedNumber = phoneNumberFormat.format("15812341234"); @@ -215,12 +215,12 @@ APIs are provided to access the system language and region information. ## Measurement Conversion -An API can be called to implement measurement conversion. +The **unitConvert** API is provided to help you implement measurement conversion. ### Available APIs - | Module | API | Description | +| Module | API | Description | | -------- | -------- | -------- | | ohos.i18n | unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string8+ | Converts one measurement unit (**fromUnit**) into another (**toUnit**) and formats the unit based on the specified locale and style. | @@ -259,7 +259,7 @@ An API can be called to implement measurement conversion. ### How to Develop 1. Instantiate an **IndexUtil** object.
- Call the **getInstance** method to instantiate an **IndexUtil** object for a specific locale. When the **locale** parameter is empty, instantiate an **IndexUtil** object of the default locale. + Call the **getInstance** method to instantiate an **IndexUtil** object for a specific locale. When the **locale** parameter is empty, instantiate an **IndexUtil** object of the default locale. ``` @@ -267,21 +267,21 @@ An API can be called to implement measurement conversion. ``` 2. Obtain the index list.
- Call the **getIndexList** method to obtain the alphabet index list of the current locale. + Call the **getIndexList** method to obtain the alphabet index list of the current locale. ``` var indexList = indexUtil.getIndexList(); ``` 3. Add an index.
- Call the **addLocale** method to add the alphabet index of a new locale to the current index list. + Call the **addLocale** method to add the alphabet index of a new locale to the current index list. ``` indexUtil.addLocale("ar") ``` 4. Obtain the index of a string.
- Call the **getIndex** method to obtain the alphabet index of a string. + Call the **getIndex** method to obtain the alphabet index of a string. ``` var text = "access index"; @@ -313,7 +313,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api ### How to Develop 1. Instantiate a **BreakIterator** object.
- Call the **getLineInstance** method to instantiate a **BreakIterator** object. + Call the **getLineInstance** method to instantiate a **BreakIterator** object. ``` @@ -322,7 +322,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api ``` 2. Set and access the text that requires line breaking.
- Call the **setLineBreakText** and **getLineBreakText** methods to set and access the text that requires line breaking. + Call the **setLineBreakText** and **getLineBreakText** methods to set and access the text that requires line breaking. ``` @@ -332,7 +332,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api ``` 3. Obtain the current position of the **BreakIterator** object.
- Call the **current** method to obtain the current position of the **BreakIterator** object in the text being processed. + Call the **current** method to obtain the current position of the **BreakIterator** object in the text being processed. ``` @@ -340,7 +340,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api ``` 4. Set the position of a **BreakIterator** object.
- The following APIs are provided to adjust the **first**, **last**, **next**, **previous**, or **following** position of the **BreakIterator** object in the text to be processed. + The following APIs are provided to adjust the **first**, **last**, **next**, **previous**, or **following** position of the **BreakIterator** object in the text to be processed. ``` @@ -356,7 +356,7 @@ When a text is displayed in more than one line, [BreakIterator](../reference/api ``` 5. Determine whether a position is a break point.
- Call the **isBoundary** method to determine whether a position is a break point. If yes, **true** is returned and the **BreakIterator** object is moved to this position. If no, **false** is returned and the **BreakIterator** object is moved to a break point after this position. + Call the **isBoundary** method to determine whether a position is a break point. If yes, **true** is returned and the **BreakIterator** object is moved to this position. If no, **false** is returned and the **BreakIterator** object is moved to a break point after this position. ``` diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md index 01d78be106d504e90df3cd173133b6900a78e0e7..6afc672c0587ecc59c7c668a8ca773357692429d 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle.md @@ -493,6 +493,74 @@ bundle.getAllApplicationInfo(bundleFlags, (err, data) => { }) ``` +## bundle.getBundleArchiveInfo + +getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise + +Obtains information about the bundles contained in a HAP file. This API uses a promise to return the result. + +**System capability** + +SystemCapability.BundleManager.BundleFramework + +**Parameters** + +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ------------ | +| hapFilePath | string | Yes | Path where the HAP file is stored. The path should point to the relative directory of the current application's data directory.| +| bundleFlags | number | Yes | Flags used to specify information contained in the **BundleInfo** object that will be returned. The default value is **0**. The value must be greater than 0.| + +**Return value** +| Type | Description | +| -------------- | -------------------------------------- | +| Promise\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Promise used to return the information about the bundles.| + +**Example** + +```js +let hapFilePath = "/data/xxx/test.hap"; +let bundleFlags = 0; +bundle.getBundleArchiveInfo(hapFilePath, bundleFlags) +.then((data) => { + console.info('Operation successful. Data: ' + JSON.stringify(data)); +}).catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); +}) +``` + +## bundle.getBundleArchiveInfo + +getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void + +Obtains information about the bundles contained in a HAP file. This API uses an asynchronous callback to return the result. + +**System capability** + +SystemCapability.BundleManager.BundleFramework + +**Parameters** + +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ------------ | +| hapFilePath | string | Yes | Path where the HAP file is stored. The path should point to the relative directory of the current application's data directory.| +| bundleFlags | number | Yes | Flags used to specify information contained in the **BundleInfo** object that will be returned. The default value is **0**. The value must be greater than 0.| +| callback| AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the information about the bundles. | + +**Example** + +```js +let hapFilePath = "/data/xxx/test.hap"; +let bundleFlags = 0; +bundle.getBundleArchiveInfo(hapFilePath, bundleFlags, (err, data) => { + if (err) { + console.error('Operation failed. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Operation successful. Data:' + JSON.stringify(data)); +}) +``` + + ## bundle.getAbilityInfo getAbilityInfo(bundleName: string, abilityName: string): Promise\ @@ -1233,7 +1301,7 @@ SystemCapability.BundleManager.BundleFramework **Return value** | Type | Description | | --------------------- | ------------------------------------------------------------ | -| Promise\ | Promise used to return the [PixelMap](js-apis-image.md). | +| Promise\ | Promise used to return the [PixelMap](js-apis-image.md).| **Example** @@ -1268,7 +1336,7 @@ SystemCapability.BundleManager.BundleFramework | ----------- | ---------------------------------------- | ---- | ---------------------------------------- | | bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. | | abilityName | string | Yes | Ability name based on which the pixel map is to obtain. | -| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](js-apis-image.md). | +| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](js-apis-image.md).| **Example** @@ -1309,7 +1377,7 @@ SystemCapability.BundleManager.BundleFramework **Return value** | Type | Description | | --------------------- | ------------------------------------------------------------ | -| Promise\ | Promise used to return the [PixelMap](js-apis-image.md). | +| Promise\ | Promise used to return the [PixelMap](js-apis-image.md).| **Example** @@ -1346,7 +1414,7 @@ SystemCapability.BundleManager.BundleFramework | bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. | | moduleName | string | Yes | Module name based on which the pixel map is to obtain. | | abilityName | string | Yes | Ability name based on which the pixel map is to obtain. | -| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](js-apis-image.md). | +| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](js-apis-image.md).| **Example** @@ -1544,6 +1612,7 @@ Enumerates bundle flags. | GET_ABILITY_INFO_WITH_DISABLE8+ | 0x00000100 | Obtains information about disabled abilities. | | GET_APPLICATION_INFO_WITH_DISABLE8+ | 0x00000200 | Obtains information about disabled applications. | | GET_ALL_APPLICATION_INFO | 0xFFFF0000 | Obtains all application information. | +| GET_BUNDLE_WITH_HASH_VALUE9+ | 0x00000030 | Obtains the bundle information with the information about hash value. | ## BundleOptions diff --git a/en/application-dev/reference/apis/js-apis-application-ability.md b/en/application-dev/reference/apis/js-apis-application-ability.md index bca94a28134524a76e3e2f77f9b832ab620a86af..136ec10fb630431a12d0455ca5e941249265267e 100644 --- a/en/application-dev/reference/apis/js-apis-application-ability.md +++ b/en/application-dev/reference/apis/js-apis-application-ability.md @@ -1,6 +1,6 @@ # Ability -> **NOTE**
+> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -18,11 +18,11 @@ import Ability from '@ohos.application.Ability'; **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - | Name | Type | Readable | Writable | Description | - | -------- | -------- | -------- | -------- | -------- | - | context | [AbilityContext](js-apis-ability-context.md) | Yes | No | Context of an ability. | - | launchWant | [Want](js-apis-application-Want.md) | Yes | No | Parameters for starting the ability. | - | lastRequestWant | [Want](js-apis-application-Want.md) | Yes | No | Parameters used when the ability was started last time. | +| Name| Type| Readable| Writable| Description| +| -------- | -------- | -------- | -------- | -------- | +| context | [AbilityContext](js-apis-ability-context.md) | Yes| No| Context of an ability.| +| launchWant | [Want](js-apis-application-Want.md) | Yes| No| Parameters for starting the ability.| +| lastRequestWant | [Want](js-apis-application-Want.md) | Yes| No| Parameters used when the ability was started last time.| ## Ability.onCreate @@ -35,10 +35,10 @@ Called to initialize the service logic when an ability is created. **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | Yes | Information related to this ability, including the ability name and bundle name. | - | param | AbilityConstant.LaunchParam | Yes | Parameters for starting the ability, and the reason for the last abnormal exit. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | want | [Want](js-apis-application-Want.md) | Yes| Information related to this ability, including the ability name and bundle name.| + | param | AbilityConstant.LaunchParam | Yes| Parameters for starting the ability, and the reason for the last abnormal exit.| **Example** @@ -61,9 +61,9 @@ Called when a **WindowStage** is created for this ability. **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | windowStage | window.WindowStage | Yes | **WindowStage** information. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | windowStage | window.WindowStage | Yes| **WindowStage** information.| **Example** @@ -105,9 +105,9 @@ Called when the **WindowStage** is restored during the migration of this ability **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | windowStage | window.WindowStage | Yes | **WindowStage** information. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | windowStage | window.WindowStage | Yes| **WindowStage** information.| **Example** @@ -143,7 +143,7 @@ Called when this ability is destroyed to clear resources. onForeground(): void; -Called when this ability is running in the foreground. +Called when this ability is switched from the background to the foreground. **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore @@ -162,7 +162,7 @@ Called when this ability is running in the foreground. onBackground(): void; -Callback when this ability is switched to the background. +Called when this ability is switched from the foreground to the background. **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore @@ -187,15 +187,15 @@ Called to save data during the ability migration preparation process. **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | wantParam | {[key: string]: any} | Yes | **want** parameter. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | wantParam | {[key: string]: any} | Yes| **want** parameter.| **Return value** - | Type | Description | - | -------- | -------- | - | AbilityConstant.OnContinueResult | Continuation result. | + | Type| Description| + | -------- | -------- | + | AbilityConstant.OnContinueResult | Continuation result.| **Example** @@ -220,9 +220,9 @@ Called when the ability startup mode is set to singleton. **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | Yes | Want parameters, such as the ability name and bundle name. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | want | [Want](js-apis-application-Want.md) | Yes| Want parameters, such as the ability name and bundle name.| **Example** @@ -245,9 +245,9 @@ Called when the configuration of the environment where the ability is running is **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | config | [Configuration](js-apis-configuration.md) | Yes | New configuration. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | config | [Configuration](js-apis-configuration.md) | Yes| New configuration.| **Example** @@ -275,16 +275,16 @@ Sends sequenceable data to the target ability. **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | method | string | Yes | Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data. | - | data | rpc.Sequenceable | Yes | Sequenceable data. You need to customize the data. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.| + | data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.| **Return value** - | Type | Description | - | -------- | -------- | - | Promise<void> | Promise used to return a response. | + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return a response.| **Example** @@ -345,16 +345,16 @@ Sends sequenceable data to the target ability and obtains the sequenceable data **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | method | string | Yes | Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data. | - | data | rpc.Sequenceable | Yes | Sequenceable data. You need to customize the data. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | method | string | Yes| Notification message string negotiated between the two abilities. The message is used to instruct the callee to register a function to receive the sequenceable data.| + | data | rpc.Sequenceable | Yes| Sequenceable data. You need to customize the data.| **Return value** - | Type | Description | - | -------- | -------- | - | Promise<rpc.MessageParcel> | Promise used to return the sequenceable data from the target ability. | + | Type| Description| + | -------- | -------- | + | Promise<rpc.MessageParcel> | Promise used to return the sequenceable data from the target ability.| **Example** @@ -451,9 +451,9 @@ Registers a callback that is invoked when the Stub on the target ability is disc **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | callback | OnReleaseCallBack | Yes | Callback used for the **onRelease** API. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | callback | OnReleaseCallBack | Yes| Callback used for the **onRelease** API.| **Example** @@ -486,7 +486,7 @@ Registers a callback that is invoked when the Stub on the target ability is disc ## Callee -Implements callbacks for caller notification registration and unregistration. +Implements callbacks for caller notification registration and deregistration. ## Callee.on @@ -499,10 +499,10 @@ Registers a caller notification callback, which is invoked when the target abili **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | method | string | Yes | Notification message string negotiated between the two abilities. | - | callback | CaleeCallBack | Yes | JS notification synchronization callback of the **rpc.MessageParcel** type. The callback must return at least one empty **rpc.Sequenceable** object. Otherwise, the function execution fails. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | method | string | Yes| Notification message string negotiated between the two abilities.| + | callback | CaleeCallBack | Yes| JS notification synchronization callback of the **rpc.MessageParcel** type. The callback must return at least one empty **rpc.Sequenceable** object. Otherwise, the function execution fails.| **Example** @@ -546,15 +546,15 @@ Registers a caller notification callback, which is invoked when the target abili off(method: string): void; -Unregisters a caller notification callback, which is invoked when the target ability registers a function. +Deregisters a caller notification callback, which is invoked when the target ability registers a function. **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore **Parameters** - | Name | Type | Mandatory | Description | - | -------- | -------- | -------- | -------- | - | method | string | Yes | Registered notification message string. | + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | method | string | Yes| Registered notification message string.| **Example** @@ -575,9 +575,9 @@ Unregisters a caller notification callback, which is invoked when the target abi **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - | Name | Type | Readable | Writable | Description | - | -------- | -------- | -------- | -------- | -------- | - | (msg: string) | function | Yes | No | Prototype of the listener function interface registered by the caller. | +| Name| Type| Readable| Writable| Description| +| -------- | -------- | -------- | -------- | -------- | +| (msg: string) | function | Yes| No| Prototype of the listener function interface registered by the caller.| ## CaleeCallBack @@ -586,6 +586,6 @@ Unregisters a caller notification callback, which is invoked when the target abi **System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore - | Name | Type | Readable | Writable | Description | - | -------- | -------- | -------- | -------- | -------- | - | (indata: rpc.MessageParcel) | rpc.Sequenceable | Yes | No | Prototype of the message listener function interface registered by the callee. | +| Name| Type| Readable| Writable| Description| +| -------- | -------- | -------- | -------- | -------- | +| (indata: rpc.MessageParcel) | rpc.Sequenceable | Yes| No| Prototype of the message listener function interface registered by the callee.| diff --git a/en/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md b/en/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md new file mode 100644 index 0000000000000000000000000000000000000000..9ac9b6868ec31a1b7e9f8b164491a6fec2e61997 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-application-abilityLifecycleCallback.md @@ -0,0 +1,153 @@ +# AbilityLifecycleCallback + +> **NOTE**
+> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. + + +A callback class that provides APIs, such as **onAbilityCreate**, **onAbilityWindowStageCreate**, and **onAbilityWindowStageDestroy**, to listen for the lifecycle of the application context. + + +## AbilityLifecycleCallback.onAbilityCreate + +onAbilityCreate(ability: Ability): void; + +Called when an ability is created. + +**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| + + +## AbilityLifecycleCallback.onAbilityWindowStageCreate + +onAbilityWindowStageCreate(ability: Ability): void; + +Called when the window stage of an ability is created. + +**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| + + +## AbilityLifecycleCallback.onAbilityWindowStageDestroy + +onAbilityWindowStageDestroy(ability: Ability): void; + +Called when the window stage of an ability is destroyed. + +**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| + + +## AbilityLifecycleCallback.onAbilityDestroy + +onAbilityDestroy(ability: Ability): void; + +Called when an ability is destroyed. + +**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| + + +## AbilityLifecycleCallback.onAbilityForeground + +onAbilityForeground(ability: Ability): void; + +Called when an ability is switched from the background to the foreground. + +**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| + + +## AbilityLifecycleCallback.onAbilityBackground + +onAbilityBackground(ability: Ability): void; + +Called when an ability is switched from the foreground to the background. + +**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| + + +## AbilityLifecycleCallback.onAbilityContinue + +onAbilityContinue(ability: Ability): void; + +Called when an ability is continued on another device. + +**System capability**: SystemCapability.Ability.AbilityRuntime.AbilityCore + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | ability | [Ability](js-apis-application-ability.md#Ability) | Yes| **Ability** object.| + +**Example** + + + ```js + import AbilityStage from "@ohos.application.AbilityStage"; + + export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + let AbilityLifecycleCallback = { + onAbilityCreate(ability){ + console.log("AbilityLifecycleCallback onAbilityCreate ability:" + JSON.stringify(ability)); + }, + onAbilityWindowStageCreate(ability){ + console.log("AbilityLifecycleCallback onAbilityWindowStageCreate ability:" + JSON.stringify(ability)); + }, + onAbilityWindowStageDestroy(ability){ + console.log("AbilityLifecycleCallback onAbilityWindowStageDestroy ability:" + JSON.stringify(ability)); + }, + onAbilityDestroy(ability){ + console.log("AbilityLifecycleCallback onAbilityDestroy ability:" + JSON.stringify(ability)); + }, + onAbilityForeground(ability){ + console.log("AbilityLifecycleCallback onAbilityForeground ability:" + JSON.stringify(ability)); + }, + onAbilityBackground(ability){ + console.log("AbilityLifecycleCallback onAbilityBackground ability:" + JSON.stringify(ability)); + }, + onAbilityContinue(ability){ + console.log("AbilityLifecycleCallback onAbilityContinue ability:" + JSON.stringify(ability)); + } + } + // 1. Obtain applicationContext through the context attribute. + let applicationContext = this.context.getApplicationContext(); + // 2. Use applicationContext to register a listener for the ability lifecycle in the application. + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("registerAbilityLifecycleCallback number: " + JSON.stringify(lifecycleid)); + } + } + ``` diff --git a/en/application-dev/reference/apis/js-apis-application-applicationContext.md b/en/application-dev/reference/apis/js-apis-application-applicationContext.md new file mode 100644 index 0000000000000000000000000000000000000000..0dfc9de068ba3aef8c84594b18dcad2730034cf0 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-application-applicationContext.md @@ -0,0 +1,71 @@ +# ApplicationContext + +> **NOTE**
+> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. + + +Provides application-level context and APIs for registering and deregistering the ability lifecycle listener in an application. + + +## How to Use + +Before calling any APIs in **ApplicationContext**, obtain an **ApplicationContext** instance through the **context** instance. + +```js +let applicationContext = this.context.getApplicationContext(); +``` + + +## ApplicationContext.registerAbilityLifecycleCallback + +registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): **number**; + +Registers a listener to monitor the ability lifecycle of the application. + +**System capability**: SystemCapability.Ability.AbilityRuntime.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------------------------ | -------- | ---- | ------------------------------ | +| [AbilityLifecycleCallback](js-apis-application-abilityLifecycleCallback.md) | callback | Yes | Callback used to return the ID of the registered listener.| + +**Return value** + +| Type | Description | +| ------ | ------------------------------ | +| number | ID of the registered listener. The ID is incremented by 1 each time the listener is registered. When the ID exceeds 2^63-1, **-1** is returned.| + +**Example** + + ```js + let applicationContext = this.context.getApplicationContext(); + console.log("stage applicationContext: " + JSON.stringify(applicationContext)); + let lifecycleid = applicationContext.registerAbilityLifecycleCallback(AbilityLifecycleCallback); + console.log("registerAbilityLifecycleCallback number: " + JSON.stringify(lifecycleid)); + ``` + +## ApplicationContext.unregisterAbilityLifecycleCallback + +unregisterAbilityLifecycleCallback(callbackId: **number**, callback: AsyncCallback<**void**>): **void**; + +Deregisters the listener that monitors the ability lifecycle of the application. + +**System capability**: SystemCapability.Ability.AbilityRuntime.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------------- | -------- | ---- | -------------------------- | +| callbackId | number | Yes | ID of the listener to deregister.| +| AsyncCallback | callback | Yes | Callback used to return the result. | + +**Example** + + ```js + let applicationContext = this.context.getApplicationContext(); + console.log("stage applicationContext: " + JSON.stringify(applicationContext)); + applicationContext.unregisterAbilityLifecycleCallback(lifecycleid, (error, data) => { + console.log("unregisterAbilityLifecycleCallback success, err: " + JSON.stringify(error)); + }); + ``` diff --git a/en/application-dev/reference/apis/js-apis-application-missionInfo.md b/en/application-dev/reference/apis/js-apis-application-missionInfo.md new file mode 100644 index 0000000000000000000000000000000000000000..8371830fe05b7b9ab89973f5a9390160734547ef --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-application-missionInfo.md @@ -0,0 +1,28 @@ +# MissionInfo + +> **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. + +## Modules to Import + +```js +import MissionInfo from '@ohos.application.missionInfo' +``` + + +## MissionInfo + +Provides the mission information. + +**System capability**: SystemCapability.Ability.AbilityBase + +| Name| Type| Readable| Writable| Description| +| -------- | -------- | -------- | -------- | -------- | +| missionId | number | Yes| Yes| Mission ID.| +| runningState | number | Yes| Yes| Running state of the mission.| +| lockedState | boolean | Yes| Yes| Locked state of the mission.| +| timestamp | string | Yes| Yes| Latest time when the mission was created or updated.| +| want | [Want](js-apis-application-Want.md) | Yes| Yes| **Want** information of the mission.| +| label | string | Yes| Yes| Label of the mission.| +| iconPath | string | Yes| Yes| Path of the mission icon.| +| continuable | boolean | Yes| Yes| Whether the mission is continuable.| diff --git a/en/application-dev/reference/apis/js-apis-backgroundTaskManager.md b/en/application-dev/reference/apis/js-apis-backgroundTaskManager.md index db39b0dbad887c8725359cc7ed1710ea618222b3..68b16ef535f1e5da679dce4baf903ef10cd4a5de 100644 --- a/en/application-dev/reference/apis/js-apis-backgroundTaskManager.md +++ b/en/application-dev/reference/apis/js-apis-backgroundTaskManager.md @@ -1,6 +1,6 @@ # Background Task Management -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE** > The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -25,7 +25,7 @@ The default duration of delayed suspension is 180000 when the battery level is h | Name | Type | Mandatory | Description | | -------- | -------------------- | ---- | ------------------------------ | | reason | string | Yes | Reason for delayed transition to the suspended state. | -| callback | Callback<void> | Yes | Invoked when a delay is about to time out. Generally, this callback is used to notify the application 6 seconds before the delay times out. | +| callback | Callback<void> | Yes | Invoked when a delay is about to time out. Generally, this callback is used to notify the application 6 seconds before the delay times out.| **Return value** | Type | Description | @@ -66,10 +66,10 @@ Obtains the remaining duration before the application is suspended. This API use ```js let id = 1; backgroundTaskManager.getRemainingDelayTime(id, (err, res) => { - if(err.data === 0) { - console.log('callback => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); + if(err) { + console.log('callback => Operation getRemainingDelayTime failed. Cause: ' + err.code); } else { - console.log('callback => Operation getRemainingDelayTime failed. Cause: ' + err.data); + console.log('callback => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); } }) ``` @@ -99,7 +99,7 @@ Obtains the remaining duration before the application is suspended. This API use backgroundTaskManager.getRemainingDelayTime(id).then( res => { console.log('promise => Operation getRemainingDelayTime succeeded. Data: ' + JSON.stringify(res)); }).catch( err => { - console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.data); + console.log('promise => Operation getRemainingDelayTime failed. Cause: ' + err.code); }) ``` @@ -186,16 +186,16 @@ Requests a continuous task from the system. This API uses a promise to return th **Parameters** -| Name | Type | Mandatory | Description | +| Name | Type | Mandatory | Description | | --------- | ---------------------------------- | ---- | ----------------------- | -| context | [Context](js-apis-Context.md) | Yes | Application context. | -| bgMode | [BackgroundMode](#backgroundmode8) | Yes | Background mode requested. | -| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked. | +| context | [Context](js-apis-Context.md) | Yes | Application context. | +| bgMode | [BackgroundMode](#backgroundmode8) | Yes | Background mode requested. | +| wantAgent | [WantAgent](js-apis-wantAgent.md) | Yes | Notification parameter, which is used to specify the target page that is redirected to when a continuous task notification is clicked.| **Return value** -| Type | Description | +| Type | Description | | -------------- | ---------------- | -| Promise\ | Promise used to return the result. | +| Promise\ | Promise used to return the result.| **Example** ```js @@ -235,10 +235,10 @@ Requests to cancel a continuous task. This API uses an asynchronous callback to **System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask **Parameters** -| Name | Type | Mandatory | Description | +| Name | Type | Mandatory | Description | | -------- | ----------------------------- | ---- | ---------------------- | -| context | [Context](js-apis-Context.md) | Yes | Application context. | -| callback | AsyncCallback<void> | Yes | Callback used to return the result. | +| context | [Context](js-apis-Context.md) | Yes | Application context. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result.| **Example** ```js @@ -266,14 +266,14 @@ Requests to cancel a continuous task. This API uses a promise to return the resu **System capability**: SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask **Parameters** -| Name | Type | Mandatory | Description | +| Name | Type | Mandatory | Description | | ------- | ----------------------------- | ---- | --------- | -| context | [Context](js-apis-Context.md) | Yes | Application context. | +| context | [Context](js-apis-Context.md) | Yes | Application context.| **Return value** -| Type | Description | +| Type | Description | | -------------- | ---------------- | -| Promise\ | Promise used to return the result. | +| Promise\ | Promise used to return the result.| **Example** ```js diff --git a/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md index 708617c49ccf91a90b7819c6515da2696bea12ca..89a4a6d8a16ce6e8d1b98a36bfe26df6ca3bf414 100644 --- a/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md +++ b/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md @@ -35,3 +35,4 @@ Provides the HAP module information. | mainElementName9+ | string | Yes | No | Information about the main ability. | | extensionAbilityInfo9+ | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | Yes | No | Information about the Extension ability.| | metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the ability. | +| hashValue9+ | string | Yes | No | The hash value of the module. | \ No newline at end of file diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md index b80690c730a7b47cc2a658577b19138666a117aa..bb320e0c8b61e2259aa8c31a6d8efa5866c780fa 100644 --- a/en/application-dev/reference/apis/js-apis-call.md +++ b/en/application-dev/reference/apis/js-apis-call.md @@ -5,7 +5,6 @@ The call module provides call management functions, including making calls, redi To subscribe to the call status, use [`observer.on('callStateChange')`](js-apis-observer.md#observeroncallstatechange). >**NOTE**
-> >The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -27,10 +26,10 @@ Initiates a call. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Type | Mandatory| Description | -| ----------- | ---------------------------- | ---- | --------------------------------------- | -| phoneNumber | string | Yes | Phone number. | -| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure| +| Name | Type | Mandatory | Description | +| ----------- | ---------------------------- | ---- | -------------------------------- | +| phoneNumber | string | Yes | Phone number. | +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure | **Example** @@ -53,11 +52,11 @@ Initiates a call. You can set call options as needed. This API uses an asynchron **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | ---------------------------- | ---- | --------------------------------------- | -| phoneNumber | string | Yes | Phone number. | +| phoneNumber | string | Yes | Phone number. | | options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. | -| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure| +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure | **Example** @@ -82,16 +81,16 @@ Initiates a call. You can set call options as needed. This API uses a promise to **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | --------------------------- | ---- | -------------------------------------- | -| phoneNumber | string | Yes | Phone number. | -| options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call.| +| phoneNumber | string | Yes | Phone number. | +| options | [DialOptions](#dialoptions) | Yes | Call option, which indicates whether the call is a voice call or video call. | **Return value** -| Type | Description | -| ---------------------- | ------------------------------------------------------------ | -| Promise<boolean> | Promise used to return the result.
- **true**: success
- **false**: failure| +| Type | Description | +| ---------------------- | ---------------------------------------------------------------- | +| Promise<boolean> | Promise used to return the result.
- **true**: success
- **false**: failure | **Example** @@ -116,10 +115,10 @@ Launches the call screen and displays the dialed number. This API uses an asynch **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | ------------------------- | ---- | ------------------------------------------ | | phoneNumber | string | Yes | Phone number. | -| callback | AsyncCallback<void> | Yes | Callback used to return the result.| +| callback | AsyncCallback<void> | Yes | Callback used to return the result. | **Example** @@ -140,15 +139,15 @@ Launches the call screen and displays the dialed number. This API uses a promise **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | ------ | ---- | ---------- | -| phoneNumber | string | Yes | Phone number.| +| phoneNumber | string | Yes | Phone number. | **Return value** | Type | Description | | ------------------- | --------------------------------- | -| Promise<void> | Promise used to return the result.| +| Promise<void> | Promise used to return the result. | **Example** @@ -171,9 +170,9 @@ Checks whether a call is in progress. This API uses an asynchronous callback to **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | -------- | ---------------------------- | ---- | ------------------------------------------------------------ | -| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Callback used to return the result.
- **true**: A call is in progress.
- **false**: No call is in progress.| +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result. Callback used to return the result.
- **true**: A call is in progress.
- **false**: No call is in progress. | **Example** @@ -196,7 +195,7 @@ Checks whether a call is in progress. This API uses a promise to return the resu | Type | Description | | ---------------------- | --------------------------------------- | -| Promise<boolean> | Promise used to return the result.| +| Promise<boolean> | Promise used to return the result. | **Example** @@ -220,9 +219,9 @@ Obtains the call status. This API uses an asynchronous callback to return the re **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | -------- | -------------------------------------------- | ---- | ------------------------------------ | -| callback | AsyncCallback<[CallState](#callstate)> | Yes | Callback used to return the result.| +| callback | AsyncCallback<[CallState](#callstate)> | Yes | Callback used to return the result. | **Example** @@ -245,7 +244,7 @@ Obtains the call status. This API uses a promise to return the result. | Type | Description | | -------------------------------------- | --------------------------------------- | -| Promise<[CallState](#callstate)> | Promise used to return the result.| +| Promise<[CallState](#callstate)> | Promise used to return the result. | **Example** @@ -270,7 +269,7 @@ Checks whether a device supports voice calls. | Type | Description | | ------- | ------------------------------------------------------------ | -| boolean | - **true**: The device supports voice calls.
- **false**: The device does not support voice calls.| +| boolean | - **true**: The device supports voice calls.
- **false**: The device does not support voice calls. | ```js let result = call.hasVoiceCapability(); @@ -287,10 +286,10 @@ Checks whether the called number is an emergency number. This API uses an asynch **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | | phoneNumber | string | Yes | Phone number. | -| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number.| +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number. | **Example** @@ -311,11 +310,11 @@ Checks whether the called number is an emergency number based on the phone numbe **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | -------------------------------------------------- | ---- | -------------------------------------------- | | phoneNumber | string | Yes | Phone number. | | options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number option. | -| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number.| +| callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number. | **Example** @@ -336,16 +335,16 @@ Checks whether the called number is an emergency number based on the phone numbe **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | -------------------------------------------------- | ---- | -------------- | | phoneNumber | string | Yes | Phone number. | -| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number option.| +| options | [EmergencyNumberOptions](#emergencynumberoptions7) | Yes | Phone number option. | **Return value** | Type | Description | | ---------------------- | --------------------------------------------------- | -| Promise<boolean> | Promise used to return the result.| +| Promise<boolean> | Promise used to return the result. | **Example** @@ -370,10 +369,10 @@ A formatted phone number is a standard numeric string, for example, 555 0100. **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | --------------------------- | ---- | ------------------------------------ | | phoneNumber | string | Yes | Phone number. | -| callback | AsyncCallback<string> | Yes | Callback used to return the result.| +| callback | AsyncCallback<string> | Yes | Callback used to return the result. | **Example** @@ -395,11 +394,11 @@ A formatted phone number is a standard numeric string, for example, 555 0100. **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | -------------------------------------------- | ---- | ------------------------------------ | | phoneNumber | string | Yes | Phone number. | | options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting option, for example, country code. | -| callback | AsyncCallback<string> | Yes | Callback used to return the result.| +| callback | AsyncCallback<string> | Yes | Callback used to return the result. | **Example** @@ -424,16 +423,16 @@ A formatted phone number is a standard numeric string, for example, 555 0100. **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | -------------------------------------------- | ---- | ---------------------- | | phoneNumber | string | Yes | Phone number. | -| options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting option, for example, country code.| +| options | [NumberFormatOptions](#numberformatoptions7) | Yes | Number formatting option, for example, country code. | **Return value** | Type | Description | | --------------------- | ------------------------------------------- | -| Promise<string> | Promise used to return the result.| +| Promise<string> | Promise used to return the result. | **Example** @@ -460,11 +459,11 @@ The phone number must match the specified country code. For example, for a China **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | --------------------------- | ---- | ----------------------------------------------------- | | phoneNumber | string | Yes | Phone number. | | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. | -| callback | AsyncCallback<string> | Yes | Callback used to return the result.| +| callback | AsyncCallback<string> | Yes | Callback used to return the result. | **Example** @@ -491,16 +490,16 @@ All country codes are supported. **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | ------ | ---- | ---------------------------------------- | | phoneNumber | string | Yes | Phone number. | -| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported.| +| countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. | **Return value** | Type | Description | | --------------------- | ------------------------------------------------------------ | -| Promise<string> | Promise used to return the result.| +| Promise<string> | Promise used to return the result. | **Example** @@ -521,7 +520,7 @@ Provides an option for determining whether a call is a video call. **System capability**: SystemCapability.Telephony.CallManager -| Name| Type | Mandatory| Description | +| Name| Type | Mandatory | Description | | ------ | ------- | ---- | ------------------------------------------------------------ | | extras | boolean | No | Indication of a video call.
- **true**: video call
- **false** (default): voice call| @@ -536,7 +535,7 @@ Enumerates call states. | CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown. | | CALL_STATE_IDLE | 0 | No call is in progress. | | CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state. | -| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.| +| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting. | ## EmergencyNumberOptions7+ @@ -544,7 +543,7 @@ Provides an option for determining whether a number is an emergency number for t **System capability**: SystemCapability.Telephony.CallManager -| Name| Type | Mandatory| Description | +| Name| Type | Mandatory | Description | | ------ | ------ | ---- | ---------------------------------------------- | | slotId | number | No | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| @@ -554,6 +553,6 @@ Provides an option for number formatting. **System capability**: SystemCapability.Telephony.CallManager -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory | Description | | ----------- | ------ | ---- | ---------------------------------------------------------- | -| countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.| +| countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**. | diff --git a/en/application-dev/reference/apis/js-apis-contact.md b/en/application-dev/reference/apis/js-apis-contact.md index 610f802066ab324e80c663d61513b062f9dfc9bf..e9ac02205ed355fb1a0933f449ebd9b304277adc 100644 --- a/en/application-dev/reference/apis/js-apis-contact.md +++ b/en/application-dev/reference/apis/js-apis-contact.md @@ -465,8 +465,6 @@ selectContact(callback: AsyncCallback<Array<Contact>>): void Selects a contact. This API uses an asynchronous callback to return the result. -This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. - **Permission required**: ohos.permission.READ_CONTACTS **System capability**: SystemCapability.Applications.Contacts and SystemCapability.Applications.ContactsData @@ -495,8 +493,6 @@ selectContact(): Promise<Array<Contact>> Selects a contact. This API uses a promise to return the result. -This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. - **Permission required**: ohos.permission.READ_CONTACTS **System capability**: SystemCapability.Applications.Contacts and SystemCapability.Applications.ContactsData diff --git a/en/application-dev/reference/apis/js-apis-data-ability.md b/en/application-dev/reference/apis/js-apis-data-ability.md index 7149bdeeaa292cc1b41a29fc09feef097dcea29f..bd14fac4882d454ba2f299ea811b89ed1d30167d 100644 --- a/en/application-dev/reference/apis/js-apis-data-ability.md +++ b/en/application-dev/reference/apis/js-apis-data-ability.md @@ -17,7 +17,7 @@ import dataAbility from '@ohos.data.dataAbility'; createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates -Creates an **RdbPredicates** object based on a **DataAabilityPredicates** object. +Creates an **RdbPredicates** object based on a **DataAbilityPredicates** object. **System capability**: SystemCapability.DistributedDataManager.DataShare.Core diff --git a/en/application-dev/reference/apis/js-apis-dataAbilityHelper.md b/en/application-dev/reference/apis/js-apis-dataAbilityHelper.md index 10d36843925949c185a431ddb60dd33c1493d7b8..1ce0a05d1ef3c97b9c0dd6d53c6abf22c2ec670c 100644 --- a/en/application-dev/reference/apis/js-apis-dataAbilityHelper.md +++ b/en/application-dev/reference/apis/js-apis-dataAbilityHelper.md @@ -1,13 +1,20 @@ # DataAbilityHelper Module (JavaScript SDK APIs) -> ![icon-note.gif](public_sys-resources/icon-note.gif)**NOTE** +> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import +```js +import featureAbility from "@ohos.ability.featureAbility"; +``` + +## Usage + +Import the following modules based on the actual situation before using the current module: ``` import featureAbility from '@ohos.ability.featureAbility' -import ohos_data_ability from '@ohos.data.dataability' +import ohos_data_ability from '@ohos.data.dataAbility' import ohos_data_rdb from '@ohos.data.rdb' ``` @@ -499,7 +506,7 @@ const valueBucket = { "name": "rose", "age": 22, "salary": 200.5, - "blobType": u8, + "blobType": "u8", } DAHelper.insert( "dataability:///com.example.DataAbility", @@ -541,7 +548,7 @@ const valueBucket = { "name": "rose1", "age": 221, "salary": 20.5, - "blobType": u8, + "blobType": "u8", } DAHelper.insert( "dataability:///com.example.DataAbility", @@ -574,9 +581,9 @@ import featureAbility from '@ohos.ability.featureAbility' var DAHelper = featureAbility.acquireDataAbilityHelper( "dataability:///com.example.DataAbility" ); -var cars = new Array({"name": "roe11", "age": 21, "salary": 20.5, "blobType": u8,}, - {"name": "roe12", "age": 21, "salary": 20.5, "blobType": u8,}, - {"name": "roe13", "age": 21, "salary": 20.5, "blobType": u8,}) +var cars = new Array({"name": "roe11", "age": 21, "salary": 20.5, "blobType": "u8",}, + {"name": "roe12", "age": 21, "salary": 20.5, "blobType": "u8",}, + {"name": "roe13", "age": 21, "salary": 20.5, "blobType": "u8",}) DAHelper.batchInsert( "dataability:///com.example.DataAbility", cars, @@ -613,9 +620,9 @@ import featureAbility from '@ohos.ability.featureAbility' var DAHelper = featureAbility.acquireDataAbilityHelper( "dataability:///com.example.DataAbility" ); -var cars = new Array({"name": "roe11", "age": 21, "salary": 20.5, "blobType": u8,}, - {"name": "roe12", "age": 21, "salary": 20.5, "blobType": u8,}, - {"name": "roe13", "age": 21, "salary": 20.5, "blobType": u8,}) +var cars = new Array({"name": "roe11", "age": 21, "salary": 20.5, "blobType": "u8",}, + {"name": "roe12", "age": 21, "salary": 20.5, "blobType": "u8",}, + {"name": "roe13", "age": 21, "salary": 20.5, "blobType": "u8",}) DAHelper.batchInsert( "dataability:///com.example.DataAbility", cars @@ -682,6 +689,7 @@ Deletes one or more data records from the database. This API uses a promise to r ```js import featureAbility from '@ohos.ability.featureAbility' +import ohos_data_ability from '@ohos.data.dataability' var DAHelper = featureAbility.acquireDataAbilityHelper( "dataability:///com.example.DataAbility" ); @@ -723,7 +731,7 @@ const va = { "name": "roe1", "age": 21, "salary": 20.5, - "blobType": u8, + "blobType": "u8", } let da = new ohos_data_ability.DataAbilityPredicates() DAHelper.update( @@ -769,7 +777,7 @@ const va = { "name": "roe1", "age": 21, "salary": 20.5, - "blobType": u8, + "blobType": "u8", } let da = new ohos_data_ability.DataAbilityPredicates() DAHelper.update( diff --git a/en/application-dev/reference/apis/js-apis-faultLogger.md b/en/application-dev/reference/apis/js-apis-faultLogger.md index bcccead1778606ac11ab58329e97932e0174f014..3ce1c4b5c66f8d1ce7d33f3a6edb036bab72d4ea 100644 --- a/en/application-dev/reference/apis/js-apis-faultLogger.md +++ b/en/application-dev/reference/apis/js-apis-faultLogger.md @@ -1,5 +1,5 @@ # Fault Logger -> ![icon-note.gif](public_sys-resources/icon-note.gif) **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. ## Modules to Import @@ -15,12 +15,12 @@ Enumerates the fault types. **System capability**: SystemCapability.HiviewDFX.Hiview.FaultLogger -| Name | Default Value | Description | +| Name| Default Value| Description| | -------- | -------- | -------- | -| NO_SPECIFIC | 0 | No specific fault type. | -| CPP_CRASH | 2 | C++ program crash. | -| JS_CRASH | 3 | JS program crash. | -| APP_FREEZE | 4 | Application freezing. | +| NO_SPECIFIC | 0 | No specific fault type.| +| CPP_CRASH | 2 | C++ program crash.| +| JS_CRASH | 3 | JS program crash.| +| APP_FREEZE | 4 | Application freezing.| ## FaultLogInfo @@ -30,14 +30,14 @@ Defines the data structure of the fault log information. | Name| Type| Description| | -------- | -------- | -------- | -| pid | number | Process ID of the faulty process. | -| uid | number | User ID of the faulty process. | -| type | [FaultType](#faulttype) | Fault type. | -| timestamp | number | Second-level timestamp when the log was generated. | -| reason | string | Reason for the fault. | -| module | string | Module on which the fault occurred. | -| summary | string | Summary of the fault. | -| fullLog | string | Full log text. | +| pid | number | Process ID of the faulty process.| +| uid | number | User ID of the faulty process.| +| type | [FaultType](#faulttype) | Fault type.| +| timestamp | number | Second-level timestamp when the log was generated.| +| reason | string | Reason for the fault.| +| module | string | Module on which the fault occurred.| +| summary | string | Summary of the fault.| +| fullLog | string | Full log text.| ## faultLogger.querySelfFaultLog @@ -51,7 +51,7 @@ Obtains the fault information about the current process. This API uses an asynch | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| faultType | [FaultType](#faulttype) | Yes| Fault type. | +| faultType | [FaultType](#faulttype) | Yes| Fault type.| | callback | AsyncCallbackArray<Array<[FaultLogInfo](#faultloginfo)>> | Yes| Callback used to return the fault information array.
The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. In this case, an error string will be returned. **Example** @@ -68,7 +68,7 @@ function queryFaultLogCallback(error, value) { console.info("Log pid: " + value[i].pid); console.info("Log uid: " + value[i].uid); console.info("Log type: " + value[i].type); - console.info("Log ts: " + value[i].ts); + console.info("Log timestamp: " + value[i].timestamp); console.info("Log reason: " + value[i].reason); console.info("Log module: " + value[i].module); console.info("Log summary: " + value[i].summary); @@ -91,13 +91,13 @@ Obtains the fault information about the current process. This API uses a promise | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| faultType | [FaultType](#faulttype) | Yes| Fault type. | +| faultType | [FaultType](#faulttype) | Yes| Fault type.| **Return value** | Type| Description| | -------- | -------- | -| Promise<Array<[FaultLogInfo](#faultloginfo)>> | Promise used to return the fault information array. You can obtain the fault information instance in its **then()** method or use **await**.
The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval. | +| Promise<Array<[FaultLogInfo](#faultloginfo)>> | Promise used to return the fault information array. You can obtain the fault information instance in its **then()** method or use **await**.
The value is the fault information array obtained. If the value is **undefined**, an exception occurs during the information retrieval.| **Example** @@ -112,7 +112,7 @@ async function getLog() { console.info("Log pid: " + value[i].pid); console.info("Log uid: " + value[i].uid); console.info("Log type: " + value[i].type); - console.info("Log ts: " + value[i].ts); + console.info("Log timestamp: " + value[i].timestamp); console.info("Log reason: " + value[i].reason); console.info("Log module: " + value[i].module); console.info("Log summary: " + value[i].summary); @@ -120,4 +120,4 @@ async function getLog() { } } } -``` \ No newline at end of file +``` diff --git a/en/application-dev/reference/apis/js-apis-formextension.md b/en/application-dev/reference/apis/js-apis-formextension.md index dea964de0b45fdeca88defea6cb06cd70d8eb43a..0329e0cf3595887133d17c9af400df4b916d7845 100644 --- a/en/application-dev/reference/apis/js-apis-formextension.md +++ b/en/application-dev/reference/apis/js-apis-formextension.md @@ -1,6 +1,6 @@ # FormExtension -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. Provides **FormExtension** APIs. @@ -46,6 +46,7 @@ Called to notify the widget provider that a **Form** instance (widget) has been **Example** ```js + import formBindingData from '@ohos.application.formBindingData' export default class MyFormExtension extends FormExtension { onCreate(want) { console.log('FormExtension onCreate, want:' + want.abilityName); @@ -100,6 +101,7 @@ Called to notify the widget provider that a widget has been updated. After obtai **Example** ```js + import formBindingData from '@ohos.application.formBindingData' export default class MyFormExtension extends FormExtension { onUpdate(formId) { console.log('FormExtension onUpdate, formId:' + formId); @@ -130,6 +132,7 @@ Called to notify the widget provider of the change of visibility. **Example** ```js + import formBindingData from '@ohos.application.formBindingData' export default class MyFormExtension extends FormExtension { onVisibilityChange(newStatus) { console.log('FormExtension onVisibilityChange, newStatus:' + newStatus); @@ -213,9 +216,35 @@ Called when the configuration of the environment where the ability is running is **Example** ```js - class MyFormExtension extends MyFormExtension { + class MyFormExtension extends FormExtension { onConfigurationUpdated(config) { console.log('onConfigurationUpdated, config:' + JSON.stringify(config)); } } ``` + + ## FormExtension.onAcquireFormState + +onAcquireFormState?(want: Want): formInfo.FormState; + +Used by the widget provider to receive the widget state query request. By default, the initial widget state is returned. + +**System capability**: SystemCapability.Ability.Form + +**Parameters** + + | Name| Type| Mandatory| Description| + | -------- | -------- | -------- | -------- | + | want | [Want](js-apis-application-Want.md) | No| Description of the widget state, including the bundle name, ability name, module name, widget name, and widget dimension.| + +**Example** + + ```js + import fromInfo from '@ohos.application.fromInfo' + class MyFormExtension extends FormExtension { + onAcquireFormState(want) { + console.log('FormExtension onAcquireFormState, want:' + want); + return fromInfo.FormState.UNKNOWN; + } + } + ``` diff --git a/en/application-dev/reference/apis/js-apis-formhost.md b/en/application-dev/reference/apis/js-apis-formhost.md index bd087eda8196a134a5ecbfbbecaaf47a6af9bfa1..5c012bf525f59b08454fd7aa0886a5a0ed419d0e 100644 --- a/en/application-dev/reference/apis/js-apis-formhost.md +++ b/en/application-dev/reference/apis/js-apis-formhost.md @@ -1,6 +1,6 @@ # FormHost -> **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. Provides APIs related to the widget host. @@ -57,15 +57,15 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| formId | string | Yes | ID of a widget.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | formId | string | Yes | ID of a widget.| **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Parameters** @@ -147,16 +147,16 @@ SystemCapability.Ability.Form **Parameters** -| Name | Type | Mandatory| Description | -| -------------- | ------ | ---- | ----------- | -| formId | string | Yes | ID of a widget. | -| isReleaseCache | boolean | No | Whether to release the cache.| + | Name | Type | Mandatory| Description | + | -------------- | ------ | ---- | ----------- | + | formId | string | Yes | ID of a widget. | + | isReleaseCache | boolean | No | Whether to release the cache.| **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** @@ -209,15 +209,15 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| formId | string | Yes | ID of a widget.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | formId | string | Yes | ID of a widget.| **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** @@ -270,15 +270,15 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| formId | string | Yes | ID of a widget.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | formId | string | Yes | ID of a widget.| **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** @@ -311,7 +311,7 @@ SystemCapability.Ability.Form **Example** ```js - var formId = "12400633174999288"; + var formId = ["12400633174999288"]; formHost.notifyVisibleForms(formId, (error, data) => { if (error.code) { console.log('formHost notifyVisibleForms, error:' + JSON.stringify(error)); @@ -337,14 +337,14 @@ SystemCapability.Ability.Form **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** ```js - var formId = "12400633174999288"; + var formId = ["12400633174999288"]; formHost.notifyVisibleForms(formId).then(() => { console.log('formHost notifyVisibleForms success'); }).catch((error) => { @@ -372,7 +372,7 @@ SystemCapability.Ability.Form **Example** ```js - var formId = "12400633174999288"; + var formId = ["12400633174999288"]; formHost.notifyInvisibleForms(formId, (error, data) => { if (error.code) { console.log('formHost notifyInvisibleForms, error:' + JSON.stringify(error)); @@ -398,14 +398,14 @@ SystemCapability.Ability.Form **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** ```js - var formId = "12400633174999288"; + var formId = ["12400633174999288"]; formHost.notifyInvisibleForms(formId).then(() => { console.log('formHost notifyInvisibleForms success'); }).catch((error) => { @@ -433,7 +433,7 @@ SystemCapability.Ability.Form **Example** ```js - var formId = "12400633174999288"; + var formId = ["12400633174999288"]; formHost.enableFormsUpdate(formId, (error, data) => { if (error.code) { console.log('formHost enableFormsUpdate, error:' + JSON.stringify(error)); @@ -459,14 +459,14 @@ SystemCapability.Ability.Form **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** ```js - var formId = "12400633174999288"; + var formId = ["12400633174999288"]; formHost.enableFormsUpdate(formId).then(() => { console.log('formHost enableFormsUpdate success'); }).catch((error) => { @@ -494,7 +494,7 @@ SystemCapability.Ability.Form **Example** ```js - var formId = "12400633174999288"; + var formId = ["12400633174999288"]; formHost.disableFormsUpdate(formId, (error, data) => { if (error.code) { console.log('formHost disableFormsUpdate, error:' + JSON.stringify(error)); @@ -520,14 +520,14 @@ SystemCapability.Ability.Form **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** ```js - var formId = "12400633174999288"; + var formId = ["12400633174999288"]; formHost.disableFormsUpdate(formId).then(() => { console.log('formHost disableFormsUpdate success'); }).catch((error) => { @@ -574,9 +574,9 @@ SystemCapability.Ability.Form **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** @@ -591,7 +591,7 @@ SystemCapability.Ability.Form ## getAllFormsInfo -getAllFormsInfo(callback: AsyncCallback<Array<FormInfo>>): void; +getAllFormsInfo(callback: AsyncCallback<Array<formInfo.FormInfo>>): void; Obtains the widget information provided by all applications on the device. This API uses an asynchronous callback to return the result. @@ -601,9 +601,9 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| callback | AsyncCallback<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | Yes| Callback used to return the widget information.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | callback | AsyncCallback<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | Yes| Callback used to return the widget information.| **Example** @@ -619,7 +619,8 @@ SystemCapability.Ability.Form ## getAllFormsInfo -getAllFormsInfo(): Promise<Array<FormInfo>>; +getAllFormsInfo(): Promise<Array<formInfo.FormInfo>>; + Obtains the widget information provided by all applications on the device. This API uses a promise to return the result. @@ -645,7 +646,8 @@ SystemCapability.Ability.Form ## getFormsInfo -getFormsInfo(bundleName: string, callback: AsyncCallback<Array<FormInfo>>): void; +getFormsInfo(bundleName: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void; + Obtains the widget information provided by a given application on the device. This API uses an asynchronous callback to return the result. @@ -655,10 +657,10 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| bundleName | string | Yes| Bundle name of the target application.| -| callback | AsyncCallback<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | Yes| Callback used to return the widget information.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | bundleName | string | Yes| Bundle name of the target application.| + | callback | AsyncCallback<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | Yes| Callback used to return the widget information.| **Example** @@ -674,7 +676,8 @@ SystemCapability.Ability.Form ## getFormsInfo -getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<FormInfo>>): void; +getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback<Array<formInfo.FormInfo>>): void; + Obtains the widget information provided by a given application on the device. This API uses an asynchronous callback to return the result. @@ -684,11 +687,11 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| bundleName | string | Yes| Bundle name of the target application.| -| moduleName | string | Yes| Module name.| -| callback | AsyncCallback<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | Yes| Callback used to return the widget information.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | bundleName | string | Yes| Bundle name of the target application.| + | moduleName | string | Yes| Module name.| + | callback | AsyncCallback<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | Yes| Callback used to return the widget information.| **Example** @@ -704,7 +707,8 @@ SystemCapability.Ability.Form ## getFormsInfo -getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<FormInfo>>; +getFormsInfo(bundleName: string, moduleName?: string): Promise<Array<formInfo.FormInfo>>; + Obtains the widget information provided by a given application on the device. This API uses a promise to return the result. @@ -714,10 +718,10 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| bundleName | string | Yes| Bundle name of the target application.| -| moduleName | string | No| Module name.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | bundleName | string | Yes| Bundle name of the target application.| + | moduleName | string | No| Module name.| **Return value** @@ -767,7 +771,7 @@ SystemCapability.Ability.Form ## deleteInvalidForms -function deleteInvalidForms(formIds: Array<string>): Promise<number>; +deleteInvalidForms(formIds: Array<string>): Promise<number>; Deletes invalid widgets from the list. This API uses a promise to return the result. @@ -800,7 +804,7 @@ SystemCapability.Ability.Form ## acquireFormState -acquireFormState(want: Want, callback: AsyncCallback<FormStateInfo>): void; +acquireFormState(want: Want, callback: AsyncCallback<formInfo.FormStateInfo>): void; Obtains the widget state. This API uses an asynchronous callback to return the result. @@ -819,9 +823,14 @@ SystemCapability.Ability.Form ```js var want = { - "deviceId": "", - "bundleName": "com.extreme.test", - "abilityName": "com.extreme.test.MainAbility" + "deviceId": "", + "bundleName": "ohos.samples.FormApplication", + "abilityName": "FormAbility", + "parameters": { + "ohos.extra.param.key.module_name": "entry", + "ohos.extra.param.key.form_name": "widget", + "ohos.extra.param.key.form_dimension": 2 + } }; formHost.acquireFormState(want, (error, data) => { if (error.code) { @@ -834,7 +843,7 @@ SystemCapability.Ability.Form ## acquireFormState -function acquireFormState(want: Want): Promise<FormStateInfo>; +acquireFormState(want: Want): Promise<formInfo.FormStateInfo>; Obtains the widget state. This API uses a promise to return the result. @@ -858,9 +867,14 @@ SystemCapability.Ability.Form ```js var want = { - "deviceId": "", - "bundleName": "com.extreme.test", - "abilityName": "com.extreme.test.MainAbility" + "deviceId": "", + "bundleName": "ohos.samples.FormApplication", + "abilityName": "FormAbility", + "parameters": { + "ohos.extra.param.key.module_name": "entry", + "ohos.extra.param.key.form_name": "widget", + "ohos.extra.param.key.form_dimension": 2 + } }; formHost.acquireFormState(want).then((data) => { console.log('formHost acquireFormState, data:' + JSON.stringify(data)); @@ -962,16 +976,16 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| formIds | Array<string> | Yes | List of widget IDs.| -| isVisible | boolean | Yes | Whether to be visible.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | formIds | Array<string> | Yes | List of widget IDs.| + | isVisible | boolean | Yes | Whether to be visible.| **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** @@ -1025,16 +1039,16 @@ SystemCapability.Ability.Form **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ------- | -| formIds | Array<string> | Yes | List of widget IDs.| -| isEnableUpdate | boolean | Yes | Whether to enable update.| + | Name| Type | Mandatory| Description | + | ------ | ------ | ---- | ------- | + | formIds | Array<string> | Yes | List of widget IDs.| + | isEnableUpdate | boolean | Yes | Whether to enable update.| **Return value** -| Type| Description| -| -------- | -------- | -| Promise<void> | Promise used to return the result indicating whether the API is successfully called.| + | Type| Description| + | -------- | -------- | + | Promise<void> | Promise used to return the result indicating whether the API is successfully called.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-formprovider.md b/en/application-dev/reference/apis/js-apis-formprovider.md index e48d4ada58ae469c73c71b6f90ae682610544706..7ff3e5f3d80fcfb93b057bf5e67def7d1f197e92 100644 --- a/en/application-dev/reference/apis/js-apis-formprovider.md +++ b/en/application-dev/reference/apis/js-apis-formprovider.md @@ -80,7 +80,7 @@ SystemCapability.Ability.Form ## updateForm -updateForm(formId: string, formBindingData: FormBindingData, callback: AsyncCallback<void>): void; +updateForm(formId: string, formBindingData: formBindingData.FormBindingData,callback: AsyncCallback<void>): void; Updates a widget. This API uses an asynchronous callback to return the result. @@ -111,7 +111,7 @@ SystemCapability.Ability.Form ## updateForm -updateForm(formId: string, formBindingData: FormBindingData): Promise<void>; +updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise<void>; Updates a widget. This API uses a promise to return the result. diff --git a/en/application-dev/reference/apis/js-apis-hichecker.md b/en/application-dev/reference/apis/js-apis-hichecker.md index d22899779e9791f098effbc5185b811b969fc98a..1095d5f9aa56c1077c8db6ba2fcb81ea29642309 100644 --- a/en/application-dev/reference/apis/js-apis-hichecker.md +++ b/en/application-dev/reference/apis/js-apis-hichecker.md @@ -98,7 +98,7 @@ Obtains a collection of thread, process, and alarm rules that have been added. hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // Obtain the collection of added rules. -hichecker.getRule(); // return 1n; +hichecker.getRule(); // Return 1n. ``` ## hichecker.contains @@ -119,7 +119,7 @@ Checks whether the specified rule exists in the collection of added rules. If th | Type | Description | | ------- | ---------------------------------------------------------- | -| boolean | Returns **true** if the rule exists in the collection of added rules; returns **false** otherwise.| +| boolean | Returns **true** if the rule exists in the collection of added rules; returns **false** otherwise. | **Example** @@ -128,6 +128,6 @@ Checks whether the specified rule exists in the collection of added rules. If th hichecker.addRule(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // Check whether the added rule exists in the collection of added rules. -hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // return true; -hichecker.contains(hichecker.RULE_CAUTION_PRINT_LOG); // return false; +hichecker.contains(hichecker.RULE_THREAD_CHECK_SLOW_PROCESS); // Return true +hichecker.contains(hichecker.RULE_CAUTION_PRINT_LOG); // Return false ``` diff --git a/en/application-dev/reference/apis/js-apis-image.md b/en/application-dev/reference/apis/js-apis-image.md index 8d00068ceb8fcce01332ec03b1cca23613254354..5b564c7addd10b39e5873bf50faa84efc9ff1ad6 100644 --- a/en/application-dev/reference/apis/js-apis-image.md +++ b/en/application-dev/reference/apis/js-apis-image.md @@ -1,16 +1,16 @@ # Image Processing -> **NOTE** +> **NOTE**
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. ## Modules to Import -``` +```js import image from '@ohos.multimedia.image'; ``` ## image.createPixelMap8+ -createPixelMap(colors: ArrayBuffer, options: InitializetionOptions): Promise\ +createPixelMap(colors: ArrayBuffer, options: InitializationOptions): Promise\ Creates a **PixelMap** object. This API uses a promise to return the result. @@ -21,7 +21,7 @@ Creates a **PixelMap** object. This API uses a promise to return the result. | Name | Type | Mandatory| Description | | ------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ | | colors | ArrayBuffer | Yes | Color array. | -| options | [InitializetionOptions](#initializationoptions8) | Yes | Pixel properties, including the alpha type, size, scale mode, pixel format, and editable.| +| options | [InitializationOptions](#initializationoptions8) | Yes | Pixel properties, including the alpha type, size, scale mode, pixel format, and editable.| **Return value** @@ -39,7 +39,7 @@ image.createPixelMap(Color, opts) ## image.createPixelMap8+ -createPixelMap(colors: ArrayBuffer, options: InitializetionOptions, callback: AsyncCallback\): void +createPixelMap(colors: ArrayBuffer, options: InitializationOptions, callback: AsyncCallback\): void Creates a **PixelMap** object. This API uses an asynchronous callback to return the result. @@ -50,7 +50,7 @@ Creates a **PixelMap** object. This API uses an asynchronous callback to return | Name | Type | Mandatory| Description | | -------- | ------------------------------------------------ | ---- | -------------------------- | | colors | ArrayBuffer | Yes | Color array. | -| options | [InitializetionOptions](#initializationoptions8) | Yes | Pixel properties. | +| options | [InitializationOptions](#initializationoptions8) | Yes | Pixel properties. | | callback | AsyncCallback\<[PixelMap](#pixelmap7)> | Yes | Callback used to return the **PixelMap** object.| **Example** @@ -66,9 +66,11 @@ Provides APIs to read or write image pixel map data and obtain image pixel map i ### Attributes -| Name | Type | Readable| Writable| Description | -| ----------------------- | ------- | ---- | ---- | ------------------------------------------------------------ | -| isEditable7+ | boolean | Yes | No | Whether the image pixel map is editable.
**System capability**: SystemCapability.Multimedia.Image| +**System capability**: SystemCapability.Multimedia.Image + +| Name | Type | Readable| Writable| Description | +| ----------------------- | ------- | ---- | ---- | -------------------------- | +| isEditable7+ | boolean | Yes | No | Whether the image pixel map is editable.| ### readPixelsToBuffer7+ @@ -468,7 +470,7 @@ Creates an **ImageSource** instance based on the URI. | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------------------------- | -| uri | string | Yes | Image source URI. Currently, only the local absolute path is supported.| +| uri | string | Yes | Image path. Currently, only the application sandbox path is supported.| **Return value** @@ -479,7 +481,8 @@ Creates an **ImageSource** instance based on the URI. **Example** ```js -const imageSourceApi = image.createImageSource('/data/local/tmp/test.jpg') +let path = this.context.getApplicationContext().fileDirs + "test.jpg"; +const imageSourceApi = image.createImageSource(path); ``` ## image.createImageSource7+ @@ -514,9 +517,11 @@ Provides APIs to obtain image information. Before calling any API in **ImageSour ### Attributes +**System capability**: SystemCapability.Multimedia.Image + | Name | Type | Readable| Writable| Description | | ---------------- | -------------- | ---- | ---- | ------------------------------------------------------------ | -| supportedFormats | Array\ | Yes | No | Supported image formats, including png, jpeg, wbmp, bmp, gif, webp, and heif.
**System capability**: SystemCapability.Multimedia.Image| +| supportedFormats | Array\ | Yes | No | Supported image formats, including png, jpeg, wbmp, bmp, gif, webp, and heif.| ### getImageInfo @@ -793,13 +798,15 @@ Provide APIs to pack images. Before calling any API in **ImagePacker**, you must ### Attributes -| Name | Type | Readable| Writable| Description | -| ---------------- | -------------- | ---- | ---- | ------------------------------------------------------------ | -| supportedFormats | Array\ | Yes | No | Supported image format, which can be jpeg.
**System capability**: SystemCapability.Multimedia.Image| +**System capability**: SystemCapability.Multimedia.Image + +| Name | Type | Readable| Writable| Description | +| ---------------- | -------------- | ---- | ---- | -------------------------- | +| supportedFormats | Array\ | Yes | No | Supported image format, which can be jpeg.| ### packing -packing(source: ImageSource, option: PackingOption, callback: AsyncCallback>): void +packing(source: ImageSource, option: PackingOption, callback: AsyncCallback\): void Packs an image. This API uses an asynchronous callback to return the result. @@ -811,7 +818,7 @@ Packs an image. This API uses an asynchronous callback to return the result. | -------- | ---------------------------------- | ---- | ---------------------------------- | | source | [ImageSource](#imagesource) | Yes | Image to pack. | | option | [PackingOption](#packingoption) | Yes | Option for image packing. | -| callback | AsyncCallback> | Yes | Callback used to return the packed data.| +| callback | AsyncCallback\ | Yes | Callback used to return the packed data.| **Example** @@ -822,7 +829,7 @@ imagePackerApi.packing(imageSourceApi, packOpts, data => {}) ### packing -packing(source: ImageSource, option: PackingOption): Promise> +packing(source: ImageSource, option: PackingOption): Promise\ Packs an image. This API uses a promise to return the result. @@ -839,7 +846,7 @@ Packs an image. This API uses a promise to return the result. | Type | Description | | :--------------------------- | :-------------------------------------------- | -| Promise> | Promise used to return the packed data.| +| Promise\ | Promise used to return the packed data.| **Example** @@ -850,7 +857,7 @@ imagePackerApi.packing(imageSourceApi, packOpts) .catch(error => {}) ``` -### packing +### packing8+ packing(source: PixelMap, option: PackingOption, callback: AsyncCallback\): void @@ -873,9 +880,9 @@ let packOpts = { format:["image/jpeg"], quality:98 } imagePackerApi.packing(pixelMapApi, packOpts, data => {}) ``` -### packing +### packing8+ -packing(source: PixelMap, option: PackingOption): Promise> +packing(source: PixelMap, option: PackingOption): Promise\ Packs an image. This API uses a promise to return the result. @@ -883,16 +890,16 @@ Packs an image. This API uses a promise to return the result. **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------------------------------- | ---- | -------------- | +| Name| Type | Mandatory| Description | +| ------ | ------------------------------- | ---- | ------------------ | | source | [PixelMap](#pixelmap) | Yes | **PixelMap** object to pack.| -| option | [PackingOption](#packingoption) | Yes | Option for image packing.| +| option | [PackingOption](#packingoption) | Yes | Option for image packing. | **Return value** | Type | Description | | :--------------------------- | :-------------------------------------------- | -| Promise> | Promise used to return the packed data.| +| Promise\ | Promise used to return the packed data.| **Example** @@ -944,6 +951,345 @@ Releases this **ImagePacker** instance. This API uses a promise to return the re }).catch((error)=>{}) ``` +## image.createImageReceiver9+ + +createImageReceiver(width: number, height: number, format: number, capacity: number): ImageReceiver + +Create an **ImageReceiver** instance by specifying the image width, height, format, and capacity. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------ | ---- | ---------------------- | +| width | number | Yes | Default image width. | +| height | number | Yes | Default image height. | +| format | number | Yes | Image format. | +| capacity | number | Yes | Maximum number of images that can be accessed at the same time.| + +**Return value** + +| Type | Description | +| -------------------------------- | --------------------------------------- | +| [ImageReceiver](#imagereceiver9) | Returns an **ImageReceiver** instance if the operation is successful.| + +**Example** + +```js +var receiver = image.createImageReceiver(8192, 8, 4, 8) +``` + +## ImageReceiver9+ + +Provides APIs to obtain the surface ID of a component, read the latest image, read the next image, and release the **ImageReceiver** instance. + +Before calling any APIs in **ImageReceiver**, you must create an **ImageReceiver** instance. + +### Attributes + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +| Name | Type | Readable| Writable| Description | +| --------------------- | ---------------------------- | ---- | ---- | ------------------ | +| size9+ | [Size](#size) | Yes | No | Image size. | +| capacity9+ | number | Yes | No | Maximum number of images that can be accessed at the same time.| +| format9+ | [ImageFormat](#imageformat9) | Yes | No | Image format. | + +### getReceivingSurfaceId9+ + +getReceivingSurfaceId(callback: AsyncCallback\): void + +Obtains a surface ID for the camera or other components. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ---------------------- | ---- | -------------------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the surface ID.| + +**Example** + +```js + receiver.getReceivingSurfaceId((err, id) => {}); +``` + +### getReceivingSurfaceId9+ + +getReceivingSurfaceId(): Promise\ + +Obtains a surface ID for the camera or other components. This API uses a promise to return the result. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Return value** + +| Type | Description | +| ---------------- | -------------------- | +| Promise\ | Promise used to return the surface ID.| + +**Example** + +```js +receiver.getReceivingSurfaceId().then( id => { + }).catch(error => { + }) +``` + +### readLatestImage9+ + +readLatestImage(callback: AsyncCallback\): void + +Reads the latest image from the **ImageReceiver** instance. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------------------------------- | ---- | ------------------------ | +| callback | AsyncCallback<[Image](#image9)> | Yes | Callback used to return the latest image.| + +**Example** + +```js + receiver.readLatestImage((err, img) => { }); +``` + +### readLatestImage9+ + +readLatestImage(): Promise\ + +Reads the latest image from the **ImageReceiver** instance. This API uses a promise to return the result. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Return value** + +| Type | Description | +| ------------------------- | ------------------ | +| Promise<[Image](#image8)> | Promise used to return the latest image.| + +**Example** + +```js +receiver.readLatestImage().then(img => {}) + .catch(error => {}) +``` + +### readNextImage9+ + +readNextImage(callback: AsyncCallback\): void + +Reads the next image from the **ImageReceiver** instance. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | ------------------------------- | ---- | -------------------------- | +| callback | AsyncCallback<[Image](#image9)> | Yes | Callback used to return the next image.| + +**Example** + +```js +receiver.readNextImage((err, img) => {}); +``` + +### readNextImage9+ + +readNextImage(): Promise\ + +Reads the next image from the **ImageReceiver** instance. This API uses a promise to return the result. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Return value** + +| Type | Description | +| ------------------------- | -------------------- | +| Promise<[Image](#image9)> | Promise used to return the next image.| + +**Example** + +```js + receiver.readNextImage().then(img => { + }).catch(error => { + }) +``` + +### on('imageArrival')9+ + +on(type: 'imageArrival', callback: AsyncCallback\): void + +Listens for image arrival events. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ------------------------------------------------------ | +| type | string | Yes | Type of event to listen for. The value is fixed at **imageArrival**, which is triggered when an image is received.| +| callback | AsyncCallback\ | Yes | Callback invoked for the event. | + +**Example** + +```js + receiver.on('imageArrival', () => {}) +``` + +### release9+ + +release(callback: AsyncCallback\): void + +Releases this **ImageReceiver** instance. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | ------------------------ | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| + +**Example** + +```js + receiver.release(() => {}) +``` + +### release9+ + +release(): Promise\ + +Releases this **ImageReceiver** instance. This API uses a promise to return the result. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +**Return value** + +| Type | Description | +| -------------- | ------------------ | +| Promise\ | Promise used to return the result.| + +**Example** + +```js + receiver.release().then(() => {}) + .catch(error => {}) +``` + +## Image9+ + +Provides APIs for basic image operations, including obtaining image information and reading and writing image data. An **Image** instance is returned when [readNextImage](#readnextimage9) and [readLatestImage](#readlatestimage9) are called. + +### Attributes + +**System capability**: SystemCapability.Multimedia.Image.Core + +| Name | Type | Readable| Writable| Description | +| --------------------- | ------------------ | ---- | ---- | -------------------------------------------------- | +| clipRect9+ | [Region](#region7) | Yes | Yes | Image area to be cropped. | +| size9+ | [Size](#size) | Yes | No | Image size. | +| format9+ | number | Yes | No | Image format. For details, see [PixelMapFormat](#pixelmapformat7).| + +### getComponent9+ + +getComponent(componentType: ComponentType, callback: AsyncCallback\): void + +Obtains the component buffer from the **Image** instance based on the color component type. This API uses an asynchronous callback to return the result. + +**System capability**: SystemCapability.Multimedia.Image.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------------- | --------------------------------------- | ---- | -------------------- | +| componentType | [ComponentType](#componenttype9) | Yes | Color component type of the image. | +| callback | AsyncCallback<[Component](#component9)> | Yes | Callback used to return the component buffer.| + +**Example** + +```js + img.getComponent(4, (err, component) => {}) +``` + +### getComponent9+ + +getComponent(componentType: ComponentType): Promise\ + +Obtains the component buffer from the **Image** instance based on the color component type. This API uses a promise to return the result. + +**System capability**: SystemCapability.Multimedia.Image.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| ------------- | -------------------------------- | ---- | ---------------- | +| componentType | [ComponentType](#componenttype9) | Yes | Color component type of the image.| + +**Return value** + +| Type | Description | +| --------------------------------- | --------------------------------- | +| Promise<[Component](#component9)> | Promise used to return the component buffer.| + +**Example** + +```js +img.getComponent(4).then(component => { }) +``` + +### release9+ + +release(callback: AsyncCallback\): void + +Releases this **Image** instance. This API uses an asynchronous callback to return the result. + +The corresponding resources must be released before another image arrives. + +**System capability**: SystemCapability.Multimedia.Image.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------- | -------------------- | ---- | -------------- | +| callback | AsyncCallback\ | Yes | Callback used to return the result.| + +**Example** + +```js +img.release(() =>{ }) +``` + +### release9+ + +release(): Promise\ + +Releases this **Image** instance. This API uses a promise to return the result. + +The corresponding resources must be released before another image arrives. + +**System capability**: SystemCapability.Multimedia.Image.Core + +**Return value** + +| Type | Description | +| -------------- | --------------------- | +| Promise\ | Promise used to return the result.| + +**Example** + +```js +img.release().then(() =>{ + }).catch(error => { + }) +``` + ## PositionArea7+ Describes area information in an image. @@ -954,8 +1300,8 @@ Describes area information in an image. | ------ | ------------------ | ---- | ---- | ------------------------------------------------------------ | | pixels | ArrayBuffer | Yes | No | Pixels of the image. | | offset | number | Yes | No | Offset for data reading. | -| stride | number | Yes | No | Number of bytes from one row of pixels in memory to the next row of pixels in memory. The value of **stride** must be greater than or equal to the value of **region.size.width** multiplied by 4. | -| region | [Region](#region8) | Yes | No | Region to read or write. The width of the region to write plus the X coordinate cannot be greater than the width of the original image. The height of the region to write plus the Y coordinate cannot be greater than the height of the original image.| +| stride | number | Yes | No | Number of bytes from one row of pixels in memory to the next row of pixels in memory. The value of **stride** must be greater than or equal to the value of **region.size.width** multiplied by 4. | +| region | [Region](#region7) | Yes | No | Region to read or write. The width of the region to write plus the X coordinate cannot be greater than the width of the original image. The height of the region to write plus the Y coordinate cannot be greater than the height of the original image.| ## ImageInfo @@ -980,7 +1326,7 @@ Describes the size of an image. ## PixelMapFormat7+ -Enumerates pixel map formats. +Enumerates the pixel formats of images. **System capability**: SystemCapability.Multimedia.Image @@ -992,7 +1338,7 @@ Enumerates pixel map formats. ## AlphaType9+ -Enumerates alpha types. +Enumerates the alpha types of images. **System capability**: SystemCapability.Multimedia.Image @@ -1005,7 +1351,7 @@ Enumerates alpha types. ## ScaleMode9+ -Enumerates scale modes. +Enumerates the scale modes of images. **System capability**: SystemCapability.Multimedia.Image @@ -1016,19 +1362,21 @@ Enumerates scale modes. ## InitializationOptions8+ +Defines pixel map initialization options. + **System capability**: SystemCapability.Multimedia.Image -| Name | Type | Readable| Writable| Description | -| ----------- | ---------------------------------- | ---- | ---- | -------------- | -| alphaType9+ | [AlphaType](#alphatype9) | Yes | Yes | Alpha type. | -| editable | boolean | Yes | Yes | Whether the image is editable. | -| pixelFormat | [PixelMapFormat](#pixelmapformat7) | Yes | Yes | Pixel map format. | -| scaleMode9+ | [ScaleMode](#scalemode9) | Yes | Yes | Scale mode. | -| size | [Size](#size) | Yes | Yes | Image size.| +| Name | Type | Readable| Writable| Description | +| ---------------------- | ---------------------------------- | ---- | ---- | -------------- | +| alphaType9+ | [AlphaType](#alphatype9) | Yes | Yes | Alpha type. | +| editable | boolean | Yes | Yes | Whether the image is editable. | +| pixelFormat | [PixelMapFormat](#pixelmapformat7) | Yes | Yes | Pixel map format. | +| scaleMode9+ | [ScaleMode](#scalemode9) | Yes | Yes | Scale mode. | +| size | [Size](#size) | Yes | Yes | Image size.| ## DecodingOptions7+ -Describes the decoding options. +Defines image decoding options. **System capability**: SystemCapability.Multimedia.Image @@ -1056,7 +1404,7 @@ Describes region information. ## PackingOption -Describes the option for image packing. +Defines the option for image packing. **System capability**: SystemCapability.Multimedia.Image @@ -1092,3 +1440,40 @@ Describes the exchangeable image file format (Exif) information of an image. | GPS_LONGITUDE | "GPSLongitude" | Image longitude. | | GPS_LATITUDE_REF | "GPSLatitudeRef" | Latitude reference, for example, N or S.| | GPS_LONGITUDE_REF | "GPSLongitudeRef" | Longitude reference, for example, W or E.| + +## ImageFormat9+ + +Enumerates the image formats. + +**System capability**: SystemCapability.Multimedia.Image.Core + +| Name | Default Value| Description | +| ------------ | ------ | -------------------- | +| YCBCR_422_SP | 1000 | YCBCR422 semi-planar format.| +| JPEG | 2000 | JPEG encoding format. | + +## ComponentType9+ + +Enumerates the color component types of images. + +**System capability**: SystemCapability.Multimedia.Image.ImageReceiver + +| Name | Default Value| Description | +| ----- | ------ | ----------- | +| YUV_Y | 1 | Luminance component. | +| YUV_U | 2 | Chrominance component. | +| YUV_V | 3 | Chrominance component. | +| JPEG | 4 | JPEG type.| + +## Component9+ + +Describes the color components of an image. + +**System capability**: SystemCapability.Multimedia.Image.Core + +| Name | Type | Readable| Writable| Description | +| ------------- | -------------------------------- | ---- | ---- | ------------ | +| componentType | [ComponentType](#componenttype9) | Yes | No | Color component type. | +| rowStride | number | Yes | No | Row stride. | +| pixelStride | number | Yes | No | Pixel stride. | +| byteBuffer | ArrayBuffer | Yes | No | Component buffer.| diff --git a/en/application-dev/reference/apis/js-apis-missionManager.md b/en/application-dev/reference/apis/js-apis-missionManager.md index 1c28c9a985bff155c8c4768e0bd9b01777d4a0e0..75c79e3af3da6181c1a81f374cdd3730e95a4191 100644 --- a/en/application-dev/reference/apis/js-apis-missionManager.md +++ b/en/application-dev/reference/apis/js-apis-missionManager.md @@ -26,15 +26,15 @@ Registers a listener to observe the mission status. **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | listener | MissionListener | Yes| Listener to register.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| listener | MissionListener | Yes| Listener to register.| **Return value** - | Type| Description| - | -------- | -------- | - | number | Returns the unique index of the mission status listener, which is created by the system and allocated when the listener is registered.| +| Type| Description| +| -------- | -------- | +| number | Returns the unique index of the mission status listener, which is created by the system and allocated when the listener is registered.| **Example** @@ -62,10 +62,10 @@ Deregisters a mission status listener. This API uses an asynchronous callback to **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** @@ -96,15 +96,15 @@ Deregisters a mission status listener. This API uses a promise to return the res **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| listenerId | number | Yes| Unique index of the mission status listener to unregister. It is returned by **registerMissionListener**.| **Return value** - | Type| Description| - | -------- | -------- | - | Promise<void> | Promise used to return the result.| +| Type| Description| +| -------- | -------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -135,11 +135,11 @@ Obtains the information about a given mission. This API uses an asynchronous cal **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | deviceId | string | Yes| Device ID. It is a null string by default for the local device.| - | missionId | number | Yes| Mission ID.| - | callback | AsyncCallback<[MissionInfo](#missioninfo)> | Yes| Callback used to return the mission information obtained.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| +| missionId | number | Yes| Mission ID.| +| callback | AsyncCallback<[MissionInfo](#missioninfo)> | Yes| Callback used to return the mission information obtained.| **Example** @@ -169,16 +169,16 @@ Obtains the information about a given mission. This API uses a promise to return **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | deviceId | string | Yes| Device ID. It is a null string by default for the local device.| - | missionId | number | Yes| Mission ID.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| +| missionId | number | Yes| Mission ID.| **Return value** - | Type| Description| - | -------- | -------- | - | Promise<[MissionInfo](#missioninfo)> | Promise used to return the mission information obtained.| +| Type| Description| +| -------- | -------- | +| Promise<[MissionInfo](#missioninfo)> | Promise used to return the mission information obtained.| **Example** @@ -201,11 +201,11 @@ Obtains information about all missions. This API uses an asynchronous callback t **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | deviceId | string | Yes| Device ID. It is a null string by default for the local device.| - | numMax | number | Yes| Maximum number of missions whose information can be obtained.| - | callback | AsyncCallback<Array<[MissionInfo](#missioninfo)>> | Yes| Callback used to return the array of mission information obtained.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| +| numMax | number | Yes| Maximum number of missions whose information can be obtained.| +| callback | AsyncCallback<Array<[MissionInfo](#missioninfo)>> | Yes| Callback used to return the array of mission information obtained.| **Example** @@ -230,16 +230,16 @@ Obtains information about all missions. This API uses a promise to return the re **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | deviceId | string | Yes| Device ID. It is a null string by default for the local device.| - | numMax | number | Yes| Maximum number of missions whose information can be obtained.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| +| numMax | number | Yes| Maximum number of missions whose information can be obtained.| **Return value** - | Type| Description| - | -------- | -------- | - | Promise<Array<[MissionInfo](#missioninfo)>> | Promise used to return the array of mission information obtained.| +| Type| Description| +| -------- | -------- | +| Promise<Array<[MissionInfo](#missioninfo)>> | Promise used to return the array of mission information obtained.| **Example** @@ -262,11 +262,11 @@ Obtains the snapshot of a given mission. This API uses an asynchronous callback **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | deviceId | string | Yes| Device ID. It is a null string by default for the local device.| - | missionId | number | Yes| Mission ID.| - | callback | AsyncCallback<[MissionSnapshot](js-apis-application-MissionSnapshot.md)> | Yes| Callback used to return the snapshot information obtained.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| +| missionId | number | Yes| Mission ID.| +| callback | AsyncCallback<[MissionSnapshot](js-apis-application-MissionSnapshot.md)> | Yes| Callback used to return the snapshot information obtained.| **Example** @@ -297,16 +297,16 @@ Obtains the snapshot of a given mission. This API uses a promise to return the r **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | deviceId | string | Yes| Device ID. It is a null string by default for the local device.| - | missionId | number | Yes| Mission ID.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| deviceId | string | Yes| Device ID. It is a null string by default for the local device.| +| missionId | number | Yes| Mission ID.| **Return value** - | Type| Description| - | -------- | -------- | - | Promise<[MissionSnapshot](js-apis-application-MissionSnapshot.md)> | Promise used to return the snapshot information obtained.| +| Type| Description| +| -------- | -------- | +| Promise<[MissionSnapshot](js-apis-application-MissionSnapshot.md)> | Promise used to return the snapshot information obtained.| **Example** @@ -337,10 +337,10 @@ Locks a given mission. This API uses an asynchronous callback to return the resu **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | missionId | number | Yes| Mission ID.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| missionId | number | Yes| Mission ID.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** @@ -370,15 +370,15 @@ Locks a given mission. This API uses a promise to return the result. **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | missionId | number | Yes| Mission ID.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| missionId | number | Yes| Mission ID.| **Return value** - | Type| Description| - | -------- | -------- | - | Promise<void> | Promise used to return the result.| +| Type| Description| +| -------- | -------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -441,15 +441,15 @@ Unlocks a given mission. This API uses a promise to return the result. **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | missionId | number | Yes| Mission ID.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| missionId | number | Yes| Mission ID.| **Return value** - | Type| Description| - | -------- | -------- | - | Promise<void> | Promise used to return the result.| +| Type| Description| +| -------- | -------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -483,10 +483,10 @@ Clears a given mission, regardless of whether it is locked. This API uses an asy **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | missionId | number | Yes| Mission ID.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| missionId | number | Yes| Mission ID.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** @@ -516,15 +516,15 @@ Clears a given mission, regardless of whether it is locked. This API uses a prom **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | missionId | number | Yes| Mission ID.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| missionId | number | Yes| Mission ID.| **Return value** - | Type| Description| - | -------- | -------- | - | Promise<void> | Promise used to return the result.| +| Type| Description| +| -------- | -------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -574,9 +574,9 @@ Clears all unlocked missions. This API uses a promise to return the result. **Return value** - | Type| Description| - | -------- | -------- | - | Promise<void> | Promise used to return the result.| +| Type| Description| +| -------- | -------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -598,10 +598,10 @@ Switches a given mission to the foreground. This API uses an asynchronous callba **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | missionId | number | Yes| Mission ID.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| missionId | number | Yes| Mission ID.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** @@ -631,11 +631,11 @@ Switches a given mission to the foreground, with the startup parameters for the **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | missionId | number | Yes| Mission ID.| - | options | StartOptions | Yes| Startup parameters, which are used to specify the window mode and device ID for switching the mission to the foreground.| - | callback | AsyncCallback<void> | Yes| Callback used to return the result.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| missionId | number | Yes| Mission ID.| +| options | StartOptions | Yes| Startup parameters, which are used to specify the window mode and device ID for switching the mission to the foreground.| +| callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** @@ -665,16 +665,16 @@ Switches a given mission to the foreground, with the startup parameters for the **Parameters** - | Name| Type| Mandatory| Description| - | -------- | -------- | -------- | -------- | - | missionId | number | Yes| Mission ID.| - | options | StartOptions | No| Startup parameters, which are used to specify the window mode and device ID for switching the mission to the foreground.| +| Name| Type| Mandatory| Description| +| -------- | -------- | -------- | -------- | +| missionId | number | Yes| Mission ID.| +| options | StartOptions | No| Startup parameters, which are used to specify the window mode and device ID for switching the mission to the foreground.| **Return value** - | Type| Description| - | -------- | -------- | - | Promise<void> | Promise used to return the result.| +| Type| Description| +| -------- | -------- | +| Promise<void> | Promise used to return the result.| **Example** @@ -700,13 +700,13 @@ Describes the mission information. **System capability**: SystemCapability.Ability.AbilityBase -| Name| Type| Readable| Writable| Description| +| Name| Type| Readable| Writable| Description| | -------- | -------- | -------- | -------- | -------- | -| missionId | number | Yes| Yes| Mission ID.| -| runningState | number | Yes| Yes| Running state of the mission.| -| lockedState | boolean | Yes| Yes| Locked state of the mission.| -| timestamp | string | Yes| Yes| Latest time when the mission was created or updated.| -| want | [Want](js-apis-application-Want.md) | Yes| Yes| **Want** information of the mission.| -| label | string | Yes| Yes| Label of the mission.| -| iconPath | string | Yes| Yes| Path of the mission icon.| -| continuable | boolean | Yes| Yes| Whether the mission is continuable.| +| missionId | number | Yes| Yes| Mission ID.| +| runningState | number | Yes| Yes| Running state of the mission.| +| lockedState | boolean | Yes| Yes| Locked state of the mission.| +| timestamp | string | Yes| Yes| Latest time when the mission was created or updated.| +| want | [Want](js-apis-application-Want.md) | Yes| Yes| **Want** information of the mission.| +| label | string | Yes| Yes| Label of the mission.| +| iconPath | string | Yes| Yes| Path of the mission icon.| +| continuable | boolean | Yes| Yes| Whether the mission can be continued on another device. | diff --git a/en/application-dev/reference/apis/js-apis-processrunninginfo.md b/en/application-dev/reference/apis/js-apis-processrunninginfo.md index 29d055c83fc1e408404a3d91c81ea0ab090a6258..63f61d7472be78055c0c4612aa154b2f9eb4c922 100644 --- a/en/application-dev/reference/apis/js-apis-processrunninginfo.md +++ b/en/application-dev/reference/apis/js-apis-processrunninginfo.md @@ -1,11 +1,16 @@ # ProcessRunningInfo -> ![icon-note.gif](public_sys-resources/icon-note.gif) **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. Provides process running information. +## Modules to Import + +```js +import appManager from '@ohos.application.appManager' +``` ## Usage diff --git a/en/application-dev/reference/apis/js-apis-system-parameter.md b/en/application-dev/reference/apis/js-apis-system-parameter.md index c111c6c2cbfa5e809816b3246a28ac8114e35f76..c068d0429fcd2aa1ee91fb3dd145ee32296274e8 100644 --- a/en/application-dev/reference/apis/js-apis-system-parameter.md +++ b/en/application-dev/reference/apis/js-apis-system-parameter.md @@ -1,6 +1,7 @@ # System Parameter -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
+> > - The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > - This is a system API and cannot be called by third-party applications. @@ -24,7 +25,7 @@ Obtains the value of the attribute with the specified key. | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system attribute.| -| def | string | No| Default Value| +| def | string | No| Default value.| **Return value** @@ -48,7 +49,7 @@ try { get(key: string, callback: AsyncCallback<string>): void -Obtains the value of the attribute with the specified key. This API uses an asynchronous callback to return the result. +Obtains the value of the attribute with the specified key. **System capability**: SystemCapability.Startup.SysInfo @@ -79,7 +80,7 @@ try { get(key: string, def: string, callback: AsyncCallback<string>): void -Obtains the value of the attribute with the specified key. This API uses an asynchronous callback to return the result. +Obtains the value of the attribute with the specified key. **System capability**: SystemCapability.Startup.SysInfo @@ -112,7 +113,7 @@ try { get(key: string, def?: string): Promise<string> -Obtains the value of the attribute with the specified key. This API uses a promise to return the result. +Obtains the value of the attribute with the specified key. **System capability**: SystemCapability.Startup.SysInfo @@ -171,11 +172,11 @@ try { ``` -## parameter.set(key: string, value: string, callback: AsyncCallback<void>) +## parameter.set set(key: string, value: string, callback: AsyncCallback<void>): void -Sets a value for the attribute with the specified key. This API uses an asynchronous callback to return the result. +Sets a value for the attribute with the specified key. **System capability**: SystemCapability.Startup.SysInfo @@ -184,7 +185,7 @@ Sets a value for the attribute with the specified key. This API uses an asynchro | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system attribute.| -| def | string | Yes| Default Value| +| value | string | Yes| System attribute value to set.| | callback | AsyncCallback<void> | Yes| Callback used to return the result.| **Example** @@ -203,11 +204,11 @@ try { ``` -## parameter.set(key: string, def?: string) +## parameter.set -set(key: string, def?: string): Promise<string> +set(key: string, value: string): Promise<void> -Sets a value for the attribute with the specified key. This API uses a promise to return the result. +Sets a value for the attribute with the specified key. **System capability**: SystemCapability.Startup.SysInfo @@ -216,13 +217,13 @@ Sets a value for the attribute with the specified key. This API uses a promise t | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | | key | string | Yes| Key of the system attribute.| -| def | string | No| Default Value| +| value| string | Yes| System attribute value to set.| **Return value** | Type| Description| | -------- | -------- | -| Promise<string> | Promise used to return the execution result.| +| Promise<void> | Promise used to return the execution result.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-webSocket.md b/en/application-dev/reference/apis/js-apis-webSocket.md index a1a24975f9e67c6acfccfc42fe9669b07fa90e22..edf6be53ac623c5fa4a8f1542bf7222dc42e713c 100644 --- a/en/application-dev/reference/apis/js-apis-webSocket.md +++ b/en/application-dev/reference/apis/js-apis-webSocket.md @@ -3,7 +3,6 @@ >![](public_sys-resources/icon-note.gif) **NOTE:** >The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > ->Newly added APIs are defined but not implemented in OpenHarmony 3.1 Release. They will be available for use in OpenHarmony 3.1 MR. You can use WebSocket to establish a bidirectional connection between a server and a client. Before doing this, you need to use the [createWebSocket](#websocketcreatewebsocket) API to create a [WebSocket](#websocket) object and then use the [connect](#connect) API to connect to the server. If the connection is successful, the client will receive a callback of the [open](#onopen) event. Then, the client can communicate with the server using the [send](#send) API. When the server sends a message to the client, the client will receive a callback of the [message](#onmessage) event. If the client no longer needs this connection, it can call the [close](#close) API to disconnect from the server. Then, the client will receive a callback of the [close](#onclose) event. diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index 4c4f1e76a0fbfb8d847f092698a27899fba367d3..9c23173a74ce036859f2b8cecdb83f541da4c463 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -58,10 +58,10 @@ Describes the properties of the status bar and navigation bar. | Name | Type| Readable| Writable| Description | | -------------------------------------- | -------- | ---- | ---- | ------------------------------------------------------------ | -| statusBarColor | string | Yes | Yes | Background color of the status bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**.| +| statusBarColor | string | Yes | Yes | Background color of the status bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, **\#00FF00** or **\#FF00FF00**.| | isStatusBarLightIcon7+ | boolean | No | Yes | Whether any icon on the status bar is highlighted. | | statusBarContentColor8+ | string | No | Yes | Color of the text on the status bar. | -| navigationBarColor | string | Yes | Yes | Background color of the navigation bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**.| +| navigationBarColor | string | Yes | Yes | Background color of the navigation bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, **\#00FF00** or **\#FF00FF00**.| | isNavigationBarLightIcon7+ | boolean | No | No | Whether any icon on the navigation bar is highlighted. | | navigationBarContentColor8+ | string | No | Yes | Color of the text on the navigation bar. | @@ -78,7 +78,7 @@ This is a system API and cannot be called by third-party applications. | type | [WindowType](#windowtype) | Yes | Yes | Type of the system bar whose properties are changed. Only the status bar and navigation bar are supported.| | isEnable | boolean | Yes | Yes | Whether the system bar is displayed. | | region | [Rect](#rect) | Yes | Yes | Current position and size of the system bar. | -| backgroundColor | string | Yes | Yes | Background color of the system bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**.| +| backgroundColor | string | Yes | Yes | Background color of the system bar. The value is a hexadecimal RGB or aRGB color value and is case insensitive, for example, **\#00FF00** or **\#FF00FF00**.| | contentColor | string | Yes | Yes | Color of the text on the system bar. | ## SystemBarTintState8+ @@ -146,6 +146,7 @@ Describes the window properties. | focusable7+ | boolean | Yes | No | Whether the window can gain focus. The default value is **true**. | | touchable7+ | boolean | Yes | No | Whether the window is touchable. The default value is **true**. | | brightness | number | Yes | Yes | Screen brightness. The value ranges from 0 to 1. The value **1** indicates the maximum brightness. | +| dimBehindValue(deprecated) | number | Yes | Yes | Dimness of the window that is not on top. The value ranges from 0 to 1. The value **1** indicates the maximum dimness.
This attribute is supported since API version 7 and deprecated since API version 9.
| | isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is **false**. | | isPrivacyMode7+ | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is **false**. | | isRoundCorner7+ | boolean | Yes | Yes | Whether the window has rounded corners. The default value is **false**. | @@ -168,7 +169,7 @@ create(id: string, type: WindowType, callback: AsyncCallback<Window>): voi Creates a subwindow. This API uses an asynchronous callback to return the result. -This API is discarded since API version 8. You are advised to use [window.create8+](#windowcreate8) instead. +This API is deprecated since API version 8. You are advised to use [window.create8+](#windowcreate8) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -201,7 +202,7 @@ create(id: string, type: WindowType): Promise<Window> Creates a subwindow. This API uses a promise to return the result. -This API is discarded since API version 8. You are advised to use [window.create8+](#windowcreate8) instead. +This API is deprecated since API version 8. You are advised to use [window.create8+](#windowcreate8) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -370,7 +371,7 @@ getTopWindow(callback: AsyncCallback<Window>): void Obtains the top window of the current application. This API uses an asynchronous callback to return the result. -This API is discarded since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. +This API is deprecated since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -400,7 +401,7 @@ getTopWindow(): Promise<Window> Obtains the top window of the current application. This API uses a promise to return the result. -This API is discarded since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. +This API is deprecated since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -706,11 +707,11 @@ Moves this window. This API uses an asynchronous callback to return the result. **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------- | ---- | --------------------------------------- | -| x | number | Yes | Distance that the window moves along the x-axis. A positive value indicates that the window moves to the right.| -| y | number | Yes | Distance that the window moves along the y-axis. A positive value indicates that the window moves downwards.| -| callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | +| Name | Type | Mandatory| Description | +| -------- | ------------------------- | ---- | ------------------------------------------------- | +| x | number | Yes | Distance that the window moves along the x-axis, in px. A positive value indicates that the window moves to the right.| +| y | number | Yes | Distance that the window moves along the y-axis, in px. A positive value indicates that the window moves downwards.| +| callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | **Example** @@ -735,10 +736,10 @@ Moves this window. This API uses a promise to return the result. **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | --------------------------------------- | -| x | number | Yes | Distance that the window moves along the x-axis. A positive value indicates that the window moves to the right.| -| y | number | Yes | Distance that the window moves along the y-axis. A positive value indicates that the window moves downwards.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | ------------------------------------------------- | +| x | number | Yes | Distance that the window moves along the x-axis, in px. A positive value indicates that the window moves to the right.| +| y | number | Yes | Distance that the window moves along the y-axis, in px. A positive value indicates that the window moves downwards.| **Return value** @@ -767,11 +768,11 @@ Changes the size of this window. This API uses an asynchronous callback to retur **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------- | ---- | ---------------- | -| width | number | Yes | New width of the window.| -| height | number | Yes | New height of the window.| -| callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | +| Name | Type | Mandatory| Description | +| -------- | ------------------------- | ---- | -------------------------- | +| width | number | Yes | New width of the window, in px.| +| height | number | Yes | New height of the window, in px.| +| callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | **Example** @@ -795,10 +796,10 @@ Changes the size of this window. This API uses a promise to return the result. **Parameters** -| Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ---------------- | -| width | number | Yes | New width of the window.| -| height | number | Yes | New height of the window.| +| Name| Type | Mandatory| Description | +| ------ | ------ | ---- | -------------------------- | +| width | number | Yes | New width of the window, in px.| +| height | number | Yes | New height of the window, in px.| **Return value** @@ -1601,7 +1602,7 @@ Sets this window to the wide or default color gamut mode. This API uses a promis promise.then((data)=> { console.info('Succeeded in setting window colorspace. Data: ' + JSON.stringify(data)) }).catch((err)=>{ - console.error('Failed to set window colorspacet. Cause: ' + JSON.stringify(err)); + console.error('Failed to set window colorspace. Cause: ' + JSON.stringify(err)); }); ``` @@ -1624,10 +1625,10 @@ Obtains the color gamut mode of this window. This API uses an asynchronous callb ```js windowClass.getColorSpace((err, data) => { if (err.code) { - console.error('Failed to get window color space. Cause:' + JSON.stringify(err)); + console.error('Failed to get window colorspace. Cause:' + JSON.stringify(err)); return; } - console.info('Succeeded in getting window color space. Cause:' + JSON.stringify(data)) + console.info('Succeeded in getting window colorspace. Cause:' + JSON.stringify(data)) }) ``` @@ -1652,7 +1653,7 @@ Obtains the color gamut mode of this window. This API uses a promise to return t promise.then((data)=> { console.info('Succeeded in getting window color space. Cause:' + JSON.stringify(data)) }).catch((err)=>{ - console.error('Failed to set window colorspacet. Cause: ' + JSON.stringify(err)); + console.error('Failed to get window colorspace. Cause: ' + JSON.stringify(err)); }); ``` @@ -1668,7 +1669,7 @@ Sets the background color for this window. This API uses an asynchronous callbac | Name | Type | Mandatory| Description | | -------- | ------------------------- | ---- | ------------------------------------------------------------ | -| color | string | Yes | Background color to set. The color is a hexadecimal value, for example, #00FF00 or #FF00FF00.| +| color | string | Yes | Background color to set. The value is a hexadecimal color value and is case insensitive, for example, **#00FF00** or **#FF00FF00**.| | callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | **Example** @@ -1696,7 +1697,7 @@ Sets the background color for this window. This API uses a promise to return the | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------------------------------------------------------------ | -| color | string | Yes | Background color to set. The color is a hexadecimal value, for example, #00FF00 or #FF00FF00.| +| color | string | Yes | Background color to set. The value is a hexadecimal color value and is case insensitive, for example, **#00FF00** or **#FF00FF00**.| **Return value** @@ -1776,6 +1777,70 @@ Sets the screen brightness for this window. This API uses a promise to return th }); ``` +### setDimBehind(deprecated) + +setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void + +Sets the dimness of the window that is not on top. This API uses an asynchronous callback to return the result. + +> This API is supported since API version 7 and deprecated since API version 9. +> + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------------- | ------------------------- | ---- | -------------------------------------------------- | +| dimBehindValue | number | Yes | Dimness of the window to set. The value ranges from 0 to 1. The value **1** indicates the dimmest.| +| callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | + +**Example** + + ```js + windowClass.setDimBehind(0.5, (err, data) => { + if (err.code) { + console.error('Failed to set the dimness. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in setting the dimness. Data:' + JSON.stringify(data)); + }); + ``` + +### setDimBehind(deprecated) + +setDimBehind(dimBehindValue: number): Promise<void> + +Sets the dimness of the window that is not on top. This API uses a promise to return the result. + +> This API is supported since API version 7 and deprecated since API version 9. +> + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------------- | ------ | ---- | -------------------------------------------------- | +| dimBehindValue | number | Yes | Dimness of the window to set. The value ranges from 0 to 1. The value **1** indicates the dimmest.| + +**Return value** + +| Type | Description | +| ------------------- | ----------------------------------------------- | +| Promise<void> | Promise used to return the execution result.| + +**Example** + + ```js + let promise = windowClass.setDimBehind(0.5); + promise.then((data)=> { + console.info('Succeeded in setting the dimness. Data: ' + JSON.stringify(data)) + }).catch((err)=>{ + console.error('Failed to set the dimness. Cause: ' + JSON.stringify(err)); + }); + ``` + ### setFocusable7+ setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void @@ -1864,6 +1929,70 @@ Sets whether to keep the screen always on. This API uses an asynchronous callbac }); ``` +### setOutsideTouchable(deprecated) + +setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): void + +Sets whether the area outside the subwindow is touchable. This API uses an asynchronous callback to return the result. + +> This API is supported since API version 7 and deprecated since API version 9. +> + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| --------- | ------------------------- | ---- | ---------------- | +| touchable | boolean | Yes | Whether the area outside the subwindow is touchable. The value **true** means that such an area is touchable, and **false** means the opposite.| +| callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | + +**Example** + + ```js + windowClass.setOutsideTouchable(true, (err, data) => { + if (err.code) { + console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in setting the area to be touchable. Data: ' + JSON.stringify(data)) + }) + ``` + +### setOutsideTouchable(deprecated) + +setOutsideTouchable(touchable: boolean): Promise<void> + +Sets whether the area outside the subwindow is touchable. This API uses a promise to return the result. + +> This API is supported since API version 7 and deprecated since API version 9. +> + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| --------- | ------- | ---- | ---------------- | +| touchable | boolean | Yes | Whether the area outside the subwindow is touchable. The value **true** means that such an area is touchable, and **false** means the opposite.| + +**Return value** + +| Type | Description | +| ------------------- | ----------------------------------------------- | +| Promise<void> | Promise used to return the execution result.| + +**Example** + + ```js + let promise = windowClass.setOutsideTouchable(true); + promise.then((data)=> { + console.info('Succeeded in setting the area to be touchable. Data: ' + JSON.stringify(data)) + }).catch((err)=>{ + console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err)); + }); + ``` + ### setKeepScreenOn setKeepScreenOn(isKeepScreenOn: boolean): Promise<void> diff --git a/en/application-dev/reference/apis/js-apis-workScheduler.md b/en/application-dev/reference/apis/js-apis-workScheduler.md index bd8e95ec9ef21a1498b3dc4db0b5f1f4fb595c49..964b63aa2ec47a0cceaaac8457f77f3a916051f7 100644 --- a/en/application-dev/reference/apis/js-apis-workScheduler.md +++ b/en/application-dev/reference/apis/js-apis-workScheduler.md @@ -1,6 +1,6 @@ # Work Scheduler -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 9. API version 9 is a canary version for trial use. The APIs of this version may be unstable. @@ -100,7 +100,7 @@ Obtains the latest task status. This API uses an asynchronous callback to return ``` workScheduler.getWorkStatus(50, (err, res) => { if (err) { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); } else { for (let item in res) { console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); @@ -136,7 +136,7 @@ Obtains the latest task status. This API uses a promise to return the result. console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); } }).catch((err) => { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); }) ``` @@ -151,7 +151,7 @@ Obtains all tasks associated with this application. This API uses an asynchronou | Name | Type | Mandatory | Description | | -------- | -------------------- | ---- | ------------------------------- | -| callback | AsyncCallback\ | Yes | Callback used to return all tasks associated with the current application.| +| callback | AsyncCallback\ | Yes | Callback used to return all tasks associated with the current application. | **Return value** @@ -164,7 +164,7 @@ Obtains all tasks associated with this application. This API uses an asynchronou ``` workScheduler.obtainAllWorks((err, res) =>{ if (err) { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); } else { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); } @@ -182,7 +182,7 @@ Obtains all tasks associated with this application. This API uses a promise to r | Type | Description | | -------------------------------------- | ------------------------------ | -| Promise> | Promise used to return all tasks associated with the current application.| +| Promise> | Promise used to return all tasks associated with the current application. | **Example** @@ -190,7 +190,7 @@ Obtains all tasks associated with this application. This API uses a promise to r workScheduler.obtainAllWorks().then((res) => { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); }).catch((err) => { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); }) ``` @@ -233,7 +233,7 @@ Checks whether the last execution of the specified task timed out. This API uses ``` workScheduler.isLastWorkTimeOut(500, (err, res) =>{ if (err) { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); } else { console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); } @@ -267,7 +267,7 @@ Checks whether the last execution of the specified task timed out. This API uses console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); }) .catch(err => { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); }); ``` @@ -291,6 +291,8 @@ Provides detailed information about the task. | repeatCycleTime | number | No | Repeat interval. | | repeatCount | number | No | Number of repeat times. | | isPersisted | boolean | No | Whether to enable persistent storage for the task. | +| isDeepIdle | boolean | No | Whether the device needs to enter the idle state. | +| idleWaitTime | number | No | Time to wait in the idle state. | ## NetworkType Enumerates the network types that can trigger the task. @@ -319,7 +321,7 @@ Enumerates the charging types that can trigger the task. | CHARGING_PLUGGED_WIRELESS | 3 | Wireless charging. | ## BatteryStatus -Enumerates the battery status that can trigger the task. +Enumerates the battery states that can trigger the task. **System capability**: SystemCapability.ResourceSchedule.WorkScheduler @@ -330,7 +332,7 @@ Enumerates the battery status that can trigger the task. | BATTERY_STATUS_LOW_OR_OKAY | 2 | The battery level is restored from low to normal, or a low battery alert is displayed.| ## StorageRequest -Enumerates the storage status that can trigger the task. +Enumerates the storage states that can trigger the task. **System capability**: SystemCapability.ResourceSchedule.WorkScheduler diff --git a/en/application-dev/reference/arkui-js/Readme-EN.md b/en/application-dev/reference/arkui-js/Readme-EN.md index fd00b650bc95c252d91fc55c323af6882030d93c..e5cbbdb9356b7066c5f53ff778f1760799a18e31 100644 --- a/en/application-dev/reference/arkui-js/Readme-EN.md +++ b/en/application-dev/reference/arkui-js/Readme-EN.md @@ -101,6 +101,7 @@ - Custom Components - [Basic Usage](js-components-custom-basic-usage.md) + - [Style Inheritance](js-components-custom-style.md) - [Custom Events](js-components-custom-events.md) - [props](js-components-custom-props.md) - [Event Parameter](js-components-custom-event-parameter.md) diff --git a/en/application-dev/reference/arkui-js/js-components-common-attributes.md b/en/application-dev/reference/arkui-js/js-components-common-attributes.md index 7c3db13df60375b2ae5988d747d7c8747da017af..4175288f9fe836b8c6d54a3e60adada277b30e40 100644 --- a/en/application-dev/reference/arkui-js/js-components-common-attributes.md +++ b/en/application-dev/reference/arkui-js/js-components-common-attributes.md @@ -1,175 +1,34 @@ -# Universal Attributes +# Universal Attributes -## Common Attributes +> **NOTE**
+> Universal attributes are supported since API version 4. Updates will be marked with a superscript to indicate their earliest API version. + +## Common Attributes Common attributes are used to set component identities and appearance. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Name

-

Type

-

Default Value

-

Mandatory

-

Description

-

id

-

string

-

-

-

No

-

Unique ID of a component.

-

style

-

string

-

-

-

No

-

Style declaration of a component.

-

class

-

string

-

-

-

No

-

Style class of a component, which is used to refer to a style table.

-

ref

-

string

-

-

-

No

-

Used to register reference information of child elements or child components. The reference information is registered with the parent component on $refs.

-

disabled

-

boolean

-

false

-

No

-

Whether a component is disabled. If it is disabled, it cannot respond to user interaction.

-

data

-

string

-

-

-

No

-

Attribute set for the component to facilitate data storage and reading. In the JS file:

-
  • Use e.target.attr.data to read data in the event callback, where e is the input parameter.
  • After a DOM element is obtained by using $element or $refs, it can be accessed through attr.data.
-
NOTE:

It is recommended that you use data-* since API version 6.

-
-

data-*6+

-

string

-

-

-

No

-

Attribute set for components to facilitate data storage and reading. The value is case insensitive. For example, data-A and data-a are the same by default. In the JS file:

-
  • Use e.target.dataSet.a to read data in the event callback, where e is the input parameter.
  • After a DOM element is obtained by using $element or $refs, it can be accessed through dataSet.a.
-

click-effect5+

-

string

-

-

-

No

-

Click effect complying with spring physics. Available values are as follows:

-
  • spring-small: The component scales down to 90% of its size when it is selected. This is appropriate for small components.
  • spring-medium: The component scales down to 95% of its size when it is selected. This is appropriate for medium-sized components.
  • spring-large: The component scales down to 95% of its size when it is selected. This is appropriate for large components.
-

dir6+

-

string

-

auto

-

No

-

Element layout mode. The value can be:

-
  • rtl: right-to-left layout.
  • ltr: left-to-right layout.
  • auto: follows the system language environment.
-
+| Name | Type | Default Value | Mandatory | Description | +| ------------------------- | ------- | ----- | ---- | ---------------------------------------- | +| id | string | - | No | Unique ID of the component. | +| style | string | - | No | Style declaration of the component. | +| class | string | - | No | Style class of the component, which is used to refer to a style table. | +| ref | string | - | No | Reference information of child elements or child components, which is registered with the parent component on `$refs`.| +| disabled | boolean | false | No | Whether the component is disabled. If it is disabled, it cannot respond to user interaction. | +| data | string | - | No | Attribute set for the component to facilitate data storage and reading. In the JS file:
- Use **e.target.attr.data** to read data in the event callback, where **e** is the input parameter.
- Use `$element` or `$refs` to obtain a DOM element, which can then be accessed through **attr.data**.
You are advised to use **data-*** instead since API version 6.| +| data-\*6+ | string | - | No | Attribute set for the component to facilitate data storage and reading. The value is case insensitive. For example, **data-A** and **data-a** are the same by default. In the JS file:
- Use **e.target.dataSet.a** to read data in the event callback, where **e** is the input parameter.
- After a DOM element is obtained by using **$element** or **$refs**, it can be accessed through **dataSet.a**.| +| click-effect5+ | string | - | No | Click effect complying with spring physics. Available values are as follows:
- **spring-small**: The component scales down to 90% of its size when it is selected. This is appropriate for small components.
- **spring-medium**: The component scales down to 95% of its size when it is selected. This is appropriate for medium-sized components.
- **spring-large**: The component scales down to 95% of its size when it is selected. This is appropriate for large components.| +| dir6+ | string | auto | No | Element layout mode. Available values are as follows:
- **rtl**: right-to-left layout.
- **ltr**: left-to-right layout.
- **auto**: follows the system language environment.| -## Rendering Attributes -Rendering attributes are used to set whether a component is rendered. +## Rendering Attributes - - - - - - - - - - - - - - - - - - - - - - - -

Name

-

Type

-

Default Value

-

Description

-

for

-

Array

-

-

-

Expands the current element based on the configured data list.

-

if

-

boolean

-

-

-

Whether the element is added or removed.

-

show

-

boolean

-

-

-

Whether the element is displayed or hidden.

-
+Rendering attributes are used to set whether a component is rendered. ->![](../../public_sys-resources/icon-note.gif) **NOTE:** ->Do not set styles in attribute fields. +| Name | Type | Default Value | Description | +| ---- | ------- | ---- | ------------------------ | +| for | Array | - | Expands the current element based on the configured data list. | +| if | boolean | - | Whether the element is added or removed.| +| show | boolean | - | Whether the element is displayed or hidden.| +> **NOTE**
+> Do not set styles in attribute fields. diff --git a/en/application-dev/reference/arkui-js/js-components-custom-style.md b/en/application-dev/reference/arkui-js/js-components-custom-style.md new file mode 100644 index 0000000000000000000000000000000000000000..37e0770cdeec8de1e3bd3c89360c56973353cea4 --- /dev/null +++ b/en/application-dev/reference/arkui-js/js-components-custom-style.md @@ -0,0 +1,43 @@ +# Style Inheritance +> **NOTE**
+> The APIs of this module are supported since API 9. Updates will be marked with a superscript to indicate their earliest API version. + +A custom component has the **inherit-class** attribute, which is defined in the following table. + +| Name | Type | Default Value| Mandatory| Description | +| ------------ | ------ | ------ | ---- | ------------------------------------------------------ | +| inherit-class | string | - | No | Class styles inherited from the parent component, seperated by spaces.| + +To enable a custom component to inherit the styles of its parent component, set the **inherit-calss** attribute for the custom component. + +The example below is a code snippet in the HML file of the parent page that references a custom component named **comp**. This component uses the **inherit-class** attribute to inherit the styles of its parent component: **parent-class1** and **parent-class2**. +```html + + + +
+ +
+``` + +Code snippet in the CSS file of the parent page: +```html +// xxx.css +.parent-class1 { + background-color:red; + border:2px; +} +.parent-class2 { + background-color:green; + border:2px; +} +``` + +Code snippet in the HML file of the custom component, where **parent-class1** and **parent-class2** are styles inherited from the parent component: +```html + +
+ Style 1 inherited from the parent component + Style 2 inherited from the parent component +
+``` diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-navigation.md b/en/application-dev/reference/arkui-ts/ts-basic-components-navigation.md index cee15503037b0aecc2f00b70bb019181cce7339d..b4d89bd97a63514d77f168827d73e1f800de6c1d 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-navigation.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-navigation.md @@ -29,11 +29,11 @@ Creates a component that can automatically display the navigation bar, title, an | Name | Type | Default Value | Description | | -------- | -------- | -------- | -------- | -| title | string \| [CustomBuilder](../../ui/ts-types.md)8+ | - | Page title. | +| title | string \| [CustomBuilder](../../ui/ts-types.md) | - | Page title. | | subtitle | string | - | Subtitle of the page. | -| menus | Array<NavigationMenuItem> \| [CustomBuilder](../../ui/ts-types.md)8+ | - | Menu in the upper right corner of the page. | +| menus | Array<NavigationMenuItem> \| [CustomBuilder](../../ui/ts-types.md) | - | Menu in the upper right corner of the page. | | titleMode | NavigationTitleMode | NavigationTitleMode.Free | Display mode of the page title bar. | -| toolBar | {
items:[
Object
] }
\| [CustomBuilder](../../ui/ts-types.md)8+ | - | Content of the toolbar.
**items**: all items on the toolbar. | +| toolBar | {
items:[
Object
] }
\| [CustomBuilder](../../ui/ts-types.md) | - | Content of the toolbar.
**items**: all items on the toolbar. | | hideToolBar | boolean | false | Whether to hide the toolbar.
**true**: Hide the toolbar.
**false**: Show the toolbar. | | hideTitleBar | boolean | false | Whether to hide the title bar. | | hideBackButton | boolean | false | Whether to hide the back button. | diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-search.md b/en/application-dev/reference/arkui-ts/ts-basic-components-search.md index fbd02e43d85081fbc64ed53d7987e86bcb3d053a..105b4f99b6eba49a341d4524b2bcbc271c9a0505 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-search.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-search.md @@ -55,7 +55,7 @@ controller: SearchController = new SearchController() ``` #### caretPosition -creatPosition(value: number): viod +creatPosition(value: number): void Sets the position of the caret. diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-select.md b/en/application-dev/reference/arkui-ts/ts-basic-components-select.md index 415a1bd3d96af1ff879af2b779c3a5481ffe3d85..e570146aecc17334b0803cde1c0db89e16a4b494 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-select.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-select.md @@ -1,6 +1,7 @@ # Select -> ![](public_sys-resources/icon-note.gif) **NOTE** This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. +> **NOTE**
+> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. The **** component provides a drop-down list box that allows users to select among multiple options. @@ -20,29 +21,29 @@ Select(options: Array\\) | Name| Type| Mandatory| Default Value| Description| | ------ | ----------------------------------------------- | ---- | ------ | -------------- | - | value | [ResourceStr](../../ui/ts-types.md) | Yes| - | Value of an option in the drop-down list box.| - | icon | [ResourceStr](../../ui/ts-types.md) | No| - | Icon of an option in the drop-down list box.| + | value | [ResourceStr](../../ui/ts-types.md) | Yes | - | Value of an option in the drop-down list box. | + | icon | [ResourceStr](../../ui/ts-types.md) | No | - | Icon of an option in the drop-down list box. | ## Attributes | Name| Type| Default Value| Description| | ----------------------- | --------------------------------------------------- | ------ | ----------------------------------------------- | -| selected | number | - | Index of the initial selected option in the drop-down list box. The index of the first option is **0**.| -| value | string | - | Text of the drop-down button.| -| font | [Font](../../ui/ts-types.md) | - | Text font of the drop-down button.| -| fontColor | [ResourceColor](../../ui/ts-types.md) | - | Text color of the drop-down button.| -| selectedOptionBgColor | [ResourceColor](../../ui/ts-types.md) | - | Background color of the selected option in the drop-down list box.| -| selectedOptionFont | [Font](../../ui/ts-types.md) | - | Text font of the selected option in the drop-down list box.| -| selectedOptionFontColor | [ResourceColor](../../ui/ts-types.md) | - | Text color of the selected option in the drop-down list box.| -| optionBgColor | [ResourceColor](../../ui/ts-types.md) | - | Background color of an option in the drop-down list box.| -| optionFont | [Font](../../ui/ts-types.md) | - | Text font of an option in the drop-down list box.| -| optionFontColor | [ResourceColor](../../ui/ts-types.md) | - | Text color of an option in the drop-down list box.| +| selected | number | - | Index of the initial selected option in the drop-down list box. The index of the first option is **0**. | +| value | string | - | Text of the drop-down button. | +| font | [Font](../../ui/ts-types.md) | - | Text font of the drop-down button. | +| fontColor | [ResourceColor](../../ui/ts-types.md) | - | Text color of the drop-down button. | +| selectedOptionBgColor | [ResourceColor](../../ui/ts-types.md) | - | Background color of the selected option in the drop-down list box. | +| selectedOptionFont | [Font](../../ui/ts-types.md) | - | Text font of the selected option in the drop-down list box. | +| selectedOptionFontColor | [ResourceColor](../../ui/ts-types.md) | - | Text color of the selected option in the drop-down list box. | +| optionBgColor | [ResourceColor](../../ui/ts-types.md) | - | Background color of an option in the drop-down list box. | +| optionFont | [Font](../../ui/ts-types.md) | - | Text font of an option in the drop-down list box. | +| optionFontColor | [ResourceColor](../../ui/ts-types.md) | - | Text color of an option in the drop-down list box. | ## Events | Name| Description| | ------------------------------------------------------------ | ------------------------------------------------------------ | -| onSelect(callback: (index: number, value?:string) => void) | Invoked when an option in the drop-down list box is selected. **index** indicates the index of the selected option. **value** indicates the value of the selected option.| +| onSelect(callback: (index: number, value?:string) => void) | Invoked when an option in the drop-down list box is selected. **index** indicates the index of the selected option. **value** indicates the value of the selected option. | ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md b/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md index 8716d4769e9c42dcc04bf777569fcc74c135b401..e9c4fbdf50f75cd15b0e8457631607c41ce305ab 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-slider.md @@ -1,7 +1,7 @@ # Slider -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. @@ -44,12 +44,12 @@ Slider(value:{value?: number, min?: number, max?: number, step?: number, style?: Touch target configuration is not supported. -| Name | Type | Default Value | Description | -| ------------- | ------- | ------------- | ---------------------------------------- | -| blockColor | Color | - | Color of the slider. | -| trackColor | Color | - | Background color of the slider. | -| selectedColor | Color | - | Color of the slider rail that has been slid. | -| showSteps | boolean | false | Whether to display the current step. | +| Name | Type | Default Value | Description | +| ------------- | ------- | ------------- | -------------------------------------------------------------------- | +| blockColor | Color | - | Color of the slider. | +| trackColor | Color | - | Background color of the slider. | +| selectedColor | Color | - | Color of the slider rail that has been slid. | +| showSteps | boolean | false | Whether to display the current step. | | showTips | boolean | false | Whether to display a bubble to indicate the percentage when sliding. | diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-span.md b/en/application-dev/reference/arkui-ts/ts-basic-components-span.md index 4303717b6c8c2fa62761c6e3a41ead8a191f0eb5..57afaf9543689837cd76a63fcc4d1a03b7eff2ac 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-span.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-span.md @@ -1,7 +1,7 @@ # Span -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. @@ -23,7 +23,7 @@ None Span(content: string) - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | | content | string | Yes | - | Text content. | @@ -42,7 +42,7 @@ In addition to the text style attributes, the attributes below are supported. Among all the universal events, only the click event is supported. -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
> As the **<Span>** component does not have size information, the **target** attribute of the **ClickEvent** object returned by the click event is invalid. diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-stepper.md b/en/application-dev/reference/arkui-ts/ts-basic-components-stepper.md index 983e00046cf706696bc901e666e6cae5432a61df..ae361a0cabcb17e92269dafcc686aa82951d60c0 100644 --- a/en/application-dev/reference/arkui-ts/ts-basic-components-stepper.md +++ b/en/application-dev/reference/arkui-ts/ts-basic-components-stepper.md @@ -1,7 +1,7 @@ # Stepper -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. @@ -24,7 +24,7 @@ Stepper(value?: { index?: number }) - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | | index | number | No | 0 | Index of the **<StepperItem>** that is currently displayed. | @@ -36,11 +36,11 @@ None ## Events - | Name | Description | +| Name | Description | | -------- | -------- | -| onFinish(callback: () => void) | Triggered when the **nextLabel** of the last **<StepperItem>** in the **<Stepper>** is clicked. | -| onSkip(callback: () => void) | Triggered when the current **<StepperItem>** is **ItemState.Skip** and the **nextLabel** is clicked. | -| onChange(callback: (prevIndex?: number, index?: number) => void) | Triggered when the text button on the left or right is clicked to switch between steps.
- **prevIndex**: index of the step page before the switching.
- **index**: index of the step page after the switching, that is, index of the previous or next page. | +| onFinish(callback: () => void) | Invoked when the **nextLabel** of the last **<StepperItem>** in the **<Stepper>** is clicked. | +| onSkip(callback: () => void) | Invoked when the current **<StepperItem>** is **ItemState.Skip** and the **nextLabel** is clicked. | +| onChange(callback: (prevIndex?: number, index?: number) => void) | Invoked when the text button on the left or right is clicked to switch between steps.
- **prevIndex**: index of the step page before the switching.
- **index**: index of the step page after the switching, that is, index of the previous or next page. | ## Example diff --git a/en/application-dev/reference/arkui-ts/ts-container-scroll.md b/en/application-dev/reference/arkui-ts/ts-container-scroll.md index 076505a2951dac1b2e3a729768f56f8d52692775..fcb3dbc0af7c3213b3e25f5b2fce53719cac5b3e 100644 --- a/en/application-dev/reference/arkui-ts/ts-container-scroll.md +++ b/en/application-dev/reference/arkui-ts/ts-container-scroll.md @@ -103,7 +103,7 @@ scroller.currentOffset(): Object Obtains the scrolling offset. -- Return values +- Return value | Type | Description | | -------- | -------- | | {
xOffset: number,
yOffset: number
} | **xOffset**: horizontal scrolling offset.
**yOffset**: vertical scrolling offset. | diff --git a/en/application-dev/reference/arkui-ts/ts-interpolation-calculation.md b/en/application-dev/reference/arkui-ts/ts-interpolation-calculation.md index de18fea31cc344b2e25091cbb442df29ad87fda9..b6b5ebc69a05d41ae6e797336cde734ca8462760 100644 --- a/en/application-dev/reference/arkui-ts/ts-interpolation-calculation.md +++ b/en/application-dev/reference/arkui-ts/ts-interpolation-calculation.md @@ -1,13 +1,13 @@ # Interpolation Calculation -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> This animation is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. ## Modules to Import - + ``` import curves from '@ohos.curves' ``` @@ -27,11 +27,11 @@ Implements initialization for the interpolation curve, which is used to create a - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | - | curve | Curve | No | Linear | Curve object. | + | curve | Curve | No | Linear | Curve object. | -- Return values +- Return value
Curve object. @@ -44,12 +44,12 @@ Constructs a step curve object. - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | - | count | number | Yes | - | Number of steps. Must be a positive integer. | - | end | boolean | No | true | Step change at the start or end point of each interval. Defaults to **true**, indicating that the step change occurs at the end point. | + | count | number | Yes | - | Number of steps. Must be a positive integer. | + | end | boolean | No | true | Step change at the start or end point of each interval. Defaults to **true**, indicating that the step change occurs at the end point. | -- Return values +- Return value
Curve object. @@ -62,14 +62,14 @@ Constructs a third-order Bezier curve object. The curve value must be between 0 - Parameters - | Name | Type | Mandatory | Description | + | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | - | x1 | number | Yes | Horizontal coordinate of the first point on the Bezier curve. | - | y1 | number | Yes | Vertical coordinate of the first point on the Bezier curve. | - | x2 | number | Yes | Horizontal coordinate of the second point on the Bezier curve. | - | y2 | number | Yes | Vertical coordinate of the second point on the Bezier curve. | + | x1 | number | Yes | Horizontal coordinate of the first point on the Bezier curve. | + | y1 | number | Yes | Vertical coordinate of the first point on the Bezier curve. | + | x2 | number | Yes | Horizontal coordinate of the second point on the Bezier curve. | + | y2 | number | Yes | Vertical coordinate of the second point on the Bezier curve. | -- Return values +- Return value
Curve object. @@ -82,20 +82,20 @@ Constructs a spring curve object. - Parameters - | Name | Type | Mandatory | Description | + | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | - | velocity | number | Yes | Initial velocity. | - | mass | number | Yes | Mass. | - | stiffness | number | Yes | Stiffness. | - | damping | number | Yes | Damping. | + | velocity | number | Yes | Initial velocity. | + | mass | number | Yes | Mass. | + | stiffness | number | Yes | Stiffness. | + | damping | number | Yes | Damping. | -- Return values +- Return value
Curve object. ## Example - + ``` import Curves from '@ohos.curves' let curve1 = Curves.init() // Create a default linear interpolation curve. @@ -106,13 +106,13 @@ let curve3 = Curves.cubicBezier(0.1, 0.0, 0.1, 1.0) // Create a third-order Bezi Curve objects can be created only by the preceding APIs. - | API | Description | +| API | Description | | -------- | -------- | -| interpolate(time: number): number | Calculation function of the interpolation curve. Passing a normalized time parameter to this function returns the current interpolation.
**time**: indicates the current normalized time. The value ranges from 0 to 1.
The curve interpolation corresponding to the normalized time point is returned. | +| interpolate(time: number): number | Calculation function of the interpolation curve. Passing a normalized time parameter to this function returns the current interpolation.
**time**: indicates the current normalized time. The value ranges from 0 to 1.
The curve interpolation corresponding to the normalized time point is returned. | - Example - + ``` import Curves from '@ohos.curves' let curve = Curves.init(Curve.EaseIn) // Create an interpolation curve which is slow and then fast by default. @@ -122,7 +122,7 @@ let curve3 = Curves.cubicBezier(0.1, 0.0, 0.1, 1.0) // Create a third-order Bezi ## Example - + ``` import Curves from '@ohos.curves' @Entry diff --git a/en/application-dev/reference/arkui-ts/ts-matrix-transformation.md b/en/application-dev/reference/arkui-ts/ts-matrix-transformation.md index a6f5c1c5d0e300331f5b927fdfd1c69473938a9d..0eded3f87db1c32ab188901e7d9f68e62ef17ddc 100644 --- a/en/application-dev/reference/arkui-ts/ts-matrix-transformation.md +++ b/en/application-dev/reference/arkui-ts/ts-matrix-transformation.md @@ -1,7 +1,7 @@ # Matrix Transformation -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** +> **NOTE**
> This animation is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. @@ -31,30 +31,30 @@ Matrix constructor, which is used to create a 4x4 matrix by using the input para | -------- | -------- | -------- | -------- | -------- | | array | Array<number> | Yes | [1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1] | A number array whose length is 16 (4 x 4). For details, see the parameter description. | -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Object | 4x4 matrix object created based on the input parameter. | + | Object | 4x4 matrix object created based on the input parameter. | - Parameter description - | Name | Type | Mandatory | Description | + | Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- | - | m00 | number | Yes | Scaling value of the x-axis. Defaults to **1** for the unit matrix. | - | m01 | number | Yes | The second value, which is affected by the rotation of the x, y, and z axes. | - | m02 | number | Yes | The third value, which is affected by the rotation of the x, y, and z axes. | - | m03 | number | Yes | Meaningless. | - | m10 | number | Yes | The fifth value, which is affected by the rotation of the x, y, and z axes. | - | m11 | number | Yes | Scaling value of the y-axis. Defaults to **1** for the unit matrix. | - | m12 | number | Yes | The seventh value, which is affected by the rotation of the x, y, and z axes. | - | m13 | number | Yes | Meaningless. | - | m20 | number | Yes | The ninth value, which is affected by the rotation of the x, y, and z axes. | - | m21 | number | Yes | The tenth value, which is affected by the rotation of the x, y, and z axes. | - | m22 | number | Yes | Scaling value of the z-axis. Defaults to **1** for the unit matrix. | - | m23 | number | Yes | Meaningless. | - | m30 | number | Yes | Translation value of the x-axis, in px. Defaults to **0** for the unit matrix. | - | m31 | number | Yes | Translation value of the y-axis, in px. Defaults to **0** for the unit matrix. | - | m32 | number | Yes | Translation value of the z-axis, in px. Defaults to **0** for the unit matrix. | - | m33 | number | Yes | Valid in homogeneous coordinates, presenting the perspective projection effect. | + | m00 | number | Yes | Scaling value of the x-axis. Defaults to **1** for the unit matrix. | + | m01 | number | Yes | The second value, which is affected by the rotation of the x, y, and z axes. | + | m02 | number | Yes | The third value, which is affected by the rotation of the x, y, and z axes. | + | m03 | number | Yes | Meaningless. | + | m10 | number | Yes | The fifth value, which is affected by the rotation of the x, y, and z axes. | + | m11 | number | Yes | Scaling value of the y-axis. Defaults to **1** for the unit matrix. | + | m12 | number | Yes | The seventh value, which is affected by the rotation of the x, y, and z axes. | + | m13 | number | Yes | Meaningless. | + | m20 | number | Yes | The ninth value, which is affected by the rotation of the x, y, and z axes. | + | m21 | number | Yes | The tenth value, which is affected by the rotation of the x, y, and z axes. | + | m22 | number | Yes | Scaling value of the z-axis. Defaults to **1** for the unit matrix. | + | m23 | number | Yes | Meaningless. | + | m30 | number | Yes | Translation value of the x-axis, in px. Defaults to **0** for the unit matrix. | + | m31 | number | Yes | Translation value of the y-axis, in px. Defaults to **0** for the unit matrix. | + | m32 | number | Yes | Translation value of the z-axis, in px. Defaults to **0** for the unit matrix. | + | m33 | number | Yes | Valid in homogeneous coordinates, presenting the perspective projection effect. | - Example @@ -76,10 +76,10 @@ identity(): Object Matrix initialization function. Can return a unit matrix object. -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Object | Unit matrix object. | + | Object | Unit matrix object. | - Example @@ -102,10 +102,10 @@ copy(): Object Matrix copy function, which is used to copy the current matrix object. -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Object | Copy object of the current matrix. | + | Object | Copy object of the current matrix. | - Example @@ -147,14 +147,14 @@ Matrix overlay function, which is used to overlay the effects of two matrices to - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | - | matrix | Matrix4 | Yes | - | Matrix object to be overlaid. | + | matrix | Matrix4 | Yes | - | Matrix object to be overlaid. | -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Object | Object after matrix overlay. | + | Object | Object after matrix overlay. | - Example @@ -188,10 +188,10 @@ invert(): Object Matrix inverse function. Can return an inverse matrix of the current matrix object, that is, get an opposite effect. -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Object | Inverse matrix object of the current matrix. | + | Object | Inverse matrix object of the current matrix. | - Example @@ -212,17 +212,17 @@ Matrix translation function, which is used to add the translation effect to the - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | - | x | number | No | 0 | Translation distance of the x-axis, in px. | - | y | number | No | 0 | Translation distance of the y-axis, in px. | - | z | number | No | 0 | Translation distance of the z-axis, in px. | + | x | number | No | 0 | Translation distance of the x-axis, in px. | + | y | number | No | 0 | Translation distance of the y-axis, in px. | + | z | number | No | 0 | Translation distance of the z-axis, in px. | -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Object | Matrix object after the translation effect is added. | + | Object | Matrix object after the translation effect is added. | - Example @@ -254,19 +254,19 @@ Matrix scaling function, which is used to add the scaling effect to the x, y, an - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | - | x | number | No | 1 | Scaling multiple of the x-axis. | - | y | number | No | 1 | Scaling multiple of the y-axis. | - | z | number | No | 1 | Scaling multiple of the z-axis. | - | centerX | number | No | 0 | X coordinate of the center point. | - | centerY | number | No | 0 | Y coordinate of the center point. | + | x | number | No | 1 | Scaling multiple of the x-axis. | + | y | number | No | 1 | Scaling multiple of the y-axis. | + | z | number | No | 1 | Scaling multiple of the z-axis. | + | centerX | number | No | 0 | X coordinate of the center point. | + | centerY | number | No | 0 | Y coordinate of the center point. | -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Object | Matrix object after the scaling effect is added. | + | Object | Matrix object after the scaling effect is added. | - Example @@ -298,20 +298,20 @@ Matrix rotation function, which is used to add the rotation effect to the x, y, - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | - | x | number | No | 1 | X coordinate of the rotation axis vector. | - | y | number | No | 1 | Y coordinate of the rotation axis vector. | - | z | number | No | 1 | Z coordinate of the rotation axis vector. | - | angle | number | No | 0 | Rotation angle. | - | centerX | number | No | 0 | X coordinate of the center point. | - | centerY | number | No | 0 | Y coordinate of the center point. | + | x | number | No | 1 | X coordinate of the rotation axis vector. | + | y | number | No | 1 | Y coordinate of the rotation axis vector. | + | z | number | No | 1 | Z coordinate of the rotation axis vector. | + | angle | number | No | 0 | Rotation angle. | + | centerX | number | No | 0 | X coordinate of the center point. | + | centerY | number | No | 0 | Y coordinate of the center point. | -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Object | Matrix object after the rotation effect is added. | + | Object | Matrix object after the rotation effect is added. | - Example @@ -343,15 +343,15 @@ Matrix point transformation function, which is used to apply the current transfo - Parameters - | Name | Type | Mandatory | Default Value | Description | + | Name | Type | Mandatory | Default Value | Description | | -------- | -------- | -------- | -------- | -------- | - | point | Point | Yes | - | Point to be transformed. | + | point | Point | Yes | - | Point to be transformed. | -- Return values - | Type | Description | +- Return value + | Type | Description | | -------- | -------- | - | Point | Point object after matrix transformation | + | Point | Point object after matrix transformation | - Example diff --git a/en/application-dev/work-scheduler/work-scheduler-dev-guide.md b/en/application-dev/work-scheduler/work-scheduler-dev-guide.md index 5892d2dfe2a57f355a6eab1ec19d4e2a032a3f8a..dfa30e4a5d03af24e4c2e75a5f0569bd1b30fa07 100644 --- a/en/application-dev/work-scheduler/work-scheduler-dev-guide.md +++ b/en/application-dev/work-scheduler/work-scheduler-dev-guide.md @@ -115,7 +115,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t workScheduler.getWorkStatus(50, (err, res) => { if (err) { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); } else { for (let item in res) { console.info('workschedulerLog getWorkStatuscallback success,' + item + ' is:' + res[item]); @@ -131,7 +131,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); } }).catch((err) => { - console.info('workschedulerLog getWorkStatus failed, because:' + err.data); + console.info('workschedulerLog getWorkStatus failed, because:' + err.code); }) @@ -141,7 +141,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t workScheduler.obtainAllWorks((err, res) =>{ if (err) { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); } else { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); } @@ -152,7 +152,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t workScheduler.obtainAllWorks().then((res) => { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); }).catch((err) => { - console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.code); }) **Stopping and Clearing Work Scheduler Tasks** @@ -166,7 +166,7 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t workScheduler.isLastWorkTimeOut(500, (err, res) =>{ if (err) { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); } else { console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); } @@ -179,6 +179,6 @@ function onWorkStop(work: WorkInfo): void; | Triggered when the Work Scheduler t console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); }) .catch(err => { - console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.code); }); }) diff --git a/en/device-dev/driver/driver-platform-gpio-des.md b/en/device-dev/driver/driver-platform-gpio-des.md index 04a850623ec868bcfb94ec22c345959c783e4303..4fff6790cac9e74383199a3e8f8c866531d19534 100644 --- a/en/device-dev/driver/driver-platform-gpio-des.md +++ b/en/device-dev/driver/driver-platform-gpio-des.md @@ -1,496 +1,280 @@ -# GPIO +# GPIO -## Overview +## Overview -Generally, a general-purpose input/output \(GPIO\) controller manages all GPIO pins by group. Each group of GPIO pins is associated with one or more registers. The GPIO pins are operated by reading data from and writing data to the registers. +A general-purpose input/output (GPIO) controller manages all GPIO pins by group. Each group of GPIO pins is associated with one or more registers. The GPIO controller manages the pins by reading data from and writing data to the registers. The GPIO APIs define a set of standard functions for performing operations on GPIO pins, including: -- Setting the pin direction, which can be input or output \(high impedance is not supported currently\) - -- Reading and writing level values, which can be low or high -- Setting an interrupt service routine \(ISR\) function and interrupt trigger mode for a pin -- Enabling or disabling interrupts for a pin - -## Available APIs - -**Table 1** APIs available for the GPIO driver - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Capability

-

Function

-

Description

-

GPIO read/write

-

GpioRead

-

Reads the level value of a GPIO pin.

-

GpioWrite

-

Writes the level value of a GPIO pin.

-

GPIO settings

-

GpioSetDir

-

Sets the direction for a GPIO pin.

-

GpioGetDir

-

Obtains the direction for a GPIO pin.

-

GPIO interrupt settings

-

GpioSetIrq

-

Sets the ISR function for a GPIO pin.

-

GpioUnSetIrq

-

Cancels the setting of the ISR function for a GPIO pin.

-

GpioEnableIrq

-

Enables GPIO interrupts for a pin.

-

GpioDisableIrq

-

Disables GPIO interrupts for a pin.

-
- - ->![](../public_sys-resources/icon-note.gif) **NOTE**
->All functions provided in this document can be called only in kernel mode. - -## Usage Guidelines - -### How to Use - -The GPIO APIs use the GPIO pin number to specify a pin. The figure below illustrates how to use the APIs. +- Setting the pin direction, which can be input or output (high impedance is not supported currently) + +- Reading and writing the pin level, which can be low or high + +- Setting the interrupt service routine (ISR) function and interrupt trigger mode for a pin + +- Enabling or disabling interrupts for a pin + + +## Available APIs + + **Table 1** GPIO driver APIs + +| Category| Description| +| -------- | -------- | +| GPIO read/write| - **GpioRead**: reads the pin level.
- **GpioWrite**: writes the pin level.| +| GPIO settings| - **GpioSetDir**: sets the pin direction.
- **GpioGetDir**: obtains the pin direction.| +| GPIO interrupt settings| - **GpioSetIrq**: sets the ISR function for a GPIO pin.
- **GpioUnsetIrq**: cancels the ISR function setting for a GPIO pin.
- **GpioEnableIrq**: enables interrupts for a pin.
- **GpioDisableIrq**: disables interrupts for a pin.| + +> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> All APIs described in this document can be called only in kernel mode. + + +## Usage Guidelines + + +### How to Use + +The figure below shows the general GPIO development process. In the APIs, a GPIO pin is specified by the pin number. **Figure 1** Using GPIO driver APIs - -![](figures/using-gpio-process.png "using-gpio-process.png") -### Determining the GPIO Pin Number +![](figures/using-GPIO-process.png "using-gpio-process.png") -The method for converting GPIO pin numbers varies depending on the GPIO controller model, parameters, and controller driver of different system on chips \(SoCs\). -- Hi3516DV300 +### Determining the GPIO Pin Number - A controller manages 12 groups of GPIO pins. Each group contains 8 GPIO pins. +The method for determining the GPIO pin number varies depending on the GPIO controller model, parameters, and controller driver of the system on chip (SoC). - GPIO pin number = GPIO group index x Number of GPIO pins in each group + Offset in the group +- Hi3516D V300 + A controller manages 12 groups of GPIO pins. Each group contains 8 GPIO pins. The group number ranges from 0 to 11. - The group index ranges from 0 to 11. + GPIO pin number = GPIO group number x Number of GPIO pins in each group + Offset in the group Example: - GPIO pin number of GPIO10\_3 = 10 x 8 + 3 = 83 - -- Hi3518EV300 - - A controller manages 10 groups of GPIO pins. Each group contains 10 GPIO pins. - - GPIO pin number = GPIO group index \(0–9\) x Number of GPIO pins in each group \(10\) + Offset in the group - - The group index ranges from 0 to 9. - - Example: - - GPIO pin number of GPIO7\_3 = 7 x 10 + 3 = 73 - - -### Using APIs to Operate GPIO Pins - -- Set the direction for a GPIO pin. - - Before performing read/write operations on a GPIO pin, call **GpioSetDir**() to set the direction. - - int32\_t GpioSetDir\(uint16\_t gpio, uint16\_t dir\); - - **Table 2** Description of GpioSetDir - - - - - - - - - - - - - - - - - - - - - -

Parameter

-

Description

-

gpio

-

GPIO pin number.

-

dir

-

Direction to set.

-

Return Value

-

Description

-

0

-

The operation is successful.

-

Negative value

-

The operation failed.

-
- - -- Read or write the level value for a GPIO pin. - - Call **GpioRead**() to read the level value of a GPIO pin. - - int32\_t GpioRead\(uint16\_t gpio, uint16\_t \*val\); - - **Table 3** Description of GpioRead - - - - - - - - - - - - - - - - - - - - - -

Parameter

-

Description

-

gpio

-

GPIO pin number.

-

val

-

Pointer to the level value.

-

Return Value

-

Description

-

0

-

The operation is successful.

-

Negative value

-

The operation failed.

-
- - - Call **GpioWrite()** to write the level value for a GPIO pin. - - int32\_t GpioWrite\(uint16\_t gpio, uint16\_t val\); - - **Table 4** Description of GpioWrite - - - - - - - - - - - - - - - - - - - - - -

Parameter

-

Description

-

gpio

-

GPIO pin number.

-

val

-

Level value to write.

-

Return Value

-

Description

-

0

-

The operation is successful.

-

Negative value

-

The operation failed.

-
- - Example: - - ``` - int32_t ret; - uint16_t val; - /* Set the output direction for GPIO3. */ - ret = GpioSetDir(3, GPIO_DIR_OUT); - if (ret != 0) { - HDF_LOGE("GpioSerDir: failed, ret %d\n", ret); - return; - } - /* Write the low level GPIO_VAL_LOW for GPIO3. */ - ret = GpioWrite(3, GPIO_VAL_LOW); - if (ret != 0) { - HDF_LOGE("GpioWrite: failed, ret %d\n", ret); - return; - } - /* Set the input direction for GPIO6. */ - ret = GpioSetDir(6, GPIO_DIR_IN); - if (ret != 0) { - HDF_LOGE("GpioSetDir: failed, ret %d\n", ret); - return; - } - /* Read the level value of GPIO6. */ - ret = GpioRead(6, &val); - ``` - - -- Set the ISR function for a GPIO pin. - - Call **GpioSetIrq()** to set the ISR function for a GPIO pin. - - int32\_t GpioSetIrq\(uint16\_t gpio, uint16\_t mode, GpioIrqFunc func, void \*arg\); - - **Table 5** Description of GpioSetIrq - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Parameter

-

Description

-

gpio

-

GPIO pin number.

-

mode

-

Interrupt trigger mode.

-

func

-

ISR function to set.

-

arg

-

Pointer to the parameters passed to the ISR function.

-

Return Value

-

Description

-

0

-

The operation is successful.

-

Negative value

-

The operation failed.

-
- - >![](../public_sys-resources/icon-caution.gif) **CAUTION**
- >Only one ISR function can be set for a GPIO pin at a time. If **GpioSetIrq** is called repeatedly, the previous IRS function will be replaced. - - If the ISR function is no longer required, call **GpioUnSetIrq()** to cancel the setting. - - int32\_t GpioUnSetIrq\(uint16\_t gpio\); - - **Table 6** Description of GpioUnSetIrq - - - - - - - - - - - - - - - - - - -

Parameter

-

Description

-

gpio

-

GPIO pin number.

-

Return Value

-

Description

-

0

-

The operation is successful.

-

Negative value

-

The operation failed.

-
- - After the ISR function is set, call **GpioEnableIrq()** to enable interrupts. - - int32\_t GpioEnableIrq\(uint16\_t gpio\); - - **Table 7** Description of GpioEnableIrq - - - - - - - - - - - - - - - - - - -

Parameter

-

Description

-

gpio

-

GPIO pin number.

-

Return Value

-

Description

-

0

-

The operation is successful.

-

Negative value

-

The operation failed.

-
- - >![](../public_sys-resources/icon-caution.gif) **CAUTION**
- >The configured ISR function can be responded only after the GPIO interrupt is enabled. - - Call **GpioDisableIrq()** to disable interrupts. - - int32\_t GpioDisableIrq\(uint16\_t gpio\); - - **Table 8** Description of GpioDisableIrq - - - - - - - - - - - - - - - - - - -

Parameter

-

Description

-

gpio

-

GPIO pin number.

-

Return Value

-

Description

-

0

-

The operation is successful.

-

Negative value

-

The operation failed.

-
- - Example: - - ``` - /* ISR function */ - */ - int32_t MyCallBackFunc(uint16_t gpio, void *data) - { - HDF_LOGI("%s: gpio:%u interrupt service in! data=%p\n", __func__, gpio, data); - return 0; - } - - int32_t ret; - /* Set the ISR function to MyCallBackFunc, the parameter to NULL, and the interrupt trigger mode to rising edge. */ - ret = GpioSetIrq(3, OSAL_IRQF_TRIGGER_RISING, MyCallBackFunc, NULL); - if (ret != 0) { - HDF_LOGE("GpioSetIrq: failed, ret %d\n", ret); - return; - } - - /* Enable an interrupt for GPIO3. */ - ret = GpioEnableIrq(3); - if (ret != 0) { - HDF_LOGE("GpioEnableIrq: failed, ret %d\n", ret); - return; - } - - /* Disable the interrupt for GPIO3. */ - ret = GpioDisableIrq(3); - if (ret != 0) { - HDF_LOGE("GpioDisableIrq: failed, ret %d\n", ret); - return; - } - - /* Cancel the ISR function for GPIO3. */ - ret = GpioUnSetIrq(3); - if (ret != 0) { - HDF_LOGE("GpioUnSetIrq: failed, ret %d\n", ret); - return; - } - ``` + GPIO pin number of GPIO10_3 = 10 x 8 + 3 = 83 + +- Hi3518E V300 + A controller manages 10 groups of GPIO pins. Each group contains 10 GPIO pins. The group number ranges from 0 to 9. + + GPIO pin number = GPIO group number x Number of GPIO pins in each group + Offset in the group + + Example: + + GPIO pin number of GPIO7_3 = 7 x 10 + 3 = 73 + + +### Using APIs to Operate GPIO Pins + +- Set the GPIO pin direction. + Before performing read/write operations on a GPIO pin, call **GpioSetDir()** to set the pin direction. + + ```c + int32_t GpioSetDir(uint16_t gpio, uint16_t dir); + ``` + + **Table 2** Description of GpioSetDir + + | **Parameter**| **Description**| + | -------- | -------- | + | gpio | GPIO pin number.| + | dir | Direction to set.| + | **Return Value**| **Description**| + | 0 | The operation is successful.| + | Negative value| The operation failed.| + +- Read or write the pin level. + Call **GpioRead()** to read the level of a GPIO pin. -## Usage Example + ```c + int32_t GpioRead(uint16_t gpio, uint16_t *val); + ``` + + **Table 3** Description of GpioRead + + | **Parameter**| **Description**| + | -------- | -------- | + | gpio | GPIO pin number.| + | val | Pointer to the level to read.| + | **Return Value**| **Description**| + | 0 | The operation is successful.| + | Negative value| The operation failed.| + + Call **GpioWrite()** to write the level for a GPIO pin. + + ```c + int32_t GpioWrite(uint16_t gpio, uint16_t val); + ``` + + **Table 4** Description of GpioWrite + + | **Parameter**| **Description**| + | -------- | -------- | + | gpio | GPIO pin number.| + | val | Level to write.| + | **Return Value**| **Description**| + | 0 | The operation is successful.| + | Negative value| The operation failed.| + + Sample code: + + + ``` + int32_t ret; + uint16_t val; + /* Set the direction of GPIO pin 3 to output. */ + ret = GpioSetDir(3, GPIO_DIR_OUT); + if (ret != 0) { + HDF_LOGE("GpioSerDir: failed, ret %d\n", ret); + return; + } + /* Write the low level GPIO_VAL_LOW for GPIO pin 3. */ + ret = GpioWrite(3, GPIO_VAL_LOW); + if (ret != 0) { + HDF_LOGE("GpioWrite: failed, ret %d\n", ret); + return; + } + /* Set the direction of GPIO pin 6 to input. */ + ret = GpioSetDir(6, GPIO_DIR_IN); + if (ret != 0) { + HDF_LOGE("GpioSetDir: failed, ret %d\n", ret); + return; + } + /* Read the level of GPIO pin 6. */ + ret = GpioRead(6, &val); + ``` + +- Set the ISR function for a GPIO pin. + + Call **GpioSetIrq()** to set the ISR function for a GPIO pin. + + ```c + int32_t GpioSetIrq(uint16_t gpio, uint16_t mode, GpioIrqFunc func, void *arg); + ``` + + **Table 5** Description of GpioSetIrq + + | **Parameter**| **Description**| + | -------- | -------- | + | gpio | GPIO pin number.| + | mode | Interrupt trigger mode.| + | func | ISR function to set.| + | arg | Pointer to the parameters passed to the ISR function.| + | **Return Value**| **Description**| + | 0 | The operation is successful.| + | Negative value| The operation failed.| + + > ![icon-caution.gif](../public_sys-resources/icon-caution.gif) **CAUTION**
+ > Only one ISR function can be set for a GPIO pin. If **GpioSetIrq** is called repeatedly, the previous IRS function will be replaced. + + If the ISR function is no longer required, call **GpioUnsetIrq()** to cancel it. + + ```c + int32_t GpioUnsetIrq(uint16_t gpio, void *arg); + ``` + + **Table 6** Description of GpioUnsetIrq + + | **Parameter**| **Description**| + | -------- | -------- | + | gpio | GPIO pin number.| + | arg | Pointer to the GPIO interrupt parameters.| + | **Return Value**| **Description**| + | 0 | The operation is successful.| + | Negative value| The operation failed.| + + After the ISR function is set, call **GpioEnableIrq()** to enable interrupts for the GPIO pin. + + ```c + int32_t GpioEnableIrq(uint16_t gpio); + ``` + + **Table 7** Description of GpioEnableIrq + + | **Parameter**| **Description**| + | -------- | -------- | + | gpio | GPIO pin number.| + | **Return Value**| **Description**| + | 0 | The operation is successful.| + | Negative value| The operation failed.| + + > ![icon-caution.gif](../public_sys-resources/icon-caution.gif) **CAUTION**
+ > The configured ISR function can be responded only after interrupts are enabled for the GPIO pin. + + You can call **GpioDisableIrq** to disable interrupts for the pin. + + ```c + int32_t GpioDisableIrq(uint16_t gpio); + ``` + + **Table 8** Description of GpioDisableIrq + + | **Parameter**| **Description**| + | -------- | -------- | + | gpio | GPIO pin number.| + | **Return Value**| **Description**| + | 0 | The operation is successful.| + | Negative value| The operation failed.| + + Sample code: + + + ``` + /* Set the ISR function. */ + int32_t MyCallBackFunc(uint16_t gpio, void *data) + { + HDF_LOGI("%s: gpio:%u interrupt service in! data=%p\n", __func__, gpio, data); + return 0; + } + + int32_t ret; + /* Set the ISR function to MyCallBackFunc, with input parameter of NULL and the interrupt trigger mode of rising edge. */ + ret = GpioSetIrq(3, OSAL_IRQF_TRIGGER_RISING, MyCallBackFunc, NULL); + if (ret != 0) { + HDF_LOGE("GpioSetIrq: failed, ret %d\n", ret); + return; + } + + /* Enable interrupts for GPIO pin 3. */ + ret = GpioEnableIrq(3); + if (ret != 0) { + HDF_LOGE("GpioEnableIrq: failed, ret %d\n", ret); + return; + } + + /* Disable interrupts for GPIO pin 3. */ + ret = GpioDisableIrq(3); + if (ret != 0) { + HDF_LOGE("GpioDisableIrq: failed, ret %d\n", ret); + return; + } + + /* Cancel the ISR function setting for GPIO pin 3. */ + ret = GpioUnsetIrq(3, NULL); + if (ret != 0) { + HDF_LOGE("GpioUnSetIrq: failed, ret %d\n", ret); + return; + } + ``` + + +## Development Example The procedure is as follows: -1. Select an idle GPIO pin. +1. Select an idle GPIO pin, for example, pin GPIO10\_3 on a Hi3516D V300 development board. - This example uses pin GPIO10\_3 on a Hi3516D V300 development board as an example. The pin number is 83. You can select an idle GPIO pin as required. + The pin number is 83. -2. Set the ISR function for the pin, with the trigger mode of rising edge and failing edge. + GPIO pin number of GPIO10_3 = 10 x 8 + 3 = 83 -3. Write high and low levels to the pin alternately, and observe the execution of the ISR function. + You can select an idle GPIO pin as required. +2. Set the ISR function for the pin, with the trigger mode of rising edge and failing edge. + +3. Write high and low levels to the pin alternately, and observe the execution of the ISR function. ``` #include "gpio_if.h" #include "hdf_log.h" @@ -503,7 +287,7 @@ static uint32_t g_irqCnt; static int32_t TestCaseGpioIrqHandler(uint16_t gpio, void *data) { HDF_LOGE("%s: irq triggered! on gpio:%u, data=%p", __func__, gpio, data); - g_irqCnt++; /* If the ISR function is triggered, the number of global interrupts is incremented by 1. */ + g_irqCnt++; /* If the ISR function is triggered, the global interrupt counter is incremented by 1. */ return GpioDisableIrq(gpio); } @@ -516,14 +300,14 @@ static int32_t TestCaseGpioIrqEdge(void) uint16_t gpio = 83; /* Number of the GPIO pin to test */ uint32_t timeout; - /* Set the output direction for the pin. */ + /* Set the pin direction to output. */ ret = GpioSetDir(gpio, GPIO_DIR_OUT); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: set dir fail! ret:%d\n", __func__, ret); return ret; } - /* Disable the interrupt of the pin. */ + /* Disable interrupts of the pin. */ ret = GpioDisableIrq(gpio); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: disable irq fail! ret:%d\n", __func__, ret); @@ -539,17 +323,17 @@ static int32_t TestCaseGpioIrqEdge(void) return ret; } - /* Enable the interrupt for this pin. */ + /* Enable interrupts for the pin. */ ret = GpioEnableIrq(gpio); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: enable irq fail! ret:%d\n", __func__, ret); - (void)GpioUnSetIrq(gpio); + (void)GpioUnsetIrq(gpio, NULL); return ret; } - g_irqCnt = 0; /* Reset the global counter. */ - timeout = 0; /* Reset the waiting time. */ - /* Wait for the ISR function of this pin to trigger. The timeout duration is 1000 ms. */ + g_irqCnt = 0; /* Reset the global interrupt counter. */ + timeout = 0; /* Clear the waiting time. */ + /* Wait for the ISR function to trigger for this pin. The timeout duration is 1000 ms. */ while (g_irqCnt <= 0 && timeout < 1000) { (void)GpioRead(gpio, &valRead); (void)GpioWrite(gpio, (valRead == GPIO_VAL_LOW) ? GPIO_VAL_HIGH : GPIO_VAL_LOW); @@ -557,7 +341,7 @@ static int32_t TestCaseGpioIrqEdge(void) OsalMDelay(200); /* wait for irq trigger */ timeout += 200; } - (void)GpioUnSetIrq(gpio); + (void)GpioUnsetIrq(gpio, NULL); return (g_irqCnt > 0) ? HDF_SUCCESS : HDF_FAILURE; } -``` \ No newline at end of file +``` diff --git a/en/device-dev/driver/driver-platform-gpio-develop.md b/en/device-dev/driver/driver-platform-gpio-develop.md index 7b14fa0201ec5c172854a1bcbeac6bdd6d5937b7..9ecbecc0945e789af111593f57ade7c938641b1b 100644 --- a/en/device-dev/driver/driver-platform-gpio-develop.md +++ b/en/device-dev/driver/driver-platform-gpio-develop.md @@ -1,15 +1,19 @@ -# GPIO +# GPIO -## Overview -In the Hardware Driver Foundation \(HDF\) framework, the general-purpose input/output \(GPIO\) module uses the service-free mode for API adaptation. The service-free mode applies to the devices that do not provide user-mode APIs or the OS system that does not distinguish the user mode and the kernel mode. In the service-free mode, **DevHandle** \(a void pointer\) directly points to the kernel-mode address of the device object. +## Overview -**Figure 1** Service-free mode -![](figures/service-free-mode.png "service-free-mode") +In the Hardware Driver Foundation (HDF), the general-purpose input/output (GPIO) module uses the service-free mode for API adaptation. The service-free mode applies to the devices that do not provide user-mode APIs or the operating system (OS) that does not distinguish the user mode and the kernel mode. In the service-free mode, **DevHandle** (a void pointer) directly points to the kernel-mode address of the device object. -## Available APIs + **Figure 1** Service-free mode + + ![](figures/service-free-mode.png "service-free-mode") + + +## Available APIs + +**GpioMethod**: -GpioMethod ``` struct GpioMethod { @@ -26,397 +30,267 @@ struct GpioMethod { int32_t (*disableIrq)(struct GpioCntlr *cntlr, uint16_t local); } ``` -**Table 1** Callbacks for the members in the GpioMethod structure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Callback

-

Input Parameter

-

Output Parameter

-

Return Value

-

Description

-

write

-

cntlr: structure pointer to the GPIO controller at the core layer.

-

local: GPIO port number, which is of the uint16_t type.

-

val: input level value, which is of the uint16_t type.

-

-

HDF_STATUS

-

Writes the level of a GPIO pin.

-

read

-

cntlr: structure pointer to the GPIO controller at the core layer.

-

local: GPIO port number, which is of the uint16_t type.

-

val: pointer to the output level value, which is of the uint16_t type.

-

HDF_STATUS

-

Reads the level of a GPIO pin.

-

setDir

-

cntlr: structure pointer to the GPIO controller at the core layer.

-

local: GPIO port number, which is of the uint16_t type.

-

dir: input pin direction, which is of the uint16_t type.

-

-

HDF_STATUS

-

Sets the input or output direction for a GPIO pin.

-

getDir

-

cntlr: structure pointer to the GPIO controller at the core layer.

-

local: GPIO port number, which is of the uint16_t type.

-

dir: pointer to the output pin direction, which is of the uint16_t type.

-

HDF_STATUS

-

Obtains the input or output direction of a GPIO pin.

-

setIrq

-

cntlr: structure pointer to the GPIO controller at the core layer.

-

local: GPIO port number, which is of the uint16_t type.

-

mode: triggering mode, which can be edge or level. The value is of the uint16_t type.

-

func: function pointer to the interrupt service handler.

-

arg: void pointer to the input parameters of the interrupt service handler.

-

-

HDF_STATUS

-

Sets an interrupt request (IRQ) for a GPIO pin.

-

unsetIrq

-

cntlr: structure pointer to the GPIO controller at the core layer.

-

local: GPIO port number, which is of the uint16_t type.

-

-

HDF_STATUS

-

Cancels the GPIO interrupt settings.

-

enableIrq

-

cntlr: structure pointer to the GPIO controller at the core layer.

-

local: GPIO port number, which is of the uint16_t type.

-

-

HDF_STATUS

-

Enables an interrupt for a GPIO pin.

-

disableIrq

-

cntlr: structure pointer to the GPIO controller at the core layer.

-

local: GPIO port number, which is of the uint16_t type.

-

-

HDF_STATUS

-

Disables an interrupt for a GPIO pin.

-
- -## How to Develop - -The GPIO controller manages all pins by group. The related parameters are described in the attribute file. Instantiating the driver entry and API functions is the core for the vendor driver to access the HDF. - -The GPIO module adaptation involves the following steps: - -1. Instantiate the driver entry. - - Instantiate the **HdfDriverEntry** structure. - - Call **HDF\_INIT** to register the **HdfDriverEntry** instance with the HDF framework. - -2. Configure attribute files. - - Add the **deviceNode** information to the **device\_info.hcs** file. - - \(Optional\) Add the **gpio\_config.hcs** file. - -3. Instantiate the GPIO controller object. - - Initialize **GpioCntlr**. - - Instantiate **GpioMethod** in the **GpioCntlr** object. - - For details, see [Available APIs](#section752964871810). - -4. \(Optional\) Debug the driver. - For new drivers, verify the basic functions, such as the GPIO control status and response to interrupts. - - -## Development Example - -The following uses **gpio\_hi35xx.c** as an example to present the contents that need to be provided by the vendor to implement device functions. - -1. Instantiate the driver entry. The driver entry must be a global variable of the **HdfDriverEntry** type \(defined in **hdf\_device\_desc.h**\), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF framework, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke. - - Generally, HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, HDF calls **Release** to release driver resources and exits. - - - GPIO driver entry reference - - ``` - struct HdfDriverEntry g_gpioDriverEntry = { - .moduleVersion = 1, - .Bind = Pl061GpioBind, // Bind does not need to be implemented for GPIO. In this example, the implementation is empty. Vendors can add related operations as required. - .Init = Pl061GpioInit, // See the Init function. - .Release = Pl061GpioRelease, // See the Release function. - .moduleName = "hisi_pl061_driver",// (Mandatory) The value must be the same as that of moduleName in the .hcs file. - }; - // Call HDF_INIT to register the driver entry with the HDF framework. - HDF_INIT(g_gpioDriverEntry); - ``` - -2. Add the **deviceNode** information to the **device\_info.hcs** file and configure the device attributes in the **gpio\_config.hcs** file. The **deviceNode** information is related to registration of the driver entry. The device attribute values are closely related to the default values or value ranges of the **GpioCntlr** members at the core layer. - - In this example, there is only one GPIO controller. If there are multiple GPIO controllers, you need to add the **deviceNode** information to the **device\_info** file and add the corresponding device attributes to the **gpio\_config** file. - - - **device\_info.hcs** configuration reference - - ``` - root { - device_info { - platform :: host { - hostName = "platform_host"; - priority = 50; - device_gpio :: device { - device0 :: deviceNode { - policy = 0; // The value 0 indicates that no service needs to be published. - priority = 10; // Driver startup priority - permission = 0644; // Permission to create device nodes for the driver - moduleName = "hisi_pl061_driver"; // (Mandatory) Driver name, which must be the same as the moduleName in the driver entry. - deviceMatchAttr = "hisilicon_hi35xx_pl061";// (Mandatory) Used to configure the private data of the controller. The value must be the same as the controller information in gpio_config.hcs. - // The controller information must be consistent. Other controller information is also contained in the file. - } - } - } - } - } - ``` - - **gpio\_config.hcs** configuration reference + **Table 1** Description of the callback functions in GpioMethod - ``` - root { - platform { - gpio_config { - controller_0x120d0000 { - match_attr = "hisilicon_hi35xx_pl061"; // (Mandatory) The value must be the same as that of deviceMatchAttr in device_info.hcs. - groupNum = 12; // (Mandatory) GPIO group index - bitNum = 8; // (Mandatory) Number of GPIO pins in each group - regBase = 0x120d0000;// (Mandatory) Physical base address - regStep = 0x1000; // (Mandatory) Register offset step - irqStart = 48; // (Mandatory) Start an IRQ. - irqShare = 0; // (Mandatory) Share the IRQ. - } - } - } - } - ``` - -3. Initialize the **GpioCntlr** object at the core layer, including initializing the vendor custom structure \(transferring parameters and data\), instantiating **GpioMethod** \(used to call underlying functions of the driver\) in **GpioCntlr**, and implementing the **HdfDriverEntry** member functions \(**Bind**, **Init**, and **Release**\). - - Custom structure reference - - To the driver, the custom structure carries parameters and data. The values in the **gpio\_config.hcs** file are read by HDF, and the structure members are initialized through **DeviceResourceIface**. Some important values, such as the index and the number of pins, are also passed to the **GpioCntlr** object at the core layer. - - ``` - struct Pl061GpioCntlr { - struct GpioCntlr cntlr;// (Mandatory) Control object of the core layer. For details about the member definitions, see the following description. - volatile unsigned char *regBase; // (Mandatory) Base address of the register - uint32_t phyBase; // (Mandatory) Physical base address - uint32_t regStep; // (Mandatory) Register offset step - uint32_t irqStart; // (Mandatory) Start an IRQ. - uint16_t groupNum; // (Mandatory) GPIO port number - uint16_t bitNum; // (Mandatory) GPIO port number - uint8_t irqShare; // (Mandatory) Share the IRQ. - struct Pl061GpioGroup *groups; // (Optional) Set based on the vendor's requirements. - }; - struct Pl061GpioGroup {// Register address, interrupt number, interrupt function, and lock - volatile unsigned char *regBase; - unsigned int index; - unsigned int irq; - OsalIRQHandle irqFunc; - OsalSpinlock lock; - }; - - // GpioCntlr is the controller structure at the core layer. Its members are assigned with values by using the Init function. - struct GpioCntlr { - struct IDeviceIoService service; - struct HdfDeviceObject *device; - struct GpioMethod *ops; - struct DListHead list; - OsalSpinlock spin; - uint16_t start; - uint16_t count; - struct GpioInfo *ginfos; - void *priv; - }; - ``` - - - Instantiate the callback function structure **GpioMethod** in **GpioCntlr**. Other members are initialized by using the **Init** function. - - ``` - // The members of the GpioMethod structure are all callbacks. Vendors need to implement the corresponding functions according to [Table 1](#table151341544111). - static struct GpioMethod g_method = { - .request = NULL, - .release = NULL, - .write = Pl061GpioWrite, // Write pin settings. - .read = Pl061GpioRead, // Read pin settings. - .setDir = Pl061GpioSetDir, // Set the pin direction. - .getDir = Pl061GpioGetDir, // Obtain the pin direction. - .toIrq = NULL, - .setIrq = Pl061GpioSetIrq, // Set an interrupt for the pin. If this capability is not available, skip it. - .unsetIrq = Pl061GpioUnsetIrq, // Cancel the interrupt settings for the pin. If this capability is not available, skip it. - .enableIrq = Pl061GpioEnableIrq, // Enable an interrupt for the pin. If this capability is not available, skip it. - .disableIrq = Pl061GpioDisableIrq,// Disable the interrupt for the pin. If this capability is not available, skip it. - }; - ``` - - - -- Init function - - Input parameters: - - **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs configuration file information. - - Return values: - - HDF\_STATUS \(The following table lists some status. For details about other status, see **HDF\_STATUS** in the **//drivers/framework/include/utils/hdf\_base.h** file.\) +| Function| Input Parameter| Output Parameter| Return Value| Description| +| -------- | -------- | -------- | -------- | -------- | +| write | **cntlr**: structure pointer to the GPIO controller at the core layer.
**local**: GPIO port number, which is of the uint16_t type.
**val**: input level, which is of the uint16_t type. | – | HDF_STATUS| Writes the level of a GPIO pin.| +| read | **cntlr**: structure pointer to the GPIO controller at the core layer.
**local**: GPIO port number, which is of the uint16_t type. | **val**: pointer to the output level, which is of the uint16_t type.| HDF_STATUS| Reads the level of a GPIO pin.| +| setDir | **cntlr**: structure pointer to the GPIO controller at the core layer.
**local**: GPIO port number, which is of the uint16_t type.
**dir**: pin direction to set, which is of the uint16_t type. | – | HDF_STATUS| Sets the direction (input or output) for a GPIO pin.| +| getDir | **cntlr**: structure pointer to the GPIO controller at the core layer.
**local**: GPIO port number, which is of the uint16_t type. | **dir**: pointer to the pin direction obtained, which is of the uint16_t type.| HDF_STATUS| Obtains the input or output direction of a GPIO pin.| +| setIrq | **cntlr**: structure pointer to the GPIO controller at the core layer.
**local**: GPIO port number, which is of the uint16_t type.
**mode**: trigger mode, which can be edge or level of the uint16_t type.
**func**: pointer to the interrupt request (IRQ) handler.
**arg**: void pointer to the input parameters of the IRQ handler. | – | HDF_STATUS| Sets an IRQ for a GPIO pin.| +| unsetIrq | **cntlr**: structure pointer to the GPIO controller at the core layer.
**local**: GPIO port number, which is of the uint16_t type. | – | HDF_STATUS| Cancels the IRQ settings for a GPIO pin.| +| enableIrq | **cntlr**: structure pointer to the GPIO controller at the core layer.
**local**: GPIO port number, which is of the uint16_t type. | – | HDF_STATUS| Enables interrupts for a GPIO pin.| +| disableIrq | **cntlr**: structure pointer to the GPIO controller at the core layer.
**local**: GPIO port number, which is of the uint16_t type. | – | HDF_STATUS| Disables interrupts for a GPIO pin.| - **Table 2** Init function description - - - - - - - - - - - - - - - - - - - - - - - - -

Status (Value)

-

Description

-

HDF_ERR_INVALID_OBJECT

-

Invalid controller object

-

HDF_ERR_MALLOC_FAIL

-

Failed to allocate memory

-

HDF_ERR_INVALID_PARAM

-

Invalid parameter

-

HDF_ERR_IO

-

I/O error

-

HDF_SUCCESS

-

Initialization successful

-

HDF_FAILURE

-

Initialization failed

-
+## How to Develop - Function description: +The GPIO controller manages all pins by group. The related parameters are defined in attribute files. You need to instantiate the driver entry and APIs for the vendor driver to access the HDF. - Initializes the custom structure object and **GpioCntlr**, calls the **GpioCntlrAdd** function at the core layer, and connects to the VFS \(optional\). +The GPIO module adaptation involves the following steps: - ``` - static int32_t Pl061GpioInit(struct HdfDeviceObject *device) - { - ... - struct Pl061GpioCntlr *pl061 = &g_pl061;// Use static global variables to complete initialization. - //static struct Pl061GpioCntlr g_pl061 = { - // .groups = NULL, - // .groupNum = PL061_GROUP_MAX, - // .bitNum = PL061_BIT_MAX, - //}; - ret = Pl061GpioReadDrs(pl061, device->property);// Use the attribute values read from the gpio_config.HCS file to initialize the members of the custom structure object. - ... - pl061->regBase = OsalIoRemap(pl061->phyBase, pl061->groupNum * pl061->regStep);// Address mapping - ... - ret = Pl061GpioInitCntlrMem(pl061); // Apply for memory. - ... - pl061->cntlr.count = pl061->groupNum x pl061->bitNum;// (Mandatory) Calculate the number of pins. - pl061->cntlr.priv = (void *)device->property; // (Mandatory) Store device attributes. - pl061->cntlr.ops = &g_method; // (Mandatory) Connect to the GpioMethod instance. - pl061->cntlr.device = device; // (Mandatory) Enable conversion between HdfDeviceObject and GpioCntlr. - ret = GpioCntlrAdd(&pl061->cntlr); // (Mandatory) Call this function to set the structure of the core layer. The driver accesses the platform core layer only after a success signal is returned. - ... - Pl061GpioDebugCntlr(pl061); - #ifdef PL061_GPIO_USER_SUPPORT // (Optional) Access the user-level virtual file system if supported. - if (GpioAddVfs(pl061->bitNum) != HDF_SUCCESS) { - HDF_LOGE("%s: add vfs fail!", __func__); +1. Instantiate the driver entry. + - Instantiate the **HdfDriverEntry** structure. + - Call **HDF_INIT** to register the **HdfDriverEntry** instance with the HDF. + +2. Configure attribute files. + - Add the **deviceNode** information to the **device_info.hcs** file. + - (Optional) Add the **gpio_config.hcs** file. + +3. Instantiate the GPIO controller object. + - Initialize **GpioCntlr**. + - Instantiate **GpioMethod** in the **GpioCntlr** object. + + > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
For details about the callbacks in **GpioMethod**, see [Available APIs](#available_apis). + +4. Debug the driver. + + (Optional) For new drivers, verify the basic functions, such as the GPIO status control and response to interrupts. + + +## Development Example + +The following uses **gpio_hi35xx.c** as an example to present the information to be provided by the vendor for implementing device functions. + +1. Instantiate the driver entry. + + The driver entry must be a global variable of the **HdfDriverEntry** type (defined in **hdf\_device\_desc.h**), and the value of **moduleName** must be the same as that in **device\_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke. + Generally, the HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, the HDF calls **Release** to release driver resources and exit. + + GPIO driver entry example: + + ``` + struct HdfDriverEntry g_gpioDriverEntry = { + .moduleVersion = 1, + .Bind = Pl061GpioBind, // Bind does not need to be implemented for GPIO. It is an empty method in this example. You can add related operations as required. + .Init = Pl061GpioInit, // See the Init function. + .Release = Pl061GpioRelease, // See the Release function. + .moduleName = "hisi_pl061_driver",// (Mandatory) The value must be the same as that of moduleName in the .hcs file. + }; + // Call HDF_INIT to register the driver entry with the HDF. + HDF_INIT(g_gpioDriverEntry); + ``` + +2. Add the **deviceNode** information to the **device_info.hcs** file, and configure the device attributes in the **gpio_config.hcs** file. + + The **deviceNode** information is related to registration of the driver entry. The device attribute values are closely related to the default values or value ranges of the **GpioCntlr** members at the core layer. + In this example, there is only one GPIO controller. If there are multiple GPIO controllers, you need to add the **deviceNode** information to the **device_info** file and add the corresponding device attributes to the **gpio_config** file for each controller. + + - **device_info.hcs** configuration example + + ``` + root { + device_info { + platform :: host { + hostName = "platform_host"; + priority = 50; + device_gpio :: device { + device0 :: deviceNode { + policy = 0; // No service is published. + priority = 10; // Driver startup priority. + permission = 0644; // Permission to create device nodes for the driver. + moduleName = "hisi_pl061_driver"; // (Mandatory) Driver name, which must be the same as moduleName in the driver entry. + deviceMatchAttr = "hisilicon_hi35xx_pl061";// (Mandatory) Private data of the controller. The value must be the same as the controller information in gpio_config.hcs. + // Add private information about all controllers in this file. + } + } + } } - #endif - ... - } - ``` - -- Release function - - Input parameters: - - **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs configuration file information. - - Return values: - - – - - Function description: - - Releases the memory and deletes the controller. This function assigns a value to the **Release** API in the driver entry structure. When the HDF framework fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations. - - - ``` - static void Pl061GpioRelease(struct HdfDeviceObject *device) - { - struct GpioCntlr *cntlr = NULL; - struct Pl061GpioCntlr *pl061 = NULL; - ... - cntlr = GpioCntlrFromDevice(device);// (Mandatory) Obtain the control object of the core layer through forced conversion. - //return (device == NULL) ? NULL : (struct GpioCntlr *)device->service; - ... - #ifdef PL061_GPIO_USER_SUPPORT - GpioRemoveVfs();// Perform operations reverse to GpioAddVfs in Init. - #endif - GpioCntlrRemove(cntlr); // (Mandatory) Remove the device information and services from the core layer. - pl061 = ToPl061GpioCntlr(cntlr); //return (struct Pl061GpioCntlr *)cntlr; - Pl061GpioRleaseCntlrMem(pl061); // (Mandatory) Release the lock and memory. - OsalIoUnmap((void *)pl061->regBase);// (Mandatory) Remove the address mapping. - pl061->regBase = NULL; + } + ``` + - **gpio_config.hcs** configuration example + + ``` + root { + platform { + gpio_config { + controller_0x120d0000 { + match_attr = "hisilicon_hi35xx_pl061"; // (Mandatory) The value must be the same as that of deviceMatchAttr in device_info.hcs. + groupNum = 12; // (Mandatory) GPIO group number. + bitNum = 8; // (Mandatory) Number of GPIO pins in each group. + regBase = 0x120d0000;// (Mandatory) Physical base address. + regStep = 0x1000; // (Mandatory) Register offset step. + irqStart = 48; // (Mandatory) Enable interrupts. + irqShare = 0; // (Mandatory) Whether to share an interrupt. + } + } + } + } + ``` + +3. Initialize the **GpioCntlr** object at the core layer, including defining a custom structure (to pass parameters and data) and implementing the **HdfDriverEntry** member functions (**Init** and **Release**) to instantiate **GpioMethod** in **GpioCntlr** (so that the underlying driver functions can be called). + - Defining a custom structure + + To the driver, the custom structure holds parameters and data. The **DeviceResourceIface** method provided by the HDF reads the values in the **gpio_config.hcs** file to initialize the members in the custom structure and passes important parameters, such as the GPIO group number and the number of pins, to the **GpioCntlr** object at the core layer. + + + ``` + struct Pl061GpioCntlr { + struct GpioCntlr cntlr;// (Mandatory) Control object at the core layer. The details are as follows: + volatile unsigned char *regBase;// (Mandatory) Register base address. + uint32_t phyBase; // (Mandatory) Physical base address. + uint32_t regStep; // (Mandatory) Register offset step. + uint32_t irqStart; // (Mandatory) Enable interrupts. + uint16_t groupNum; // (Mandatory) Parameter of the GPIO port number. + uint16_t bitNum; // (Mandatory) Parameter of the GPIO port number. + uint8_t irqShare; // (Mandatory) Whether to share an interrupt. + struct Pl061GpioGroup *groups; // (Optional) Set based on the actual requirements. + }; + struct Pl061GpioGroup {// Register address, IRQ number and function, and lock. + volatile unsigned char *regBase; + unsigned int index; + unsigned int irq; + OsalIRQHandle irqFunc; + OsalSpinlock lock; + }; + + // GpioCntlr is the controller structure at the core layer. The Init function assigns values to the members of GpioCntlr. + struct GpioCntlr { + struct IDeviceIoService service; + struct HdfDeviceObject *device; + struct GpioMethod *ops; + struct DListHead list; + OsalSpinlock spin; + uint16_t start; + uint16_t count; + struct GpioInfo *ginfos; + void *priv; + }; + ``` + + - Instantiating the **GpioMethod** structure in **GpioCntlr** (other members are initialized by **Init**) + + + ``` + // The members of the GpioMethod structure are all callbacks. You need to implement the functions listed in Table 1. + static struct GpioMethod g_method = { + .request = NULL, + .release = NULL, + .write = Pl061GpioWrite, // Write the pin level. + .read = Pl061GpioRead, // Read the pin level. + .setDir = Pl061GpioSetDir, // Set the pin direction. + .getDir = Pl061GpioGetDir, // Obtain the pin direction. + .toIrq = NULL, + .setIrq = Pl061GpioSetIrq, // Set an IRQ for a pin. Skip it if this capability is not available. + .unsetIrq = Pl061GpioUnsetIrq, // Cancel the IRQ settings for a pin. Skip it if this capability is not available. + .enableIrq = Pl061GpioEnableIrq, // Enable interrupts for a pin. Skip it if this capability is not available. + .disableIrq = Pl061GpioDisableIrq,// Disable interrupts for a pin. Skip it if this capability is not available. + }; + ``` + + - **Init** function + + Input parameter: + + **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information. + + Return value: + + HDF_STATUS + + The table below describes some status. For more information, see **HDF_STATUS** in the **/drivers/framework/include/utils/hdf_base.h** file. + + **Table 2** HDF_STATUS + + | Status| Description| + | -------- | -------- | + | HDF_ERR_INVALID_OBJECT | Invalid controller object.| + | HDF_ERR_MALLOC_FAIL | Failed to allocate memory.| + | HDF_ERR_INVALID_PARAM | Invalid parameter.| + | HDF_ERR_IO | I/O error.| + | HDF_SUCCESS | Initialization successful.| + | HDF_FAILURE | Initialization failed.| + + Function description: + + Initializes the custom structure object and **GpioCntlr**, calls the **GpioCntlrAdd** function at the core layer, and (optional) connects to the virtual file system (VFS). + + + ``` + static int32_t Pl061GpioInit(struct HdfDeviceObject *device) + { + ... + struct Pl061GpioCntlr *pl061 = &g_pl061;// Use static global variables to complete initialization. + // static struct Pl061GpioCntlr g_pl061 = { + // .groups = NULL, + // .groupNum = PL061_GROUP_MAX, + // .bitNum = PL061_BIT_MAX, + //}; + ret = Pl061GpioReadDrs(pl061, device->property);// Use the attribute values read from the gpio_config.hcs file to initialize the members of the custom structure object. + ... + pl061->regBase = OsalIoRemap(pl061->phyBase, pl061->groupNum * pl061->regStep);// Create address mapping. + ... + ret = Pl061GpioInitCntlrMem(pl061); // Allocate memory. + ... + pl061->cntlr.count = pl061->groupNum x pl061->bitNum;// (Mandatory) Calculate the number of pins. + pl061->cntlr.priv = (void *)device->property; // (Mandatory) Store device attributes. + pl061->cntlr.ops = &g_method; // (Mandatory) Attach the GpioMethod instance. + pl061->cntlr.device = device; // (Mandatory) Prerequisites for conversion between HdfDeviceObject and GpioCntlr. + ret = GpioCntlrAdd(&pl061->cntlr); // (Mandatory) Call this function to fill the structure of the core layer. The driver accesses the platform core layer only after a success signal is returned. + ... + Pl061GpioDebugCntlr(pl061); + #ifdef PL061_GPIO_USER_SUPPORT // (Optional) Access the user-level VFS if it is supported. + if (GpioAddVfs(pl061->bitNum) != HDF_SUCCESS) { + HDF_LOGE("%s: add vfs fail!", __func__); } - ``` \ No newline at end of file + #endif + ... + } + ``` + + - **Release** function + + Input parameter: + + **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs configuration file information. + + Return value: + + No value is returned. + + Function description: + + Releases the memory and deletes the controller. This function assigns values to the **Release** function in the driver entry structure. If the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the value assignment operations. + + + ``` + static void Pl061GpioRelease(struct HdfDeviceObject *device) + { + struct GpioCntlr *cntlr = NULL; + struct Pl061GpioCntlr *pl061 = NULL; + ... + cntlr = GpioCntlrFromDevice(device);// (Mandatory) Obtain the control object at the core layer through forced conversion. + // return (device == NULL) ? NULL : (struct GpioCntlr *)device->service; + ... + #ifdef PL061_GPIO_USER_SUPPORT + GpioRemoveVfs();// Reverse operation of GpioAddVfs in Init. + #endif + GpioCntlrRemove(cntlr); // (Mandatory) Remove the device information and services from the core layer. + pl061 = ToPl061GpioCntlr(cntlr); // return (struct Pl061GpioCntlr *)cntlr; + Pl061GpioRleaseCntlrMem(pl061); // (Mandatory) Release the lock and memory. + OsalIoUnmap((void *)pl061->regBase);// (Mandatory) Unmap the addresses. + pl061->regBase = NULL; + } + ``` diff --git a/en/device-dev/driver/driver-platform-hdmi-des.md b/en/device-dev/driver/driver-platform-hdmi-des.md index 16927b0fff02c7bc751393f49816ca231c8434cb..fa1e7e03d94b7b23674fe29776cbe771bad23d4f 100644 --- a/en/device-dev/driver/driver-platform-hdmi-des.md +++ b/en/device-dev/driver/driver-platform-hdmi-des.md @@ -6,34 +6,34 @@ ### HDMI High-definition multimedia interface (HDMI) is an interface for transmitting audio and video data from a source device, such as a DVD player or set-top box (STB), to a sink device, such as a TV or display. -HDMI works in primary/secondary mode and usually has a source and a sink. +HDMI usually has a source and a sink. The HDMI APIs provide a set of common functions for HDMI transmission, including: - Opening and closing an HDMI controller - Starting and stopping HDMI transmission - Setting audio, video, and High Dynamic Range (HDR) attributes, color depth, and AV mute - Reading the raw Extended Display Identification Data (EDID) from a sink -- Registering and unregistering a callback for HDMI hot plug detect (HPD). +- Registering and unregistering a callback for HDMI hot plug detect (HPD) ### Basic Concepts HDMI is an audio and video transmission protocol released by Hitachi, Panasonic, Philips, Silicon Image, Sony, Thomson, and Toshiba. The transmission process complies with the Transition-minimized Differential Signaling (TMDS). - TMDS is used to transmit audio, video, and various auxiliary data. -- Display data channel (DDC) allows the TX and RX ends to obtain the sending and receiving capabilities. However, the HDMI only needs to unidirectionally obtain the capabilities of the RX end (display). +- Display data channel (DDC) allows the TX and RX ends to obtain the transmitting and receiving capabilities. However, HDMI only needs to unidirectionally obtain the capabilities of the RX end (display). - Consumer Electronics Control (CEC) enables interaction between the HDMI TX and RX devices. - Fixed rate link (FRL) allows the maximum TMDS bandwidth to be increased from 18 Gbit/s to 48 Gbit/s. - High-bandwidth Digital Content Protection (HDCP) prevents copying of digital audio and video content being transmitted across devices. -- Extended Display Identification Data (EDID), usually stored in the display firmware, provides the vendor information, EDID version, maximum image size, color settings, vendor pre-settings, frequency range limit, display name, and serial number. +- EDID, usually stored in the display firmware, provides the vendor information, EDID version, maximum image size, color settings, vendor pre-settings, frequency range limit, display name, and serial number. ### Working Principles -The HDMI source end provides +5 V and GND for DDC and CEC communication. Through the DDC, the source end obtains the sink end parameters, such as the RX capabilities. The CEC is optional. It is used to synchronize the control signals between the source and sink ends to improve user experience. There are four TMDS channels between the HDMI source and sink ends. The TMDS clock channel provides clock signals for TMDS, and the other three channels transmit audio, video, and auxiliary data. HPD is the hot plug detect port. When the sink end is connected, the source end responds by using an interrupt program. +The HDMI source provides +5 V and GND for DDC and CEC communication. Through the DDC, the source obtains the sink parameters, such as the RX capabilities. The CEC provides an optional channel to synchronize control signals between the source and sink for better user experience. There are four TMDS channels between the HDMI source and sink. The TMDS clock channel provides clock signals for TMDS, and the other three channels transmit audio, video, and auxiliary data. HDP is the hot plug detect port. When the sink is connected, the source responds by using an interrupt service routine (ISR). The figure below shows the HDMI physical connection. - + **Figure 1** HDMI physical connection - + ![](figures/HDMI_physical_connection.png "HDMI_physical_connection") ### Constraints @@ -69,15 +69,15 @@ HDMI features high transmission rate, wide transmission bandwidth, high compatib ### How to Develop -The figure below illustrates the process of using an HDMI device. +The figure below illustrates the general HDMI development process. -**Figure 2** Process of using an HDMI device - -![](figures/HDMI_usage_flowchart.png "HDMI_usage_flowchart") +**Figure 2** Using HDMI driver APIs + +![](figures/using-HDMI-process.png "using-HDMI-process") #### Opening an HDMI Controller -Before HDMI communication, call **HdmiOpen** to open an HDMI controller. +Before HDMI communication, call **HdmiOpen()** to open an HDMI controller. ```c DevHandle HdmiOpen(int16_t number); @@ -88,11 +88,11 @@ DevHandle HdmiOpen(int16_t number); | Parameter | Description | | ---------- | -------------------- | | number | HDMI controller ID. | -| **Return Value**| **Description** | -| NULL | Failed to open the HDMI controller. | +| **Return Value**| **Description** | +| NULL | The operation failed. | | Controller handle| Handle of the opened HDMI controller.| -Example: Open controller 0 of the two HDMI controllers (numbered 0 and 1) in the system. +For example, open controller 0 of the two HDMI controllers (numbered 0 and 1) in the system: ```c DevHandle hdmiHandle = NULL; /* HDMI controller handle / @@ -117,7 +117,7 @@ int32_t HdmiRegisterHpdCallbackFunc(DevHandle handle, struct HdmiHpdCallbackInfo | ---------- | ------------------ | | handle | HDMI controller handle. | | callback | Pointer to the callback to be invoked to return the HPD result.| -| **Return Value**| **Description** | +| **Return Value**| **Description** | | 0 | The operation is successful. | | Negative value | The operation failed. | @@ -165,7 +165,7 @@ int32_t HdmiReadSinkEdid(DevHandle handle, uint8_t *buffer, uint32_t len); | handle | HDMI controller handle. | | buffer | Pointer to the data buffer. | | len | Data length. | -| **Return Value**| **Description** | +| **Return Value**| **Description** | | Positive integer | Raw EDID read.| | Negative number or 0 | Failed to read the EDID. | @@ -194,7 +194,7 @@ int32_t HdmiSetAudioAttribute(DevHandle handle, struct HdmiAudioAttr *attr); | ------ | -------------- | | handle | HDMI controller handle.| | attr | Pointer to the audio attributes. | -| **Return Value**| **Description** | +| **Return Value**| **Description** | | 0 | The operation is successful. | | Negative value | The operation failed. | @@ -260,7 +260,7 @@ int32_t HdmiSetHdrAttribute(DevHandle handle, struct HdmiHdrAttr *attr); | Parameter | Description | | ---------- | -------------- | | handle | HDMI controller handle.| -| attr | Pinter to the HDR attributes. | +| attr | Pointer to the HDR attributes | | **Return Value**| **Description**| | 0 | The operation is successful. | | Negative value | The operation failed. | @@ -295,7 +295,7 @@ int32_t HdmiAvmuteSet(DevHandle handle, bool enable); | ---------- | ----------------- | | handle | HDMI controller handle. | | enable | Whether to enable the AV mute feature.| -| **Return Value**| **Description** | +| **Return Value**| **Description** | | 0 | The operation is successful. | | Negative value | The operation failed. | @@ -615,4 +615,4 @@ static int32_t TestCaseHdmi(void) return 0; } -``` \ No newline at end of file +``` diff --git a/en/device-dev/driver/driver-platform-hdmi-develop.md b/en/device-dev/driver/driver-platform-hdmi-develop.md index 81597bf7b61d98dce8a3ed210aaffe06e3782298..7cd4437b5c7fd746b9a1cb467d71046cb8b0e740 100644 --- a/en/device-dev/driver/driver-platform-hdmi-develop.md +++ b/en/device-dev/driver/driver-platform-hdmi-develop.md @@ -5,15 +5,13 @@ ### HDMI -High-definition multimedia interface (HDMI) is an interface for transmitting audio and video data from a source device, such as a DVD player or set-top box (STB), to a sink device, such as a TV or display. +High Definition Multimedia Interface (HDMI) is an audio and video transmission protocol jointly released by Hitachi, Panasonic, Philips, Silicon Image, Sony, Thomson and Toshiba. It is used to transmit audio and video data from a source device, such as a DVD player or set-top box (STB), to a sink device, such as a TV or display. The transmission process complies with the Transition-minimized Differential Signaling (TMDS). ### Basic Concepts -HDMI is an audio and video transmission protocol released by Hitachi, Panasonic, Philips, Silicon Image, Sony, Thomson, and Toshiba. The transmission process complies with the Transition Minimized Differential Signaling (TMDS) protocol. - - TMDS is used to transmit audio, video, and various auxiliary data. -- Display data channel (DDC) allows the TX and RX ends to obtain the sending and receiving capabilities. However, the HDMI only needs to unidirectionally obtain the capabilities of the RX end (display). +- Display data channel (DDC) allows the TX and RX ends to obtain the transmitting and receiving capabilities. However, HDMI only needs to unidirectionally obtain the capabilities of the RX end (display). - Consumer Electronics Control (CEC) enables interaction between the HDMI TX and RX devices. @@ -23,7 +21,7 @@ HDMI is an audio and video transmission protocol released by Hitachi, Panasonic, ### Working Principles -In the HDF, the HDMI module uses the independent service mode for API adaptation. In this mode, each device independently publishes a device service to process external access requests. After receiving an access request, the device manager extracts the parameters in the request to call the internal method of the target device. In the independent service mode, the service management capabilities of the HDFDeviceManager can be directly used. However, you need to configure a node for each device, which increases the memory usage. +In the HDF, the HDMI module uses the independent service mode for API adaptation. In this mode, each device independently publishes a service to process external access requests. When receiving an access request, the HDF DeviceManager extracts parameters from the request to call the internal APIs of the target device. In the independent service mode, the HDF DeviceManager provides service management capabilities. However, you need to configure a node for each device to increase memory resources. **Figure 1** Independent service mode @@ -35,13 +33,13 @@ Currently, the HDMI module supports only the kernels (LiteOS) of mini and small ## Development Guidelines -### Use Cases +### When to Use HDMI features high transmission rate, wide transmission bandwidth, high compatibility, and can transmit uncompressed audio and video signals. Compared with the traditional full analog interface, HDMI simplifies connection between devices and provides HDMI-specific intelligent features, which are ideal for high-quality audio and video transmission of small-sized devices. ### Available APIs - **HdmiCntlrOps**: - + +**HdmiCntlrOps**: ```c struct HdmiCntlrOps { void (*hardWareInit)(struct HdmiCntlr *cntlr); @@ -81,42 +79,42 @@ struct HdmiCntlrOps { }; ``` -**Table 1** Description of the HdmiCntlrOps structure +**Table 1** Description of the callback functions in HdmiCntlrOps | Function | Input Parameter | Output Parameter | Return Value | Description | | ------------------------ | ------------------------------------------------------------ | -------------------------------------- | ------------------ | -------------------------------------------------- | | hardWareInit | **cntlr**: structure pointer to an HDMI controller at the core layer.| –| –| Initializes the HDMI hardware.| -| hardWareStatusGet | **cntlr**: structure pointer to an HDMI controller at the core layer.
| **status**: pointer to the HDMI hardware status.| –| Obtains the HDMI hardware status. | -| controllerReset | **cntlr**: structure pointer to an HDMI controller at the core layer.| – | –| Resets an HDMI controller. | -| hotPlugStateGet | **cntlr**: structure pointer to an HDMI controller at the core layer. | – | **bool**: HDMI hot-plug status.| Obtains the HDMI hot-plug status. | -| hotPlugInterruptStateGet | **cntlr**: structure pointer to an HDMI controller at the core layer. | – | **bool**: HDMI hot-plug interrupt status.| Obtains the HDMI hot-plug interrupt status. | -| lowPowerSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable low power consumption.| – | –| Enables or disables low power consumption.| -| tmdsModeSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**mode**: TMDS mode.| – | –| Sets the TMDS mode. | -|tmdsConfigSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**mode**: TMDS parameters.|–|HDF_STATUS|Sets TMDS parameters.| -|infoFrameEnable|**cntlr**: structure pointer to an HDMI controller at the core layer.
**infoFrameType**: packet type.
**enable**: whether to enable infoFrame.|–|–|Enables or disables infoFrame.| -|infoFrameSend|**cntlr**: structure pointer to an HDMI controller at the core layer.
**infoFrameType**: packet type.
**data**: pointer to infoFrame data.
**len**: data length.|–|HDF_STATUS|Sends an infoFrame.| +| hardWareStatusGet | **cntlr**: structure pointer to an HDMI controller at the core layer.
| **status**: pointer to the HDMI hardware status.| –| Obtains the HDMI hardware status.| +| controllerReset | **cntlr**: structure pointer to an HDMI controller at the core layer.| –| –| Resets an HDMI controller.| +| hotPlugStateGet | **cntlr**: structure pointer to an HDMI controller at the core layer.| –| **bool**: HDMI hot-plug status.| Obtains the HDMI hot-plug status.| +| hotPlugInterruptStateGet | **cntlr**: structure pointer to an HDMI controller at the core layer.| –| **bool**: HDMI hot-plug interrupt status.| Obtains the HDMI hot-plug interrupt status.| +| lowPowerSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable low power consumption.| –| –| Enables or disables low power consumption.| +| tmdsModeSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**mode**: TMDS mode.| –| –| Sets the TMDS mode.| +| tmdsConfigSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**mode**: TMDS parameters.| –| HDF_STATUS| Sets TMDS parameters.| +| infoFrameEnable | **cntlr**: structure pointer to an HDMI controller at the core layer.
**infoFrameType**: packet type.
**enable**: whether to enable infoFrame.| –| –| Enables or disables infoFrame.| +| infoFrameSend | **cntlr**: structure pointer to an HDMI controller at the core layer.
**infoFrameType**: packet type.
**data**: pointer to infoFrame data.
**len**: data length.| –| HDF_STATUS| Sends an infoFrame.| |cecMsgSend|**cntlr**: structure pointer to an HDMI controller at the core layer.
**msg**: pointer to the CEC message|–|HDF_STATUS|Sends a CEC message.| |audioPathEnable|**cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable the audio path.|–|–|Enables or disables the audio path.| -|audioPathSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**config**: pointer to the audio path configuration.|–|–|Sets the audio path.| +| audioPathSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**config**: pointer to the audio path configuration.| –| –| Sets the audio path.| |phyOutputEnable|**cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable the physical layer output.|–|–|Enables or disables the physical layer output.| -|phyOutputSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**cfg**: pointer to the physical layer configuration.|–|–|Sets the physical layer information.| +| phyOutputSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**cfg**: pointer to the physical layer configuration.| –| –| Sets the physical layer information.| |blackDataSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable the black screen.|–|–|Sets the black screen.| |videoMuteEnable|**cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable the video mute feature.|–|–|Enables or disables the video mute feature.| -|videoPathSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**attr**: pointer to the video path configuration.|–|–|Sets the video path.| +| videoPathSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**attr**: pointer to the video path configuration.| –| –| Sets the video path.| |audioMuteEnable|**cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable the audio mute feature.|–|–|Enables or disables the audio mute feature.| |avmuteSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable the AV mute feature.|–|–|Enables or disables the AV mute feature.| |ddcTransfer|**cntlr**: structure pointer to an HDMI controller at the core layer.
**ddcCfg**: pointer to the DDC configuration.|**ddcCfg**: DDC configuration.|HDF_STATUS|Reads and writes data through the DDC.| -|scdcSourceScrambleGet|**cntlr**: structure pointer to an HDMI controller at the core layer.|–|Scrambling status of the source.|Obtains the scrambling status of the source.| +| scdcSourceScrambleGet | **cntlr**: structure pointer to an HDMI controller at the core layer.| –| Scrambling status of the source.| Obtains the scrambling status of the source.| |scdcSourceScrambleSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable the scrambling for the source.|–|HDF_STATUS|Enables or disable scrambling for the source.| |frlEnable|**cntlr**: structure pointer to an HDMI controller at the core layer.
**enable**: whether to enable the FRL.|–|HDF_STATUS|Enables or disables the FRL.| -|audioNctsSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**cfg**: pointer to the N/CTS configuration.|–|HDF_STATUS|Sets the audio N/CTS information.| +| audioNctsSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**cfg**: pointer to the N/CTS configuration.| –| HDF_STATUS| Sets the audio N/CTS information.| |frlTrainingConfigSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**cfg**: pointer to the FRL training configuration.|–|–|Sets FRL training information.| -|frlTrainingStart|**cntlr**: structure pointer to an HDMI controller at the core layer.|–|–|Starts FRL training.| -|frlGetTriningRslt|**cntlr**: structure pointer to an HDMI controller at the core layer.|**rslt**: FRL training result.|–|Obtains the FRL training result.| -|hdcpRegInit|**cntlr**: structure pointer to an HDMI controller at the core layer.|–|–|Initializes registers related to the High-bandwidth Digital Content Protection (HDCP) process.| -|hdcpGenerateAksvAndAn|**cntlr**: structure pointer to an HDMI controller at the core layer.|–|HDF_STATUS|Generates the **Aksv** and **An** in the HDCP process.| -|hdcpOptReg|**cntlr**: structure pointer to an HDMI controller at the core layer.
**type**: operation type.
**data**: register data.
**len**: data length.|**data**: register data.|HDF_STATUS|Reads or writes the registers during the HDCP process.| -|hdrTimerSet|**cntlr**: structure pointer to an HDMI controller at the core layer.
**config**: pointer to the timer configuration|–|–|Sets the HDR-related timer.| +| frlTrainingStart | **cntlr**: structure pointer to an HDMI controller at the core layer.| –| –| Starts FRL training.| +| frlGetTriningRslt | **cntlr**: structure pointer to an HDMI controller at the core layer.| **rslt**: FRL training result.| –| Obtains the FRL training result.| +| hdcpRegInit | **cntlr**: structure pointer to an HDMI controller at the core layer.| –| –| Initializes registers related to the High-bandwidth Digital Content Protection (HDCP) process.| +|hdcpGenerateAksvAndAn |**cntlr**: structure pointer to an HDMI controller at the core layer.| –| HDF_STATUS| Generates the **Aksv** and **An** in the HDCP process.| +| hdcpOptReg | **cntlr**: structure pointer to an HDMI controller at the core layer.
**type**: operation type.
**data**: register data.
**len**: data length.| **data**: register data.| HDF_STATUS| Reads or writes the registers during the HDCP process.| +| hdrTimerSet | **cntlr**: structure pointer to an HDMI controller at the core layer.
**config**: pointer to the timer configuration| –| –| Sets the HDR-related timer.| ### How to Develop @@ -139,9 +137,9 @@ The HDMI module adaptation involves the following steps: The driver entry must be a global variable of the **HdfDriverEntry** type (which is defined in **hdf_device_desc.h**), and the value of **moduleName** must be the same as that in **device_info.hcs**. In the HDF, the start address of each **HdfDriverEntry** object of all loaded drivers is collected to form a segment address space similar to an array for the upper layer to invoke. - Generally, the HDF calls the **Bind()** function and then the **Init()** function to load a driver. If **Init()** fails to be called, the HDF calls **Release()** to release driver resources and exit. + Generally, the HDF calls the **Bind** function and then the **Init** function to load a driver. If **Init** fails to be called, the HDF calls **Release** to release driver resources and exit. - HDMI driver entry reference: + HDMI driver entry example: ```c struct HdfDriverEntry g_hdmiDriverEntry = { @@ -149,25 +147,25 @@ The HDMI module adaptation involves the following steps: .Bind = HdmiAdapterBind, .Init = HdmiAdapterInit, .Release = HdmiAdapterRelease, - .moduleName = "adapter_hdmi_driver",// (Mandatory) The value must be the same as that in the .hcs file. + .moduleName = "adapter_hdmi_driver",// (mandatory) The value must be the same as that in the .hcs file. }; HDF_INIT(g_hdmiDriverEntry); // Call HDF_INIT to register the driver entry with the HDF. ``` 2. Configure attribute files. - Add **deviceNode** to the **device_info.hcs** file, and configure the device attributes in the **hdmi\_config.hcs** file. The **deviceNode** information is related to registration of the driver entry. The device attribute values are closely related to the driver implementation and the default values or restriction ranges of the **HdmiCntlr** members at the core layer. + Add **deviceNode** to the **device_info.hcs** file, and configure the device attributes in the **hdmi_config.hcs** file. The **deviceNode** information is related to registration of the driver entry. The device attribute values are closely related to the driver implementation and the default values or restriction ranges of the **HdmiCntlr** members at the core layer. - Configure HDMI controller information from the first node. This node specifies a type of HDMI controllers rather than a specific HDMI controller. In this example, there is only one HDMI controller. If there are multiple HDMI controllers, you need to add the **deviceNode** information to the **device\_info** file and add the corresponding device attributes to the **hdmi\_config** file. + Configure HDMI controller information from the first node. This node specifies a type of HDMI controllers rather than a specific HDMI controller. In this example, there is only one HDMI controller. If there are multiple HDMI controllers, you need to add the **deviceNode** information to the **device_info** file and add the corresponding device attributes to the **hdmi_config** file. - - **device\_info.hcs** configuration reference + - **device_info.hcs** configuration example: ```c root { platform :: host { device_hdmi :: device { device0 :: deviceNode { - policy = 2; // The value 2 means to publish a service. + policy = 2; // Publish services. priority = 20; // Driver startup priority. permission = 0644; // Permission to create device nodes for the driver. serviceName = "HDF_PLATFORM_HDMI_0"; // (Mandatory) Unique name of the service published by the driver. @@ -179,7 +177,7 @@ The HDMI module adaptation involves the following steps: } ``` - - **hdmi_config.hcs** configuration reference + - **hdmi_config.hcs** configuration example: ```c root { @@ -230,13 +228,15 @@ The HDMI module adaptation involves the following steps: 3. Instantiate the **HdmiCntlr** object. - Initialize the **HdmiCntlr** object at the core layer, including initializing the vendor custom structure (passing parameters and data) and instantiating the **HdmiCntlrOps** (used to call the underlying functions of the driver). The **HdfDriverEntry** member functions (**Bind**, **Init**, and **Release**) must be implemented in this step. - - - Custom structure reference + Initialize the **HdmiCntlr** object at the core layer, including defining a custom structure (to pass parameters and data) and implementing the **HdfDriverEntry** member functions (**Bind**, **Init** and **Release**) to instantiate **HdmiCntlrOps** in **HdmiCntlr** (so that the underlying driver functions can be called). - > ![](../public_sys-resources/icon-note.gif) **NOTE**
- > To the driver, the custom structure carries parameters and data. The values in the **hdmi_config.hcs** file are read by the HDF, and structure members are initialized by **DeviceResourceIface**. Some important values (such as the device number and bus number) are also passed to the **HdmiCntlr** object at the core layer. + - Defining the custom structure + > ![](../public_sys-resources/icon-note.gif) **NOTE** + > + > + > To the driver, the custom structure holds parameters and data. The **DeviceResourceIface** method provided by the HDF reads the values in the **hdmi_config.hcs** file to initialize the members in the custom structure and passes important parameters, such as the device number and bus number, to the **HdmiCntlr** object at the core layer. + ```c struct HdmiAdapterHost { struct HdmiCntlr *cntlr; // (Mandatory) Control object at the core layer. The details are as follows: @@ -245,8 +245,8 @@ The HDMI module adaptation involves the following steps: uint32_t regSize; // (Mandatory) Register bit width. uint32_t irqNum; // (Mandatory) IRQ number. }; - - /* HdmiCntlr is the controller structure at the core layer. Its members are assigned with values by using the Init() function. */ + + /* HdmiCntlr is the controller structure at the core layer. The Init function assigns values to the members of HdmiCntlr. */ struct HdmiCntlr { struct IDeviceIoService service; struct HdfDeviceObject *hdfDevObj; @@ -272,8 +272,8 @@ The HDMI module adaptation involves the following steps: }; ``` - - Instantiate **HdmiCntlrOps** in **HdmiCntlr**. - + - Instantiating **HdmiCntlrOps** in **HdmiCntlr** + ```c static struct HdmiCntlrOps g_hdmiAdapterHostOps = { .hardWareInit = HdmiAdapterHardWareInit, @@ -313,28 +313,33 @@ The HDMI module adaptation involves the following steps: }; ``` - - **Bind()** function - - **Input parameter**: - **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs configuration. - - **Return value**: - **HDF\_STATUS** (The following table lists some states. For more details, see **HDF\_STATUS** definition in the **/drivers/framework/include/utils/hdf\_base.h file**.) - - | State | Description | + - **Bind** function + + **Input parameter**: + + **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information. + + **Return value**: + + HDF_STATUS + + The table below describes some status. For more information, see **HDF_STATUS** in the **/drivers/framework/include/utils/hdf_base.h** file. + + |Status|Description| |:-|:-| |HDF_ERR_INVALID_OBJECT|Invalid controller object.| - |HDF_ERR_INVALID_PARAM|Invalid parameter.| - |HDF_ERR_MALLOC_FAIL |Memory allocation failed.| + |HDF_ERR_INVALID_PARAM |Invalid parameter.| + |HDF_ERR_MALLOC_FAIL |Failed to allocate memory.| |HDF_ERR_IO |I/O error.| |HDF_SUCCESS |Transmission successful.| |HDF_FAILURE |Transmission failed.| - - **Function description**: + + **Function description**: + Initializes the custom structure object **HdmiAdapterHost** and **HdmiCntlr**, and calls the **HdmiCntlrAdd** function to add the HDMI controller to the core layer. - + The **HdmiCntlr**, **HdmiAdapterHost**, and **HdfDeviceObject** assign values with each other so that other functions can be converted successfully. - + ```c static int32_t HdmiAdapterBind(struct HdfDeviceObject *obj) { @@ -355,13 +360,13 @@ The HDMI module adaptation involves the following steps: cntlr->ops = &g_hdmiHostOps; // (Mandatory) Connect to the HdmiCntlrOps instance. cntlr->hdfDevObj = obj; // (Mandatory) Prerequisites for conversion between HdfDeviceObject and HdmiCntlr. obj->service = &cntlr->service; // (Mandatory) Prerequisites for conversion between HdfDeviceObject and HdmiCntlr. - ret = HdmiAdapterCntlrParse(cntlr, obj); // (Mandatory) Initialize cntlr. If the operation fails, execute goto__ERR. + ret = HdmiAdapterCntlrParse(cntlr, obj); // (Mandatory) Initialize cntlr. If the operation fails, execute goto __ERR. ... - ret = HdmiAdapterHostParse(host, obj); // (Mandatory) Initialize the attributes of the host object. If the initialization fails, execute goto__ERR. + ret = HdmiAdapterHostParse(host, obj); // (Mandatory) Initialize the attributes of the host object. If the operation fails, execute goto__ERR. ... - ret = HdmiAdapterHostInit(host, cntlr); // Perform vendor custom structure initialization. If the initialization fails, execute goto __ERR. + ret = HdmiAdapterHostInit(host, cntlr); // Initialize the custom structure. If the operation fails, execute goto __ERR. ... - ret = HdmiCntlrAdd(cntlr); // Call the function at the core layer. If the operation fails, execute goto__ERR. + ret = HdmiCntlrAdd(cntlr); // Call the functions at the core layer. If the operation fails, execute goto__ERR. ... HDF_LOGD("HdmiAdapterBind: success."); return HDF_SUCCESS; @@ -371,47 +376,52 @@ The HDMI module adaptation involves the following steps: return ret; } ``` - - - **Init()** function - - **Input parameter**: - **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs configuration. - - **Return value**: + + - **Init** function + + **Input parameter**: + + **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information. + + **Return value**: + HDF_STATUS - - **Function description**: - + + **Function description**: + Implements the **HdmiAdapterInit** function. - + ```c static int32_t HdmiAdapterInit(struct HdfDeviceObject *obj) { return HDF_SUCCESS; } ``` - - - **Release()** function - - **Input parameter**: - **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs configuration. - - **Return value**: - – + + - **Release** function + + **Input parameter**: + + **HdfDeviceObject**, an interface parameter exposed by the driver, contains the .hcs information. + + **Return value**: + + No value is returned. + + **Function description**: + + Releases the memory and deletes the controller. This function assigns values to the **Release** callback in the driver entry structure. If the HDF fails to call the **Init** function to initialize the driver, the **Release** function can be called to release driver resources. - **Function description**: - Releases the memory and deletes the controller. This function assigns a value to the **Release()** API in the driver entry structure. If the HDF fails to call the **Init()** function to initialize the driver, the **Release()** function can be called to release driver resources. - ```c static void HdmiAdapterRelease(struct HdfDeviceObject *obj) { struct HdmiCntlr *cntlr = NULL; ... - cntlr = (struct MmcCntlr *)obj->service;// Forcibly convert HdfDeviceObject to HdmiCntlr by using service. For details about the value assignment, see the Bind() function. + cntlr = (struct MmcCntlr *)obj->service;// Forcibly convert HdfDeviceObject to HdmiCntlr by using service. For details about the value assignment, see the Bind function. ... - HimciDeleteHost((struct HimciAdapterHost *)cntlr->priv);// Memory release function customized by the vendor. A forced conversion from HdmiCntlr to HimciAdapterHost is involved in the process. + HimciDeleteHost((struct HimciAdapterHost *)cntlr->priv);// Customized memory release function. A forced conversion from HdmiCntlr to HimciAdapterHost is involved in the process. } ``` - > ![](../public_sys-resources/icon-note.gif) **NOTE**
- > All forced conversion operations for obtaining the corresponding object can be successful only when the **Init()** function has the corresponding value assignment operations. + > ![](../public_sys-resources/icon-note.gif) **NOTE**
+ > All forced conversion operations for obtaining the corresponding object can be successful only when the **Init** function has the corresponding value assignment operations. diff --git a/en/device-dev/driver/figures/HDMI_usage_flowchart.png b/en/device-dev/driver/figures/HDMI_usage_flowchart.png deleted file mode 100644 index b5832da900957cef38bf2c8785cc721f6671c7d6..0000000000000000000000000000000000000000 Binary files a/en/device-dev/driver/figures/HDMI_usage_flowchart.png and /dev/null differ diff --git a/en/device-dev/driver/figures/independent-service-mode.png b/en/device-dev/driver/figures/independent-service-mode.png index 18aa5b9a3eba056449451df1a947dbfc955ff2ba..6f62ffab6727cfc882bd87e256b01e6948bfb2b5 100644 Binary files a/en/device-dev/driver/figures/independent-service-mode.png and b/en/device-dev/driver/figures/independent-service-mode.png differ diff --git a/en/device-dev/driver/figures/service-free-mode.png b/en/device-dev/driver/figures/service-free-mode.png index 99ae0d286999397706fc4d6efa79ac6ba9651848..f92ab25701be209fbfb7472ffc04d97261597c72 100644 Binary files a/en/device-dev/driver/figures/service-free-mode.png and b/en/device-dev/driver/figures/service-free-mode.png differ diff --git a/en/device-dev/driver/figures/unified-service-mode.png b/en/device-dev/driver/figures/unified-service-mode.png index fc024f6e999c5e453e23392cb1163bc26f0669fc..478d733a1a9b4c0abf4477dbc71b047711cc0e9b 100644 Binary files a/en/device-dev/driver/figures/unified-service-mode.png and b/en/device-dev/driver/figures/unified-service-mode.png differ diff --git a/en/device-dev/driver/figures/using-HDMI-process.png b/en/device-dev/driver/figures/using-HDMI-process.png new file mode 100644 index 0000000000000000000000000000000000000000..61f106d3c61e210274ac842b03a663a06b55fc12 Binary files /dev/null and b/en/device-dev/driver/figures/using-HDMI-process.png differ diff --git a/en/device-dev/faqs/faqs-burning.md b/en/device-dev/faqs/faqs-burning.md index 80d948564f2c43db713774ff954070b2c1fa0720..ffb73e7a78f8e3d5bfea49fd63b82803eafb9d69 100644 --- a/en/device-dev/faqs/faqs-burning.md +++ b/en/device-dev/faqs/faqs-burning.md @@ -8,33 +8,33 @@ - **Symptom** -**Error: Opening COMxx: Access denied** is displayed after clicking **Burn** and selecting a serial port. - - **Figure 1** Failed to open the serial port - ![en-us_image_0000001243481961](figures/en-us_image_0000001243481961.png) + After I click **Burn** and select a serial port, **Error: Opening COMxx: Access denied** is displayed. + + **Figure 1** Access denied error + ![failed-to-open-the-serial-port](figures/failed-to-open-the-serial-port.png) - **Possible Causes** -The serial port is in use. - + The serial port is in use. + - **Solution** -1. Search for the terminal using serial-xx from the drop-down list in the **TERMINAL** panel. - + 1. Search for the terminal using serial-xx from the drop-down list in the **TERMINAL** panel. **Figure 2** Checking whether the serial port is in use + ![en-us_image_0000001243481989](figures/en-us_image_0000001243481989.png) - -2. Click the dustbin icon as shown below to disable the terminal using the serial port. - + + 2. Click the dustbin icon as shown below to disable the terminal using the serial port. + **Figure 3** Disabling the terminal using the serial port - + ![en-us_image_0000001243082093](figures/en-us_image_0000001243082093.png) -3. Click **Burn**, select the serial port, and start burning images again. - + 3. Click **Burn**, select the serial port, and start burning images again. + **Figure 4** Restarting the burning task - + ![en-us_image_0000001198322224](figures/en-us_image_0000001198322224.png) @@ -42,100 +42,98 @@ The serial port is in use. - **Symptom** -The burning status is not displayed after clicking **Burn** and selecting a serial port. - + The image failed to be burnt over a serial port. + - **Possible Causes** -The IDE is not restarted after the DevEco plug-in is installed. - + The DevEco Device Tool plug-in is not restarted after being installed. + - **Solution** - Restart the IDE. + Restart DevEco Device Tool. ### No Command Output Is Displayed - **Symptom** -The serial port shows that the connection has been established. After the board is restarted, nothing is displayed when you press **Enter**. - + The serial port shows that the connection has been established. After the board is restarted, nothing is displayed when I press **Enter**. + - **Possible Cause 1** -The serial port is connected incorrectly. - + The serial port is connected incorrectly. + - **Solution** -Change the serial port number. - -Start **Device Manager** to check whether the serial port connected to the board is the same as that connected to the terminal device. If the serial ports are different, perform step 1 in the **Running an Image** section to change the serial port number. - + Change the serial port number. + + Start **Device Manager** to check whether the serial port connected to the board is the same as that connected to the terminal device. If the serial ports are different, perform step 1 in the **Running an Image** section to change the serial port number. + - **Possible Cause 2** -The U-Boot of the board is damaged. - + The U-Boot of the board is damaged. + - **Solution** -Burn the U-Boot. - - If the fault persists after you perform the preceding operations, the U-Boot of the board may be damaged. You can burn the U-Boot by performing the following steps: + Burn the U-Boot. + + If the fault persists after you perform the preceding operations, the U-Boot of the board may be damaged. In this case, burn the U-Boot by performing the following steps: -1. Obtain the U-Boot file. - > ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE** - > The U-Boot file of the two boards can be obtained from the following paths, respectively. - > - > Hi3516D V300: **device\hisilicon\hispark_taurus\sdk_liteos\uboot\out\boot\u-boot-hi3516dv300.bin** - > - > Hi3518E V300: **device\hisilicon\hispark_aries\sdk_liteos\uboot\out\boot\u-boot-hi3518ev300.bin** + 1. Obtain the U-Boot file. + > ![icon-notice.gif](public_sys-resources/icon-notice.gif) **NOTICE** + > The U-Boot file of the two boards can be obtained from the following paths, respectively. + > + > Hi3516D V300: **device\hisilicon\hispark_taurus\sdk_liteos\uboot\out\boot\u-boot-hi3516dv300.bin** + > + > Hi3518E V300: **device\hisilicon\hispark_aries\sdk_liteos\uboot\out\boot\u-boot-hi3518ev300.bin** -2. Burn the U-Boot file by following the procedures for burning a U-Boot file over USB. - Select the U-Boot files of the corresponding development board for burning by referring to [Burning to Hi3516D V300](../quick-start/quickstart-ide-lite-steps-hi3516-burn.md). + 2. Burn the U-Boot file by following the procedures for burning a U-Boot file over USB. + Select the U-Boot files of the corresponding development board for burning by referring to [Burning to Hi3516D V300](../quick-start/quickstart-ide-lite-steps-hi3516-burn.md). -3. Log in to the serial port after the burning is complete. + 3. Log in to the serial port after the burning is complete. - **Figure 5** Information displayed through the serial port after the U-Boot file is burnt + **Figure 5** Information displayed through the serial port after the U-Boot file is burnt - ![en-us_image_0000001243484907](figures/en-us_image_0000001243484907.png) + ![en-us_image_0000001243484907](figures/en-us_image_0000001243484907.png) ### Windows-based PC Failed to Be Connected to the Board - **Symptom** -The file image cannot be obtained after clicking **Burn** and selecting a serial port. - - **Figure 6** Failed to obtain the file image due to network disconnection - + + The file image cannot be obtained after clicking **Burn** and selecting a serial port. + + **Figure 6** Failed to obtain the file image due to network disconnection + ![en-us_image_0000001198322428](figures/en-us_image_0000001198322428.png) - + - **Possible Causes** -The board is disconnected from the Windows-based PC. - -Windows Firewall does not allow Visual Studio Code to access the network. - -- **Solution** - 1. Check whether the network cable is properly connected. - 2. Click **Windows Firewall**. + The board is disconnected from the Windows-based PC. -**Figure 7** Setting the firewall + Windows Firewall does not allow Visual Studio Code to access the network. -![en-us_image_0000001198162584](figures/en-us_image_0000001198162584.png) +- **Solution** -3. Click **Firewall & network protection**, and on the displayed page, click **Allow an app through the firewall**. + 1. Check whether the network cable is properly connected. + 2. Click **Windows Firewall**. -**Figure 8** Firewall & network protection + **Figure 7** Setting the firewall + ![en-us_image_0000001198162584](figures/en-us_image_0000001198162584.png) -![en-us_image_0000001198323146](figures/en-us_image_0000001198323146.png) + 3. Click **Firewall & network protection**. On the displayed page, click **Allow an app through the firewall**. -4. Select Visual Studio Code. + **Figure 8** Firewall & network protection + ![en-us_image_0000001198323146](figures/en-us_image_0000001198323146.png) -**Figure 9** Selecting Visual Studio Code - -![en-us_image_0000001198003232](figures/en-us_image_0000001198003232.png) + 4. Select Visual Studio Code. -5. Select the **Private** and **Public** network access rights for Visual Studio Code. + **Figure 9** Selecting Visual Studio Code + ![en-us_image_0000001198003232](figures/en-us_image_0000001198003232.png) -**Figure 10** Allowing Visual Studio Code to access the network + 5. Select the **Private** and **Public** network access rights for Visual Studio Code. -![en-us_image_0000001243084579](figures/en-us_image_0000001243084579.png) \ No newline at end of file + **Figure 10** Allowing Visual Studio Code to access the network + ![en-us_image_0000001243084579](figures/en-us_image_0000001243084579.png) \ No newline at end of file diff --git a/en/device-dev/quick-start/quickstart-ide-lite-sourcecode-acquire.md b/en/device-dev/quick-start/quickstart-ide-lite-sourcecode-acquire.md index f3fa19d7af0f3a2bec21a1dcf1116d5b005c4982..32fcdc946a307400c48ce0ac2000e6720c84ef8c 100644 --- a/en/device-dev/quick-start/quickstart-ide-lite-sourcecode-acquire.md +++ b/en/device-dev/quick-start/quickstart-ide-lite-sourcecode-acquire.md @@ -19,13 +19,13 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ``` Run the following command to install the tools: - + ``` sudo apt-get install git git-lfs ``` 4. Configure user information. - + ``` git config --global user.name "yourname" git config --global user.email "your-email-address" @@ -33,7 +33,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ``` 5. Run the following commands to install the **repo** tool: - + ``` curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 -o /usr/local/bin/repo # If you do not have the access permission to this directory, download the tool to any other accessible directory and configure the directory to the environment variable. chmod a+x /usr/local/bin/repo @@ -41,7 +41,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ``` -## Obtaining Source Code +## Procedure > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities. @@ -58,7 +58,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony Method 2: Use the **repo** tool to download the source code over HTTPS. - + ``` repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify repo sync -c @@ -72,8 +72,8 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ## Running prebuilts - Go to the root directory of the source code and run the following script to install the compiler and binary tool: - +Go to the root directory of the source code and run the following script to install the compiler and binary tool: + ``` bash build/prebuilts_download.sh ``` diff --git a/en/device-dev/quick-start/quickstart-ide-standard-sourcecode-acquire.md b/en/device-dev/quick-start/quickstart-ide-standard-sourcecode-acquire.md index c84614b09578234a33cbec7223e1f88e93abbb77..6e0f345c7b9d5749b296c8be584db6ad5e0c68a4 100644 --- a/en/device-dev/quick-start/quickstart-ide-standard-sourcecode-acquire.md +++ b/en/device-dev/quick-start/quickstart-ide-standard-sourcecode-acquire.md @@ -4,7 +4,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony source code: -## Before You Start +## Preparations 1. Register your account with Gitee. @@ -41,7 +41,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ``` -## Obtaining Source Code +## Procedure > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities. diff --git a/en/device-dev/quick-start/quickstart-lite-env-setup.md b/en/device-dev/quick-start/quickstart-lite-env-setup.md index 894e3d8b8fb99afcfd005fa232c0945b0e990315..e3e2272b3d6bf18186391a56c0c14dd35f3a4fa2 100644 --- a/en/device-dev/quick-start/quickstart-lite-env-setup.md +++ b/en/device-dev/quick-start/quickstart-lite-env-setup.md @@ -278,7 +278,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ``` -### Obtaining Source Code +### Procedure > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities. @@ -309,7 +309,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ### Running prebuilts - Go to the root directory of the source code and run the following script to install the compiler and binary tool: +Go to the root directory of the source code and run the following script to install the compiler and binary tool: ``` bash build/prebuilts_download.sh diff --git a/en/device-dev/quick-start/quickstart-standard-env-setup.md b/en/device-dev/quick-start/quickstart-standard-env-setup.md index 9b55be45cee8bab38bcc23b23558f9b8d3806c16..e815cd2617071cf655bd573407f803999ccd9276 100644 --- a/en/device-dev/quick-start/quickstart-standard-env-setup.md +++ b/en/device-dev/quick-start/quickstart-standard-env-setup.md @@ -267,7 +267,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ``` -### Obtaining Source Code +### Procedure > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
> Download the master code if you want to get quick access to the latest features for your development. Download the release code, which is more stable, if you want to develop commercial functionalities. @@ -298,7 +298,7 @@ In the Ubuntu environment, perform the following steps to obtain the OpenHarmony ### Running prebuilts - Go to the root directory of the source code and run the following script to install the compiler and binary tool: +Go to the root directory of the source code and run the following script to install the compiler and binary tool: ``` bash build/prebuilts_download.sh diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-listening.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-listening.md index 203f131c7baff6d80e226a96ba35db3e28f34ccb..ca5cdeb43229fda462a6b498d19563fcff88eaa7 100644 --- a/en/device-dev/subsystems/subsys-dfx-hisysevent-listening.md +++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-listening.md @@ -18,8 +18,8 @@ Before subscribing to system events, you need to configure HiSysEvent logging. F | Name| Description | | -------- | --------- | -|bool HiSysEventManager::AddEventListener(std::shared_ptr<HiSysEventSubscribeCallBack> listener, std::vector<ListenerRule>& rules)|Registers a listener for system events. You can listen for certain events by specifying rules.

Input arguments:
  • **listener**: callback object for system events.
  • **rules**: rules for event listening.
Return value:
  • **0**: Repeated registration is successful.
  • **1**: Initial registration is successful.
  • Other values: Registration has failed.
| -|bool HiSysEventManager::RemoveListener(std::shared_ptr<HiSysEventSubscribeCallBack> listener)|Removes the listener for system events.

Input arguments:
  • **listener**: callback object for system events.
Return value:
None.| +|int32_t HiSysEventManager::AddEventListener(std::shared_ptr<HiSysEventSubscribeCallBack> listener, std::vector<ListenerRule>& rules)|Registers a listener for system events. You can listen for certain events by specifying rules.

Input arguments:
  • **listener**: callback object for system events.
  • **rules**: rules for event listening.
Return value:
  • **0**: registration is successful.
  • Other values: Registration has failed.
| +|int32_t HiSysEventManager::RemoveListener(std::shared_ptr<HiSysEventSubscribeCallBack> listener)|Removes the listener for system events.

Input arguments:
  • **listener**: callback object for system events.
Return value:
  • **0**: Cancel registration is successful.
  • Other values: Cancel registration has failed.
| **Table 2** Description of ListenerRule diff --git a/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md b/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md index d743a8fbda8832246e7098bb2f2d7b0177d61eda..f9ffdfd5983a14da9a8c2b834869fd70a501d666 100644 --- a/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md +++ b/en/device-dev/subsystems/subsys-dfx-hisysevent-query.md @@ -12,7 +12,7 @@ HiSysEvent provides an API for you to query system events. You can query concern | Name| Description | | -------- | --------- | -| bool HiSysEventManager::QueryHiSysEvent(struct QueryArg& queryArg, std::vector<QueryRule>& queryRules, std::shared_ptr<HiSysEventQueryCallBack> queryCallBack) | Queries system events by specifying search criteria such as the time segment, event domain, and event name.

Input arguments:
  • **queryArg**: event query parameter.
  • **queryRules**: event filtering rules.
  • **queryRules**: callback object for query results.
Return value:
  • **true**: The query is successful.
  • **false**: The query has failed.
| +| int32_t HiSysEventManager::QueryHiSysEvent(struct QueryArg& queryArg, std::vector<QueryRule>& queryRules, std::shared_ptr<HiSysEventQueryCallBack> queryCallBack) | Queries system events by specifying search criteria such as the time segment, event domain, and event name.

Input arguments:
  • **queryArg**: event query parameter.
  • **queryRules**: event filtering rules.
  • **queryRules**: callback object for query results.
Return value:
  • **0**: The query is successful.
  • Other values: The query has failed.
| **Table 2** Description of QueryArg diff --git a/en/readme/startup.md b/en/readme/startup.md index 98c67077d5c1b8cf4d0a59e61492ab90b50c068a..4d1d1780815533373ea44576ea746c119625d80d 100644 --- a/en/readme/startup.md +++ b/en/readme/startup.md @@ -2,32 +2,32 @@ ## Introduction -The Startup subsystem provides the functions of starting key system processes and services after the kernel is started and before applications are started, and restoring the system to factory settings. The subsystem consists of the following modules: +The startup subsystem is responsible for starting key system processes and services after the kernel is started and before applications are started. The subsystem consists of the following modules: -- init\_lite +- init - This module can be used on the Hi3516D V300 and Hi3518E V300 platforms powered by LiteOS Cortex-A. + This module can be used on platforms powered by LiteOS Cortex-A or Linux kernel. - It starts system service processes from the time the kernel loads the first user-space process to the time the first application is started. In addition to loading key system processes, the module needs to configure their permissions during the startup and keep the specified process alive after sub-processes are started. If a process exits abnormally, the module needs to restart it, and to perform system reset for a special process. + The module starts system service processes from the time the kernel loads the first user-space process to the time the first application is started. In addition to loading key system processes, it needs to configure their permissions during the startup and keep the specified process alive after sub-processes are started. If a key process exits abnormally, the module needs to perform a system restart. For details, see [init Module](../device-dev/subsystems/subsys-boot-init.md). -- appspawn\_lite +- appspawn - This module can be used on the Hi3516D V300 and Hi3518E V300 platforms powered by LiteOS Cortex-A. + This module comes with the Lite and Standard editions. The Lite edition can be used on platforms powered by the LiteOS-A kernel, and the Standard edition can be used on platforms powered by the Linux kernel. - This module spawns application processes upon receiving commands from the application framework, configures permissions for new processes, and calls the entry function of the application framework. + The module spawns application processes upon receiving commands from the application framework, configures permissions for new processes, and calls the entry function of the application framework. -- bootstrap\_lite +- bootstrap - This module can be used on the Hi3861 platform powered by LiteOS Cortex-M. + This module can be used on platforms powered by the LiteOS Cortex-M kernel. - This module provides entry identifiers for starting services and features. When Samgr starts, it will call the entry function identified by bootstrap\_lite and start system services. + The module provides entry identifiers for starting services and features. When SAMGR is started, the entry function identified by **bootstrap** is invoked and system services are started. -- syspara\_lite +- syspara This module obtains and sets system attributes. - It can be used on the Hi3861, Hi3516D V300, and Hi3518E V300 platforms powered by LiteOS Cortex-M and LiteOS Cortex-A. Supported system attributes consist of default, OEM-specified, and custom system attributes. OEM-specified system attributes provide only default values. The specific values need to be adjusted as required. For details, see [Usage Guidelines](#section8533192617117). + The module can be used on all platforms. Supported system attributes consist of default, OEM-specified, and custom system attributes. OEM-specified system attributes provide only default values. The specific values need to be adjusted as required. For details, see [syspara Module](../device-dev/subsystems/subsys-boot-syspara.md). ## Directory Structure @@ -35,6 +35,7 @@ The Startup subsystem provides the functions of starting key system processes an **Table 1** Directory structure of the source code for the startup subsystem + - + + + + - - - - - + - - +

Directory

Description

@@ -45,62 +46,64 @@ The Startup subsystem provides the functions of starting key system processes an

base/startup/appspawn_lite

appspawn_lite module for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them.

+

appspawn module of the Lite edition for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them.

+
Platforms using the LiteOS Cortex-A kernel +

base/startup/appspawn_standard

+

appspawn module of the Standard version for spawning application processes. It receives Ability Manager Service (AMS) messages via IPC, parses the messages, starts application processes based on the parsing result, and grants permissions to them.

Hi3516D V300

-

Hi3518E V300

+
Platforms using the Linux kernel

base/startup/bootstrap_lite

bootstrap_lite module for starting all services except core system services.

+

bootstrap module for starting all services except core system services.

Hi3861

+
Platforms using the LiteOS Cortex-M kernel

base/startup/init_lite

init_lite module for implementing the init process, which is the first user-space process loaded after the kernel is initialized. Upon startup, the process parses the configuration file in /etc/init.cfg. Based on the parsing result, the process then starts other key system processes and grants required permissions to them.

-

Hi3516D V300

-

Hi3518E V300

+

init_lite module for implementing the init process, which is the first user-space process loaded after the kernel is initialized. Upon startup, the process parses the configuration file in **/etc/init.cfg**. Based on the parsing result, the process then starts other key system processes and grants required permissions to them.

Platforms using the LiteOS Cortex-A or Linux kernel

base/startup/syspara_lite

syspara_lite module that provides APIs to obtain device information, including the product name, brand name, category name, and manufacturer name.

-

Hi3861

-

Hi3516D V300

-

Hi3518E V300

+

syspara module that provides APIs to obtain device information, including the product name, brand name, category name, and manufacturer name.

All platforms
+ ``` base/startup/ -├── appspawn_standard # appspawn_lite module for the standard system +├── appspawn_standard # appspawn module for the standard system │ ├── include # Header files │ ├── parameter # System parameters │ ├── src # Source files │ └── test # Test cases -├── appspawn_lite # appspawn_lite module for the mini system +├── appspawn_lite # appspawn module for the mini system │ └── services │ ├── include # Header files │ ├── src # Source files │ └── test # Test cases -├── bootstrap_lite # bootstrap_lite module +├── bootstrap_lite # bootstrap module │ └── services │ └── source # Source files -├── init_lite # init_lite module +├── init_lite # init module │ ├── initsync # Source files │ ├── interfaces # External APIs │ └── services │ ├── include # Header files │ ├── src # Source files │ └── test # Test cases -└── syspara_lite # syspara_lite module +└── syspara_lite # syspara module ├── adapter # Adaptation code ├── frameworks # Source files ├── hals # Header files for the hardware abstraction layer (HAL) @@ -108,191 +111,16 @@ base/startup/ └── simulator # Simulator adaptation ``` -## Constraints - -OEM-specified system attributes provide only default values. The specific values need to be adjusted as required. - -## Usage Guidelines - -- Configuration file of the init\_lite module - - The configuration file **init.cfg** of the init\_lite module contains service names, executable file paths, permissions, and other attributes of all key system services that need to be started by the init process. The file is stored in **/vendor/hisilicon/hispark\_aries/init\_configs/** under **/etc/**. It is in JSON format, and its size cannot exceed 100 KB. - - After the init process starts, it reads the **/etc/init.cfg** file, parses the JSON content, and loads system services in sequence based on the parsing result. The format and content of the configuration file are described as follows: - - -``` -{ - "jobs" : [{ - "name" : "pre-init", -------- Job executed before the initialization. It can be used to store some operations (for example, creating a directory) performed before the init process is started. - "cmds" : [ -------- Commands supported by the current job. Currently, only start, mkdir, chmod, chown, and mount are currently supported. - -------- The command name and the parameters (128 bytes or less) must be separated by only one space. - "mkdir /testdir", -------- Command for creating a directory. mkdir and the target directory must be separated by only one space. - "chmod 0700 /testdir", -------- Command for modifying the permission. chmod, permission, and the target directory must be separated by only one space. The permission must be in the 0xxx format. - "chown 99 99 /testdir",-------- Command for modifying the owner group. chown, UID, GID, and the target directory must be separated by only one space. - "mkdir /testdir2", - "mount vfat /dev/mmcblk0p0 /testdir2 noexec nosuid" -------- mount command in the following format: mount file system type source target flags data - -------- Supported flags include only nodev, noexec, nosuid, and rdonly, which are separated by a space. - ] - }, { - "name" : "init", -------- Job name, which currently supports only pre-init, init, and post-init. - "cmds" : [ -------- A single job currently supports a maximum of 30 commands. - "start service1", -------- Service startup command 1. - "start service2" -------- Service startup command 2. The sequence of the commands in the array can be adjusted as required. The init process then executes the commands in the same sequence as they are parsed. - ] - }, { - "name" : "post-init", -------- Job executed after the initialization. It can be used to store some operations performed after the init process is started. - "cmds" : [] - } - ], - "services" : [{ -------- Service set (in an array), including all system services that need to be started by the init process. Currently, a maximum of 100 services are supported. - "name" : "service1", -------- Name of the current service. A maximum of 32 bytes must be specified for the name. - "path" : "/bin/process1" -------- Full path of the executable file of the current service. A maximum of 64 bytes must be specified for the path. - "uid" : 1, -------- UID of the current service process. - "gid" : 1, -------- GID of the current service process. - "once" : 0, -------- Whether the current service process is a one-off process. - 0 --- The current service process is not a one-off process. If the process exits for a certain reason, the init_lite module restarts the service process upon receiving the SIGCHLD signal. - non-0 --- The current service process is a one-off process. If the process exits for a certain reason, the init_lite module does not restart the service process. - "importance" : 1, -------- Whether the current service process is a key system process - 0 --- The current service process is not a key system process. If the process exits due to any reason, the init_lite module does not reset the system. - non-0 --- The current service process is a key system process. If the process exits due to any reason, the init_lite module resets and restarts the system upon receiving the SIGCHLD signal. - "caps" : [0, 1, 2, 5] -------- Capabilities required by the current service. They are determined by the capabilities supported by the security subsystem and configured in accordance with the principle of least permission. (Currently, a maximum of 100 values can be configured.) - }, { - "name" : "service2", -------- Next service that needs to be started by the init_lite module. The service sequence is irrelevant to the startup sequence, which is determined by the command sequence in the previous job. - "path" : "/bin/process2", - "uid" : 2, - "gid" : 2, - "once" : 1, - "importance" : 0, - "caps" : [ ] - } - ] -} -``` - -**Table 2** Supported commands - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Name

-

Syntax

-

Description

-

start

-

start ServiceName (Only one space is allowed.)

-

Starts a service. The service name must be the same as that in the services array in the file.

-

mkdir

-

mkdir /xxxx/xxx (Only one space is allowed.)

-

Creates a directory.

-

chmod

-

chmod 0xxx /xxx/xx (Only one space is allowed.)

-

Changes the permission. The permission value must be in 0xxx format, for example, 0755 or 0600. This configuration must comply with the principle of least permission.

-

chown

-

chown uid gid /xxx/xx (Only one space is allowed.)

-

Changes the owner group.

-

mount

-

mount fileSysType source target flags data (Only one space is allowed.)

-

Mounts data. Currently, flags can only be nodev, noexec, nosuid, or rdonly, and other strings are considered as data.

-
- -It is worth noting that the modified **init.cfg** file must be in JSON format. Otherwise, the init process fails to parse the file, and no service will be started. The configured service permission **uid/gid/capability** must meet the requirements imposed by the security subsystem and comply with the principle of least permission. In addition, if the values of **once** and **importance** of a service are both **0** and the service exits for more than four consecutive times within four minutes, the init process will stop restarting the service. - -- System parameters - - OEM-specific system attributes - - For Hi3516D V300 and Hi3518E V300 development boards, you need to modify the source files in the **vendor/hisilicon/hispark\_aries/hals/utils/sys\_param** directory. - - ``` - static const char HOS_PRODUCT_TYPE[] = {"****"}; - static const char HOS_MANUFACTURE[] = {"****"}; - static const char HOS_BRAND[] = {"****"}; - static const char HOS_MARKET_NAME[] = {"****"}; - static const char HOS_PRODUCT_SERIES[] = {"****"}; - static const char HOS_PRODUCT_MODEL[] = {"****"}; - static const char HOS_SOFTWARE_MODEL[] = {"****"}; - static const char HOS_HARDWARE_MODEL[] = {"****"}; - static const char HOS_HARDWARE_PROFILE[] = {"aout:true,display:true"}; - static const char HOS_BOOTLOADER_VERSION[] = {"bootloader"}; - static const char HOS_SECURE_PATCH_LEVEL[] = {"2020-6-5"}; - static const char HOS_ABI_LIST[] = {"****"}; - ``` - - For Hi3861 development boards, you need to modify the source files in the **vendor/hisilicon/hispark\_pegasus/hals/utils/sys\_param** directory. - - ``` - static const char HOS_PRODUCT_TYPE[] = {"****"}; - static const char HOS_MANUFACTURE[] = {"****"}; - static const char HOS_BRAND[] = {"****"}; - static const char HOS_MARKET_NAME[] = {"****"}; - static const char HOS_PRODUCT_SERIES[] = {"****"}; - static const char HOS_PRODUCT_MODEL[] = {"****"}; - static const char HOS_SOFTWARE_MODEL[] = {"****"}; - static const char HOS_HARDWARE_MODEL[] = {"****"}; - static const char HOS_HARDWARE_PROFILE[] = {"aout:true,display:true"}; - static const char HOS_BOOTLOADER_VERSION[] = {"bootloader"}; - static const char HOS_SECURE_PATCH_LEVEL[] = {"2020-6-5"}; - static const char HOS_ABI_LIST[] = {"****"}; - ``` - - - Obtaining default system attributes - - ``` - const char* value1 = GetProductType(); - printf("Product type =%s\n", value1); - const char* value2 = GetManufacture(); - printf("Manufacture =%s\n", value2); - const char* value3 = GetBrand(); - printf("GetBrand =%s\n", value3); - ``` - - - - Obtaining custom system attributes - - ``` - const char* defSysParam = "data of sys param ***..."; - char key[] = "rw.parameter.key"; - char value[] = "OEM-hisi-10.1.0"; - int ret = SetParameter(key, value); - char valueGet[128] = {0}; - ret = GetParameter(key, defSysParam, valueGet, 128); - printf("value = %s\n", valueGet); - ``` - - - ## Repositories Involved -Startup subsystem +[Startup subsystem](../device-dev/subsystems/subsys-boot-overview.md) -[startup\_init\_lite](https://gitee.com/openharmony/startup_init_lite) +[startup\_appspawn\_lite](https://gitee.com/openharmony/startup_appspawn_lite) -[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite) +[startup\_appspawn](https://gitee.com/openharmony/startup_appspawn) [startup\_bootstrap\_lite](https://gitee.com/openharmony/startup_bootstrap_lite) -[startup\_appspawn\_lite](https://gitee.com/openharmony/startup_appspawn_lite) +[startup_init_lite](https://gitee.com/openharmony/startup_init_lite) +[startup\_syspara\_lite](https://gitee.com/openharmony/startup_syspara_lite) diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-ability.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..f372d5bd1b804eb02486f1d880a684cf55e0691e --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-ability.md @@ -0,0 +1,186 @@ +# JS API Changes of the Ability Framework + +The table below lists the APIs changes of the ability framework in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| AbilityContext | AbilityContext | restoreWindowStage(localStorage: LocalStorage) : void; | Added| +| AbilityContext | AbilityContext | requestPermissionsFromUser(permissions: Array\, requestCallback: AsyncCallback\) : void;
requestPermissionsFromUser(permissions: Array\) : Promise\; | Added| +| AbilityContext | AbilityContext | setMissionIcon(icon: image.PixelMap, callback:AsyncCallback\): void;
setMissionIcon(icon: image.PixelMap): Promise\; | Added| +| AbilityContext | AbilityContext | setMissionLabel(label: string, callback:AsyncCallback\): void;
setMissionLabel(label: string): Promise\; | Added| +| AbilityContext | AbilityContext | disconnectAbility(connection: number, callback:AsyncCallback\): void;
disconnectAbility(connection: number): Promise\; | Added| +| AbilityContext | AbilityContext | connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; | Added| +| AbilityContext | AbilityContext | connectAbility(want: Want, options: ConnectOptions): number; | Added| +| AbilityContext | AbilityContext | terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\): void;
terminateSelfWithResult(parameter: AbilityResult): Promise\; | Added| +| AbilityContext | AbilityContext | terminateSelf(callback: AsyncCallback\): void;
terminateSelf(): Promise\; | Added| +| AbilityContext | AbilityContext | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void;
startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; | Added| +| AbilityContext | AbilityContext | startAbilityForResult(want: Want, callback: AsyncCallback\): void;
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback\): void;
startAbilityForResult(want: Want, options?: StartOptions): Promise\; | Added| +| AbilityContext | AbilityContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; | Added| +| AbilityContext | AbilityContext | startAbilityByCall(want: Want): Promise\; | Added| +| AbilityContext | AbilityContext | startAbility(want: Want, callback: AsyncCallback\): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback\): void;
startAbility(want: Want, options?: StartOptions): Promise\; | Added| +| AbilityContext | AbilityContext | config: Configuration; | Added| +| AbilityContext | AbilityContext | currentHapModuleInfo: HapModuleInfo; | Added| +| AbilityContext | AbilityContext | abilityInfo: AbilityInfo; | Added| +| abilityDelegator | AbilityDelegator | doAbilityBackground(ability: Ability, callback: AsyncCallback\): void;
doAbilityBackground(ability: Ability): Promise\; | Added| +| abilityDelegator | AbilityDelegator | doAbilityForeground(ability: Ability, callback: AsyncCallback\): void;
doAbilityForeground(ability: Ability): Promise\; | Added| +| abilityDelegator | AbilityDelegator | startAbility(want: Want, callback: AsyncCallback\): void;
startAbility(want: Want): Promise\; | Added| +| abilityDelegator | AbilityDelegator | getCurrentTopAbility(callback: AsyncCallback\): void;
getCurrentTopAbility(): Promise\ | Added| +| abilityDelegator | AbilityDelegator | getAbilityState(ability: Ability): number; | Added| +| abilityDelegator | AbilityDelegator | getAppContext(): Context; | Added| +| abilityDelegator | AbilityDelegator | waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void;
waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback\): void;
waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise\; | Added| +| abilityDelegator | AbilityDelegator | removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void;
removeAbilityMonitor(monitor: AbilityMonitor): Promise\; | Added| +| abilityDelegator | AbilityDelegator | addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void;
addAbilityMonitor(monitor: AbilityMonitor): Promise\; | Added| +| abilityMonitor | AbilityMonitor | onWindowStageDestroy?:(data: Ability) => void; | Added| +| abilityMonitor | AbilityMonitor | onWindowStageRestore?:(data: Ability) => void; | Added| +| abilityMonitor | AbilityMonitor | onWindowStageCreate?:(data: Ability) => void; | Added| +| abilityMonitor | AbilityMonitor | onAbilityDestroy?:(data: Ability) => void; | Added| +| abilityMonitor | AbilityMonitor | onAbilityBackground?:(data: Ability) => void; | Added| +| abilityMonitor | AbilityMonitor | onAbilityForeground?:(data: Ability) => void; | Added| +| abilityMonitor | AbilityMonitor | onAbilityCreate?:(data: Ability) => void; | Added| +| abilityMonitor | AbilityMonitor | abilityName: string; | Added| +| AbilityStageContext | AbilityStageContext | config: Configuration; | Added| +| AbilityStageContext | AbilityStageContext | currentHapModuleInfo: HapModuleInfo; | Added| +| AbilityStateData | AbilityStateData | moduleName: string; | Added| +| ApplicationContext | ApplicationContext | unregisterAbilityLifecycleCallback(callbackId: number, callback: AsyncCallback\): void;
unregisterAbilityLifecycleCallback(callbackId: number): Promise\; | Added| +| ApplicationContext | ApplicationContext | registerAbilityLifecycleCallback(callback: AbilityLifecycleCallback): number; | Added| +| context | AreaMode | EL2 = 1 | Added| +| context | AreaMode | EL1 = 0 | Added| +| context | Context | createBundleContext(bundleName: string): Context; | Added| +| context | Context | area: AreaMode; | Added| +| context | Context | eventHub: EventHub; | Added| +| context | Context | distributedFilesDir: string; | Added| +| context | Context | bundleCodeDir : string; | Added| +| context | Context | preferencesDir : string; | Added| +| context | Context | databaseDir : string; | Added| +| context | Context | filesDir : string; | Added| +| context | Context | tempDir: string; | Added| +| context | Context | cacheDir: string; | Added| +| context | Context | applicationInfo: ApplicationInfo; | Added| +| context | Context | resourceManager: resmgr.ResourceManager; | Added| +| EventHub | EventHub | emit(event: string, ...args: Object[]): void | Added| +| EventHub | EventHub | off(event: string, callback?: Function): void | Added| +| EventHub | EventHub | on(event: string, callback: Function): void | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly writePermission: string; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly readPermission: string; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly enabled: boolean; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly metadata: Array\; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly applicationInfo: ApplicationInfo; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly permissions: Array\; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly extensionAbilityType: bundle.ExtensionAbilityType; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly isVisible: boolean; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly iconId: number; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly descriptionId: number; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly labelId: number; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly name: string; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly moduleName: string; | Added| +| extensionAbilityInfo | ExtensionAbilityInfo | readonly bundleName: string; | Added| +| ExtensionContext | ExtensionContext | config: Configuration; | Added| +| ExtensionContext | ExtensionContext | currentHapModuleInfo: HapModuleInfo; | Added| +| ExtensionRunningInfo | ExtensionRunningInfo | type: bundle.ExtensionAbilityType; | Added| +| ExtensionRunningInfo | ExtensionRunningInfo | clientPackage: Array\; | Added| +| ExtensionRunningInfo | ExtensionRunningInfo | startTime: number; | Added| +| ExtensionRunningInfo | ExtensionRunningInfo | processName: string; | Added| +| ExtensionRunningInfo | ExtensionRunningInfo | uid: number; | Added| +| ExtensionRunningInfo | ExtensionRunningInfo | pid: number; | Added| +| ExtensionRunningInfo | ExtensionRunningInfo | extension: ElementName; | Added| +| FormExtensionContext | FormExtensionContext | updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback\): void;
updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise\; | Added| +| MissionListener | MissionListener | onMissionIconUpdated(mission: number, icon: image.PixelMap): void; | Added| +| ohos.application.Ability | Ability | dump(params: Array\): Array\; | Added| +| ohos.application.Ability | Ability | onConfigurationUpdated(config: Configuration): void; | Added| +| ohos.application.Ability | Ability | onNewWant(want: Want): void; | Added| +| ohos.application.Ability | Ability | onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult; | Added| +| ohos.application.Ability | Ability | onBackground(): void; | Added| +| ohos.application.Ability | Ability | onForeground(): void; | Added| +| ohos.application.Ability | Ability | onDestroy(): void; | Added| +| ohos.application.Ability | Ability | onWindowStageRestore(windowStage: window.WindowStage): void; | Added| +| ohos.application.Ability | Ability | onWindowStageDestroy(): void; | Added| +| ohos.application.Ability | Ability | onWindowStageCreate(windowStage: window.WindowStage): void; | Added| +| ohos.application.Ability | Ability | onCreate(want: Want, param: AbilityConstant.LaunchParam): void; | Added| +| ohos.application.Ability | Ability | callee: Callee; | Added| +| ohos.application.Ability | Ability | lastRequestWant: Want; | Added| +| ohos.application.Ability | Ability | launchWant: Want; | Added| +| ohos.application.Ability | Ability | context: AbilityContext; | Added| +| ohos.application.Ability | Callee | off(method: string): void; | Added| +| ohos.application.Ability | Callee | on(method: string, callback: CaleeCallBack): void; | Added| +| ohos.application.Ability | Caller | onRelease(callback: OnReleaseCallBack): void; | Added| +| ohos.application.Ability | Caller | release(): void; | Added| +| ohos.application.Ability | Caller | callWithResult(method: string, data: rpc.Sequenceable): Promise; | Added| +| ohos.application.Ability | Caller | call(method: string, data: rpc.Sequenceable): Promise\; | Added| +| ohos.application.Ability | CaleeCallBack | (indata: rpc.MessageParcel): rpc.Sequenceable; | Added| +| ohos.application.Ability | OnReleaseCallBack | (msg: string): void; | Added| +| ohos.application.AbilityConstant | OnContinueResult | MISMATCH = 2 | Added| +| ohos.application.AbilityConstant | OnContinueResult | REJECT = 1 | Added| +| ohos.application.AbilityConstant | OnContinueResult | AGREE = 0 | Added| +| ohos.application.AbilityConstant | LastExitReason | NORMAL = 2 | Added| +| ohos.application.AbilityConstant | LastExitReason | ABILITY_NOT_RESPONDING = 1 | Added| +| ohos.application.AbilityConstant | LastExitReason | UNKNOWN = 0 | Added| +| ohos.application.AbilityConstant | LaunchReason | CONTINUATION = 3 | Added| +| ohos.application.AbilityConstant | LaunchReason | CALL = 2 | Added| +| ohos.application.AbilityConstant | LaunchReason | START_ABILITY = 1 | Added| +| ohos.application.AbilityConstant | LaunchReason | UNKNOWN = 0 | Added| +| ohos.application.AbilityConstant | LaunchParam | lastExitReason: LastExitReason; | Added| +| ohos.application.AbilityConstant | LaunchParam | launchReason: LaunchReason; | Added| +| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityContinue(ability: Ability): void; | Added| +| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityBackground(ability: Ability): void; | Added| +| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityForeground(ability: Ability): void; | Added| +| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityDestroy(ability: Ability): void; | Added| +| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityWindowStageDestroy(ability: Ability): void; | Added| +| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityWindowStageCreate(ability: Ability): void; | Added| +| ohos.application.AbilityLifecycleCallback | AbilityLifecycleCallback | onAbilityCreate(ability: Ability): void; | Added| +| ohos.application.abilityManager | abilityManager | function getTopAbility(): Promise\;
function getTopAbility(callback: AsyncCallback\): void; | Added| +| ohos.application.abilityManager | abilityManager | function getExtensionRunningInfos(upperLimit: number): Promise\>;
function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\>): void; | Added| +| ohos.application.AbilityStage | AbilityStage | onConfigurationUpdated(config: Configuration): void; | Added| +| ohos.application.AbilityStage | AbilityStage | onAcceptWant(want: Want): string; | Added| +| ohos.application.AbilityStage | AbilityStage | onCreate(): void; | Added| +| ohos.application.AbilityStage | AbilityStage | context: AbilityStageContext; | Added| +| ohos.application.Configuration | Configuration | displayId?: number; | Added| +| ohos.application.Configuration | Configuration | screenDensity?: ConfigurationConstant.ScreenDensity; | Added| +| ohos.application.Configuration | Configuration | direction?: ConfigurationConstant.Direction; | Added| +| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_XXXLDPI = 640 | Added| +| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_XXLDPI = 480 | Added| +| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_XLDPI = 320 | Added| +| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_LDPI = 240 | Added| +| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_MDPI = 160 | Added| +| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_SDPI = 120 | Added| +| ohos.application.ConfigurationConstant | ScreenDensity | SCREEN_DENSITY_NOT_SET = 0 | Added| +| ohos.application.ConfigurationConstant | Direction | DIRECTION_HORIZONTAL = 1 | Added| +| ohos.application.ConfigurationConstant | Direction | DIRECTION_VERTICAL = 0 | Added| +| ohos.application.ConfigurationConstant | Direction | DIRECTION_NOT_SET = -1 | Added| +| ohos.application.FormExtension | FormExtension | onAcquireFormState?(want: Want): formInfo.FormState; | Added| +| ohos.application.FormExtension | FormExtension | onConfigurationUpdated(config: Configuration): void; | Added| +| ohos.application.FormExtension | FormExtension | onDestroy(formId: string): void; | Added| +| ohos.application.FormExtension | FormExtension | onEvent(formId: string, message: string): void; | Added| +| ohos.application.FormExtension | FormExtension | onVisibilityChange(newStatus: { [key: string]: number }): void; | Added| +| ohos.application.FormExtension | FormExtension | onUpdate(formId: string): void; | Added| +| ohos.application.FormExtension | FormExtension | onCastToNormal(formId: string): void; | Added| +| ohos.application.FormExtension | FormExtension | onCreate(want: Want): formBindingData.FormBindingData; | Added| +| ohos.application.FormExtension | FormExtension | context: FormExtensionContext; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | dump(params: Array\): Array\; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onConfigurationUpdated(config: Configuration): void; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onReconnect(want: Want): void; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onDisconnect(want: Want): void; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onConnect(want: Want): rpc.RemoteObject; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onRequest(want: Want, startId: number): void; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onDestroy(): void; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | onCreate(want: Want): void; | Added| +| ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | context: ServiceExtensionContext; | Added| +| ohos.application.StartOptions | StartOptions | displayId?: number; | Added| +| ohos.application.StartOptions | StartOptions | windowMode?: number; | Added| +| ohos.application.StaticSubscriberExtensionAbility | StaticSubscriberExtensionAbility | onReceiveEvent(event: CommonEventData): void; | Added| +| ohos.application.uriPermissionManager | uriPermissionManager | function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback\): void;
function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise\; | Added| +| ohos.application.WindowExtensionAbility | WindowExtensionAbility | onWindowReady(window: Window): void; | Added| +| ohos.application.WindowExtensionAbility | WindowExtensionAbility | onDisconnect(want: Want): void; | Added| +| ohos.application.WindowExtensionAbility | WindowExtensionAbility | onConnect(want: Want): rpc.RemoteObject; | Added| +| ohos.application.WindowExtensionAbility | WindowExtensionAbility | context: ExtensionContext; | Added| +| ohos.wantAgent | wantAgent | function getOperationType(agent: WantAgent, callback: AsyncCallback\): void;
function getOperationType(agent: WantAgent): Promise\; | Added| +| PermissionRequestResult | PermissionRequestResult | authResults: Array\; | Added| +| PermissionRequestResult | PermissionRequestResult | permissions: Array\; | Added| +| ServiceExtensionContext | ServiceExtensionContext | disconnectAbility(connection: number, callback:AsyncCallback\): void;
disconnectAbility(connection: number): Promise\; | Added| +| ServiceExtensionContext | ServiceExtensionContext | connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; | Added| +| ServiceExtensionContext | ServiceExtensionContext | connectAbility(want: Want, options: ConnectOptions): number; | Added| +| ServiceExtensionContext | ServiceExtensionContext | terminateSelf(callback: AsyncCallback\): void;
terminateSelf(): Promise\; | Added| +| ServiceExtensionContext | ServiceExtensionContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; | Added| +| ServiceExtensionContext | ServiceExtensionContext | startAbility(want: Want, callback: AsyncCallback\): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback\): void;
startAbility(want: Want, options?: StartOptions): Promise\; | Added| +| ServiceExtensionContext | ServiceExtensionContext | extensionAbilityInfo: ExtensionAbilityInfo; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-arkui.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-arkui.md new file mode 100644 index 0000000000000000000000000000000000000000..a48599787d68400f19602205fbfb4b6e208a65e3 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-arkui.md @@ -0,0 +1,24 @@ +# JS API Changes of the ArkUI Development Framework + +The table below lists the APIs changes of the ArkUI development framework in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| common | | function getContext(component?: Object): Object; | Added| +| sidebar | SideBarContainerAttribute | autoHide(value: boolean): SideBarContainerAttribute; | Added| +| state_management | LocalStorage | clear(): boolean; | Added| +| state_management | LocalStorage | delete(propName: string): boolean; | Added| +| state_management | LocalStorage | setAndProp\(propName: string, defaultValue: T, propUser?: T, subscribersName?: string): T; | Added| +| state_management | LocalStorage | prop\(propName: string, propUser?: T, subscribersName?: string): T; | Added| +| state_management | LocalStorage | setAndLink\(propName: string, defaultValue: T, linkUser?: T, subscribersName?: string): T; | Added| +| state_management | LocalStorage | link\(propName: string, linkUser?: T, subscribersName?: string): T; | Added| +| state_management | LocalStorage | setOrCreate\(propName: string, newValue?: T): boolean; | Added| +| state_management | LocalStorage | set\(propName: string, newValue: T): boolean; | Added| +| state_management | LocalStorage | get\(propName: string): T; | Added| +| state_management | LocalStorage | size(): number; | Added| +| state_management | LocalStorage | keys(): IterableIterator\; | Added| +| state_management | LocalStorage | has(propName: string): boolean; | Added| +| state_management | LocalStorage | static GetShared(): LocalStorage; | Added| +| state_management | LocalStorage | constructor(initializingProperties?: Object); | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-battery.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-battery.md new file mode 100644 index 0000000000000000000000000000000000000000..6602aad017dfd41a26912c6b706590185ce78999 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-battery.md @@ -0,0 +1,38 @@ +# JS API Changes of the Power Management Subsystem + +The table below lists the APIs changes of the power management subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_TECHNOLOGY | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_PRESENT | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_CHARGE_COUNTER | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_CHARGE_STATE | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_MAX_VOLTAGE | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_MAX_CURRENT | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_PLUGGED_TYPE | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_HEALTH_STATE | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_TEMPERATURE | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_VOLTAGE | Added| +| ohos.batteryinfo | CommonEventBatteryChangedCode | EXTRA_SOC = 0 | Added| +| ohos.batteryinfo | BatteryCapacityLevel | LEVEL_CRITICAL | Added| +| ohos.batteryinfo | BatteryCapacityLevel | LEVEL_LOW | Added| +| ohos.batteryinfo | BatteryCapacityLevel | LEVEL_NORMAL | Added| +| ohos.batteryinfo | BatteryCapacityLevel | LEVEL_HIGH | Added| +| ohos.batteryinfo | BatteryCapacityLevel | LEVEL_FULL | Added| +| ohos.batteryinfo | BatteryCapacityLevel | LEVEL_NONE | Added| +| ohos.batteryinfo | batteryInfo | const remainingEnergy: number; | Added| +| ohos.batteryinfo | batteryInfo | const nowCurrent: number; | Added| +| ohos.batteryinfo | batteryInfo | const totalEnergy: number; | Added| +| ohos.batteryinfo | batteryInfo | const estimatedRemainingChargeTime: number; | Added| +| ohos.batteryinfo | batteryInfo | const batteryCapacityLevel: BatteryCapacityLevel; | Added| +| ohos.power | DevicePowerMode | MODE_EXTREME_POWER_SAVE | Added| +| ohos.power | DevicePowerMode | MODE_PERFORMANCE | Added| +| ohos.power | DevicePowerMode | MODE_POWER_SAVE | Added| +| ohos.power | DevicePowerMode | MODE_NORMAL = 600 | Added| +| ohos.power | power | setPowerMode(mode: DevicePowerMode, callback: AsyncCallback\): void;
setPowerMode(mode: DevicePowerMode): Promise\; | Added| +| ohos.power | power | getPowerMode(callback: AsyncCallback\): void;
getPowerMode(): Promise\; | Added| +| ohos.power | power | suspendDevice(): void; | Added| +| ohos.power | power | wakeupDevice(detail: string): void; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-bundle.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-bundle.md new file mode 100644 index 0000000000000000000000000000000000000000..258f6d0b11b82cc7929825b9cedcf0642f457bf1 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-bundle.md @@ -0,0 +1,39 @@ +# JS API Changes of the Bundle Management Framework + +The table below lists the APIs changes of the bundle management framework in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| bundleInfo | BundleInfo | readonly extensionAbilityInfo: Array\; | Added| +| bundleInfo | ReqPermissionDetail | reasonId: number; | Added| +| hapModuleInfo | HapModuleInfo | readonly metadata: Array\; | Added| +| hapModuleInfo | HapModuleInfo | readonly extensionAbilityInfo: Array\; | Added| +| hapModuleInfo | HapModuleInfo | readonly mainElementName: string; | Added| +| metadata | Metadata | resource: string; | Added| +| metadata | Metadata | value: string; | Added| +| metadata | Metadata | name: string; | Added| +| ohos.bundle | bundle | isModuleRemovable(bundleName: string, moduleName: string, callback: AsyncCallback\): void;
isModuleRemovable(bundleName: string, moduleName: string): Promise\; | Added| +| ohos.bundle | bundle | setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag, callback: AsyncCallback\):void;
setModuleUpgradeFlag(bundleName: string, moduleName: string, upgradeFlag: UpgradeFlag): Promise\; | Added| +| ohos.bundle | bundle | queryExtensionAbilityInfos(want: Want, extensionType: number, extensionFlags: number, userId: number, callback: AsyncCallback\>): void;
queryExtensionAbilityInfos(want: Want, extensionType: number, extensionFlags: number, callback: AsyncCallback\>): void;
queryExtensionAbilityInfos(want: Want, extensionType: number, extensionFlags: number, userId?: number): Promise\>; | Added| +| ohos.bundle | UpgradeFlag | RELATION_UPGRADE = 2 | Added| +| ohos.bundle | UpgradeFlag | SINGLE_UPGRADE = 1 | Added| +| ohos.bundle | UpgradeFlag | NOT_UPGRADE = 0 | Added| +| ohos.bundle | ExtensionAbilityType | UNSPECIFIED = 20 | Added| +| ohos.bundle | ExtensionAbilityType | WINDOW = 10 | Added| +| ohos.bundle | ExtensionAbilityType | BACKUP = 9 | Added| +| ohos.bundle | ExtensionAbilityType | WALLPAPER = 8 | Added| +| ohos.bundle | ExtensionAbilityType | STATIC_SUBSCRIBER = 7 | Added| +| ohos.bundle | ExtensionAbilityType | FILE_SHARE = 6 | Added| +| ohos.bundle | ExtensionAbilityType | DATA_SHARE = 5 | Added| +| ohos.bundle | ExtensionAbilityType | ACCESSIBILITY = 4 | Added| +| ohos.bundle | ExtensionAbilityType | SERVICE = 3 | Added| +| ohos.bundle | ExtensionAbilityType | INPUT_METHOD = 2 | Added| +| ohos.bundle | ExtensionAbilityType | WORK_SCHEDULER = 1 | Added| +| ohos.bundle | ExtensionAbilityType | FORM = 0 | Added| +| ohos.bundle | ExtensionFlag | GET_EXTENSION_INFO_WITH_METADATA = 0x00000020 | Added| +| ohos.bundle | ExtensionFlag | GET_EXTENSION_INFO_WITH_APPLICATION = 0x00000004 | Added| +| ohos.bundle | ExtensionFlag | GET_EXTENSION_INFO_WITH_PERMISSION = 0x00000002 | Added| +| ohos.bundle | ExtensionFlag | GET_EXTENSION_INFO_DEFAULT = 0x00000000 | Added| +| ohos.bundle | BundleFlag | GET_BUNDLE_WITH_EXTENSION_ABILITY = 0x00000020 | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-communicate.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-communicate.md new file mode 100644 index 0000000000000000000000000000000000000000..9b4d681e6620852cf7e6b79f2aafb7ee0b03ef95 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-communicate.md @@ -0,0 +1,13 @@ +# JS API Changes of the Communication Subsystem + +The table below lists the APIs changes of the communication subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.bluetooth | ProfileId | PROFILE_HID_HOST = 6 | Added| +| ohos.bluetooth | HidHostProfile | off(type: "connectionStateChange", callback?: Callback\): void; | Added| +| ohos.bluetooth | HidHostProfile | on(type: "connectionStateChange", callback: Callback\): void; | Added| +| ohos.bluetooth | HidHostProfile | disconnect(device: string): boolean; | Added| +| ohos.bluetooth | HidHostProfile | connect(device: string): boolean; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-dfx.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-dfx.md new file mode 100644 index 0000000000000000000000000000000000000000..9ec7e5f0c3f52a7f5859971b8526f1b29f7552cb --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-dfx.md @@ -0,0 +1,11 @@ +# JS API Changes of the DFX Subsystem + +The table below lists the APIs changes of the DFX subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.hidebug | hidebug | getServiceDump(serviceid : number) : string; | Added| +| ohos.hidebug | hidebug | getCpuUsage() : number; | Added| +| ohos.hidebug | hidebug | getPrivateDirty() : bigint; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-distributed-data.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-distributed-data.md new file mode 100644 index 0000000000000000000000000000000000000000..c4abe4ef99aed8b2cea17c803a6aacc946687f8f --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-distributed-data.md @@ -0,0 +1,45 @@ +# JS API Changes of the Distributed Data Management Subsystem + +The table below lists the APIs changes of the distributed data management subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.data.preferences | preferences | const MAX_VALUE_LENGTH: 8192; | Added| +| ohos.data.preferences | preferences | const MAX_KEY_LENGTH: 80; | Added| +| ohos.data.preferences | Preferences | off(type: 'change', callback?: Callback\<{ key: string }>): void; | Added| +| ohos.data.preferences | Preferences | on(type: 'change', callback: Callback\<{ key: string }>): void; | Added| +| ohos.data.preferences | Preferences | flush(callback: AsyncCallback\): void;
flush(): Promise\; | Added| +| ohos.data.preferences | Preferences | clear(callback: AsyncCallback\): void;
clear(): Promise\; | Added| +| ohos.data.preferences | Preferences | delete(key: string, callback: AsyncCallback\): void;
delete(key: string): Promise\; | Added| +| ohos.data.preferences | Preferences | put(key: string, value: ValueType, callback: AsyncCallback\): void;
put(key: string, value: ValueType): Promise\; | Added| +| ohos.data.preferences | Preferences | has(key: string, callback: AsyncCallback\): void;
has(key: string): Promise\; | Added| +| ohos.data.preferences | Preferences | getAll(callback: AsyncCallback\): void;
getAll(): Promise\; | Added| +| ohos.data.preferences | Preferences | get(key: string, defValue: ValueType, callback: AsyncCallback\): void;
get(key: string, defValue: ValueType): Promise\; | Added| +| ohos.data.preferences | preferences | removePreferencesFromCache(context: Context, name: string, callback: AsyncCallback\): void;
removePreferencesFromCache(context: Context, name: string): Promise\; | Added| +| ohos.data.preferences | preferences | deletePreferences(context: Context, name: string, callback: AsyncCallback\): void;
deletePreferences(context: Context, name: string): Promise\; | Added| +| ohos.data.preferences | preferences | getPreferences(context: Context, name: string, callback: AsyncCallback\): void;
getPreferences(context: Context, name: string): Promise\; | Added| +| ohos.data.storage | storage | const MAX_VALUE_LENGTH: 8192; | Deprecated| +| ohos.data.storage | storage | const MAX_KEY_LENGTH: 80; | Deprecated| +| ohos.data.storage | StorageObserver | key: string; | Deprecated| +| ohos.data.storage | Storage | off(type: 'change', callback: Callback\): void; | Deprecated| +| ohos.data.storage | Storage | on(type: 'change', callback: Callback\): void; | Deprecated| +| ohos.data.storage | Storage | flush(callback: AsyncCallback\): void;
flush(): Promise\; | Deprecated| +| ohos.data.storage | Storage | flushSync(): void; | Deprecated| +| ohos.data.storage | Storage | clear(callback: AsyncCallback\): void;
clear(): Promise\; | Deprecated| +| ohos.data.storage | Storage | clearSync(): void; | Deprecated| +| ohos.data.storage | Storage | delete(key: string, callback: AsyncCallback\): void;
delete(key: string): Promise\; | Deprecated| +| ohos.data.storage | Storage | deleteSync(key: string): void; | Deprecated| +| ohos.data.storage | Storage | put(key: string, value: ValueType, callback: AsyncCallback\): void;
put(key: string, value: ValueType): Promise\; | Deprecated| +| ohos.data.storage | Storage | putSync(key: string, value: ValueType): void; | Deprecated| +| ohos.data.storage | Storage | has(key: string, callback: AsyncCallback\): boolean;
has(key: string): Promise\; | Deprecated| +| ohos.data.storage | Storage | hasSync(key: string): boolean; | Deprecated| +| ohos.data.storage | Storage | get(key: string, defValue: ValueType, callback: AsyncCallback\): void;
get(key: string, defValue: ValueType): Promise\; | Deprecated| +| ohos.data.storage | Storage | getSync(key: string, defValue: ValueType): ValueType; | Deprecated| +| ohos.data.storage | storage | removeStorageFromCache(path: string, callback: AsyncCallback\): void;
removeStorageFromCache(path: string): Promise\; | Deprecated| +| ohos.data.storage | storage | removeStorageFromCacheSync(path: string): void; | Deprecated| +| ohos.data.storage | storage | deleteStorage(path: string, callback: AsyncCallback\): void;
deleteStorage(path: string): Promise\; | Deprecated| +| ohos.data.storage | storage | deleteStorageSync(path: string): void; | Deprecated| +| ohos.data.storage | storage | getStorage(path: string, callback: AsyncCallback\): void;
getStorage(path: string): Promise\; | Deprecated| +| ohos.data.storage | storage | getStorageSync(path: string): Storage; | Deprecated| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-event-and-notification.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-event-and-notification.md new file mode 100644 index 0000000000000000000000000000000000000000..1a5c9ece5de2bcbd69827001803733740789f738 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-event-and-notification.md @@ -0,0 +1,19 @@ +# JS API Changes of the Common Event and Notification Framework + +The table below lists the APIs changes of the common event and notification framework in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| commonEventSubscriber | CommonEventSubscriber | finishCommonEvent(callback: AsyncCallback\): void;
finishCommonEvent(): Promise\; | Added| +| notificationSlot | NotificationSlot | readonly enabled?: boolean; | Added| +| ohos.commonEvent | Support | COMMON_EVENT_VOLUME_EJECT = "usual.event.data.VOLUME_EJECT" | Added| +| ohos.commonEvent | Support | COMMON_EVENT_VOLUME_BAD_REMOVAL = "usual.event.data.VOLUME_BAD_REMOVAL" | Added| +| ohos.commonEvent | Support | COMMON_EVENT_VOLUME_MOUNTED = "usual.event.data.VOLUME_MOUNTED" | Added| +| ohos.commonEvent | Support | COMMON_EVENT_VOLUME_UNMOUNTED = "usual.event.data.VOLUME_UNMOUNTED" | Added| +| ohos.commonEvent | Support | COMMON_EVENT_VOLUME_REMOVED = "usual.event.data.VOLUME_REMOVED" | Added| +| ohos.notification | notification | isNotificationSlotEnabled(bundle: BundleOption, type: SlotType, callback: AsyncCallback\): void;
isNotificationSlotEnabled(bundle: BundleOption, type: SlotType): Promise\; | Added| +| ohos.notification | notification | enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean, callback: AsyncCallback\): void;
enableNotificationSlot(bundle: BundleOption, type: SlotType, enable: boolean): Promise\; | Added| +| ohos.notification | notification | cancelAsBundle(id: number, representativeBundle: string, userId: number, callback: AsyncCallback\): void;
cancelAsBundle(id: number, representativeBundle: string, userId: number): Promise\; | Added| +| ohos.notification | notification | publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number, callback: AsyncCallback\): void;
publishAsBundle(request: NotificationRequest, representativeBundle: string, userId: number): Promise\; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-file-management.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-file-management.md new file mode 100644 index 0000000000000000000000000000000000000000..692b190046c2183ca06fe8ea878b6ebc4108158b --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-file-management.md @@ -0,0 +1,41 @@ +# JS API Changes of the File Management Subsystem + +The table below lists the APIs changes of the file management subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.securityLabel | securityLabel | getSecurityLabelSync(path:string): string; | Added| +| ohos.securityLabel | securityLabel | getSecurityLabel(path:string, callback: AsyncCallback\): void;
getSecurityLabel(path:string): Promise\; | Added| +| ohos.securityLabel | securityLabel | setSecurityLabelSync(path:string, type:dataLevel): void; | Added| +| ohos.securityLabel | securityLabel | setSecurityLabel(path:string, type:dataLevel, callback: AsyncCallback\): void;
setSecurityLabel(path:string, type:dataLevel): Promise\; | Added| +| ohos.storageStatistics | storageStatistics | getFreeSize(callback: AsyncCallback\): void;
getFreeSize(): Promise\; | Added| +| ohos.storageStatistics | storageStatistics | getTotalSize(callback: AsyncCallback\): void;
getTotalSize(): Promise\; | Added| +| ohos.storageStatistics | storageStatistics | getUserStorageStats(userId?: number): Promise\;
getUserStorageStats(callback: AsyncCallback\): void;
getUserStorageStats(userId: number, callback: AsyncCallback\): void; | Added| +| ohos.storageStatistics | StorageStats | app: number; | Added| +| ohos.storageStatistics | StorageStats | file: number; | Added| +| ohos.storageStatistics | StorageStats | image: number; | Added| +| ohos.storageStatistics | StorageStats | video: number; | Added| +| ohos.storageStatistics | StorageStats | audio: number; | Added| +| ohos.storageStatistics | StorageStats | total: number; | Added| +| ohos.storageStatistics | storageStatistics | getSystemSize(callback: AsyncCallback\): void;
getSystemSize(): Promise\; | Added| +| ohos.storageStatistics | storageStatistics | getCurrentBundleStats(callback: AsyncCallback\): void;
getCurrentBundleStats(): Promise\; | Added| +| ohos.storageStatistics | storageStatistics | getBundleStats(packageName: string, callback: AsyncCallback\): void;
getBundleStats(packageName: string): Promise\; | Added| +| ohos.storageStatistics | BundleStats | dataSize: number; | Added| +| ohos.storageStatistics | BundleStats | cacheSize: number; | Added| +| ohos.storageStatistics | BundleStats | appSize: number; | Added| +| ohos.volumeManager | volumeManager | partition(volId: string, fstype: string, callback: AsyncCallback\): void;
partition(volId: string, fstype: string): Promise\; | Added| +| ohos.volumeManager | volumeManager | format(volId: string, callback: AsyncCallback\): void;
format(volId: string): Promise\; | Added| +| ohos.volumeManager | volumeManager | setVolumeDescription(uuid: string, description: string, callback: AsyncCallback\): void;
setVolumeDescription(uuid: string, description: string): Promise\; | Added| +| ohos.volumeManager | volumeManager | getVolumeById(id: string, callback: AsyncCallback\): void;
getVolumeById(id: string): Promise\; | Added| +| ohos.volumeManager | volumeManager | getVolumeByUuid(uuid: string, callback: AsyncCallback\): void;
getVolumeByUuid(uuid: string): Promise\; | Added| +| ohos.volumeManager | volumeManager | unmount(volumeId: string, callback: AsyncCallback\): void;
unmount(volumeId: string): Promise\; | Added| +| ohos.volumeManager | volumeManager | mount(volumeId: string, callback: AsyncCallback\): void;
mount(volumeId: string): Promise\; | Added| +| ohos.volumeManager | volumeManager | getAllVolumes(callback: AsyncCallback\>): void;
getAllVolumes(): Promise\>; | Added| +| ohos.volumeManager | Volume | path: string; | Added| +| ohos.volumeManager | Volume | state: number; | Added| +| ohos.volumeManager | Volume | removable: boolean; | Added| +| ohos.volumeManager | Volume | description: string; | Added| +| ohos.volumeManager | Volume | uuid: string; | Added| +| ohos.volumeManager | Volume | id: string; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-global.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-global.md new file mode 100644 index 0000000000000000000000000000000000000000..7681622ca08797c1ef4492d75d52e27ce3364f27 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-global.md @@ -0,0 +1,33 @@ +# JS API Changes of the Globalization Subsystem + +The table below lists the APIs changes of the globalization subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| DeviceSettingsManager | DeviceSettingsManager | setDateTime(admin: Want, time: number, callback: AsyncCallback\): void;
setDateTime(admin: Want, time: number): Promise\; | Added| +| ohos.enterpriseDeviceManager | enterpriseDeviceManager | getDeviceSettingsManager(callback: AsyncCallback\): void;
getDeviceSettingsManager(): Promise\; | Added| +| ohos.enterpriseDeviceManager | enterpriseDeviceManager | isSuperAdmin(bundleName: String, callback: AsyncCallback\): void;
isSuperAdmin(bundleName: String): Promise\; | Added| +| ohos.enterpriseDeviceManager | enterpriseDeviceManager | setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback\): void;
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise\; | Added| +| ohos.enterpriseDeviceManager | enterpriseDeviceManager | getEnterpriseInfo(admin: Want, callback: AsyncCallback\): void;
getEnterpriseInfo(admin: Want): Promise\; | Added| +| ohos.enterpriseDeviceManager | enterpriseDeviceManager | isAdminAppActive(admin: Want, callback: AsyncCallback\): void;
isAdminAppActive(admin: Want): Promise\; | Added| +| ohos.enterpriseDeviceManager | enterpriseDeviceManager | deactivateSuperAdmin(bundleName: String, callback: AsyncCallback\): void;
deactivateSuperAdmin(bundleName: String): Promise\; | Added| +| ohos.enterpriseDeviceManager | enterpriseDeviceManager | deactivateAdmin(admin: Want, callback: AsyncCallback\): void;
deactivateAdmin(admin: Want): Promise\; | Added| +| ohos.enterpriseDeviceManager | enterpriseDeviceManager | activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback\): void;
activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType): Promise\; | Added| +| ohos.enterpriseDeviceManager | AdminType | ADMIN_TYPE_SUPER = 0x01 | Added| +| ohos.enterpriseDeviceManager | AdminType | ADMIN_TYPE_NORMAL = 0x00 | Added| +| ohos.enterpriseDeviceManager | EnterpriseInfo | description: string; | Added| +| ohos.enterpriseDeviceManager | EnterpriseInfo | name: string; | Added| +| ohos.i18n | i18n | getAppPreferredLanguage(): string; | Added| +| ohos.resourceManager | ResourceManager | getNumberByName(resName: string): number; | Added| +| ohos.resourceManager | ResourceManager | getNumber(resId: number): number; | Added| +| ohos.resourceManager | ResourceManager | getBooleanByName(resName: string): boolean; | Added| +| ohos.resourceManager | ResourceManager | getBoolean(resId: number): boolean; | Added| +| ohos.resourceManager | ResourceManager | getStringByNameSync(resName: string): string; | Added| +| ohos.resourceManager | ResourceManager | getStringSync(resId: number): string; | Added| +| ohos.resourceManager | ResourceManager | getPluralStringByName(resName: string, num: number, callback: AsyncCallback\): void;
getPluralStringByName(resName: string, num: number): Promise\; | Added| +| ohos.resourceManager | ResourceManager | getMediaBase64ByName(resName: string, callback: AsyncCallback\): void;
getMediaBase64ByName(resName: string): Promise\; | Added| +| ohos.resourceManager | ResourceManager | getMediaByName(resName: string, callback: AsyncCallback\): void;
getMediaByName(resName: string): Promise\; | Added| +| ohos.resourceManager | ResourceManager | getStringArrayByName(resName: string, callback: AsyncCallback\>): void;
getStringArrayByName(resName: string): Promise\>; | Added| +| ohos.resourceManager | ResourceManager | getStringByName(resName: string, callback: AsyncCallback\): void;
getStringByName(resName: string): Promise\; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-init.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-init.md new file mode 100644 index 0000000000000000000000000000000000000000..26eab3c5e8acc195719fbfb95465a5b35d5b590d --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-init.md @@ -0,0 +1,9 @@ +# JS API Changes of the Startup Subsystem + +The table below lists the APIs changes of the startup subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.systemCapability | systemCapability | querySystemCapabilities(callback: AsyncCallback\): void;
querySystemCapabilities(): Promise\; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-misc.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-misc.md new file mode 100644 index 0000000000000000000000000000000000000000..d267617279f474a6ff86b0bff88a253b061e7752 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-misc.md @@ -0,0 +1,33 @@ +# JS API Changes of the Misc Services Subsystem + +The table below lists the APIs changes of the Misc services subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Method/Event Name| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.screenLock | sendScreenLockEvent | sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback\): void;
sendScreenLockEvent(event: String, parameter: number): Promise\; | Added| +| ohos.screenLock | off_changeUser | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_endSleep | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_beginSleep | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_screenlockEnabled | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_beginExitAnimation | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_unlockScreen | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_endScreenOff | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_beginScreenOff | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_endScreenOn | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_beginScreenOn | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_endWakeUp | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | off_beginWakeUp | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | on_screenlockEnabled | on(type: 'screenlockEnabled', callback: Callback\): void; | Added| +| ohos.screenLock | on_changeUser | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | on_endSleep | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | on_beginSleep | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | Added| +| ohos.screenLock | on_beginExitAnimation | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | Added| +| ohos.screenLock | on_unlockScreen | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | Added| +| ohos.screenLock | on_endScreenOff | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | Added| +| ohos.screenLock | on_beginScreenOff | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | Added| +| ohos.screenLock | on_endScreenOn | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | Added| +| ohos.screenLock | on_beginScreenOn | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | Added| +| ohos.screenLock | on_endWakeUp | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | Added| +| ohos.screenLock | on_beginWakeUp | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-multi-modal-input.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-multi-modal-input.md new file mode 100644 index 0000000000000000000000000000000000000000..6419a1eadef915fa9823d16c21f8609f9413e55b --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-multi-modal-input.md @@ -0,0 +1,458 @@ +# JS API Changes of the Multimodal Input Subsystem + +The table below lists the APIs changes of the multimodal input subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.multimodalInput.inputDevice | inputDevice | function getKeyboardType(deviceId: number, callback: AsyncCallback\): void;
function getKeyboardType(deviceId: number): Promise\; | Added| +| ohos.multimodalInput.inputDevice | inputDevice | function supportKeys(deviceId: number, keys: Array\, callback: Callback\>): void;
function supportKeys(deviceId: number, keys: Array\): Promise\>; | Added| +| ohos.multimodalInput.inputDevice | InputDeviceData | uniq: string; | Added| +| ohos.multimodalInput.inputDevice | InputDeviceData | phys: string; | Added| +| ohos.multimodalInput.inputDevice | InputDeviceData | version: number; | Added| +| ohos.multimodalInput.inputDevice | InputDeviceData | vendor: number; | Added| +| ohos.multimodalInput.inputDevice | InputDeviceData | product: number; | Added| +| ohos.multimodalInput.inputDevice | InputDeviceData | bus: number; | Added| +| ohos.multimodalInput.inputDevice | AxisRange | resolution: number; | Added| +| ohos.multimodalInput.inputDevice | AxisRange | flat: number; | Added| +| ohos.multimodalInput.inputDevice | AxisRange | fuzz: number; | Added| +| ohos.multimodalInput.inputDevice | inputDevice | function off(type: "change", listener?: Callback\): void; | Added| +| ohos.multimodalInput.inputDevice | inputDevice | function on(type: "change", listener: Callback\): void; | Added| +| ohos.multimodalInput.inputDevice | DeviceListener | deviceId: number; | Added| +| ohos.multimodalInput.inputDevice | DeviceListener | type: ChangedType; | Added| +| ohos.multimodalInput.inputDevice | KeyboardType | REMOTE_CONTROL = 5 | Added| +| ohos.multimodalInput.inputDevice | KeyboardType | HANDWRITING_PEN = 4 | Added| +| ohos.multimodalInput.inputDevice | KeyboardType | DIGITAL_KEYBOARD = 3 | Added| +| ohos.multimodalInput.inputDevice | KeyboardType | ALPHABETIC_KEYBOARD = 2 | Added| +| ohos.multimodalInput.inputDevice | KeyboardType | UNKNOWN = 1 | Added| +| ohos.multimodalInput.inputDevice | KeyboardType | NONE = 0 | Added| +| ohos.multimodalInput.inputEvent | InputEvent | windowId: number; | Added| +| ohos.multimodalInput.inputEvent | InputEvent | screenId: number; | Added| +| ohos.multimodalInput.inputEvent | InputEvent | actionTime: number; | Added| +| ohos.multimodalInput.inputEvent | InputEvent | deviceId: number; | Added| +| ohos.multimodalInput.inputEvent | InputEvent | id: number; | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_9 = 3109 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_8 = 3108 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_7 = 3107 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_6 = 3106 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_5 = 3105 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_4 = 3104 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_3 = 3103 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_2 = 3102 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_1 = 3101 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_0 = 3100 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CHANNEL = 3001 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_RFKILL = 2847 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_WWAN_WIMAX = 2846 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_UWB = 2845 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_WLAN = 2844 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BLUETOOTH = 2843 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BATTERY = 2842 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SWITCHVIDEOMODE = 2841 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ALTERASE = 2839 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SHOP = 2838 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SPORT = 2837 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CONNECT = 2836 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_QUESTION = 2834 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SOUND = 2833 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_HP = 2832 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SUSPEND = 2831 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DASHBOARD = 2830 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PROG4 = 2829 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PROG3 = 2828 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F24 = 2827 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F23 = 2826 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F22 = 2825 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F21 = 2824 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F20 = 2823 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F19 = 2822 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F18 = 2821 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F17 = 2820 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F16 = 2819 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F15 = 2818 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F14 = 2817 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F13 = 2816 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MOVE = 2815 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ISO = 2814 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_EJECTCLOSECD = 2813 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_COMPUTER = 2812 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CYCLEWINDOWS = 2811 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DIRECTION_ROTATE_DISPLAY = 2810 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SCREENLOCK = 2809 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MSDOS = 2808 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PROG2 = 2807 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PROG1 = 2806 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_XFER = 2805 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DELETEFILE = 2804 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SENDFILE = 2803 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_WAKEUP = 2802 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SETUP = 2801 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FRONT = 2800 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDINPUTASSIST_CANCEL = 2731 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDINPUTASSIST_ACCEPT = 2730 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDINPUTASSIST_NEXTGROUP = 2729 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDINPUTASSIST_PREVGROUP = 2728 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDINPUTASSIST_NEXT = 2727 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDINPUTASSIST_PREV = 2726 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BRIGHTNESS_MAX = 2725 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BRIGHTNESS_MIN = 2724 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBD_LAYOUT_NEXT = 2723 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ASSISTANT = 2722 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SCREENSAVER = 2721 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_APPSELECT = 2720 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CONTROLPANEL = 2719 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_JOURNAL = 2718 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_TASKMANAGER = 2717 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BUTTONCONFIG = 2716 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_IMAGES = 2715 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_REPEAT = 2714 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_COFFEE = 2713 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SPELLCHECK = 2712 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BRIGHTNESS_TOGGLE = 2711 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MESSENGER = 2710 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ADDRESSBOOK = 2709 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VOICEMAIL = 2708 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NEWS = 2707 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DATABASE = 2706 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PRESENTATION = 2705 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_GRAPHICSEDITOR = 2704 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SPREADSHEET = 2703 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_EDITOR = 2702 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_WORDPROCESSOR = 2701 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ZOOMRESET = 2700 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ZOOMOUT = 2699 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ZOOMIN = 2698 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_GAMES = 2697 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VIDEOPHONE = 2696 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SHUFFLE = 2695 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SLOW = 2694 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_RESTART = 2693 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_LAST = 2692 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CHANNELDOWN = 2691 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CHANNELUP = 2690 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BLUE = 2689 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_YELLOW = 2688 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_GREEN = 2687 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_RED = 2686 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CALENDAR = 2685 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEMO = 2684 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VIDEO = 2683 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_AUDIO = 2682 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DVD = 2681 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PLAYER = 2680 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_TUNER = 2679 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_TAPE = 2678 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CD = 2677 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SAT = 2676 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VCR2 = 2675 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VCR = 2674 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_TV2 = 2673 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_TV = 2672 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PC = 2671 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ASPECT_RATIO = 2670 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KEYBOARD = 2669 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FULL_SCREEN = 2668 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SUBTITLE = 2667 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PVR = 2666 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PROGRAM = 2665 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_INFO = 2664 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_GOTO = 2663 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BTN_MISC = 2662 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DISPLAY_OFF = 2661 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BRIGHTNESS_ZERO = 2660 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BRIGHTNESS_CYCLE = 2659 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VIDEO_PREV = 2658 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VIDEO_NEXT = 2657 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DOCUMENTS = 2656 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SAVE = 2655 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FORWARDMAIL = 2654 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_REPLY = 2653 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SEND = 2652 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDILLUM_UP = 2651 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDILLUM_DOWN = 2650 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KBDILLUM_TOGGLE = 2649 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CANCEL = 2648 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FINANCE = 2647 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CHAT = 2646 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PRINT = 2645 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BASSBOOST = 2644 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PLAY = 2643 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CLOSE = 2642 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_REDO = 2641 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NEW = 2640 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SCROLLDOWN = 2639 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SCROLLUP = 2638 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_EDIT = 2637 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_EXIT = 2636 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_REFRESH = 2635 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CONFIG = 2634 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_STOPCD = 2632 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PREVIOUS = 2631 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PLAYPAUSE = 2630 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NEXT = 2629 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BOOKMARKS = 2628 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FILE = 2627 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CALC = 2626 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_HELP = 2625 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CUT = 2624 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FIND = 2623 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PASTE = 2622 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_OPEN = 2621 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_COPY = 2620 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_UNDO = 2619 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PROPS = 2618 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_AGAIN = 2617 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_STOP = 2616 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_YEN = 2615 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_HANJA = 2614 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_HANGUEL = 2613 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SCALE = 2612 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_PLUSMINUS = 2611 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MACRO = 2610 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_LINEFEED = 2609 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MUHENKAN = 2608 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KATAKANA_HIRAGANA = 2607 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_HENKAN = 2606 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_HIRAGANA = 2605 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_KATAKANA = 2604 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_RO = 2603 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_102ND = 2602 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ZENKAKU_HANKAKU = 2601 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SLEEP = 2600 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VIRTUAL_MULTITASK = 2210 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_RIGHT_PAREN = 2122 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_LEFT_PAREN = 2121 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_EQUALS = 2120 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_ENTER = 2119 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_COMMA = 2118 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_DOT = 2117 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_ADD = 2116 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_SUBTRACT = 2115 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_MULTIPLY = 2114 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_DIVIDE = 2113 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_9 = 2112 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_8 = 2111 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_7 = 2110 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_6 = 2109 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_5 = 2108 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_4 = 2107 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_3 = 2106 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_2 = 2105 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_1 = 2104 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUMPAD_0 = 2103 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_NUM_LOCK = 2102 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F12 = 2101 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F11 = 2100 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F10 = 2099 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F9 = 2098 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F8 = 2097 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F7 = 2096 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F6 = 2095 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F5 = 2094 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F4 = 2093 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F3 = 2092 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F2 = 2091 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F1 = 2090 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_RECORD = 2089 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_EJECT = 2088 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_CLOSE = 2087 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_PAUSE = 2086 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_PLAY = 2085 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FORWARD = 2084 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_INSERT = 2083 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MOVE_END = 2082 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MOVE_HOME = 2081 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BREAK = 2080 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SYSRQ = 2079 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FUNCTION = 2078 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_META_RIGHT = 2077 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_META_LEFT = 2076 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SCROLL_LOCK = 2075 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CAPS_LOCK = 2074 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CTRL_RIGHT = 2073 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CTRL_LEFT = 2072 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FORWARD_DEL = 2071 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ESCAPE = 2070 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PAGE_DOWN = 2069 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PAGE_UP = 2068 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MENU = 2067 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PLUS = 2066 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_AT = 2065 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SLASH = 2064 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_APOSTROPHE = 2063 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SEMICOLON = 2062 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BACKSLASH = 2061 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_RIGHT_BRACKET = 2060 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_LEFT_BRACKET = 2059 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_EQUALS = 2058 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MINUS = 2057 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_GRAVE = 2056 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DEL = 2055 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ENTER = 2054 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ENVELOPE = 2053 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_EXPLORER = 2052 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SYM = 2051 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SPACE = 2050 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_TAB = 2049 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SHIFT_RIGHT = 2048 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_SHIFT_LEFT = 2047 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ALT_RIGHT = 2046 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_ALT_LEFT = 2045 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_PERIOD = 2044 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_COMMA = 2043 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_Z = 2042 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_Y = 2041 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_X = 2040 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_W = 2039 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_V = 2038 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_U = 2037 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_T = 2036 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_S = 2035 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_R = 2034 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_Q = 2033 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_P = 2032 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_O = 2031 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_N = 2030 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_M = 2029 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_L = 2028 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_K = 2027 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_J = 2026 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_I = 2025 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_H = 2024 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_G = 2023 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_F = 2022 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_E = 2021 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_D = 2020 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_C = 2019 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_B = 2018 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_A = 2017 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DPAD_CENTER = 2016 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DPAD_RIGHT = 2015 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DPAD_LEFT = 2014 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DPAD_DOWN = 2013 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_DPAD_UP = 2012 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_POUND = 2011 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_STAR = 2010 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_9 = 2009 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_8 = 2008 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_7 = 2007 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_6 = 2006 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_5 = 2005 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_4 = 2004 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_3 = 2003 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_2 = 2002 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_1 = 2001 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_0 = 2000 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BRIGHTNESS_DOWN = 41 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BRIGHTNESS_UP = 40 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MUTE = 23 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VOLUME_MUTE = 22 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_CAMERA = 19 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_POWER = 18 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VOLUME_DOWN = 17 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_VOLUME_UP = 16 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_FAST_FORWARD = 15 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_REWIND = 14 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_PREVIOUS = 13 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_NEXT = 12 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_STOP = 11 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_MEDIA_PLAY_PAUSE = 10 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_BACK = 2 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_HOME = 1 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_UNKNOWN = -1 | Added| +| ohos.multimodalInput.keyCode | KeyCode | KEYCODE_FN = 0 | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | scrollLock: boolean; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | numLock: boolean; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | capsLock: boolean; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | fnKey: boolean; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | logoKey: boolean; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | shiftKey: boolean; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | altKey: boolean; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | ctrlKey: boolean; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | keys: Key[]; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | unicodeChar: number; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | key: Key; | Added| +| ohos.multimodalInput.keyEvent | KeyEvent | action: Action; | Added| +| ohos.multimodalInput.keyEvent | Key | deviceId: number; | Added| +| ohos.multimodalInput.keyEvent | Key | pressedTime: number; | Added| +| ohos.multimodalInput.keyEvent | Key | code: KeyCode; | Added| +| ohos.multimodalInput.keyEvent | Action | UP = 2 | Added| +| ohos.multimodalInput.keyEvent | Action | DOWN = 1 | Added| +| ohos.multimodalInput.keyEvent | Action | CANCEL = 0 | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | scrollLock:boolean | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | numLock:boolean | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | capsLock:boolean | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | fnKey:boolean | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | logoKey: boolean; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | shiftKey: boolean; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | altKey: boolean; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | ctrlKey: boolean; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | pressedKeys: KeyCode[]; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | axes: AxisValue[]; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | pressedButtons: Button[]; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | button: Button; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | rawDeltaY: number; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | rawDeltaX: number; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | windowY: number; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | windowX: number; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | screenY: number; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | screenX: number; | Added| +| ohos.multimodalInput.mouseEvent | MouseEvent | action: Action; | Added| +| ohos.multimodalInput.mouseEvent | AxisValue | value: number | Added| +| ohos.multimodalInput.mouseEvent | AxisValue | axis: Axis; | Added| +| ohos.multimodalInput.mouseEvent | Axis | PINCH = 2 | Added| +| ohos.multimodalInput.mouseEvent | Axis | SCROLL_HORIZONTAL = 1 | Added| +| ohos.multimodalInput.mouseEvent | Axis | SCROLL_VERTICAL = 0 | Added| +| ohos.multimodalInput.mouseEvent | Button | TASK = 7 | Added| +| ohos.multimodalInput.mouseEvent | Button | BACK = 6 | Added| +| ohos.multimodalInput.mouseEvent | Button | FORWARD = 5 | Added| +| ohos.multimodalInput.mouseEvent | Button | EXTRA = 4 | Added| +| ohos.multimodalInput.mouseEvent | Button | SIDE = 3 | Added| +| ohos.multimodalInput.mouseEvent | Button | RIGHT = 2 | Added| +| ohos.multimodalInput.mouseEvent | Button | MIDDLE = 1 | Added| +| ohos.multimodalInput.mouseEvent | Button | LEFT = 0 | Added| +| ohos.multimodalInput.mouseEvent | Action | AXIS_END = 6 | Added| +| ohos.multimodalInput.mouseEvent | Action | AXIS_UPDATE = 5 | Added| +| ohos.multimodalInput.mouseEvent | Action | AXIS_BEGIN = 4 | Added| +| ohos.multimodalInput.mouseEvent | Action | BUTTON_UP = 3 | Added| +| ohos.multimodalInput.mouseEvent | Action | BUTTON_DOWN = 2 | Added| +| ohos.multimodalInput.mouseEvent | Action | MOVE = 1 | Added| +| ohos.multimodalInput.mouseEvent | Action | CANCEL = 0 | Added| +| ohos.multimodalInput.touchEvent | TouchEvent | sourceType: SourceType; | Added| +| ohos.multimodalInput.touchEvent | TouchEvent | touches: Touch[]; | Added| +| ohos.multimodalInput.touchEvent | TouchEvent | touch: Touch; | Added| +| ohos.multimodalInput.touchEvent | TouchEvent | action: Action; | Added| +| ohos.multimodalInput.touchEvent | Touch | toolType: ToolType; | Added| +| ohos.multimodalInput.touchEvent | Touch | rawY: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | rawX: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | toolHeight: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | toolWidth: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | toolY: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | toolX: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | tiltY: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | tiltX: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | height: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | width: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | pressure: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | windowY: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | windowX: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | screenY: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | screenX: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | pressedTime: number; | Added| +| ohos.multimodalInput.touchEvent | Touch | id: number; | Added| +| ohos.multimodalInput.touchEvent | SourceType | TOUCH_PAD = 2 | Added| +| ohos.multimodalInput.touchEvent | SourceType | PEN = 1 | Added| +| ohos.multimodalInput.touchEvent | SourceType | TOUCH_SCREEN = 0 | Added| +| ohos.multimodalInput.touchEvent | ToolType | LENS = 7 | Added| +| ohos.multimodalInput.touchEvent | ToolType | MOUSE = 6 | Added| +| ohos.multimodalInput.touchEvent | ToolType | AIRBRUSH = 5 | Added| +| ohos.multimodalInput.touchEvent | ToolType | PENCIL = 4 | Added| +| ohos.multimodalInput.touchEvent | ToolType | BRUSH = 3 | Added| +| ohos.multimodalInput.touchEvent | ToolType | RUBBER = 2 | Added| +| ohos.multimodalInput.touchEvent | ToolType | PEN = 1 | Added| +| ohos.multimodalInput.touchEvent | ToolType | FINGER = 0 | Added| +| ohos.multimodalInput.touchEvent | Action | UP = 3 | Added| +| ohos.multimodalInput.touchEvent | Action | MOVE = 2 | Added| +| ohos.multimodalInput.touchEvent | Action | DOWN = 1 | Added| +| ohos.multimodalInput.touchEvent | Action | CANCEL = 0 | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-multimedia.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-multimedia.md new file mode 100644 index 0000000000000000000000000000000000000000..1335db077f8cbc0ae346787e74997777f8a1e7a1 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-multimedia.md @@ -0,0 +1,193 @@ +# JS API Changes of the Multimedia Subsystem + +The table below lists the APIs changes of the multimedia subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.multimedia.audio | AudioRenderer | on(type: 'interrupt', callback: Callback\): void; | Added| +| ohos.multimedia.audio | InterruptEvent | hintType: InterruptHint; | Added| +| ohos.multimedia.audio | InterruptEvent | forceType: InterruptForceType; | Added| +| ohos.multimedia.audio | InterruptEvent | eventType: InterruptType; | Added| +| ohos.multimedia.audio | InterruptForceType | INTERRUPT_SHARE | Added| +| ohos.multimedia.audio | InterruptForceType | INTERRUPT_FORCE = 0 | Added| +| ohos.multimedia.camera | VideoOutputError | code: VideoOutputErrorCode; | Added| +| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_UNKNOWN = -1 | Added| +| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback\): void; | Added| +| ohos.multimedia.camera | VideoOutput | on(type: 'frameEnd', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | VideoOutput | on(type: 'frameStart', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | VideoOutput | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| +| ohos.multimedia.camera | VideoOutput | stop(callback: AsyncCallback\): void;
stop(): Promise\; | Added| +| ohos.multimedia.camera | VideoOutput | start(callback: AsyncCallback\): void;
start(): Promise\; | Added| +| ohos.multimedia.camera | camera | function createVideoOutput(surfaceId: string, callback: AsyncCallback\): void;
function createVideoOutput(surfaceId: string): Promise\; | Added| +| ohos.multimedia.camera | PhotoOutputError | code: PhotoOutputErrorCode; | Added| +| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_UNKNOWN = -1 | Added| +| ohos.multimedia.camera | CaptureEndInfo | frameCount: number; | Added| +| ohos.multimedia.camera | CaptureEndInfo | captureId: number; | Added| +| ohos.multimedia.camera | FrameShutterInfo | timestamp: number; | Added| +| ohos.multimedia.camera | FrameShutterInfo | captureId: number; | Added| +| ohos.multimedia.camera | PhotoOutput | on(type: 'error', callback: ErrorCallback\): void; | Added| +| ohos.multimedia.camera | PhotoOutput | on(type: 'captureEnd', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | PhotoOutput | on(type: 'frameShutter', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | PhotoOutput | on(type: 'captureStart', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | PhotoOutput | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| +| ohos.multimedia.camera | PhotoOutput | capture(callback: AsyncCallback\): void;
capture(setting: PhotoCaptureSetting, callback: AsyncCallback\): void;
capture(setting?: PhotoCaptureSetting): Promise\; | Added| +| ohos.multimedia.camera | PhotoCaptureSetting | rotation?: ImageRotation; | Added| +| ohos.multimedia.camera | PhotoCaptureSetting | quality?: QualityLevel; | Added| +| ohos.multimedia.camera | QualityLevel | QUALITY_LEVEL_LOW | Added| +| ohos.multimedia.camera | QualityLevel | QUALITY_LEVEL_MEDIUM | Added| +| ohos.multimedia.camera | QualityLevel | QUALITY_LEVEL_HIGH = 0 | Added| +| ohos.multimedia.camera | ImageRotation | ROTATION_270 = 270 | Added| +| ohos.multimedia.camera | ImageRotation | ROTATION_180 = 180 | Added| +| ohos.multimedia.camera | ImageRotation | ROTATION_90 = 90 | Added| +| ohos.multimedia.camera | ImageRotation | ROTATION_0 = 0 | Added| +| ohos.multimedia.camera | camera | function createPhotoOutput(surfaceId: string, callback: AsyncCallback\): void;
function createPhotoOutput(surfaceId: string): Promise\; | Added| +| ohos.multimedia.camera | PreviewOutputError | code: PreviewOutputErrorCode; | Added| +| ohos.multimedia.camera | PreviewOutputErrorCode | ERROR_UNKNOWN = -1 | Added| +| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback\): void; | Added| +| ohos.multimedia.camera | PreviewOutput | on(type: 'frameEnd', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | PreviewOutput | on(type: 'frameStart', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | PreviewOutput | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| +| ohos.multimedia.camera | camera | function createPreviewOutput(surfaceId: string, callback: AsyncCallback\): void;
function createPreviewOutput(surfaceId: string): Promise\; | Added| +| ohos.multimedia.camera | CaptureSessionError | code: CaptureSessionErrorCode; | Added| +| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_UNKNOWN = -1 | Added| +| ohos.multimedia.camera | CaptureSession | on(type: 'error', callback: ErrorCallback\): void; | Added| +| ohos.multimedia.camera | CaptureSession | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| +| ohos.multimedia.camera | CaptureSession | stop(callback: AsyncCallback\): void;
stop(): Promise\; | Added| +| ohos.multimedia.camera | CaptureSession | start(callback: AsyncCallback\): void;
start(): Promise\; | Added| +| ohos.multimedia.camera | CaptureSession | removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback\): void;
removeOutput(previewOutput: PreviewOutput): Promise\;
removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback\): void;
removeOutput(photoOutput: PhotoOutput): Promise\;
removeOutput(videoOutput: VideoOutput, callback: AsyncCallback\): void;
removeOutput(videoOutput: VideoOutput): Promise\; | Added| +| ohos.multimedia.camera | CaptureSession | removeInput(cameraInput: CameraInput, callback: AsyncCallback\): void;
removeInput(cameraInput: CameraInput): Promise\; | Added| +| ohos.multimedia.camera | CaptureSession | addOutput(previewOutput: PreviewOutput, callback: AsyncCallback\): void;
addOutput(previewOutput: PreviewOutput): Promise\;
addOutput(photoOutput: PhotoOutput, callback: AsyncCallback\): void;
addOutput(photoOutput: PhotoOutput): Promise\;
addOutput(videoOutput: VideoOutput, callback: AsyncCallback\): void;
addOutput(videoOutput: VideoOutput): Promise\; | Added| +| ohos.multimedia.camera | CaptureSession | addInput(cameraInput: CameraInput, callback: AsyncCallback\): void;
addInput(cameraInput: CameraInput): Promise\; | Added| +| ohos.multimedia.camera | CaptureSession | commitConfig(callback: AsyncCallback\): void;
commitConfig(): Promise\; | Added| +| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback\): void;
beginConfig(): Promise\; | Added| +| ohos.multimedia.camera | camera | function createCaptureSession(context: Context, callback: AsyncCallback\): void;
function createCaptureSession(context: Context): Promise\; | Added| +| ohos.multimedia.camera | FocusState | FOCUS_STATE_UNFOCUSED | Added| +| ohos.multimedia.camera | FocusState | FOCUS_STATE_FOCUSED | Added| +| ohos.multimedia.camera | FocusState | FOCUS_STATE_SCAN = 0 | Added| +| ohos.multimedia.camera | FocusMode | FOCUS_MODE_LOCKED | Added| +| ohos.multimedia.camera | FocusMode | FOCUS_MODE_AUTO | Added| +| ohos.multimedia.camera | FocusMode | FOCUS_MODE_CONTINUOUS_AUTO | Added| +| ohos.multimedia.camera | FocusMode | FOCUS_MODE_MANUAL = 0 | Added| +| ohos.multimedia.camera | FlashMode | FLASH_MODE_ALWAYS_OPEN | Added| +| ohos.multimedia.camera | FlashMode | FLASH_MODE_AUTO | Added| +| ohos.multimedia.camera | FlashMode | FLASH_MODE_OPEN | Added| +| ohos.multimedia.camera | FlashMode | FLASH_MODE_CLOSE = 0 | Added| +| ohos.multimedia.camera | CameraInputError | code: CameraInputErrorCode; | Added| +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_UNKNOWN = -1 | Added| +| ohos.multimedia.camera | CameraInput | on(type: 'error', callback: ErrorCallback\): void; | Added| +| ohos.multimedia.camera | CameraInput | on(type: 'focusStateChange', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback\): void;
setZoomRatio(zoomRatio: number): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback\): void;
getZoomRatio(): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback\>): void;
getZoomRatioRange(): Promise\>; | Added| +| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback\): void;
setFocusMode(afMode: FocusMode): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback\): void;
getFocusMode(): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback\): void;
isFocusModeSupported(afMode: FocusMode): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | setFlashMode(flashMode: FlashMode, callback: AsyncCallback\): void;
setFlashMode(flashMode: FlashMode): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | getFlashMode(callback: AsyncCallback\): void;
getFlashMode(): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback\): void;
isFlashModeSupported(flashMode: FlashMode): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | hasFlash(callback: AsyncCallback\): void;
hasFlash(): Promise\; | Added| +| ohos.multimedia.camera | CameraInput | getCameraId(callback: AsyncCallback\): void;
getCameraId(): Promise\; | Added| +| ohos.multimedia.camera | Size | width: number; | Added| +| ohos.multimedia.camera | Size | height: number; | Added| +| ohos.multimedia.camera | Camera | readonly connectionType: ConnectionType; | Added| +| ohos.multimedia.camera | Camera | readonly cameraType: CameraType; | Added| +| ohos.multimedia.camera | Camera | readonly cameraPosition: CameraPosition; | Added| +| ohos.multimedia.camera | Camera | readonly cameraId: string; | Added| +| ohos.multimedia.camera | ConnectionType | CAMERA_CONNECTION_REMOTE | Added| +| ohos.multimedia.camera | ConnectionType | CAMERA_CONNECTION_USB_PLUGIN | Added| +| ohos.multimedia.camera | ConnectionType | CAMERA_CONNECTION_BUILT_IN = 0 | Added| +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_TRUE_DEPTH | Added| +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_TELEPHOTO | Added| +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_ULTRA_WIDE | Added| +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_WIDE_ANGLE | Added| +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_UNSPECIFIED = 0 | Added| +| ohos.multimedia.camera | CameraPosition | CAMERA_POSITION_FRONT | Added| +| ohos.multimedia.camera | CameraPosition | CAMERA_POSITION_BACK | Added| +| ohos.multimedia.camera | CameraPosition | CAMERA_POSITION_UNSPECIFIED = 0 | Added| +| ohos.multimedia.camera | CameraStatusInfo | status: CameraStatus; | Added| +| ohos.multimedia.camera | CameraStatusInfo | camera: Camera; | Added| +| ohos.multimedia.camera | CameraManager | on(type: 'cameraStatus', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.camera | CameraManager | createCameraInput(cameraId: string, callback: AsyncCallback\): void;
createCameraInput(cameraId: string): Promise\;
createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback\): void;
createCameraInput(position: CameraPosition, type: CameraType): Promise\; | Added| +| ohos.multimedia.camera | CameraManager | getCameras(callback: AsyncCallback\>): void;
getCameras(): Promise\>; | Added| +| ohos.multimedia.camera | CameraStatus | CAMERA_STATUS_UNAVAILABLE | Added| +| ohos.multimedia.camera | CameraStatus | CAMERA_STATUS_AVAILABLE | Added| +| ohos.multimedia.camera | CameraStatus | CAMERA_STATUS_DISAPPEAR | Added| +| ohos.multimedia.camera | CameraStatus | CAMERA_STATUS_APPEAR = 0 | Added| +| ohos.multimedia.camera | camera | function getCameraManager(context: Context, callback: AsyncCallback\): void;
function getCameraManager(context: Context): Promise\; | Added| +| ohos.multimedia.image | ImageReceiver | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| +| ohos.multimedia.image | ImageReceiver | on(type: 'imageArrival', callback: AsyncCallback\): void; | Added| +| ohos.multimedia.image | ImageReceiver | readNextImage(callback: AsyncCallback\): void;
readNextImage(): Promise\; | Added| +| ohos.multimedia.image | ImageReceiver | readLatestImage(callback: AsyncCallback\): void;
readLatestImage(): Promise\; | Added| +| ohos.multimedia.image | ImageReceiver | getReceivingSurfaceId(callback: AsyncCallback\): void;
getReceivingSurfaceId(): Promise\; | Added| +| ohos.multimedia.image | ImageReceiver | readonly format: ImageFormat; | Added| +| ohos.multimedia.image | ImageReceiver | readonly capacity: number; | Added| +| ohos.multimedia.image | ImageReceiver | readonly size: Size; | Added| +| ohos.multimedia.image | Image | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| +| ohos.multimedia.image | Image | getComponent(componentType: ComponentType, callback: AsyncCallback\): void;
getComponent(componentType: ComponentType): Promise\; | Added| +| ohos.multimedia.image | Image | readonly format: number; | Added| +| ohos.multimedia.image | Image | readonly size: Size; | Added| +| ohos.multimedia.image | Image | clipRect: Region; | Added| +| ohos.multimedia.image | ImageSource | updateData(buf: ArrayBuffer, isFinished: boolean, value: number, length: number): Promise\;
updateData(buf: ArrayBuffer, isFinished: boolean, value: number, length: number, callback: AsyncCallback\): void; | Added| +| ohos.multimedia.image | ImageSource | modifyImageProperty(key: string, value: string): Promise\;
modifyImageProperty(key: string, value: string, callback: AsyncCallback\): void; | Added| +| ohos.multimedia.image | image | function createImageReceiver(width: number, height: number, format: number, capacity: number): ImageReceiver; | Added| +| ohos.multimedia.image | image | function CreateIncrementalSource(buf: ArrayBuffer): ImageSource; | Added| +| ohos.multimedia.image | InitializationOptions | scaleMode?: ScaleMode; | Added| +| ohos.multimedia.image | InitializationOptions | alphaType?: AlphaType; | Added| +| ohos.multimedia.image | Component | readonly byteBuffer: ArrayBuffer; | Added| +| ohos.multimedia.image | Component | readonly pixelStride: number; | Added| +| ohos.multimedia.image | Component | readonly rowStride: number; | Added| +| ohos.multimedia.image | Component | readonly componentType: ComponentType; | Added| +| ohos.multimedia.image | ComponentType | JPEG = 4 | Added| +| ohos.multimedia.image | ComponentType | YUV_V = 3 | Added| +| ohos.multimedia.image | ComponentType | YUV_U = 2 | Added| +| ohos.multimedia.image | ComponentType | YUV_Y = 1 | Added| +| ohos.multimedia.image | ScaleMode | CENTER_CROP = 1 | Added| +| ohos.multimedia.image | ScaleMode | FIT_TARGET_SIZE = 0 | Added| +| ohos.multimedia.image | AlphaType | UNPREMUL = 3 | Added| +| ohos.multimedia.image | AlphaType | PREMUL = 2 | Added| +| ohos.multimedia.image | AlphaType | OPAQUE = 1 | Added| +| ohos.multimedia.image | AlphaType | UNKNOWN = 0 | Added| +| ohos.multimedia.image | ImageFormat | JPEG = 2000 | Added| +| ohos.multimedia.image | ImageFormat | YCBCR_422_SP = 1000 | Added| +| ohos.multimedia.media | VideoRecorderConfig | location?: Location; | Added| +| ohos.multimedia.media | VideoRecorderConfig | rotation?: number; | Added| +| ohos.multimedia.media | VideoRecorderConfig | url: string; | Added| +| ohos.multimedia.media | VideoRecorderConfig | profile: VideoRecorderProfile; | Added| +| ohos.multimedia.media | VideoRecorderConfig | videoSourceType: VideoSourceType; | Added| +| ohos.multimedia.media | VideoRecorderConfig | audioSourceType: AudioSourceType; | Added| +| ohos.multimedia.media | VideoSourceType | VIDEO_SOURCE_TYPE_SURFACE_ES = 1 | Added| +| ohos.multimedia.media | VideoSourceType | VIDEO_SOURCE_TYPE_SURFACE_YUV = 0 | Added| +| ohos.multimedia.media | AudioSourceType | AUDIO_SOURCE_TYPE_MIC = 1 | Added| +| ohos.multimedia.media | AudioSourceType | AUDIO_SOURCE_TYPE_DEFAULT = 0 | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly videoFrameRate: number; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly videoFrameHeight: number; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly videoFrameWidth: number; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly videoCodec: CodecMimeType; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly videoBitrate: number; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly fileFormat: ContainerFormatType; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly audioSampleRate: number; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly audioCodec: CodecMimeType; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly audioChannels: number; | Added| +| ohos.multimedia.media | VideoRecorderProfile | readonly audioBitrate: number; | Added| +| ohos.multimedia.media | VideoRecorder | readonly state: VideoRecordState; | Added| +| ohos.multimedia.media | VideoRecorder | on(type: 'error', callback: ErrorCallback): void; | Added| +| ohos.multimedia.media | VideoRecorder | reset(callback: AsyncCallback\): void;
reset(): Promise\; | Added| +| ohos.multimedia.media | VideoRecorder | release(callback: AsyncCallback\): void;
release(): Promise\; | Added| +| ohos.multimedia.media | VideoRecorder | stop(callback: AsyncCallback\): void;
stop(): Promise\; | Added| +| ohos.multimedia.media | VideoRecorder | resume(callback: AsyncCallback\): void;
resume(): Promise\; | Added| +| ohos.multimedia.media | VideoRecorder | pause(callback: AsyncCallback\): void;
pause(): Promise\; | Added| +| ohos.multimedia.media | VideoRecorder | start(callback: AsyncCallback\): void;
start(): Promise\; | Added| +| ohos.multimedia.media | VideoRecorder | getInputSurface(callback: AsyncCallback\): void;
getInputSurface(): Promise\; | Added| +| ohos.multimedia.media | VideoRecorder | prepare(config: VideoRecorderConfig, callback: AsyncCallback\): void;
prepare(config: VideoRecorderConfig): Promise\; | Added| +| ohos.multimedia.media | media | function createVideoRecorder(callback: AsyncCallback\): void;
function createVideoRecorder(): Promise\; | Added| +| ohos.multimedia.mediaLibrary | MediaLibrary | startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\>): void;
startMediaSelect(option: MediaSelectOption): Promise\>; | Deprecated| +| ohos.multimedia.mediaLibrary | MediaLibrary | startImagePreview(images: Array\, index: number, callback: AsyncCallback\): void;
startImagePreview(images: Array\, callback: AsyncCallback\): void;
startImagePreview(images: Array\, index?: number): Promise\; | Deprecated| +| ohos.multimedia.mediaLibrary | MediaLibrary | storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\): void;
storeMediaAsset(option: MediaAssetOption): Promise\; | Deprecated| +| ohos.multimedia.mediaLibrary | MediaSelectOption | count: number; | Deprecated| +| ohos.multimedia.mediaLibrary | MediaSelectOption | type: 'image' \| 'video' \| 'media'; | Deprecated| +| ohos.multimedia.mediaLibrary | MediaAssetOption | relativePath?: string; | Deprecated| +| ohos.multimedia.mediaLibrary | MediaAssetOption | mimeType: string; | Deprecated| +| ohos.multimedia.mediaLibrary | MediaAssetOption | src: string; | Deprecated| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-resource-scheduler.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-resource-scheduler.md new file mode 100644 index 0000000000000000000000000000000000000000..26d556058fd95e6a198dc9d2c4fd5358fc6f36f8 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-resource-scheduler.md @@ -0,0 +1,66 @@ +# JS API Changes of the Resource Scheduler Subsystem + +The table below lists the APIs changes of the resource scheduler subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.bundleState | bundleState | getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback\>): void;
getRecentlyUsedModules(maxNum?: number): Promise\>; | Added| +| ohos.bundleState | BundleActiveModuleInfo | formRecords: Array\; | Added| +| ohos.bundleState | BundleActiveModuleInfo | lastModuleUsedTime: number; | Added| +| ohos.bundleState | BundleActiveModuleInfo | launchedCount: number; | Added| +| ohos.bundleState | BundleActiveModuleInfo | abilityIconId?: number; | Added| +| ohos.bundleState | BundleActiveModuleInfo | abilityDescriptionId?: number; | Added| +| ohos.bundleState | BundleActiveModuleInfo | abilityLableId?: number; | Added| +| ohos.bundleState | BundleActiveModuleInfo | descriptionId?: number; | Added| +| ohos.bundleState | BundleActiveModuleInfo | labelId?: number; | Added| +| ohos.bundleState | BundleActiveModuleInfo | appLabelId?: number; | Added| +| ohos.bundleState | BundleActiveModuleInfo | abilityName?: string; | Added| +| ohos.bundleState | BundleActiveModuleInfo | moduleName: string; | Added| +| ohos.bundleState | BundleActiveModuleInfo | bundleName: string; | Added| +| ohos.bundleState | BundleActiveModuleInfo | deviceId?: string; | Added| +| ohos.bundleState | BundleActiveFormInfo | count: number; | Added| +| ohos.bundleState | BundleActiveFormInfo | formLastUsedTime: number; | Added| +| ohos.bundleState | BundleActiveFormInfo | formId: number; | Added| +| ohos.bundleState | BundleActiveFormInfo | formDimension: number; | Added| +| ohos.bundleState | BundleActiveFormInfo | formName: string; | Added| +| ohos.workScheduler | StorageRequest | STORAGE_LEVEL_LOW_OR_OKAY | Added| +| ohos.workScheduler | StorageRequest | STORAGE_LEVEL_OKAY | Added| +| ohos.workScheduler | StorageRequest | STORAGE_LEVEL_LOW = 0 | Added| +| ohos.workScheduler | BatteryStatus | BATTERY_STATUS_LOW_OR_OKAY | Added| +| ohos.workScheduler | BatteryStatus | BATTERY_STATUS_OKAY | Added| +| ohos.workScheduler | BatteryStatus | BATTERY_STATUS_LOW = 0 | Added| +| ohos.workScheduler | ChargingType | CHARGING_PLUGGED_WIRELESS | Added| +| ohos.workScheduler | ChargingType | CHARGING_PLUGGED_USB | Added| +| ohos.workScheduler | ChargingType | CHARGING_PLUGGED_AC | Added| +| ohos.workScheduler | ChargingType | CHARGING_PLUGGED_ANY = 0 | Added| +| ohos.workScheduler | NetworkType | NETWORK_TYPE_ETHERNET | Added| +| ohos.workScheduler | NetworkType | NETWORK_TYPE_WIFI_P2P | Added| +| ohos.workScheduler | NetworkType | NETWORK_TYPE_BLUETOOTH | Added| +| ohos.workScheduler | NetworkType | NETWORK_TYPE_WIFI | Added| +| ohos.workScheduler | NetworkType | NETWORK_TYPE_MOBILE | Added| +| ohos.workScheduler | NetworkType | NETWORK_TYPE_ANY = 0 | Added| +| ohos.workScheduler | workScheduler | isLastWorkTimeOut(workId: number, callback: AsyncCallback\): boolean;
isLastWorkTimeOut(workId: number): Promise\; | Added| +| ohos.workScheduler | workScheduler | stopAndClearWorks(): boolean; | Added| +| ohos.workScheduler | workScheduler | obtainAllWorks(callback: AsyncCallback\): Array\;
obtainAllWorks(): Promise\>; | Added| +| ohos.workScheduler | workScheduler | getWorkStatus(workId: number, callback: AsyncCallback\): void;
getWorkStatus(workId: number): Promise\; | Added| +| ohos.workScheduler | workScheduler | stopWork(work: WorkInfo, needCancel?: boolean): boolean; | Added| +| ohos.workScheduler | workScheduler | startWork(work: WorkInfo): boolean; | Added| +| ohos.workScheduler | WorkInfo | idleWaitTime?: number; | Added| +| ohos.workScheduler | WorkInfo | isDeepIdle?: boolean; | Added| +| ohos.workScheduler | WorkInfo | repeatCount?: number; | Added| +| ohos.workScheduler | WorkInfo | isRepeat?: boolean; | Added| +| ohos.workScheduler | WorkInfo | repeatCycleTime?: number; | Added| +| ohos.workScheduler | WorkInfo | storageRequest?: StorageRequest; | Added| +| ohos.workScheduler | WorkInfo | batteryStatus?: BatteryStatus; | Added| +| ohos.workScheduler | WorkInfo | batteryLevel?: number; | Added| +| ohos.workScheduler | WorkInfo | chargerType?: ChargingType; | Added| +| ohos.workScheduler | WorkInfo | isCharging?: boolean; | Added| +| ohos.workScheduler | WorkInfo | networkType?: NetworkType; | Added| +| ohos.workScheduler | WorkInfo | isPersisted?: boolean; | Added| +| ohos.workScheduler | WorkInfo | abilityName: string; | Added| +| ohos.workScheduler | WorkInfo | bundleName: string; | Added| +| ohos.workScheduler | WorkInfo | workId: number; | Added| +| ohos.WorkSchedulerExtensionAbility | WorkSchedulerExtensionAbility | onWorkStop(work: workScheduler.WorkInfo): void; | Added| +| ohos.WorkSchedulerExtensionAbility | WorkSchedulerExtensionAbility | onWorkStart(work: workScheduler.WorkInfo): void; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-soft-bus.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-soft-bus.md new file mode 100644 index 0000000000000000000000000000000000000000..2bc0ae8d79fdd72a7b8c2952513c7cb8b32f0d5b --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-soft-bus.md @@ -0,0 +1,43 @@ +# JS API Changes of the DSoftBus Subsystem + +The table below lists the APIs changes of the DSoftBus subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.rpc | Ashmem | readFromAshmem(size: number, offset: number): number[]; | Added| +| ohos.rpc | Ashmem | writeToAshmem(buf: number[], size: number, offset: number): boolean; | Added| +| ohos.rpc | Ashmem | setProtection(protectionType: number): boolean; | Added| +| ohos.rpc | Ashmem | mapReadOnlyAshmem(): boolean; | Added| +| ohos.rpc | Ashmem | mapReadAndWriteAshmem(): boolean; | Added| +| ohos.rpc | Ashmem | mapAshmem(mapType: number): boolean; | Added| +| ohos.rpc | Ashmem | getAshmemSize(): number; | Added| +| ohos.rpc | Ashmem | unmapAshmem(): void; | Added| +| ohos.rpc | Ashmem | closeAshmem(): void; | Added| +| ohos.rpc | Ashmem | static createAshmemFromExisting(ashmem: Ashmem): Ashmem; | Added| +| ohos.rpc | Ashmem | static createAshmem(name: string, size: number): Ashmem; | Added| +| ohos.rpc | Ashmem | PROT_WRITE = 2; | Added| +| ohos.rpc | Ashmem | PROT_READ = 1; | Added| +| ohos.rpc | Ashmem | PROT_NONE = 0; | Added| +| ohos.rpc | Ashmem | PROT_EXEC = 4; | Added| +| ohos.rpc | IPCSkeleton | static getCallingTokenId(): number; | Added| +| ohos.rpc | SendRequestResult | reply: MessageParcel; | Added| +| ohos.rpc | SendRequestResult | data: MessageParcel; | Added| +| ohos.rpc | SendRequestResult | code: number; | Added| +| ohos.rpc | SendRequestResult | errCode: number; | Added| +| ohos.rpc | MessageParcel | readRawData(size: number): number[]; | Added| +| ohos.rpc | MessageParcel | writeRawData(rawData: number[], size: number): boolean; | Added| +| ohos.rpc | MessageParcel | getRawDataCapacity(): number; | Added| +| ohos.rpc | MessageParcel | readAshmem(): Ashmem; | Added| +| ohos.rpc | MessageParcel | writeAshmem(ashmem: Ashmem): boolean; | Added| +| ohos.rpc | MessageParcel | readFileDescriptor(): number; | Added| +| ohos.rpc | MessageParcel | writeFileDescriptor(fd: number): boolean; | Added| +| ohos.rpc | MessageParcel | containFileDescriptors(): boolean; | Added| +| ohos.rpc | MessageParcel | static dupFileDescriptor(fd: number) :number; | Added| +| ohos.rpc | MessageParcel | static closeFileDescriptor(fd: number): void; | Added| +| ohos.rpc | MessageParcel | readRemoteObjectArray(objects: IRemoteObject[]): void;
readRemoteObjectArray(): IRemoteObject[]; | Added| +| ohos.rpc | MessageParcel | readSequenceableArray(sequenceableArray: Sequenceable[]): void; | Added| +| ohos.rpc | MessageParcel | writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean; | Added| +| ohos.rpc | MessageParcel | readException(): void; | Added| +| ohos.rpc | MessageParcel | writeNoException(): void; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-unitest.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-unitest.md new file mode 100644 index 0000000000000000000000000000000000000000..8527b14af314ab755d13573413003efefde71373 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-unitest.md @@ -0,0 +1,25 @@ +# JS API Changes of the Testing Framework Subsystem + +The table below lists the APIs changes of the testing framework subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.uitest | UiDriver | drag(startx: number, starty: number, endx: number, endy: number): Promise\; | Added| +| ohos.uitest | UiDriver | waitForComponent(by: By, time: number): Promise\; | Added| +| ohos.uitest | UiComponent | dragTo(target: UiComponent): Promise\; | Added| +| ohos.uitest | UiComponent | getBounds(): Promise\; | Added| +| ohos.uitest | UiComponent | scrollToBottom(): Promise\; | Added| +| ohos.uitest | UiComponent | scrollToTop(): Promise\; | Added| +| ohos.uitest | UiComponent | clearText(): Promise\; | Added| +| ohos.uitest | UiComponent | isCheckable(): Promise\; | Added| +| ohos.uitest | UiComponent | isChecked(): Promise\; | Added| +| ohos.uitest | UiComponent | isLongClickable(): Promise\; | Added| +| ohos.uitest | By | checkable(b?: bool): By; | Added| +| ohos.uitest | By | checked(b?: bool): By; | Added| +| ohos.uitest | By | longClickable(b?: bool): By; | Added| +| ohos.uitest | Rect | readonly bottomY: number; | Added| +| ohos.uitest | Rect | readonly rightX: number; | Added| +| ohos.uitest | Rect | readonly topY: number; | Added| +| ohos.uitest | Rect | readonly leftX: number; | Added| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-web.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-web.md new file mode 100644 index 0000000000000000000000000000000000000000..942d6ec8a33bb0d6ebf6de5a10a01ec0e987695a --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-web.md @@ -0,0 +1,46 @@ +# JS API Changes of the Web Subsystem + +The table below lists the APIs changes of the web subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Function| Change Type| +|---|---|---|---| +| web | WebAttribute | "onShowFileSelector(callback: (event?: { result: FileSelectorResult, fileSelector: FileSelectorParam }) => boolean): WebAttribute;" | Added| +| web | WebAttribute | webDebuggingAccess(webDebuggingAccess: boolean): WebAttribute; | Added| +| web | WebAttribute | fileFromUrlAccess(fileFromUrlAccess: boolean): WebAttribute; | Added| +| web | WebController | getCookieManager() : WebCookie | Added| +| web | WebCookie | deleteExpiredCookie(): void; | Added| +| web | WebCookie | deleteSessionCookie(): void; | Added| +| web | WebCookie | deleteEntireCookie(): void; | Added| +| web | WebCookie | existCookie(): boolean; | Added| +| web | WebCookie | getCookie(url: string): string; | Added| +| web | WebCookie | saveCookieSync(): boolean; | Added| +| web | WebCookie | putAcceptFileURICookieEnabled(accept: boolean): void; | Added| +| web | WebCookie | putAcceptThirdPartyCookieEnabled(accept: boolean): void; | Added| +| web | WebCookie | putAcceptCookieEnabled(accept: boolean): void; | Added| +| web | WebCookie | isFileURICookieAllowed(): boolean; | Added| +| web | WebCookie | isThirdPartyCookieAllowed(): boolean; | Added| +| web | WebCookie | isCookieAllowed(): boolean; | Added| +| web | FileSelectorResult | handleFileList(fileList: Array\): void; | Added| +| web | FileSelectorResult | constructor(); | Added| +| web | FileSelectorParam | isCapture(): boolean; | Added| +| web | FileSelectorParam | getAcceptType(): Array\; | Added| +| web | FileSelectorParam | getMode(): FileSelectorMode; | Added| +| web | FileSelectorParam | getTitle(): string; | Added| +| web | FileSelectorParam | constructor(); | Added| +| web | FileSelectorMode | FileSaveMode | Added| +| web | FileSelectorMode | FileOpenFolderMode | Added| +| web | FileSelectorMode | FileOpenMultipleMode | Added| +| web | FileSelectorMode | FileOpenMode | Added| +| web | RenderExitReason | ProcessExitUnknown | Added| +| web | RenderExitReason | ProcessOom | Added| +| web | RenderExitReason | ProcessCrashed | Added| +| web | RenderExitReason | ProcessWasKilled | Added| +| web | RenderExitReason | ProcessAbnormalTermination | Added| +| web | CacheMode | Default | Added| +| web | WebAttribute | onFileSelectorShow(callback: (event?: { callback: Function, fileSelector: object }) => void): WebAttribute; | Deprecated| +| web | WebAttribute | onSslErrorReceive(callback: (event?: { handler: Function, error: object }) => void): WebAttribute; | Deprecated| +| web | WebAttribute | onRenderExited(callback: (event?: { detail: object }) => boolean): WebAttribute; | Deprecated| +| web | WebCookie | saveCookie(); | Deprecated| +| web | WebCookie | setCookie(); | Deprecated| diff --git a/en/release-notes/api-change/v3.2-beta/js-apidiff-window.md b/en/release-notes/api-change/v3.2-beta/js-apidiff-window.md new file mode 100644 index 0000000000000000000000000000000000000000..17e4312d9955fbcd21278a9788bc90d6da3d62dd --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/js-apidiff-window.md @@ -0,0 +1,50 @@ +# JS API Changes of the Window Manager Subsystem + +The table below lists the APIs changes of the window manager subsystem in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## API Changes + +| Module| Class| Method/Attribute/Enumeration/Constant| Change Type| +|---|---|---|---| +| ohos.screen | ScreenModeInfo | refreshRate: number; | Added| +| ohos.screen | ScreenModeInfo | height: number; | Added| +| ohos.screen | ScreenModeInfo | width: number; | Added| +| ohos.screen | ScreenModeInfo | id: number; | Added| +| ohos.screen | Orientation | SENSOR_HORIZONTAL = 7 | Added| +| ohos.screen | Orientation | SENSOR_VERTICAL = 6 | Added| +| ohos.screen | Orientation | SENSOR = 5 | Added| +| ohos.screen | Orientation | REVERSE_HORIZONTAL = 4 | Added| +| ohos.screen | Orientation | REVERSE_VERTICAL = 3 | Added| +| ohos.screen | Orientation | HORIZONTAL = 2 | Added| +| ohos.screen | Orientation | VERTICAL = 1 | Added| +| ohos.screen | Orientation | UNSPECIFIED = 0 | Added| +| ohos.screen | Screen | setScreenActiveMode(modeIndex: number, callback: AsyncCallback\): void;
setScreenActiveMode(modeIndex: number): Promise\; | Added| +| ohos.screen | Screen | setOrientation(orientation: Orientation, callback: AsyncCallback\): void;
setOrientation(orientation: Orientation): Promise\; | Added| +| ohos.screen | Screen | readonly orientation: Orientation; | Added| +| ohos.screen | Screen | readonly activeModeIndex: number; | Added| +| ohos.screen | Screen | readonly supportedModeInfo: Array\; | Added| +| ohos.screen | Screen | readonly parent: number; | Added| +| ohos.screen | Screen | readonly id: number; | Added| +| ohos.screen | ExpandOption | startY: number; | Added| +| ohos.screen | ExpandOption | startX: number; | Added| +| ohos.screen | ExpandOption | screenId: number; | Added| +| ohos.screen | screen | function makeMirror(mainScreen:number, mirrorScreen:Array\, callback: AsyncCallback\): void;
function makeMirror(mainScreen:number, mirrorScreen:Array\): Promise\; | Added| +| ohos.screen | screen | function makeExpand(options:Array\, callback: AsyncCallback\): void;
function makeExpand(options:Array\): Promise\; | Added| +| ohos.screen | screen | function off(eventType: 'connect' \| 'disconnect' \| 'change', callback?: Callback\): void; | Added| +| ohos.screen | screen | function getAllScreens(callback: AsyncCallback\>): void;
function getAllScreens(): Promise\>; | Added| +| ohos.window | WindowStage | loadContent(path: string, storage: LocalStorage, callback: AsyncCallback\): void;
loadContent(path: string, storage?: LocalStorage): Promise\;
loadContent(path: string, callback: AsyncCallback\): void; | Added| +| ohos.window | WindowStage | getSubWindow(): Promise\>;
getSubWindow(callback: AsyncCallback\>): void; | Added| +| ohos.window | WindowStage | createSubWindow(name: string): Promise\;
createSubWindow(name: string, callback: AsyncCallback\): void; | Added| +| ohos.window | WindowStage | getMainWindow(): Promise\;
getMainWindow(callback: AsyncCallback\): void; | Added| +| ohos.window | WindowStageEventType | BACKGROUND | Added| +| ohos.window | WindowStageEventType | INACTIVE | Added| +| ohos.window | WindowStageEventType | ACTIVE | Added| +| ohos.window | WindowStageEventType | FOREGROUND = 1 | Added| +| ohos.window | window | function setWindowLayoutMode(mode: WindowLayoutMode, callback: AsyncCallback\): void;
function setWindowLayoutMode(mode: WindowLayoutMode): Promise\; | Added| +| ohos.window | window | function toggleShownStateForAllAppWindows(callback: AsyncCallback\): void;
function toggleShownStateForAllAppWindows(): Promise\; | Added| +| ohos.window | window | function minimizeAll(id: number, callback: AsyncCallback\): void;
function minimizeAll(id: number): Promise\; | Added| +| ohos.window | WindowLayoutMode | WINDOW_LAYOUT_MODE_TILE | Added| +| ohos.window | WindowLayoutMode | WINDOW_LAYOUT_MODE_CASCADE | Added| +| ohos.window | Window | setOutsideTouchable(touchable: boolean): Promise\;
setOutsideTouchable(touchable: boolean, callback: AsyncCallback\): void; | Deprecated| +| ohos.window | Window | setDimBehind(dimBehindValue: number, callback: AsyncCallback\): void;
setDimBehind(dimBehindValue: number): Promise\; | Deprecated| +| ohos.window | WindowProperties | dimBehindValue: number | Deprecated| diff --git a/en/release-notes/api-change/v3.2-beta/native-apidiff-v3.2-beta.md b/en/release-notes/api-change/v3.2-beta/native-apidiff-v3.2-beta.md new file mode 100644 index 0000000000000000000000000000000000000000..18e3a41f2dffc00a3527c5be2740a3eaf8ee3bec --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/native-apidiff-v3.2-beta.md @@ -0,0 +1,12 @@ +# Native API Differences + +The table below lists the native APIs changes in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release. + +## Standard System API Changes + +| Module| API | Change Type| Change Description | +| -------- | ------------------------------------------------------------ | -------- | ----------------------------------------------- | +| ArkUI-xcomponent | int32_t OH_NativeXComponent_GetMouseEvent(
OH_NativeXComponent* component, const void* window, OH_NativeXComponent_MouseEvent* mouseEvent) | Added | You can obtain mouse events by using the XComponent.| +| ArkUI-xcomponent | int32_t OH_NativeXComponent_RegisterMouseEventCallback(
OH_NativeXComponent* component, OH_NativeXComponent_MouseEvent_Callback* callback) | Added | You can register an XComponent callback event.| + + diff --git a/en/release-notes/api-change/v3.2-beta/readme.md b/en/release-notes/api-change/v3.2-beta/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..bb853a0b7e30e1ca6ad8d15623f00457ace31a35 --- /dev/null +++ b/en/release-notes/api-change/v3.2-beta/readme.md @@ -0,0 +1,25 @@ +# Readme + +This directory records the API changes in OpenHarmony 3.2 Beta1 over OpenHarmony 3.1 Release, including new, updated, deprecated, and deleted APIs. + +- JS API Differences + - [Ability framework](js-apidiff-ability.md) + - [ArkUI Development Framework](js-apidiff-arkui.md) + - [Power management subsystem](js-apidiff-battery.md) + - [Bundle management framework](js-apidiff-bundle.md) + - [Communication subsystem](js-apidiff-communicate.md) + - [DFX subsystem](js-apidiff-dfx.md) + - [Distributed data management subsystem](js-apidiff-distributed-data.md) + - [Common event and notification framework](js-apidiff-event-and-notification.md) + - [File management subsystem](js-apidiff-file-management.md) + - [Globalization subsystem](js-apidiff-global.md) + - [Startup subsystem](js-apidiff-init.md) + - [Misc services subsystem](js-apidiff-misc.md) + - [Multimodal input subsystem](js-apidiff-multi-modal-input.md) + - [Multimedia subsystem](js-apidiff-multimedia.md) + - [Resource scheduler subsystem](js-apidiff-resource-scheduler.md) + - [DSoftBus subsystem](js-apidiff-soft-bus.md) + - [Testing framework subsystem](js-apidiff-unitest.md) + - [Web subsystem](js-apidiff-web.md) + - [Window manager subsystem](js-apidiff-window.md) +- [Native API Differences](native-apidiff-v3.2-beta.md) diff --git a/zh-cn/application-dev/ability/fa-dataability.md b/zh-cn/application-dev/ability/fa-dataability.md index e9fd630224f21b76c4ebd019d130ba8ee44aea9d..8c566aa444759c855db899ff1a3543935ad2e179 100644 --- a/zh-cn/application-dev/ability/fa-dataability.md +++ b/zh-cn/application-dev/ability/fa-dataability.md @@ -6,22 +6,22 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开 ## 接口说明 -**表1** Data中相关生命周期功能介绍 +**表1** Data中相关生命周期API功能介绍 |接口名|描述| |:------|:------| -|onInitialized|在Ability初始化调用,通过此回调方法执行rdb等初始化操作。| -|update|更新数据库中的数据。| -|query|查询数据库中的数据。| -|delete|删除一条或多条数据。| -|normalizeUri|对uri进行规范化。一个规范化的uri可以支持跨设备使用、持久化、备份和还原等,当上下文改变时仍然可以引用到相同的数据项。| -|batchInsert|向数据库中插入多条数据。| -|denormalizeUri|将一个由normalizeUri生产的规范化uri转换成非规范化的uri。| -|insert|向数据中插入一条数据。| -|openFile|打开一个文件。| -|getFileTypes|获取文件的MIME类型。| -|getType|获取uri指定数据相匹配的MIME类型。| -|executeBatch|批量操作数据库中的数据。| -|call|自定义方法。| +|onInitialized?(info: AbilityInfo): void|在Ability初始化调用,通过此回调方法执行rdb等初始化操作。| +|update?(uri: string, valueBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void|更新数据库中的数据。| +|query?(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void|查询数据库中的数据。| +|delete?(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void|删除一条或多条数据。| +|normalizeUri?(uri: string, callback: AsyncCallback): void|对uri进行规范化。一个规范化的uri可以支持跨设备使用、持久化、备份和还原等,当上下文改变时仍然可以引用到相同的数据项。| +|batchInsert?(uri: string, valueBuckets: Array, callback: AsyncCallback): void|向数据库中插入多条数据。| +|denormalizeUri?(uri: string, callback: AsyncCallback): void|将一个由normalizeUri生产的规范化uri转换成非规范化的uri。| +|insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback): void|向数据中插入一条数据。| +|openFile?(uri: string, mode: string, callback: AsyncCallback): void|打开一个文件。| +|getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void|获取文件的MIME类型。| +|getType?(uri: string, callback: AsyncCallback): void|获取uri指定数据相匹配的MIME类型。| +|executeBatch?(ops: Array, callback: AsyncCallback>): void|批量操作数据库中的数据。| +|call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback): void|自定义方法。| ## 开发步骤 @@ -97,15 +97,15 @@ Data提供方可以自定义数据的增、删、改、查,以及文件打开 ```json "abilities":[{ - "srcPath": "DataAbility", - "name": ".DataAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:description_dataability", - "type": "data", - "visible": true, - "uri": "dataability://ohos.samples.etsdataability.DataAbility" - }] + "srcPath": "DataAbility", + "name": ".DataAbility", + "icon": "$media:icon", + "srcLanguage": "ets", + "description": "$string:description_dataability", + "type": "data", + "visible": true, + "uri": "dataability://ohos.samples.etsdataability.DataAbility" + }] ``` ### 访问Data diff --git a/zh-cn/application-dev/ability/fa-serviceability.md b/zh-cn/application-dev/ability/fa-serviceability.md index 335854f911b13966767e34bb28bb42b587d6aed0..da697588bed85887df36ea4182223ebd3946bfb2 100644 --- a/zh-cn/application-dev/ability/fa-serviceability.md +++ b/zh-cn/application-dev/ability/fa-serviceability.md @@ -5,18 +5,18 @@ ## 接口说明 -**表1** Service中相关生命周期功能介绍 +**表1** Service中相关生命周期API功能介绍 |接口名|描述| |:------|:------| -|onStart|该方法在创建Service的时候调用,用于Service的初始化。在Service的整个生命周期只会调用一次,调用时传入的Want应为空。| -|onCommand|在Service创建完成之后调用,该方法在客户端每次启动该Service时都会调用,开发者可以在该方法中做一些调用统计、初始化类的操作。| -|onConnect|在Ability和Service连接时调用。| -|onDisconnect|在Ability与绑定的Service断开连接时调用。| -|onStop|在Service销毁时调用。Service应通过实现此方法来清理任何资源,如关闭线程、注册的侦听器等。| +|onStart?(): void|该方法在创建Service的时候调用,用于Service的初始化。在Service的整个生命周期只会调用一次,调用时传入的Want应为空。| +|onCommand?(want: Want, startId: number): void|在Service创建完成之后调用,该方法在客户端每次启动该Service时都会调用,开发者可以在该方法中做一些调用统计、初始化类的操作。| +|onConnect?(want: Want): rpc.RemoteObject|在Ability和Service连接时调用。| +|onDisconnect?(want: Want): void|在Ability与绑定的Service断开连接时调用。| +|onStop?(): void|在Service销毁时调用。Service应通过实现此方法来清理任何资源,如关闭线程、注册的侦听器等。| ## 开发步骤 -### 创建Service +### 创建注册Service 1. Service也是一种Ability,Ability为Service提供了以下生命周期方法,开发者可以重写这些方法,来添加其他Ability请求与Service Ability交互时的处理方法。 @@ -113,7 +113,7 @@ let promise = featureAbility.startAbility( ### 停止Service - Service一旦创建就会一直保持在后台运行,除非必须回收内存资源,否则系统不会停止或销毁Service。开发者可以在Service中通过terminateSelf()停止本Service。 + Service一旦创建就会一直保持在后台运行,除非必须回收内存资源,否则系统不会停止或销毁Service。 diff --git a/zh-cn/application-dev/ability/stage-ability.md b/zh-cn/application-dev/ability/stage-ability.md index 2757581f9962a0963852166f142a3fd1a0c678fa..35afcbc9dc1db61f262580ed5b3ee8994f2b329f 100644 --- a/zh-cn/application-dev/ability/stage-ability.md +++ b/zh-cn/application-dev/ability/stage-ability.md @@ -50,7 +50,7 @@ Ability功能如下(Ability类,具体的API详见[接口文档](../reference |onWindowStageDestroy(): void|Ability生命周期回调,销毁window stage时被调用。| |onForeground(): void|Ability生命周期回调,Ability切换至前台时被调用。| |onBackground(): void|Ability生命周期回调,Ability切换至后台时被调用。| -|onNewWant(want: Want): void|Ability回调,Ability的启动模式设置为单例时被调用。| +|onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void|Ability回调,Ability的启动模式设置为单例时被调用。| |onConfigurationUpdated(config: Configuration): void|Ability回调,Ability的系统配置更新时被调用。| ### 实现AbilityStage及Ability生命周期 创建Stage模型的Page Ability应用,需实现AbilityStage接口及Ability生命周期接口,并使用窗口提供的方法设置页面。具体示例代码如下: @@ -292,7 +292,7 @@ async function reStartAbility() { import Ability from '@ohos.application.Ability' export default class MainAbility extends Ability { - onNewWant(want) { + onNewWant(want, launchParams) { globalThis.newWant = want } } diff --git a/zh-cn/application-dev/ability/stage-serviceextension.md b/zh-cn/application-dev/ability/stage-serviceextension.md index dc08f94c1427592f465fb6f35ae9da9b1fe82784..daf703a4edf3e1c4529b54b66552dc611dc148e4 100644 --- a/zh-cn/application-dev/ability/stage-serviceextension.md +++ b/zh-cn/application-dev/ability/stage-serviceextension.md @@ -7,75 +7,68 @@ ExtensionAbility,是Stage模型中新增的扩展组件的基类,一般用 ## 接口说明 -**表1** ServiceExtensionAbility中相关生命周期功能介绍 +**表1** ServiceExtensionAbility中相关生命周期API功能介绍 |接口名|描述| |:------|:------| -|onCreate|首次调用startAbility、connectAbility时触发,开发者可以进行初始化操作。| -|onRequest|每次调用startAbility都会触发,首次调用时startId为1,重复调用startAbility递增。| -|onConnect|调用connectAbility触发,重复调用不会再次触发,除非调用disconnectAbility解除绑定后再调用;onConnect返回一个进程通信类RemoteObject。| -|onDisconnect|调用disconnectAbility触发,Extension如果是用connectAbility拉起的,并且已经没有其他应用绑定这个Extension,则会触发onDestroy生命周期销毁组件。| -|onDestroy|调用停止当前ability接口terminateSelf会触发。| +|onCreate(want: Want): void|首次调用startAbility、connectAbility时触发,开发者可以进行初始化操作。| +|onRequest(want: Want, startId: number): void|每次调用startAbility都会触发,首次调用时startId为1,重复调用startAbility递增。| +|onConnect(want: Want): rpc.RemoteObject|调用connectAbility触发,重复调用不会再次触发,除非调用disconnectAbility解除绑定后再调用;onConnect返回一个进程通信类RemoteObject。| +|onDisconnect(want: Want): void|调用disconnectAbility触发,Extension如果是用connectAbility拉起的,并且已经没有其他应用绑定这个Extension,则会触发onDestroy生命周期销毁组件。| +|onDestroy(): void|调用停止当前ability接口terminateSelf会触发。| ## 约束与限制 -- OpenHarmony当前不支持三方应用创建ServiceExtensionAbility。 +OpenHarmony当前不支持三方应用创建ServiceExtensionAbility。 ## 开发步骤 -1.创建ServiceExtensionAbility +1. 需要在应用配置文件module.json中进行注册,注册类型type需要设置为service。module.json配置样例如下所示: -开发者在创建TS文件中自定义类继承ServiceExtensionAbility,重写基类回调函数,示例如下: - - ```js - import rpc from '@ohos.rpc' - class StubTest extends rpc.RemoteObject { - constructor(des) { - super(des); - } - onRemoteRequest(code, data, reply, option) { - } - } - - class ServiceExt extends ServiceExtensionAbility { - onCreate(want) { - console.log('onCreate, want:' + want.abilityName); - } - onRequest(want, startId) { - console.log('onRequest, want:' + want.abilityName); - } - onConnect(want) { - console.log('onConnect , want:' + want.abilityName); - return new StubTest("test"); - } - onDisconnect(want) { - console.log('onDisconnect, want:' + want.abilityName); - } - onDestroy() { - console.log('onDestroy'); - } - } - ``` + ```json + "extensionAbilities":[{ + "name": "ServiceExtAbility", + "icon": "$media:icon", + "description": "service", + "type": "service", + "visible": true, + "srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts" + }] + ``` -2.注册ServiceExtensionAbility -需要在应用配置文件module.json中进行注册,注册类型type需要设置为service。 +2. 开发者在定义Service的目录下创建TS文件,自定义类继承ServiceExtensionAbility,重写基类回调函数,示例如下: -**module.json配置样例** - -```json -"extensionAbilities":[{ - "name": "ServiceExtAbility", - "icon": "$media:icon", - "description": "service", - "type": "service", - "visible": true, - "srcEntrance": "./ets/ServiceExtAbility/ServiceExtAbility.ts" -}] -``` + ```js + import rpc from '@ohos.rpc' + class StubTest extends rpc.RemoteObject { + constructor(des) { + super(des); + } + onRemoteRequest(code, data, reply, option) { + } + } + class ServiceExt extends ServiceExtensionAbility { + console.log('onCreate, want:' + want.abilityName); + } + onRequest(want, startId) { + console.log('onRequest, want:' + want.abilityName); + } + onConnect(want) { + console.log('onConnect , want:' + want.abilityName); + return new StubTest("test"); + } + onDisconnect(want) { + console.log('onDisconnect, want:' + want.abilityName); + } + onDestroy() { + console.log('onDestroy'); + } + } + ``` ## 相关实例 针对ServiceExtensionAbility开发,有以下相关实例可供参考: diff --git a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md index a946d4dfaf3978b972f0857b2ff7e2273c6f262d..47c693cb3082578e011e97d2f078a86da6a8b18c 100644 --- a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md +++ b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-dev-guide.md @@ -19,9 +19,18 @@ import stats from '@ohos.bundleState'; | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback<BundleActiveInfoResponse>): void | 通过指定起始和结束时间查询应用使用时长统计信息。 | | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void | 通过指定起始和结束时间查询当前应用的事件集合。 | | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback<Array<BundleStateInfo>>): void | 通过指定时间段间隔(天、周、月、年)查询应用使用时长统计信息。 | -| function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void | 查询(返回)当前调用者应用的使用优先级群组。 | +| function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback<number>): void | 查询当前调用者应用或者指定应用的使用优先级群组。callback形式。 | +| function queryAppUsagePriorityGroup(bundleName? : string): Promise; | 查询当前调用者应用或者指定应用的使用优先级群组。promise形式。 | | function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void | 判断指定Bundle Name的应用当前是否是空闲状态。 | | function getRecentlyUsedModules(maxNum: number, callback: AsyncCallback<BundleActiveModuleInfo>): void | 根据maxNum,查询FA使用记录,返回不超过maxNum条FA使用记录。 | +| function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void | 通过指定起始和结束时间查询所有应用的通知次数。 | +| function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void | 通过指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。 | +| function setBundleGroup(bundleName : string, newGroup: GroupType, callback: AsyncCallback): void | 给应用名是bundleName的应用分组设置成newGroup,返回设置结果是否成功,以callback形式返回。 | +| function setBundleGroup(bundleName : string, newGroup : GroupType): Promise; | 给应用名是bundleName的应用分组设置成newGroup,返回设置结果是否成功,以promise形式返回。 | +| function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void | 注册应用分组变化监听回调,返回注册是否成功,当应用分组发生变化时,会给所有已注册的监听者返回回调信息,以callback形式返回。 | +| function registerGroupCallBack(callback: Callback): Promise; | 注册应用分组变化监听回调,返回注册是否成功,当应用分组发生变化时,会给所有已注册的监听者返回回调信息,以promise形式返回。 | +| function unRegisterGroupCallBack(callback: AsyncCallback): void | 解除应用分组监听回调,以callback形式返回。 | +| function unRegisterGroupCallBack(): Promise; | 解除应用分组监听回调,以promise形式返回。 | ## 开发步骤 @@ -163,19 +172,19 @@ import stats from '@ohos.bundleState'; }); ``` -6. 查询(返回)当前调用者应用的使用优先级群组,config.json中不需要配置权限。 +6. 查询(无参)当前调用者应用的使用优先级群组,config.json中不需要配置权限。查询(有参)指定应用的使用优先级群组,config.json中需要配置权限:ohos.permission.BUNDLE_ACTIVE_INFO。 ```js import stats from '@ohos.bundleState' - - // 异步方法promise方式 + + // 无参异步方法promise方式 stats.queryAppUsagePriorityGroup().then( res => { console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise succeeded. result: ' + JSON.stringify(res)); }).catch( err => { console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise failed. because: ' + err.code); }); - - // 异步方法callback方式 + + // 无参异步方法callback方式 stats.queryAppUsagePriorityGroup((err, res) => { if (err) { console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup callback failed. because: ' + err.code); @@ -183,6 +192,22 @@ import stats from '@ohos.bundleState'; console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup callback succeeded. result: ' + JSON.stringify(res)); } }); + + //有参异步promise方式 + stats.queryAppUsagePriorityGroup(this.bundleName).then( res => { + console.log('BUNDLE_ACTIVE QueryPackageGroup promise succeeded. result: ' + JSON.stringify(res)); + }).catch( err => { + console.log('BUNDLE_ACTIVE QueryPackageGroup promise failed. because: ' + err.code); + }); + + //有参异步方法callback方式 + stats.queryAppUsagePriorityGroup(this.bundleName, (err, res) => { + if(err) { + console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE QueryPackageGroup callback succeeded. result: ' + JSON.stringify(res)); + } + }); ``` 7. 判断指定Bundle Name的应用当前是否是空闲状态,config.json中不需要配置权限。 @@ -261,3 +286,132 @@ import stats from '@ohos.bundleState'; }); ``` +9. 通过指定起始和结束时间查询所有应用的通知次数,config.json中需要配置权限:ohos.permission.BUNDLE_ACTIVE_INFO。 + + ```js + import stats from '@ohos.bundleState' + + // 异步方法promise方式 + stats.queryAppNotificationNumber(0, 20000000000000).then( res => { + console.log('BUNDLE_ACTIVE queryAppNotificationNumber promise success.'); + console.log('BUNDLE_ACTIVE queryAppNotificationNumber promise result ' + JSON.stringify(res)); + }).catch( err => { + console.log('BUNDLE_ACTIVE queryAppNotificationNumber promise failed, because: ' + err.code); + }); + + // 异步方法callback方式 + stats.queryAppNotificationNumber(0, 20000000000000, (err, res) => { + if (err) { + console.log('BUNDLE_ACTIVE queryAppNotificationNumber callback failed, because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE queryAppNotificationNumber callback success.'); + console.log('BUNDLE_ACTIVE queryAppNotificationNumber callback result ' + JSON.stringify(res)); + } + }); + ``` + +10. 通过指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息,config.json中需要配置权限:ohos.permission.BUNDLE_ACTIVE_INFO。 + + ```js + import stats from '@ohos.bundleState' + + // 异步方法promise方式 + stats.queryBundleActiveEventStates(0, 20000000000000).then( res => { + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates promise success.'); + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates promise result ' + JSON.stringify(res)); + }).catch( err => { + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates promise failed, because: ' + err.code); + }); + + // 异步方法callback方式 + stats.queryBundleActiveEventStates(0, 20000000000000, (err, res) => { + if (err) { + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates callback failed, because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates callback success.'); + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates callback result ' + JSON.stringify(res)); + } + }); + ``` + +11. 给应用名是bundleName的应用分组设置成newGroup,返回设置结果是否成功 + + ```javascript + import stats from '@ohos.bundleState' + + //异步方法promise + stats.setBundleGroup(this.bundleName, this.newGroup).then( res => { + console.log('BUNDLE_ACTIVE SetBundleGroup promise succeeded. result: ' + JSON.stringify(res)); + }).catch( err => { + console.log('BUNDLE_ACTIVE SetBundleGroup promise failed. because: ' + err.code); + }); + //异步方法callback + stats.setBundleGroup(this.bundleName, this.newGroup, (err, res) => { + if(err) { + console.log('BUNDLE_ACTIVE SetBundleGroup callback failed. because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE SetBundleGroup callback succeeded. result: ' + JSON.stringify(res)); + } + }); + ``` + +12. 注册应用分组变化监听回调,返回注册是否成功,当应用分组发生变化时,会给所有已注册的监听者返回回调信息 + + ```javascript + import stats from '@ohos.bundleState' + + //异步方法promise形式 + let onBundleGroupChanged = (err,res) =>{ + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result oldGroup is : ' + res.oldGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result newGroup is : ' + res.newGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result changeReason is : ' + res.newGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result userId is : ' + res.userId); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result bundleName is : ' + res.bundleName); + }; + stats.registerGroupCallBack(onBundleGroupChanged).then( res => { + console.log('BUNDLE_ACTIVE RegisterGroupCallBack promise succeeded. result1: ' + JSON.stringify(res)); + }).catch( err => { + console.log('BUNDLE_ACTIVE RegisterGroupCallBack promise failed. because: ' + err.code); + }); + //异步方法callback形式 + let onBundleGroupChanged = (err,res) =>{ + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s oldGroup is : ' + res.oldGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s newGroup is : ' + res.newGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s changeReason is : ' + res.newGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s userId is : ' + res.userId); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s bundleName is : ' + res.bundleName); + }; + stats.registerGroupCallBack(onBundleGroupChanged, (err,res)=>{ + if(err) { + console.log('BUNDLE_ACTIVE RegisterGroupCallBack callback failed, because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE RegisterGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE RegisterGroupCallBack result is : ' + JSON.stringify(res)); + } + }); + ``` + +13. 解除应用分组监听回调 + + ```javascript + import stats from '@ohos.bundleState' + + //promise + stats.unRegisterGroupCallBack().then( res => { + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack promise succeeded. result: ' + JSON.stringify(res)); + }).catch( err => { + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack promise failed. because: ' + err.code); + }); + //callback + stats.unRegisterGroupCallBack((err,res)=>{ + if(err) { + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack callback failed, because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack result is : ' + JSON.stringify(res)); + } + }); + ``` + diff --git a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md index 607dbcd18aaa0bdb88dcb2bd9102692a86412ee1..333bdcab114e55a85874845713775bf64beed3f8 100644 --- a/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md +++ b/zh-cn/application-dev/device-usage-statistics/device-usage-statistics-overview.md @@ -16,10 +16,24 @@ 2. 根据起止时间查询应用的使用时长。 3. 根据起止时间查询当前应用的事件集合。 4. 根据interval(日、周、月、年)类型和起止时间查询应用的使用时长。 -5. 查询调用者应用的优先级群组。 +5. 查询调用者应用或指定应用的优先级群组。 6. 判断指定应用当前是否是空闲状态。 7. 查询FA使用记录。返回数量最大不超过maxNum设置的值,FA使用记录由近及远排序,maxNum最大为1000,若不填写maxNum参数,则maxNum默认为1000。 +8. 根据起止时间查询应用通知次数。 +9. 根据起止时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。 + +- 设置接口 + +1. 给应用名称为bundleName的应用分组设置为newGroup。 + +- 注册接口 + +1. 注册应用分组变化回调监听,当应用分组发生变化,会给所有已注册的应用返回变化信息 + +- 解注册接口 + +1. 解除注册应用分组变化回调监听 ### 设备使用信息统计使用权限 -- 设备使用信息统计的queryBundleActiveStates、queryBundleStateInfos、queryBundleStateInfoByInterval接口为系统api,调用前需要申请ohos.permission.BUNDLE_ACTIVE_INFO权限。 -- 设备使用信息统计的queryCurrentBundleActiveStates、queryAppUsagePriorityGroup、isIdleState接口为三方api,调用时不需要申请权限。 \ No newline at end of file +- 设备使用信息统计的queryBundleActiveStates、queryBundleStateInfos、queryBundleStateInfoByInterval、queryBundleActiveEventStates、queryAppNotificationNumber、queryAppUsagePriorityGroup(有参)、setBundleGroup、registerGroupCallBack、unRegisterGroupCallBack接口为系统api,调用前需要申请ohos.permission.BUNDLE_ACTIVE_INFO权限。 +- 设备使用信息统计的queryCurrentBundleActiveStates、queryAppUsagePriorityGroup(无参)、isIdleState接口为三方api,调用时不需要申请权限。 \ No newline at end of file diff --git a/zh-cn/application-dev/napi/drawing-guidelines.md b/zh-cn/application-dev/napi/drawing-guidelines.md index 2a3e2b6398222401ab0fc645bd7a289e52316c86..bfdd9c85e29b4514675691da9416e6b5448174bb 100644 --- a/zh-cn/application-dev/napi/drawing-guidelines.md +++ b/zh-cn/application-dev/napi/drawing-guidelines.md @@ -157,7 +157,7 @@ Native Drawing模块提供了一系列的接口用于基本图形和字体的绘 2. **设置排版风格**。 ```c++ - // 选择左对齐/居中对齐等排版属性 + // 选择从左到右/左对齐等排版属性 OH_Drawing_TypographyStyle* typoStyle = OH_Drawing_CreateTypographyStyle(); OH_Drawing_SetTypographyTextDirection(typoStyle, TEXT_DIRECTION_LTR); OH_Drawing_SetTypographyTextAlign(typoStyle, TEXT_ALIGN_LEFT); @@ -204,5 +204,5 @@ Native Drawing模块提供了一系列的接口用于基本图形和字体的绘 ## 相关实例 针对Drawing模块的使用,有以下相关实例可供参考: -* [Drawing模块2D图形绘制](https://gitee.com/openharmony/graphic_standard/blob/master/rosen/samples/2d_graphics/drawing_c_sample.cpp)。 -* [Drawing模块文本绘制显示](https://gitee.com/openharmony/graphic_standard/blob/master/rosen/samples/text/renderservice/drawing_text_c_sample.cpp)。 +* [Drawing模块2D图形绘制](https://gitee.com/openharmony/graphic_graphic_2d/blob/master/rosen/samples/2d_graphics/drawing_c_sample.cpp)。 +* [Drawing模块文本绘制显示](https://gitee.com/openharmony/graphic_graphic_2d/blob/master/rosen/samples/text/renderservice/drawing_text_c_sample.cpp)。 diff --git a/zh-cn/application-dev/quick-start/app-provision-structure.md b/zh-cn/application-dev/quick-start/app-provision-structure.md index e68547b804344cc5272b2e3b4757a178d3922a08..bcace10036d5b6ddcd5c626eb13630c504bd4100 100644 --- a/zh-cn/application-dev/quick-start/app-provision-structure.md +++ b/zh-cn/application-dev/quick-start/app-provision-structure.md @@ -1,5 +1,5 @@ # HarmonyAppProvision配置文件的说明 -在应用的开发过程中,应用的部分信息需要在HarmonyAppProvision配置文件(该文件在部分文档中也称为profile文件)中声明。 +在应用的开发过程中,应用的权限、签名信息等需要在HarmonyAppProvision配置文件(该文件在部分文档中也称为profile文件)中声明。 ## 配置文件的内部结构 HarmonyAppProvision文件包含version-code对象、version-name对象、uuid对象、type对象、issuer对象、validity对象、bundle-info对象、acls对象、permissions对象、debug-info对象等部分组成。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md index 2b3b63b6615facd817b6310f85a0a2c5694e8bd9..876e7897bfb2997a6f74c07da09a09c26a9bb204 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md @@ -1611,7 +1611,9 @@ bundle.queryExtensionAbilityInfos(want, extensionType, extensionFlags, receiver) | GET_ABILITY_INFO_SYSTEMAPP_ONLY8+ | 0x00000080 | 获取仅包括系统应用的ability信息 | | GET_ABILITY_INFO_WITH_DISABLE8+ | 0x00000100 | 获取包括被禁用的ability信息 | | GET_APPLICATION_INFO_WITH_DISABLE8+ | 0x00000200 | 获取包括被禁用的应用信息 | +| GET_APPLICATION_INFO_WITH_CERTIFICATE_FINGERPRINT 9+ | 0x00000400 | 获取包括应用申请的签名证书的指纹信息 | | GET_ALL_APPLICATION_INFO | 0xFFFF0000 | 获取应用所有的信息 | +| GET_BUNDLE_WITH_HASH_VALUE9+ | 0x00000030 | 获取包含Hash值的包信息. | ## BundleOptions diff --git a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md index 5b6b53e8e33673af9da8d5f73924aac882bb9be2..75cf5b6e66ade013504dabb737581f82769c90b3 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-ability-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-ability-context.md @@ -28,10 +28,10 @@ class MainAbility extends Ability { **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | -| abilityInfo | AbilityInfo | 是 | 否 | Abilityinfo相关信息 | -| currentHapModuleInfo | HapModuleInfo | 是 | 否 | 当前hap包的信息 | +| abilityInfo | AbilityInfo | 是 | 否 | Abilityinfo相关信息 | +| currentHapModuleInfo | HapModuleInfo | 是 | 否 | 当前hap包的信息 | ## AbilityContext.startAbility @@ -44,10 +44,10 @@ startAbility(want: Want, callback: AsyncCallback<void>): void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | - | callback | AsyncCallback<void> | 是 | callback形式返回启动结果 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | +| callback | AsyncCallback<void> | 是 | callback形式返回启动结果 | **示例:** @@ -73,11 +73,11 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void& **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | - | options | StartOptions | 是 | 启动Ability所携带的参数。 | - | callback | AsyncCallback<void> | 是 | callback形式返回启动结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | +| options | StartOptions | 是 | 启动Ability所携带的参数。 | +| callback | AsyncCallback<void> | 是 | callback形式返回启动结果。 | **示例:** @@ -106,16 +106,16 @@ startAbility(want: Want, options?: StartOptions): Promise<void>; **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | - | options | StartOptions | 否 | 启动Ability所携带的参数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | +| options | StartOptions | 否 | 启动Ability所携带的参数。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<void> | Promise形式返回启动结果。 | +| 类型 | 说明 | +| -------- | -------- | +| Promise<void> | Promise形式返回启动结果。 | **示例:** @@ -147,10 +147,10 @@ startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>): **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | want |[Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | - | callback | AsyncCallback<[AbilityResult](js-apis-featureAbility.md#abilityresult)> | 是 | 执行结果回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| want |[Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | +| callback | AsyncCallback<[AbilityResult](js-apis-featureAbility.md#abilityresult)> | 是 | 执行结果回调函数。 | **示例:** @@ -175,11 +175,11 @@ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | want |[Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | - | options | StartOptions | 是 | 启动Ability所携带的参数。 | - | callback | AsyncCallback<[AbilityResult](js-apis-featureAbility.md#abilityresult)> | 是 | 执行结果回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| want |[Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | +| options | StartOptions | 是 | 启动Ability所携带的参数。 | +| callback | AsyncCallback<[AbilityResult](js-apis-featureAbility.md#abilityresult)> | 是 | 执行结果回调函数。 | **示例:** @@ -208,17 +208,17 @@ startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityRes **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | - | options | StartOptions | 否 | 启动Ability所携带的参数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| want | [Want](js-apis-application-Want.md) | 是 | 启动Ability的want信息。 | +| options | StartOptions | 否 | 启动Ability所携带的参数。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<[AbilityResult](js-apis-featureAbility.md#abilityresult)> | Promise形式返回执行结果。 | +| 类型 | 说明 | +| -------- | -------- | +| Promise<[AbilityResult](js-apis-featureAbility.md#abilityresult)> | Promise形式返回执行结果。 | **示例:** @@ -244,9 +244,9 @@ terminateSelf(callback: AsyncCallback<void>): void; **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<void> | 是 | 回调函数,返回接口调用是否成功的结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| callback | AsyncCallback<void> | 是 | 回调函数,返回接口调用是否成功的结果。 | **示例:** @@ -267,9 +267,9 @@ terminateSelf(): Promise<void>; **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<void> | 返回一个Promise,包含接口的结果。 | +| 类型 | 说明 | +| -------- | -------- | +| Promise<void> | 返回一个Promise,包含接口的结果。 | **示例:** @@ -292,10 +292,10 @@ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<voi **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | 是 | 返回给调用startAbilityForResult 接口调用方的相关信息。 | - | callback | AsyncCallback<void> | 是 | callback形式返回停止结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | 是 | 返回给调用startAbilityForResult 接口调用方的相关信息。 | +| callback | AsyncCallback<void> | 是 | callback形式返回停止结果。 | **示例:** @@ -321,15 +321,15 @@ terminateSelfWithResult(parameter: AbilityResult): Promise<void>; **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | 是 | 返回给startAbilityForResult 调用方的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| parameter | [AbilityResult](js-apis-featureAbility.md#abilityresult) | 是 | 返回给startAbilityForResult 调用方的信息。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<void> | promise形式返回停止结果。 | +| 类型 | 说明 | +| -------- | -------- | +| Promise<void> | promise形式返回停止结果。 | **示例:** @@ -355,15 +355,15 @@ startAbilityByCall(want: Want): Promise<Caller>; **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | 是 | 传入需要启动的ability的信息,包含ability名称、包名、设备ID,设备ID缺省或为空表示启动本地ability。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| want | [Want](js-apis-application-Want.md) | 是 | 传入需要启动的ability的信息,包含ability名称、包名、设备ID,设备ID缺省或为空表示启动本地ability。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<Caller> | 获取要通讯的caller对象。 | +| 类型 | 说明 | +| -------- | -------- | +| Promise<Caller> | 获取要通讯的caller对象。 | **示例:** @@ -397,10 +397,10 @@ requestPermissionsFromUser(permissions: Array<string>, requestCallback: As **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | permissions | Array<string> | 是 | 权限列表。 | - | callback | AsyncCallback<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | 是 | 回调函数,返回接口调用是否成功的结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| permissions | Array<string> | 是 | 权限列表。 | +| callback | AsyncCallback<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | 是 | 回调函数,返回接口调用是否成功的结果。 | **示例:** @@ -423,15 +423,15 @@ requestPermissionsFromUser(permissions: Array<string>) : Promise<Permis **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | permissions | Array<string> | 是 | 权限列表。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| permissions | Array<string> | 是 | 权限列表。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | 返回一个Promise,包含接口的结果。 | +| 类型 | 说明 | +| -------- | -------- | +| Promise<[PermissionRequestResult](js-apis-permissionrequestresult.md)> | 返回一个Promise,包含接口的结果。 | **示例:** @@ -456,10 +456,10 @@ setMissionLabel(label: string, callback:AsyncCallback<void>): void; **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | label | string | 是 | 显示名称。 | - | callback | AsyncCallback<void> | 是 | 回调函数,返回接口调用是否成功的结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| label | string | 是 | 显示名称。 | +| callback | AsyncCallback<void> | 是 | 回调函数,返回接口调用是否成功的结果。 | **示例:** @@ -480,15 +480,15 @@ setMissionLabel(label: string): Promise<void> **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | label | string | 是 | 显示名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| label | string | 是 | 显示名称。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<void> | 返回一个Promise,包含接口的结果。 | +| 类型 | 说明 | +| -------- | -------- | +| Promise<void> | 返回一个Promise,包含接口的结果。 | **示例:** @@ -500,3 +500,23 @@ setMissionLabel(label: string): Promise<void> }); ``` +## AbilityContext.isTerminating + +isTerminating(): boolean; + +查询ability是否在terminating状态。 + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**返回值:** + +| 类型 | 说明 | +| -------- | -------- | +| bool | true:ability当前处于terminating状态;false:不处于terminating状态。 | + +**示例:** + + ```js + var isTerminating = this.context.isTerminating(); + console.log('ability state :' + isTerminating); + ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-appAccount.md b/zh-cn/application-dev/reference/apis/js-apis-appAccount.md index 7fb71c1da37fa5a62251781a727f447a785620fa..1569b8860b5a0ffbb93999eb6ac67f8777053518 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-appAccount.md +++ b/zh-cn/application-dev/reference/apis/js-apis-appAccount.md @@ -1,5 +1,7 @@ # 应用帐号管理 +本模块不仅用于对应用帐号的添加、删除、查询、修改和授权,且提供帐号将数据写入磁盘和数据同步的能力。 + > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -15,13 +17,14 @@ import account_appAccount from '@ohos.account.appAccount'; createAppAccountManager(): AppAccountManager -应用帐号管理:获取应用帐号模块对象。 +获取应用帐号模块的对象。 **系统能力:** SystemCapability.Account.AppAccount **返回值:** -| 类型 | 说明 | -| ----------------- | ------------ | + +| 类型 | 说明 | +| ----------------- | ------------------------ | | AppAccountManager | 获取应用帐号模块的实例。 | **示例:** @@ -43,10 +46,10 @@ addAccount(name: string, callback: AsyncCallback<void>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | --------------------- | -| name | string | 是 | 要添加的应用帐户的名称。 | -| callback | AsyncCallback<void> | 是 | 将此应用的帐号名添加到帐号管理服务的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------------------------------------- | +| name | string | 是 | 要添加的应用帐号名称。 | +| callback | AsyncCallback<void> | 是 | 将此应用的帐号名添加到帐号管理服务回调。 | **示例:** @@ -61,17 +64,17 @@ addAccount(name: string, callback: AsyncCallback<void>): void addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>): void -将此应用程序的帐号名和额外信息添加到帐号管理服务中,使用callback回调异步返回结果。 +将此应用程序的帐号名和额外信息(能转换string类型的其它信息,如token)添加到帐号管理服务中,使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------------------------- | ---- | ---------------------------------------- | -| name | string | 是 | 要添加的应用帐户的名称。 | -| extraInfo | string | 是 | 要添加的应用帐户的额外信息(例如token等),额外的信息不能是应用帐号的敏感信息。 | -| callback | AsyncCallback<void> | 是 | 将此应用程序的帐号名和额外信息添加到帐号管理服务中的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------------------------- | ---- | ------------------------------------------------------------ | +| name | string | 是 | 要添加的应用帐号名称。 | +| extraInfo | string | 是 | 要添加的应用帐号的额外信息(能转换string类型的其它信息,如token等),额外信息不能是应用帐号的敏感信息(如应用账号密码)。 | +| callback | AsyncCallback<void> | 是 | 将此应用程序的帐号名和额外信息添加到帐号管理服务中回调。 | **示例:** @@ -86,23 +89,23 @@ addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>) ### addAccount -addAccount(name: string, extraInfo?: string): Promise<void> +addAccount(name: string, extraInfo: string): Promise<void> -将此应用的帐号名或额外信息添加到帐号管理服务中,使用Promise方式异步返回结果。 +将此应用的帐号名或额外信息(能转换成string类型的其它信息)添加到帐号管理服务中,使用Promise方式异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------ | ---- | -------------------------------- | -| name | string | 是 | 要添加的应用帐户的名称。 | -| extraInfo | string | 是 | 要添加的应用帐户的额外信息,额外的信息不能是应用帐号的敏感信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | ------------------------------------------------------------ | +| name | string | 是 | 要添加的应用帐号名称。 | +| extraInfo | string | 是 | 要添加的应用帐号的额外信息(能转换成string类型的其它信息),额外信息不能是应用帐号的敏感信息(如应用账号密码)。 | **返回值:** -| 类型 | 说明 | -| ------------------- | --------------------- | +| 类型 | 说明 | +| ------------------- | ----------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -120,18 +123,18 @@ addAccount(name: string, extraInfo?: string): Promise<void> addAccountImplicitly(owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void -根据指定的帐号所有者、鉴权类型和可选项,隐式地添加应用帐号,并使用callback回调异步返回结果。 +根据指定的帐号所有者、鉴权类型和可选项隐式地添加应用帐号,并使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------- | ---- | --------------- | -| owner | string | 是 | 要添加的应用帐户的所有者包名。 | -| authType | string | 是 | 要添加的应用帐户的鉴权类型。 | -| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | -| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | ---------------------------------------------- | +| owner | string | 是 | 要添加的应用帐号所有者包名。 | +| authType | string | 是 | 要添加的应用帐号鉴权类型。鉴权类型为自定义。 | +| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。可选项可根据自己需要设置。 | +| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | **示例:** @@ -167,10 +170,10 @@ deleteAccount(name: string, callback: AsyncCallback<void>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ----------------- | -| name | string | 是 | 要删除的应用帐户的名称。 | -| callback | AsyncCallback<void> | 是 | 帐号管理服务中删除应用帐号的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | -------------------------------- | +| name | string | 是 | 要删除的应用帐号名称。 | +| callback | AsyncCallback<void> | 是 | 帐号管理服务中删除应用帐号回调。 | **示例:** @@ -191,14 +194,14 @@ deleteAccount(name: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---- | ------ | ---- | ------------ | -| name | string | 是 | 要删除的应用帐户的名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ---------------------- | +| name | string | 是 | 要删除的应用帐号名称。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :-------------------- | +| 类型 | 说明 | +| :------------------ | :---------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -216,17 +219,17 @@ deleteAccount(name: string): Promise<void> disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<void>): void -禁止指定第三方应用帐户的名称访问指定包名称的第三方应用,使用callback回调异步返回结果。 +禁止指定第三方应用帐号名称对指定的第三方应用进行访问,使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------------------------- | ---- | ------------------------------- | -| name | string | 是 | 要禁用访问的第三方应用帐户的名称。 | -| bundleName | string | 是 | 第三方应用的包名。 | -| callback | AsyncCallback<void> | 是 | 禁止指定第三方应用帐户的名称访问指定包名称的第三方应用的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ------------------------------------------------------------ | +| name | string | 是 | 要禁用访问的第三方应用帐号名称。 | +| bundleName | string | 是 | 第三方应用的包名。 | +| callback | AsyncCallback<void> | 是 | 禁止指定第三方应用帐号名称对指定包名称的第三方应用的回调进行访问。 | **示例:** @@ -241,21 +244,21 @@ disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<vo disableAppAccess(name: string, bundleName: string): Promise<void> -禁止指定第三方应用帐户的名称访问指定包名称的第三方应用,使用Promise方式异步返回结果。 +禁止指定第三方应用帐号名称对指定包名称的第三方应用进行访问,使用Promise方式异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------ | ---- | ----------------- | -| name | string | 是 | 要禁用访问的第三方应用帐户的名称。 | -| bundleName | string | 是 | 第三方应用的包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------ | ---- | -------------------------------- | +| name | string | 是 | 要禁用访问的第三方应用帐号名称。 | +| bundleName | string | 是 | 第三方应用的包名。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :-------------------- | +| 类型 | 说明 | +| :------------------ | :---------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -273,17 +276,17 @@ disableAppAccess(name: string, bundleName: string): Promise<void> enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<void>): void -允许指定第三方应用帐户的名称访问指定包名称的第三方应用,使用callback回调异步返回结果。 +允许指定第三方应用帐号名称对指定包名称的第三方应用进行访问,使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------------------------- | ---- | ------------------------------- | -| name | string | 是 | 应用帐号名称。 | -| bundleName | string | 是 | 第三方应用的包名。 | -| callback | AsyncCallback<void> | 是 | 允许指定第三方应用帐户的名称访问指定包名称的第三方应用的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ------------------------------------------------------------ | +| name | string | 是 | 应用帐号名称。 | +| bundleName | string | 是 | 第三方应用的包名。 | +| callback | AsyncCallback<void> | 是 | 允许指定第三方应用帐号名称对指定包名称的第三方应用的回调进行访问。 | **示例:** @@ -298,21 +301,21 @@ enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<voi enableAppAccess(name: string, bundleName: string): Promise<void> -允许指定第三方应用帐户的名称访问指定包名称的第三方应用,使用Promise方式异步返回结果。 +允许指定第三方应用帐号的名称对指定包名称的第三方应用进行访问,使用Promise方式异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------ | ---- | --------- | -| name | string | 是 | 应用帐号名称。 | -| bundleName | string | 是 | 第三方应用的包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------ | ---- | ------------------ | +| name | string | 是 | 应用帐号名称。 | +| bundleName | string | 是 | 第三方应用的包名。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :-------------------- | +| 类型 | 说明 | +| :------------------ | :---------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -337,10 +340,10 @@ checkAppAccountSyncEnable(name: string, callback: AsyncCallback<boolean>): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------- | ---- | ---------------------- | -| name | string | 是 | 应用帐号名称。 | -| callback | AsyncCallback<boolean> | 是 | 检查指定应用帐号是否允许应用数据同步的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------- | ---- | ------------------------------------------ | +| name | string | 是 | 应用帐号名称。 | +| callback | AsyncCallback<boolean> | 是 | 检查指定应用帐号是否允许应用数据同步回调。 | **示例:** @@ -364,14 +367,14 @@ checkAppAccountSyncEnable(name: string): Promise<boolean> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---- | ------ | ---- | ------- | -| name | string | 是 | 应用帐号名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | -------------- | +| name | string | 是 | 应用帐号名称。 | **返回值:** -| 类型 | 说明 | -| :--------------------- | :-------------------- | +| 类型 | 说明 | +| :--------------------- | :---------------------------------- | | Promise<boolean> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -395,12 +398,12 @@ setAccountCredential(name: string, credentialType: string, credential: string,ca **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | ------------------------- | ---- | -------------- | -| name | string | 是 | 应用程序帐户的名称。 | -| credentialType | string | 是 | 要设置的凭据的类型。 | -| credential | string | 是 | 要设置的凭据。 | -| callback | AsyncCallback<void> | 是 | 设置此应用帐号的凭据的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ------------------------- | ---- | -------------------------- | +| name | string | 是 | 应用程序帐号名称。 | +| credentialType | string | 是 | 要设置的凭据类型。 | +| credential | string | 是 | 要设置的凭据。 | +| callback | AsyncCallback<void> | 是 | 设置此应用帐号的凭据回调。 | **示例:** @@ -421,16 +424,16 @@ setAccountCredential(name: string, credentialType: string, credential: string): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | ------ | ---- | ---------- | -| name | string | 是 | 应用帐户的名称。 | -| credentialType | string | 是 | 要设置的凭据的类型。 | -| credential | string | 是 | 要设置的凭据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ------ | ---- | -------------------- | +| name | string | 是 | 应用帐号的名称。 | +| credentialType | string | 是 | 要设置的凭据的类型。 | +| credential | string | 是 | 要设置的凭据。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :-------------------- | +| 类型 | 说明 | +| :------------------ | :---------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -454,11 +457,11 @@ setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback< **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------------------------- | ---- | ---------------- | -| name | string | 是 | 应用帐户的名称。 | -| extraInfo | string | 是 | 要设置的额外信息。 | -| callback | AsyncCallback<void> | 是 | 设置此应用帐号的额外信息的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------------------------- | ---- | ------------------------------ | +| name | string | 是 | 应用帐号名称。 | +| extraInfo | string | 是 | 要设置的额外信息。 | +| callback | AsyncCallback<void> | 是 | 设置此应用帐号的额外信息回调。 | **示例:** @@ -479,15 +482,15 @@ setAccountExtraInfo(name: string, extraInfo: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------ | ---- | --------- | -| name | string | 是 | 应用帐户的名称。 | -| extraInfo | string | 是 | 要设置的额外信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | ------------------ | +| name | string | 是 | 应用帐号名称。 | +| extraInfo | string | 是 | 要设置的额外信息。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :-------------------- | +| 类型 | 说明 | +| :------------------ | :---------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -513,11 +516,11 @@ setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ------------------------- | -| name | string | 是 | 应用帐户的名称。 | -| isEnable | boolean | 是 | 是否允许应用数据同步。 | -| callback | AsyncCallback<void> | 是 | 设置指定的应用帐号是否允许应用程序数据同步的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | -------------------------------------------------- | +| name | string | 是 | 应用帐号名称。 | +| isEnable | boolean | 是 | 是否允许应用数据同步。 | +| callback | AsyncCallback<void> | 是 | 设置指定的应用帐号是否允许应用程序数据同步的回调。 | **示例:** @@ -540,15 +543,15 @@ setAppAccountSyncEnable(name: string, isEnable: boolean): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------- | ---- | ----------- | -| name | string | 是 | 应用帐户的名称。 | -| isEnable | boolean | 是 | 是否允许应用数据同步。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------- | ---- | ---------------------- | +| name | string | 是 | 应用帐号名称。 | +| isEnable | boolean | 是 | 是否允许应用数据同步。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :-------------------- | +| 类型 | 说明 | +| :------------------ | :---------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -572,12 +575,12 @@ setAssociatedData(name: string, key: string, value: string, callback: AsyncCallb **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ----------------- | -| name | string | 是 | 应用帐户的名称。 | -| key | string | 是 | 要设置的数据的键,密钥可以自定义。 | -| value | string | 是 | 要设置的数据的值。 | -| callback | AsyncCallback<void> | 是 | 设置与此应用帐号关联的数据的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------------------------------- | +| name | string | 是 | 应用帐号名称。 | +| key | string | 是 | 要设置的数据的键,密钥可以自定义。 | +| value | string | 是 | 要设置的数据的值。 | +| callback | AsyncCallback<void> | 是 | 设置与此应用帐号关联的数据的回调。 | **示例:** @@ -597,16 +600,16 @@ setAssociatedData(name: string, key: string, value: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ------ | ---- | ----------------- | -| name | string | 是 | 应用帐户的名称。 | -| key | string | 是 | 要设置的数据的键,密钥可以自定义。 | -| value | string | 是 | 要设置的数据的值。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ---------------------------------- | +| name | string | 是 | 应用帐号名称。 | +| key | string | 是 | 要设置的数据的键,密钥可以自定义。 | +| value | string | 是 | 要设置的数据的值。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :-------------------- | +| 类型 | 说明 | +| :------------------ | :---------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -624,17 +627,17 @@ setAssociatedData(name: string, key: string, value: string): Promise<void> getAccountCredential(name: string, credentialType: string, callback: AsyncCallback<string>): void -获取此应用帐号的凭据,使用callback回调异步返回结果。 +获取此应用帐号的凭据(如数字密码、人脸和PIN码等),使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | --------------------------- | ---- | -------------- | -| name | string | 是 | 应用帐号名称。 | -| credentialType | string | 是 | 要获取的凭据的类型。 | -| callback | AsyncCallback<string> | 是 | 获取此应用帐号的凭据的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | --------------------------- | ---- | ---------------------------- | +| name | string | 是 | 应用帐号名称。 | +| credentialType | string | 是 | 获取此应用帐号的凭据的类型。 | +| callback | AsyncCallback<string> | 是 | 获取此应用帐号的凭据的回调。 | **示例:** @@ -656,15 +659,15 @@ getAccountCredential(name: string, credentialType: string): Promise<string> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | ------ | ---- | ---------- | -| name | string | 是 | 应用帐号名称。 | -| credentialType | string | 是 | 要获取的凭据的类型。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ------ | ---- | -------------------- | +| name | string | 是 | 应用帐号名称。 | +| credentialType | string | 是 | 要获取的凭据的类型。 | **返回值:** -| 类型 | 说明 | -| :-------------------- | :-------------------- | +| 类型 | 说明 | +| :-------------------- | :---------------------------------- | | Promise<string> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -682,16 +685,16 @@ getAccountCredential(name: string, credentialType: string): Promise<string> getAccountExtraInfo(name: string, callback: AsyncCallback<string>): void -获取此应用帐号的额外信息,使用callback回调异步返回结果。 +获取此应用帐号的额外信息(能转换成string类型的其它信息),使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------------- | ---- | ---------------- | -| name | string | 是 | 应用帐号名称。 | -| callback | AsyncCallback<string> | 是 | 获取此应用帐号的额外信息的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ------------------------------ | +| name | string | 是 | 应用帐号名称。 | +| callback | AsyncCallback<string> | 是 | 获取此应用帐号的额外信息回调。 | **示例:** @@ -713,14 +716,14 @@ getAccountExtraInfo(name: string): Promise<string> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---- | ------ | ---- | ------- | -| name | string | 是 | 应用帐号名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | -------------- | +| name | string | 是 | 应用帐号名称。 | **返回值:** -| 类型 | 说明 | -| :-------------------- | :-------------------- | +| 类型 | 说明 | +| :-------------------- | :---------------------------------- | | Promise<string> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -744,11 +747,11 @@ getAssociatedData(name: string, key: string, callback: AsyncCallback<string&g **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------------- | ---- | ----------------- | -| name | string | 是 | 应用帐号名称。 | -| key | string | 是 | 要获取的数据的key。 | -| callback | AsyncCallback<string> | 是 | 获取与此应用帐号关联的数据的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ---------------------------------- | +| name | string | 是 | 应用帐号名称。 | +| key | string | 是 | 要获取的数据的键。 | +| callback | AsyncCallback<string> | 是 | 获取与此应用帐号关联的数据的回调。 | **示例:** @@ -770,15 +773,15 @@ getAssociatedData(name: string, key: string): Promise<string> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---- | ------ | ---- | ----------- | -| name | string | 是 | 应用帐号名称。 | -| key | string | 是 | 要获取的数据的key。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------------------ | +| name | string | 是 | 应用帐号名称。 | +| key | string | 是 | 要获取的数据的键。 | **返回值:** -| 类型 | 说明 | -| :-------------------- | :-------------------- | +| 类型 | 说明 | +| :-------------------- | :---------------------------------- | | Promise<string> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -804,9 +807,9 @@ getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>& **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------------------- | ---- | -------- | -| callback | AsyncCallback<Array<AppAccountInfo>> | 是 | 应用帐号信息列表 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------------------------------ | ---- | ------------------ | +| callback | AsyncCallback<Array<AppAccountInfo>> | 是 | 应用帐号信息列表。 | **示例:** @@ -830,8 +833,8 @@ getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>> **参数:** -| 类型 | 说明 | -| ---------------------------------------- | --------------------- | +| 类型 | 说明 | +| ------------------------------------------ | ----------------------------------- | | Promise<Array<AppAccountInfo>> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -857,10 +860,10 @@ getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------------------- | ---- | -------- | -| owner | string | 是 | 应用包名称 | -| callback | AsyncCallback<Array<AppAccountInfo>> | 是 | 应用帐号信息列表 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------------------------------ | ---- | ------------------ | +| owner | string | 是 | 应用包名称。 | +| callback | AsyncCallback<Array<AppAccountInfo>> | 是 | 应用帐号信息列表。 | **示例:** @@ -885,14 +888,14 @@ getAllAccounts(owner: string): Promise<Array<AppAccountInfo>> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ------ | ---- | ----- | -| owner | string | 是 | 应用包名称 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------------ | +| owner | string | 是 | 应用包名称。 | **参数:** -| 类型 | 说明 | -| ---------------------------------------- | --------------------- | +| 类型 | 说明 | +| ------------------------------------------ | ----------------------------------- | | Promise<Array<AppAccountInfo>> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -917,11 +920,11 @@ on(type: 'change', owners: Array<string>, callback: Callback<Array<A **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------------------- | ---- | ------------------------------ | -| type | 'change' | 是 | 关于帐户更改事件,当帐户所有者更新帐户时,订阅者将收到通知。 | -| owners | Array<string> | 是 | 指示帐户的所有者。 | -| callback | Callback<Array<AppAccountInfo>> | 是 | 订阅指定帐号所有者的帐户变更事件的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------------------------- | ---- | ------------------------------------------------------------ | +| type | 'change' | 是 | 关于帐号更改事件,当帐号所有者更新帐号时,订阅者将收到通知。 | +| owners | Array<string> | 是 | 指示帐号的所有者。 | +| callback | Callback<Array<AppAccountInfo>> | 是 | 订阅指定帐号所有者的帐号变更事件的回调。 | **示例:** @@ -948,10 +951,10 @@ off(type: 'change', callback?: Callback>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------------------------------- | ---- | ------------ | -| type | 'change' | 是 | 关于帐户更改事件。 | -| callback | Callback> | 否 | 取消订阅帐号事件的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------- | ---- | ------------------------ | +| type | 'change' | 是 | 关于帐号更改事件。 | +| callback | Callback> | 否 | 取消订阅帐号事件的回调。 | **示例:** @@ -975,19 +978,19 @@ off(type: 'change', callback?: Callback>): void authenticate(name: string, owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void -鉴权应用帐户以获取OAuth令牌,使用callback回调异步返回结果。 +对应用帐户进行鉴权以获取OAuth令牌,使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------- | ---- | --------------- | -| name | string | 是 | 要鉴权的应用帐户的名称。 | -| owner | string | 是 | 要鉴权的应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | -| options | {[key: string]: any} | 是 | 鉴权所需的可选项。 | -| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | ------------------------------ | +| name | string | 是 | 要鉴权的应用帐号名称。 | +| owner | string | 是 | 要鉴权的应用帐号所有者包名。 | +| authType | string | 是 | 鉴权类型。 | +| options | {[key: string]: any} | 是 | 鉴权所需的可选项。 | +| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | **示例:** @@ -1017,18 +1020,18 @@ authenticate(name: string, owner: string, authType: string, options: {[key: stri getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback<string>): void -获取指定应用帐户和鉴权类型的OAuth令牌,使用callback回调异步返回结果。 +获取指定应用帐号和鉴权类型的OAuth令牌,使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------------- | ---- | ----------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | -| callback | AsyncCallback<string> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ---------------------- | +| name | string | 是 | 应用帐号的名称。 | +| owner | string | 是 | 应用帐号的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | +| callback |AsyncCallback<string> | 是 | 查询结果的回调。 | **示例:** @@ -1050,16 +1053,16 @@ getOAuthToken(name: string, owner: string, authType: string): Promise<string& **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | ----------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ---------------------- | +| name | string | 是 | 应用帐号的名称。 | +| owner | string | 是 | 应用帐号的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | **参数:** -| 类型 | 说明 | -| --------------------- | --------------------- | +| 类型 | 说明 | +| --------------------- | ----------------------------------- | | Promise<string> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1077,18 +1080,18 @@ getOAuthToken(name: string, owner: string, authType: string): Promise<string& setOAuthToken(name: string, authType: string, token: string, callback: AsyncCallback<void>): void -设置指定应用帐户和鉴权类型的OAuth令牌,使用callback回调异步返回结果。 +设置指定应用帐号和鉴权类型的OAuth令牌,使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | -------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| token | string | 是 | OAuth令牌。 | -| callback | AsyncCallback<void> | 是 | 设置结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------------- | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 鉴权类型。 | +| token | string | 是 | OAuth令牌。 | +| callback | AsyncCallback<void> | 是 | 设置结果的回调。 | **示例:** @@ -1109,16 +1112,16 @@ setOAuthToken(name: string, authType: string, token: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | -------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| token | string | 是 | OAuth令牌。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ---------------- | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 鉴权类型。 | +| token | string | 是 | OAuth令牌。 | **参数:** -| 类型 | 说明 | -| ------------------- | --------------------- | +| 类型 | 说明 | +| ------------------- | ----------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1142,13 +1145,13 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string, c **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ------------ | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | -| token | string | 是 | 要删除的OAuth令牌。 | -| callback | AsyncCallback<void> | 是 | 删除结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------------------- | +| name | string | 是 | 应用帐号的名称。 | +| owner | string | 是 | 应用帐号的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | +| token | string | 是 | 要删除的OAuth令牌。 | +| callback | AsyncCallback<void> | 是 | 删除结果的回调。 | **示例:** @@ -1169,17 +1172,17 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | ------------ | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | -| token | string | 是 | 要删除的OAuth令牌。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ---------------------- | +| name | string | 是 | 应用帐号的名称。 | +| owner | string | 是 | 应用帐号的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | +| token | string | 是 | 要删除的OAuth令牌。 | **参数:** -| 类型 | 说明 | -| ------------------- | --------------------- | +| 类型 | 说明 | +| ------------------- | ----------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1203,13 +1206,13 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------------------------- | ---- | ------------ | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| bundleName | string | 是 | 被设置可见性的应用包名。 | -| isVisible | boolean | 是 | 是否可见。 | -| callback | AsyncCallback<void> | 是 | 设置结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ----------------------------------------- | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 鉴权类型。 | +| bundleName | string | 是 | 被设置可见性的应用包名。 | +| isVisible | boolean | 是 | 是否可见。当设置成true可见,false不可见。 | +| callback | AsyncCallback<void> | 是 | 设置结果的回调。 | **示例:** @@ -1230,17 +1233,17 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------- | ---- | ------------ | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| bundleName | string | 是 | 被设置可见性的应用包名。 | -| isVisible | boolean | 是 | 是否可见。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------- | ---- | ------------------------ | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 鉴权类型。 | +| bundleName | string | 是 | 被设置可见性的应用包名。 | +| isVisible | boolean | 是 | 是否可见。 | **参数:** -| 类型 | 说明 | -| ------------------- | --------------------- | +| 类型 | 说明 | +| ------------------- | ----------------------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1264,12 +1267,12 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, ca **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ---------------------------- | ---- | ------------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| bundleName | string | 是 | 用于检查可见性的应用包名。 | -| callback | AsyncCallback<boolean> | 是 | 检查结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ---------------------------- | ---- | ---------------------- | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 鉴权类型。 | +| bundleName | string | 是 | 检查可见性的应用包名。 | +| callback | AsyncCallback<boolean> | 是 | 检查结果的回调。 | **示例:** @@ -1291,16 +1294,16 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): P **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------ | ---- | ------------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| bundleName | string | 是 | 用于检查可见性的应用包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------ | ---- | -------------------------- | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 鉴权类型。 | +| bundleName | string | 是 | 用于检查可见性的应用包名。 | **参数:** -| 类型 | 说明 | -| ---------------------- | --------------------- | +| 类型 | 说明 | +| ---------------------- | ----------------------------------- | | Promise<boolean> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1324,13 +1327,13 @@ getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback<Array& **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------------------- | ---- | ----------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| callback | AsyncCallback<Array<OAuthTokenInfo>> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------------------------------------------ | ---- | ---------------------- | +| name | string | 是 | 应用帐号的名称。 | +| owner | string | 是 | 应用帐号的所有者包名。 | +| callback | AsyncCallback<Array< [OAuthTokenInfo](#oauthtokeninfo8)>> | 是 | 查询结果的回调。 | -**示例:** +**示例:** ```js const appAccountManager = account_appAccount.createAppAccountManager(); @@ -1350,16 +1353,16 @@ getAllOAuthTokens(name: string, owner: string): Promise<Array<OAuthTokenIn **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ------ | ---- | ----------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ---------------------- | +| name | string | 是 | 应用帐号的名称。 | +| owner | string | 是 | 应用帐号的所有者包名。 | **参数:** -| 类型 | 说明 | -| ---------------------------------------- | --------------------- | -| Promise<Array<OAuthTokenInfo>> | Promise实例,用于获取异步返回结果。 | +| 类型 | 说明 | +| ------------------------------------------ | ----------------------------------- | +| Promise<Array< [OAuthTokenInfo](#oauthtokeninfo8)>> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1382,11 +1385,11 @@ getOAuthList(name: string, authType: string, callback: AsyncCallback<Array< **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------------------- | ---- | ----------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| callback | AsyncCallback<Array<string>> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ----------------------------------------- | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 应用帐号的鉴权类型的OAuth令牌的授权列表。 | +| callback | AsyncCallback<Array<string>> | 是 | 查询结果的回调。 | **示例:** @@ -1408,15 +1411,15 @@ getOAuthList(name: string, authType: string): Promise<Array<string>> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ------ | ---- | ----------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ----------------------------------------- | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 应用帐号的鉴权类型的OAuth令牌的授权列表。 | **参数:** -| 类型 | 说明 | -| ---------------------------------- | --------------------- | +| 类型 | 说明 | +| ---------------------------------- | ----------------------------------- | | Promise<Array<string>> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1440,14 +1443,15 @@ getAuthenticatorCallback(sessionId: string, callback: AsyncCallback<Authentic **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ---------------------------------------- | ---- | -------- | -| sessionId | string | 是 | 鉴权会话的标识。 | -| callback | AsyncCallback<AuthenticatorCallback> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------------------------------------------ | ---- | ---------------- | +| sessionId | string | 是 | 鉴权会话的标识。 | +| callback | AsyncCallback<AuthenticatorCallback> | 是 | 查询结果的回调。 | **示例:** ```js + import featureAbility from '@ohos.ability.featureAbility'; const appAccountManager = account_appAccount.createAppAccountManager(); featureAbility.getWant((err, want) => { var sessionId = want.parameters[account_appAccount.Constants.KEY_SESSION_ID]; @@ -1475,14 +1479,14 @@ getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------ | ---- | -------- | -| sessionId | string | 是 | 鉴权会话的标识。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | ---------------- | +| sessionId | string | 是 | 鉴权会话的标识。 | **参数:** -| 类型 | 说明 | -| ------------------------------------ | --------------------- | +| 类型 | 说明 | +| ------------------------------------ | ----------------------------------- | | Promise<AuthenticatorCallback> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1509,16 +1513,16 @@ getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback> getAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo>): void -获取指定应用帐户的认证器信息,使用callback回调异步返回结果。 +获取指定应用帐号的认证器信息,使用callback回调异步返回结果。 **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------------------------------------- | ---- | ----------- | -| owner | string | 是 | 应用帐户的所有者包名。 | -| callback | AsyncCallback<AuthenticatorInfo> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | ---------------------- | +| owner | string | 是 | 应用帐号的所有者包名。 | +| callback | AsyncCallback<AuthenticatorInfo> | 是 | 查询结果的回调。 | **示例:** @@ -1540,14 +1544,14 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ------ | ---- | ----------- | -| owner | string | 是 | 应用帐户的所有者包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ---------------------- | +| owner | string | 是 | 应用帐号的所有者包名。 | **参数:** -| 类型 | 说明 | -| -------------------------------- | --------------------- | +| 类型 | 说明 | +| -------------------------------- | ----------------------------------- | | Promise<AuthenticatorInfo> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1567,10 +1571,10 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 参数名 | 类型 | 必填 | 说明 | -| ----- | ------ | ---- | ----------- | -| owner | string | 是 | 应用帐户的所有者包名。 | -| name | string | 是 | 应用帐户的名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ---------------------- | +| owner | string | 是 | 应用帐号的所有者包名。 | +| name | string | 是 | 应用帐号的名称。 | ## OAuthTokenInfo8+ @@ -1578,10 +1582,10 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | -------- | -| authType | string | 是 | 令牌的鉴权类型。 | -| token | string | 是 | 令牌的取值。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ---------------- | +| authType | string | 是 | 令牌的鉴权类型。 | +| token | string | 是 | 令牌的取值。 | ## AuthenticatorInfo8+ @@ -1589,11 +1593,11 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------ | ---- | ---------- | -| owner | string | 是 | 认证器的所有者包名。 | -| iconId | string | 是 | 认证器的图标标识。 | -| labelId | string | 是 | 认证器的标签标识。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | -------------------- | +| owner | string | 是 | 认证器的所有者包名。 | +| iconId | string | 是 | 认证器的图标标识。 | +| labelId | string | 是 | 认证器的标签标识。 | ## Constants8+ @@ -1601,19 +1605,19 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 名称 | 默认值 | 描述 | -| ----------------------------- | ---------------------- | ------------- | -| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | 表示操作_隐式添加帐号。 | -| ACTION_AUTHENTICATE | "authenticate" | 表示操作_鉴权。 | -| KEY_NAME | "name" | 表示键名_应用帐户名称。 | -| KEY_OWNER | "owner" | 表示键名_应用帐户所有者。 | -| KEY_TOKEN | "token" | 表示键名_令牌。 | -| KEY_ACTION | "action" | 表示键名_操作。 | -| KEY_AUTH_TYPE | "authType" | 表示键名_鉴权类型。 | -| KEY_SESSION_ID | "sessionId" | 表示键名_会话标识。 | -| KEY_CALLER_PID | "callerPid" | 表示键名_调用方PID。 | -| KEY_CALLER_UID | "callerUid" | 表示键名_调用方UID。 | -| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | 表示键名_调用方包名。 | +| 名称 | 默认值 | 说明 | +| ----------------------------- | ---------------------- | -------------------------- | +| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | 表示操作,隐式添加帐号。 | +| ACTION_AUTHENTICATE | "authenticate" | 表示操作,鉴权。 | +| KEY_NAME | "name" | 表示键名,应用帐号名称。 | +| KEY_OWNER | "owner" | 表示键名,应用帐号所有者。 | +| KEY_TOKEN | "token" | 表示键名,令牌。 | +| KEY_ACTION | "action" | 表示键名,操作。 | +| KEY_AUTH_TYPE | "authType" | 表示键名,鉴权类型。 | +| KEY_SESSION_ID | "sessionId" | 表示键名,会话标识。 | +| KEY_CALLER_PID | "callerPid" | 表示键名,调用方PID。 | +| KEY_CALLER_UID | "callerUid" | 表示键名,调用方UID。 | +| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | 表示键名,调用方包名。 | ## ResultCode8+ @@ -1621,27 +1625,27 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 名称 | 默认值 | 描述 | -| ----------------------------------- | ----- | ------------ | -| SUCCESS | 0 | 表示操作成功。 | -| ERROR_ACCOUNT_NOT_EXIST | 10001 | 表示应用帐户不存在。 | -| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | 表示应用帐户服务异常。 | -| ERROR_INVALID_PASSWORD | 10003 | 表示密码无效。 | -| ERROR_INVALID_REQUEST | 10004 | 表示请求无效。 | -| ERROR_INVALID_RESPONSE | 10005 | 表示响应无效。 | -| ERROR_NETWORK_EXCEPTION | 10006 | 表示网络异常。 | -| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | 表示认证器不存在。 | -| ERROR_OAUTH_CANCELED | 10008 | 表示鉴权取消。 | -| ERROR_OAUTH_LIST_TOO_LARGE | 10009 | 表示开放授权列表过大。 | -| ERROR_OAUTH_SERVICE_BUSY | 10010 | 表示开放授权服务忙碌。 | -| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | 表示开放授权服务异常。 | -| ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | 表示鉴权会话不存在。 | -| ERROR_OAUTH_TIMEOUT | 10013 | 表示鉴权超时。 | -| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | 表示开放授权令牌不存在。 | -| ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | 表示开放授权令牌过多。 | -| ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | 表示不支持的鉴权操作。 | -| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | 表示不支持的鉴权类型。 | -| ERROR_PERMISSION_DENIED | 10018 | 表示权限不足。 | +| 名称 | 默认值 | 说明 | +| ----------------------------------- | ------ | ------------------------ | +| SUCCESS | 0 | 表示操作成功。 | +| ERROR_ACCOUNT_NOT_EXIST | 10001 | 表示应用帐号不存在。 | +| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | 表示应用帐号服务异常。 | +| ERROR_INVALID_PASSWORD | 10003 | 表示密码无效。 | +| ERROR_INVALID_REQUEST | 10004 | 表示请求无效。 | +| ERROR_INVALID_RESPONSE | 10005 | 表示响应无效。 | +| ERROR_NETWORK_EXCEPTION | 10006 | 表示网络异常。 | +| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | 表示认证器不存在。 | +| ERROR_OAUTH_CANCELED | 10008 | 表示鉴权取消。 | +| ERROR_OAUTH_LIST_TOO_LARGE | 10009 | 表示开放授权列表过大。 | +| ERROR_OAUTH_SERVICE_BUSY | 10010 | 表示开放授权服务忙碌。 | +| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | 表示开放授权服务异常。 | +| ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | 表示鉴权会话不存在。 | +| ERROR_OAUTH_TIMEOUT | 10013 | 表示鉴权超时。 | +| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | 表示开放授权令牌不存在。 | +| ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | 表示开放授权令牌过多。 | +| ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | 表示不支持的鉴权操作。 | +| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | 表示不支持的鉴权类型。 | +| ERROR_PERMISSION_DENIED | 10018 | 表示权限不足。 | ## AuthenticatorCallback8+ @@ -1656,10 +1660,10 @@ onResult: (code: number, result: {[key: string]: any}) => void **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | -------------------- | ---- | ------ | -| code | number | 是 | 鉴权结果码。 | -| result | {[key: string]: any} | 是 | 鉴权结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | -------------------- | ---- | ------------ | +| code | number | 是 | 鉴权结果码。 | +| result | {[key: string]: any} | 是 | 鉴权结果。 | **示例:** @@ -1686,9 +1690,9 @@ onRequestRedirected: (request: Want) => void **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ---- | ---- | ---------- | -| request | Want | 是 | 用于跳转的请求信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ---- | ---- | -------------------- | +| request | Want | 是 | 用于跳转的请求信息。 | **示例:** @@ -1723,12 +1727,12 @@ addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------------- | --------------------- | ---- | --------------- | -| authType | string | 是 | 应用帐户的鉴权类型。 | -| callerBundleName | string | 是 | 鉴权请求方的包名。 | -| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | -| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------------- | --------------------- | ---- | ------------------------------ | +| authType | string | 是 | 应用帐号的鉴权类型。 | +| callerBundleName | string | 是 | 鉴权请求方的包名。 | +| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | +| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | ### authenticate8+ @@ -1739,13 +1743,13 @@ authenticate(name: string, authType: string, callerBundleName: string, options: **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 接口名 | 类型 | 必填 | 说明 | -| ---------------- | --------------------- | ---- | --------------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 应用帐户的鉴权类型。 | -| callerBundleName | string | 是 | 鉴权请求方的包名。 | -| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | -| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | +| 接口名 | 类型 | 必填 | 说明 | +| ---------------- | --------------------- | ---- | ------------------------------ | +| name | string | 是 | 应用帐号的名称。 | +| authType | string | 是 | 应用帐号的鉴权类型。 | +| callerBundleName | string | 是 | 鉴权请求方的包名。 | +| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | +| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-ability.md b/zh-cn/application-dev/reference/apis/js-apis-application-ability.md index 9180b5ca7cb8c29d19e6c6cf8440d8d7fb287a23..f25a3f71f82b79524ac88f51fa1c72d06cdf81e1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-ability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-ability.md @@ -20,6 +20,8 @@ import Ability from '@ohos.application.Ability'; | context | [AbilityContext](js-apis-ability-context.md) | 是 | 否 | 上下文。 | | launchWant | [Want](js-apis-application-Want.md) | 是 | 否 | Ability启动时的参数。 | | lastRequestWant | [Want](js-apis-application-Want.md) | 是 | 否 | Ability最后请求时的参数。| +| callee | [Callee](#callee) | 是 | 否 | 调用Stub(桩)服务对象。| + ## Ability.onCreate @@ -210,7 +212,7 @@ onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult; ## Ability.onNewWant -onNewWant(want: Want): void; +onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void; 当ability的启动模式设置为单例时回调会被调用。 @@ -221,13 +223,17 @@ onNewWant(want: Want): void; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | want | [Want](js-apis-application-Want.md) | 是 | Want类型参数,如ability名称,包名等。 | + | launchParams | AbilityConstant.LaunchParam | 是 | Ability启动的原因、上次异常退出的原因信息。 | **示例:** ```js class myAbility extends Ability { - onNewWant(want) { + onNewWant(want, launchParams) { console.log('onNewWant, want:' + want.abilityName); + if (launchParams.launchReason === AbilityConstant.LaunchReason.CONTINUATION) { + console.log('onNewWant, launchReason is continuation'); + } } } ``` @@ -261,7 +267,7 @@ onConfigurationUpdated(config: Configuration): void; dump(params: Array\): Array\; -指示from命令的参数。 +转储客户端信息时调用。 **系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore @@ -269,7 +275,7 @@ dump(params: Array\): Array\; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | params | Array\ | 是 | 指示from命令的参数。| + | params | Array\ | 是 | 表示命令形式的参数。| **示例:** @@ -475,7 +481,7 @@ release(): void; onRelease(callback: OnReleaseCallBack): void; -注册通用组件服务端Stub断开监听通知。 +注册通用组件服务端Stub(桩)断开监听通知。 **系统能力**:SystemCapability.Ability.AbilityRuntime.AbilityCore diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-context.md b/zh-cn/application-dev/reference/apis/js-apis-application-context.md index 73f6e1376567bc57c24ce90d8800581411383c68..bf23d15111cd777c546a9bee357d1efd44a108fa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-application-context.md +++ b/zh-cn/application-dev/reference/apis/js-apis-application-context.md @@ -19,19 +19,19 @@ import AbilityContext from '@ohos.application.Ability'; **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core - | 名称 | 参数类型 | 可读 | 可写 | 说明 | + | 名称 | 参数类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | -| resourceManager | ResourceManager | 是 | 否 | ResourceManager对象。 | -| applicationInfo | ApplicationInfo | 是 | 否 | 当前应用信息。 | -| cacheDir | string | 是 | 否 | 应用在内部存储上的缓存路径。 | -| tempDir | string | 是 | 否 | 应用的临时文件路径。 | -| filesDir | string | 是 | 否 | 应用在内部存储上的文件路径。 | -| databaseDir | string | 是 | 否 | 获取本地数据存储路径。 | -| storageDir | string | 是 | 否 | 获取轻量级数据存储路径。 | -| bundleCodeDir | string | 是 | 否 | 应用安装路径。 | -| distributedFilesDir | string | 是 | 否 | 应用的分布式文件路径。 | -| eventHub | [EventHub](js-apis-eventhub.md) | 是 | 否 | 事件中心信息。| -| area | [AreaMode](#areamode) | 是 | 是 | 文件分区。| +| resourceManager | ResourceManager | 是 | 否 | ResourceManager对象。 | +| applicationInfo | ApplicationInfo | 是 | 否 | 当前应用信息。 | +| cacheDir | string | 是 | 否 | 应用在内部存储上的缓存路径。 | +| tempDir | string | 是 | 否 | 应用的临时文件路径。 | +| filesDir | string | 是 | 否 | 应用在内部存储上的文件路径。 | +| databaseDir | string | 是 | 否 | 获取本地数据存储路径。 | +| storageDir | string | 是 | 否 | 获取轻量级数据存储路径。 | +| bundleCodeDir | string | 是 | 否 | 应用安装路径。 | +| distributedFilesDir | string | 是 | 否 | 应用的分布式文件路径。 | +| eventHub | [EventHub](js-apis-eventhub.md) | 是 | 否 | 事件中心信息。| +| area | [AreaMode](#areamode) | 是 | 是 | 文件分区。| ## Context.createBundleContext @@ -44,18 +44,18 @@ createBundleContext(bundleName: string): Context; **参数:** - | 参数名 | 类型 | 必填 | 说明 | + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | bundleName | string | 是 | 应用bundle名。 | + | bundleName | string | 是 | 应用bundle名。 | **返回值:** - | 类型 | 说明 | + | 类型 | 说明 | | -------- | -------- | - | Context | 对应创建应用的上下文context。 | + | Context | 对应创建应用的上下文context。 | **示例:** - + ```js import AbilityContext from '@ohos.application.Ability' class MainAbility extends AbilityContext { @@ -68,6 +68,76 @@ createBundleContext(bundleName: string): Context; ``` +## Context.createModuleContext + +createModuleContext(moduleName: string): Context; + +创建指定hap上下文。 + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | moduleName | string | 是 | 应用内hap名。 | + +**返回值:** + + | 类型 | 说明 | + | -------- | -------- | + | Context | 对应创建hap的上下文context。 | + +**示例:** + + ```js + import AbilityContext from '@ohos.application.Ability' + class MainAbility extends AbilityContext { + onWindowStageCreate(windowStage) { + let moduleName = "module"; + let context = this.context.createModuleContext(moduleName); + } +} + + ``` + + +## Context.createModuleContext + +createModuleContext(bundleName: string, moduleName: string): Context; + +创建指定应用上下文。 + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | bundleName | string | 是 | 应用bundle名。 | + | moduleName | string | 是 | 应用内hap名。 | + +**返回值:** + + | 类型 | 说明 | + | -------- | -------- | + | Context | 对应创建应用内hap的上下文context。 | + +**示例:** + + ```js + import AbilityContext from '@ohos.application.Ability' + class MainAbility extends AbilityContext { + onWindowStageCreate(windowStage) { + let bundleName = "com.example.bundle"; + let moduleName = "module"; + let context = this.context.createModuleContext(bundleName, moduleName); + } +} + + ``` + + ## Context.getApplicationContext getApplicationContext(): ApplicationContext; @@ -83,7 +153,7 @@ getApplicationContext(): ApplicationContext; | ApplicationContext | 当前ApplicationContext对象信息。 | **示例:** - + ```js // 必选项。 let applicationContext = this.context.getApplicationContext(); diff --git a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md index ca9896fc59fca22d5afce2c49ac6fce4513fae38..f4e5c8739e07648053206684f1519958ea514b60 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md @@ -160,7 +160,7 @@ getAppMemorySize(callback: AsyncCallback\): void; ``` ## appManager.getProcessRunningInfos8+ -getProcessRunningInfos(): Promise>; +getProcessRunningInfos(): Promise\>; 获取有关运行进程的信息。 @@ -168,9 +168,9 @@ getProcessRunningInfos(): Promise>; **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise> | 获取有关运行进程的信息。 | +| 类型 | 说明 | +| -------- | -------- | +| Promise\> | 获取有关运行进程的信息。 | **示例:** @@ -184,7 +184,7 @@ getProcessRunningInfos(): Promise>; ## appManager.getProcessRunningInfos8+ -getProcessRunningInfos(callback: AsyncCallback>): void; +getProcessRunningInfos(callback: AsyncCallback\>): void; 获取有关运行进程的信息。 @@ -192,9 +192,9 @@ getProcessRunningInfos(callback: AsyncCallback>): voi **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | callback | AsyncCallback> | 否 | 获取有关运行进程的信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| callback | AsyncCallback\> | 否 | 获取有关运行进程的信息。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md index c50ee9a95aa26fd6a979830b804d6c2d00ff036e..0743db388c590c7b7e791757c28147f33623100a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md @@ -38,4 +38,5 @@ | removable8+ | boolean | 是 | 否 | 应用程序是否可以被移除 | | accessTokenId8+ | number | 是 | 否 | 应用程序的accessTokenId | | uid8+ | number | 是 | 否 | 应用程序的uid | -| entityType8+ | string | 是 | 否 | 应用程序的实体类型 | \ No newline at end of file +| entityType8+ | string | 是 | 否 | 应用程序的实体类型 | +| fingerprint9+ | string | 是 | 否 | 应用程序的签名证书指纹信息,即开发者申请的签名证书的sha256值 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md b/zh-cn/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md index 32bf5db17e3dac348c518c405c06725501908447..e3cb4688ef1990f14462927e59399deb42128847 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md @@ -34,4 +34,5 @@ Hap模块信息 | installationFree | boolean | 是 | 否 | 是否支持免安装 | | mainElementName9+ | string | 是 | 否 | 入口ability信息 | | extensionAbilityInfo9+ | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | 是 | 否 | extensionAbility信息 | -| metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | 是 | 否 | Ability的元信息 | \ No newline at end of file +| metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | 是 | 否 | Ability的元信息 | +| hashValue9+ | string | 是 | 否 | Module的Hash值 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-data-ability.md b/zh-cn/application-dev/reference/apis/js-apis-data-ability.md index bd4c9f3b8282c1e912c29608225ad7e34e34a9b0..46ef1ed278ecae77dbe8fcfda41cab066b559479 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-data-ability.md +++ b/zh-cn/application-dev/reference/apis/js-apis-data-ability.md @@ -17,7 +17,7 @@ import dataAbility from '@ohos.data.dataAbility'; createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates -从DataAabilityPredicates对象创建RdbPredicates对象。 +从DataAbilityPredicates对象创建RdbPredicates对象。 **系统能力:** SystemCapability.DistributedDataManager.DataShare.Core。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md b/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md index 1725e2a0ebd727bf6815beb6234cad3ae5c0f856..76c6e5424b2416467eee3b89e6da91010f23a4a8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md +++ b/zh-cn/application-dev/reference/apis/js-apis-dataAbilityHelper.md @@ -870,7 +870,7 @@ DAHelper.query( ## DataAbilityHelper.call -call(uri: string, method: string, arg: string, extras: PacMap): Promise +call(uri: string, method: string, arg: string, extras: PacMap): Promise\ 调用DataAbility的扩展接口,使用Promise方式作为异步方法。 @@ -906,7 +906,7 @@ dataAbilityHelper.call("dataability:///com.example.jsapidemo.UserDataAbility", " ## DataAbilityHelper.call -call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void +call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback\): void 调用DataAbility的扩展接口,使用callback方式作为异步方法。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md b/zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md index 3b8dcf260a6cbae98c9b724a037a2222ad478812..6f6de81432c60173b2a89562d0a828658b1a0487 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md +++ b/zh-cn/application-dev/reference/apis/js-apis-deviceUsageStatistics.md @@ -69,53 +69,80 @@ isIdleState(bundleName: string): Promise<boolean> ## bundleState.queryAppUsagePriorityGroup -queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void +queryAppUsagePriorityGroup(bundleName? : string): Promise -查询(返回)当前调用者应用的使用优先级群组,使用Callback形式返回。 +可选参数。设置该参数时查询指定bundleName对应应用的分组。无参数时查询当前应用的分组。使用Promise形式返回其应用分组。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO **系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup **参数**: - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<number> | 是 | 指定的callback回调方法。返回当前调用者应用的使用优先级群组。| +| 参数名 | 类型 | 必填 | 说明 | +| ----------------------- | ------ | ---- | ------------------------------------------------------------ | +| bundleName9+ | string | 否 | 可选参数。设置该参数时查询指定bundleName对应应用的分组。无参数时查询当前应用的分组。 | + +**返回值**: + +| 类型 | 说明 | +| --------------- | ----------------------------------------------- | +| Promise | 指定的Promise回调方法。返回查询的应用分组结果。 | **示例**: - ```js - bundleState.queryAppUsagePriorityGroup((err, res) => { - if (err) { - console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup callback failed. because: ' + err.code); - } else { - console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup callback succeeded. result: ' + JSON.stringify(res)); - } - }); - ``` +```javascript +//有bundleName的promise +bundleState.queryAppUsagePriorityGroup(this.bundleName).then( res => { + console.log('BUNDLE_ACTIVE QueryPackageGroup promise succeeded. result: ' + JSON.stringify(res)); +}).catch( err => { + console.log('BUNDLE_ACTIVE QueryPackageGroup promise failed. because: ' + err.code); +}); +//无bundleName的promise +bundleState.queryAppUsagePriorityGroup().then( res => { + console.log('BUNDLE_ACTIVE QueryPackageGroup promise succeeded. result: ' + JSON.stringify(res)); +}).catch( err => { + console.log('BUNDLE_ACTIVE QueryPackageGroup promise failed. because: ' + err.code); +}); +``` ## bundleState.queryAppUsagePriorityGroup -queryAppUsagePriorityGroup(): Promise<number> +queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void + +可选参数。设置该参数时查询指定bundleName对应应用的分组。无参数时查询当前应用的分组。使用callback形式返回其应用分组。 -查询(返回)当前调用者应用的使用优先级群组,使用Promise形式返回。 +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO **系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup -**返回值**: +**参数**: - | 类型 | 说明 | - | -------- | -------- | - | Promise<number> | 指定的Promise回调方法。查询(返回)当前调用者应用的使用优先级群组。| +| 参数名 | 类型 | 必填 | 说明 | +| ----------------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | +| bundleName9+ | string | 否 | 可选参数。设置该参数时查询指定bundleName对应应用的分组。无参数时查询当前应用的分组。 | +| callback | AsyncCallback<Array<[BundleActiveModuleInfo](#bundleactivemoduleinfo9)>> | 是 | 指定的CallBack回调方法。返回查询的应用分组。 | **示例**: - ```js - bundleState.queryAppUsagePriorityGroup().then( res => { - console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise succeeded. result: ' + JSON.stringify(res)); - }).catch( err => { - console.log('BUNDLE_ACTIVE queryAppUsagePriorityGroup promise failed. because: ' + err.code); - }); - ``` +```javascript +//有bundleName的callback +bundleState.queryAppUsagePriorityGroup(this.bundleName, (err, res) => { + if(err) { + console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE QueryPackageGroup callback succeeded. result: ' + JSON.stringify(res)); + } +}); +//无bundleName的callback +bundleState.queryAppUsagePriorityGroup((err, res) => { + if(err) { + console.log('BUNDLE_ACTIVE QueryPackageGroup callback failed. because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE QueryPackageGroup callback succeeded. result: ' + JSON.stringify(res)); + } +}); +``` ## bundleState.queryBundleStateInfos @@ -496,6 +523,340 @@ getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback<Array<Bund }); ``` +## bundleState.setBundleGroup9+ + +setBundleGroup(bundleName: string, newGroup: GroupType): Promise + +将指定的bundleName的应用的分组设置为newGroup,使用Promise形式返回设置是否成功。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | --------- | ---- | -------- | +| bundleName | string | 是 | 应用名称 | +| newGroup | GroupType | 是 | 应用分组 | + +**返回值**: + +| 类型 | 说明 | +| ---------------- | ------------------------------------------- | +| Promise | 指定的Promise回调方法。返回本次设置是否成功 | + +**示例**: + +```javascript +this.bundleName = "com.example.deviceUsageStatistics"; +this.newGroup = stats.GroupType.ACTIVE_GROUP_DAILY; + +bundleState.setBundleGroup(this.bundleName, this.newGroup).then( res => { + console.log('BUNDLE_ACTIVE SetBundleGroup promise succeeded. result: ' + JSON.stringify(res)); +}).catch( err => { + console.log('BUNDLE_ACTIVE SetBundleGroup promise failed. because: ' + err.code); +}); +``` + +## bundleState.setBundleGroup9+ + +setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void + +将指定的bundleName的应用的分组设置为newGroup,使用CallBack形式返回设置是否成功。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ---------------------- | ---- | ------------------------------------------ | +| bundleName | string | 是 | 应用名称 | +| newGroup | GroupType | 是 | 应用分组 | +| callback | AsyncCallback | 是 | 指定的CallBack回调方法。返回设置是否成功。 | + +**示例**: + +```javascript +this.bundleName = "com.example.deviceUsageStatistics"; +this.newGroup = stats.GroupType.ACTIVE_GROUP_DAILY; + +bundleState.setBundleGroup(this.bundleName, this.newGroup, (err, res) => { + if(err) { + console.log('BUNDLE_ACTIVE SetBundleGroup callback failed. because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE SetBundleGroup callback succeeded. result: ' + JSON.stringify(res)); + } +}); +``` + +## bundleState.registerGroupCallBack9+ + +registerGroupCallBack(callback: Callback): Promise + +应用分组变化注册,待用户名下的某个应用分组发生变化时,通过callback形式向所有已注册的应用返回BundleActiveGroupCallbackInfo。使用Promise形式返回注册是否成功。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------- | ---- | ---------------------- | +| callback | Callback | 是 | 应用分组变化的回调函数 | + +**返回值**: + +| 类型 | 说明 | +| ---------------- | --------------------------------------- | +| Promise | 指定的Promise回调方法。返回注册是否成功 | + +**示例**: + +```javascript +let onBundleGroupChanged = (err,res) =>{ + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result oldGroup is : ' + res.oldGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result newGroup is : ' + res.newGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result changeReason is : ' + res.newGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result userId is : ' + res.userId); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result bundleName is : ' + res.bundleName); +}; +bundleState.registerGroupCallBack(onBundleGroupChanged).then( res => { + console.log('BUNDLE_ACTIVE RegisterGroupCallBack promise succeeded. result1: ' + JSON.stringify(res)); +}).catch( err => { + console.log('BUNDLE_ACTIVE RegisterGroupCallBack promise failed. because: ' + err.code); +}); +``` + +## bundleState.registerGroupCallBack9+ + +registerGroupCallBack(callback: Callback, callback: AsyncCallback): void + +应用分组变化注册,待用户名下的某个应用分组发生变化时,通过callback形式向所有已注册的应用返回BundleActiveGroupCallbackInfo。使用异步callback形式返回注册是否成功。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------------------- | ---- | -------------------------- | +| callback | Callback | 是 | 应用分组变化的回调函数 | +| callback | AsyncCallback | 是 | 注册是否成功的异步回调函数 | + +**示例**: + +```javascript +let onBundleGroupChanged = (err,res) =>{ + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s oldGroup is : ' + res.oldGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s newGroup is : ' + res.newGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s changeReason is : ' + res.newGroup); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s userId is : ' + res.userId); + console.log('BUNDLE_ACTIVE onBundleGroupChanged RegisterGroupCallBack result‘s bundleName is : ' + res.bundleName); +}; +bundleState.registerGroupCallBack(onBundleGroupChanged, (err,res)=>{ + if(err) { + console.log('BUNDLE_ACTIVE RegisterGroupCallBack callback failed, because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE RegisterGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE RegisterGroupCallBack result is : ' + JSON.stringify(res)); + } +}); +``` + +## bundleState.unRegisterGroupCallBack9+ + +unRegisterGroupCallBack(): Promise + +应用分组变化解注册,将之前注册的解除注册。使用Promise形式返回注册是否成功。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + +**参数**:无参数 + +**返回值**: + +| 类型 | 说明 | +| ---------------- | ----------------------------------------- | +| Promise | 指定的Promise回调方法。返回解注册是否成功 | + +**示例**: + +```javascript +bundleState.unRegisterGroupCallBack().then( res => { + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack promise succeeded. result: ' + JSON.stringify(res)); +}).catch( err => { + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack promise failed. because: ' + err.code); +}); +``` + +## bundleState.unRegisterGroupCallBack9+ + +unRegisterGroupCallBack(callback: AsyncCallback): void; + +应用分组变化解注册,将之前注册的解除注册。使用异步callback形式返回注册是否成功。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + +**参数**: + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------- | ---- | ---------------------------- | +| callback | AsyncCallback | 是 | 解注册是否成功的异步回调函数 | + +**示例**: + +```javascript +bundleState.unRegisterGroupCallBack((err,res)=>{ + if(err) { + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack callback failed, because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack callback success.'); + console.log('BUNDLE_ACTIVE UnRegisterGroupCallBack result is : ' + JSON.stringify(res)); + } +}); +``` + +## bundleState.queryBundleActiveEventStates9+ + +queryBundleActiveEventStates(begin: number, end: number): Promise<Array<BundleActiveEventState>> + +通过指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息,使用Promise形式返回。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App + +**参数**: + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | begin | number | 是 | 起始时间。| + | end | number | 是 | 结束时间。| + +**返回值**: + + | 类型 | 说明 | + | -------- | -------- | + | Promise<Array<[BundleActiveEventState](#bundleactiveeventstate9)>> | 指定的Promise回调方法。返回指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。| + +**示例**: + + ```js + bundleState.queryBundleActiveEventStates(0, 20000000000000).then( res => { + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates promise success.'); + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates promise result ' + JSON.stringify(res)); + }).catch( err=> { + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates promise failed, because: ' + err.code); + }); + ``` + +## bundleState.queryBundleActiveEventStates9+ + +queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void + +通过指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息,使用Callback形式返回。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App + +**参数**: + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | begin | number | 是 | 起始时间。| + | end | number | 是 | 结束时间。| + | callback | AsyncCallback<Array<[BundleActiveEventState](#bundleactiveeventstate9)>> | 是 | 指定的callback回调方法。返回指定起始和结束时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。| + +**示例**: + + ```js + bundleState.queryBundleActiveEventStates(0, 20000000000000, (err, res) => { + if(err) { + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates callback failed, because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates callback success.'); + console.log('BUNDLE_ACTIVE queryBundleActiveEventStates callback result ' + JSON.stringify(res)); + } + }); + ``` + +## bundleState.queryAppNotificationNumber9+ + +queryAppNotificationNumber(begin: number, end: number): Promise<Array<BundleActiveEventState>> + +通过指定起始和结束时间查询所有应用的通知次数信息,使用Promise形式返回。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App + +**参数**: + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | begin | number | 是 | 起始时间。| + | end | number | 是 | 结束时间。| + +**返回值**: + + | 类型 | 说明 | + | -------- | -------- | + | Promise<Array<[BundleActiveEventState](#bundleactiveeventstate9)>> | 指定的Promise回调方法。返回指定起始和结束时间查询所有应用的通知次数信息。| + +**示例**: + + ```js + bundleState.queryAppNotificationNumber(0, 20000000000000).then( res => { + console.log('BUNDLE_ACTIVE queryAppNotificationNumber promise success.'); + console.log('BUNDLE_ACTIVE queryAppNotificationNumber promise result ' + JSON.stringify(res)); + }).catch( err=> { + console.log('BUNDLE_ACTIVE queryAppNotificationNumber promise failed, because: ' + err.code); + }); + ``` + +## bundleState.queryAppNotificationNumber9+ + +queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveEventState>>): void + +通过指定起始和结束时间查询所有应用的通知次数信息,使用Callback形式返回。 + +**需要权限**:ohos.permission.BUNDLE_ACTIVE_INFO + +**系统能力**:SystemCapability.ResourceSchedule.UsageStatistics.App + +**参数**: + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | begin | number | 是 | 起始时间。| + | end | number | 是 | 结束时间。| + | callback | AsyncCallback<Array<[BundleActiveEventState](#bundleactiveeventstate9)>> | 是 | 指定的callback回调方法。返回通过指定起始和结束时间查询所有应用的通知次数信息。| + +**示例**: + + ```js + bundleState.queryAppNotificationNumber(0, 20000000000000, (err, res) => { + if(err) { + console.log('BUNDLE_ACTIVE queryAppNotificationNumberCallBack callback failed, because: ' + err.code); + } else { + console.log('BUNDLE_ACTIVE queryAppNotificationNumberCallBack callback success.'); + console.log('BUNDLE_ACTIVE queryAppNotificationNumberCallBack callback result ' + JSON.stringify(res)); + } + }); + ``` + ## BundleActiveModuleInfo9+ FA的使用信息的属性集合。 @@ -530,12 +891,27 @@ FA卡片的使用信息的属性集合。 | formLastUsedTime | number | 是 | 卡片的上一次点击时间。| | count | number | 是 | 卡片的点击次数。| +## BundleActiveGroupCallbackInfo9+ + +应用分组变化回调返回的属性集合 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.ResourceSchedule.UsageStatistics.App + +| 参数名 | 类型 | 必填 | 说明 | +| ---------------- | ------ | ---- | ---------------- | +| appUsageOldGroup | number | 是 | 修改前的应用分组 | +| appUsageNewGroup | number | 是 | 修改后的应用分组 | +| useId | number | 是 | 用户id | +| changeReason | number | 是 | 分组变化原因 | +| bundleName | string | 是 | 应用名称 | + ## BundleStateInfo + 提供应用使用时长的具体信息。 ### 属性 -**系统能力**:以下各项对应的系统能力均为SystemCapability.ResourceSchedule.UsageStatistics.App +**系统能力**:以下各项对应的系统能力均为SystemCapability.ResourceSchedule.UsageStatistics.AppGroup | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | @@ -591,6 +967,18 @@ merge(toMerge: BundleStateInfo): void | -------- | -------- | -------- | -------- | | [key: string]: BundleStateInfo | [key: string]: [BundleStateInfo](#bundlestateinfo) | 是 | 不同应用的使用时长统计信息。| +## BundleActiveEventState9+ + +提供通知、系统事件的统计信息。 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.ResourceSchedule.UsageStatistics.App + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| name | string | 是 | 通知应用包名或者系统事件名。| +| eventId | number | 是 | 通知、系统事件类型。| +| count | number | 是 | 应用通知次数或者系统事件触发次数。| + ## IntervalType 提供应用使用时长的查询类型。 @@ -603,4 +991,19 @@ merge(toMerge: BundleStateInfo): void | BY_DAILY | 1 | 表示系统按照天去查询指定时间段间隔的应用使用时长信息。| | BY_WEEKLY | 2 | 表示系统按照周去查询指定时间段间隔的应用使用时长信息。| | BY_MONTHLY | 3 | 表示系统按照月去查询指定时间段间隔的应用使用时长信息。| -| BY_ANNUALLY | 4 | 表示系统按照年去查询指定时间段间隔的应用使用时长信息。| \ No newline at end of file +| BY_ANNUALLY | 4 | 表示系统按照年去查询指定时间段间隔的应用使用时长信息。| + +## GroupType + +提供应用分组的设置类型。 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.ResourceSchedule.UsageStatistics.AppGroup + +| 名称 | 默认值 | 说明 | +| ------------------ | ------ | ---------------------------------- | +| ACTIVE_GROUP_ALIVE | 10 | 活跃分组 | +| ACTIVE_GROUP_DAILY | 20 | 经常使用,但当前并未在活跃态 | +| ACTIVE_GROUP_FIXED | 30 | 常用分组,定期使用,但不是每天使用 | +| ACTIVE_GROUP_RARE | 40 | 极少使用分组,不经常使用 | +| ACTIVE_GROUP_LIMIT | 50 | 受限使用分组 | +| ACTIVE_GROUP_NEVER | 60 | 从未使用分组,安装但是从未运行过 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-fileio.md b/zh-cn/application-dev/reference/apis/js-apis-fileio.md index fc4205ce6cf0407ba851aceff378213e2abf89f6..3e7b62d94222debbd35d644304471180ca834caa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-fileio.md +++ b/zh-cn/application-dev/reference/apis/js-apis-fileio.md @@ -3,7 +3,13 @@ > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 6开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 -该模块提供文件存储相关的常用功能:向应用程序提供用于IO的JS接口,包括用于管理文件的基本文件接口,用于管理目录的基本目录接口,用于获取文件信息的统计接口,用于流式读写文件的流式接口。 +该模块提供文件存储相关的常用功能,向应用程序提供用于IO的JS接口,包括: + +- 用于管理文件的基本文件接口 +- 用于管理目录的基本目录接口 +- 用于获取文件信息的统计接口 +- 用于流式读写文件的流式接口 + ## 导入模块 @@ -1082,7 +1088,7 @@ chmodSync(path: string, mode: number): void fstat(fd: number): Promise<Stat> -以异步方法基于文件描述符获取文件状态信息,使用promise形式返回结果。 +以异步方法基于文件描述符获取文件信息,使用promise形式返回结果。 **系统能力**:SystemCapability.FileManagement.File.FileIO @@ -1110,7 +1116,7 @@ fstat(fd: number): Promise<Stat> fstat(fd: number, callback: AsyncCallback<Stat>): void -以异步方法基于文件描述符获取文件状态信息,使用callback形式返回结果。 +以异步方法基于文件描述符获取文件信息,使用callback形式返回结果。 **系统能力**:SystemCapability.FileManagement.File.FileIO @@ -1118,7 +1124,7 @@ fstat(fd: number, callback: AsyncCallback<Stat>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------- | ---- | ---------------- | | fd | number | 是 | 待获取文件的文件描述符。 | - | callback | AsyncCallback<[Stat](#stat)> | 是 | 异步获取文件状态信息之后的回调。 | + | callback | AsyncCallback<[Stat](#stat)> | 是 | 异步获取文件信息之后的回调。 | **示例:** ```js @@ -1133,7 +1139,7 @@ fstat(fd: number, callback: AsyncCallback<Stat>): void fstatSync(fd: number): Stat -以同步方法基于文件描述符获取文件状态信息。 +以同步方法基于文件描述符获取文件信息。 **系统能力**:SystemCapability.FileManagement.File.FileIO @@ -1392,14 +1398,14 @@ readTextSync(filePath: string, options?: { lstat(path: string): Promise<Stat> -以异步方法获取链接状态信息,使用promise形式返回结果。 +以异步方法获取链接信息,使用promise形式返回结果。 **系统能力**:SystemCapability.FileManagement.File.FileIO **参数:** | 参数名 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | -------------------------------------- | -| path | string | 是 | 目标文件的应用沙箱路径,指向链接状态。 | +| path | string | 是 | 目标文件的应用沙箱路径,指向链接。 | **返回值:** | 类型 | 说明 | @@ -1420,15 +1426,15 @@ lstat(path: string): Promise<Stat> lstat(path:string, callback:AsyncCallback<Stat>): void -以异步方法获取链接状态信息,使用callback形式返回结果。 +以异步方法获取链接信息,使用callback形式返回结果。 **系统能力**:SystemCapability.FileManagement.File.FileIO **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------- | ---- | -------------------------------------- | -| path | string | 是 | 目标文件的应用沙箱路径,指向链接状态。 | -| callback | AsyncCallback<[Stat](#stat)> | 是 | 异步获取链接状态信息之后的回调。 | +| path | string | 是 | 目标文件的应用沙箱路径,指向链接。 | +| callback | AsyncCallback<[Stat](#stat)> | 是 | 异步获取链接信息之后的回调。 | **示例:** ```js @@ -1442,14 +1448,14 @@ lstat(path:string, callback:AsyncCallback<Stat>): void lstatSync(path:string): Stat -以同步方法获取链接状态信息。 +以同步方法获取链接信息。 **系统能力**:SystemCapability.FileManagement.File.FileIO **参数:** | 参数名 | 类型 | 必填 | 说明 | | ------ | ------ | ---- | -------------------------------------- | -| path | string | 是 | 目标文件的应用沙箱路径,指向链接状态。 | +| path | string | 是 | 目标文件的应用沙箱路径,指向链接。 | **返回值:** | 类型 | 说明 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-formextension.md b/zh-cn/application-dev/reference/apis/js-apis-formextension.md index da29e670f5b74037853a83f6d9b98bd2c4861cd0..e13c18bd8d0bd317aad24fbe224da7f146e6e4b4 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-formextension.md +++ b/zh-cn/application-dev/reference/apis/js-apis-formextension.md @@ -227,7 +227,7 @@ onConfigurationUpdated(config: Configuration): void; onAcquireFormState?(want: Want): formInfo.FormState; -返回formInfo#FormState对象。 +卡片提供方接收查询卡片状态通知接口。默认返回卡片初始状态。 **系统能力**:SystemCapability.Ability.Form @@ -235,7 +235,7 @@ onAcquireFormState?(want: Want): formInfo.FormState; | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | want | [Want](js-apis-application-Want.md) | 否 | 返回formInfo#FormState对象。 | + | want | [Want](js-apis-application-Want.md) | 否 | want表示获取卡片状态的描述。描述包括包名称、能力名称、模块名称、卡片名和卡片维度。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-formprovider.md b/zh-cn/application-dev/reference/apis/js-apis-formprovider.md index 253c97bf7f1f690670d1511d28ee48ce7afbcf8a..d54b0a645854978c69f51f0f880bfb2df10fd048 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-formprovider.md +++ b/zh-cn/application-dev/reference/apis/js-apis-formprovider.md @@ -143,4 +143,205 @@ SystemCapability.Ability.Form }).catch((error) => { console.log('formProvider updateForm, error:' + JSON.stringify(error)); }); - ``` \ No newline at end of file + ``` + +## getFormsInfo9+ + +getFormsInfo(callback: AsyncCallback<Array<formInfo.FormInfo>>): void; + +获取设备上当前应用程序的卡片信息。 + +**系统能力:** SystemCapability.Ability.Form + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| callback | AsyncCallback<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | 是 | callback形式返回查询到的卡片信息。 | + +**示例:** + +```js +formProvider.getFormsInfo((error, data) => { + if (error.code) { + console.log('formProvider getFormsInfo, error:' + JSON.stringify(error)); + } else { + console.log('formProvider getFormsInfo, data:' + JSON.stringify(data)); + } +}); +``` +## getFormsInfo9+ + +getFormsInfo(filter: formInfo.FormInfoFilter, callback: AsyncCallback<Array<formInfo.FormInfo>>): void; + +获取设备上当前应用程序的卡片信息。 + +**系统能力:** SystemCapability.Ability.Form + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| filter | formInfo.FormInfoFilter | 是 | 过滤卡片信息 | +| callback | AsyncCallback<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | 是 | callback形式返回查询到的卡片信息。 | + +**示例:** + +```js +const filter : formInfo.FormInfoFilter = { + moduleName : "entry" +}; +formProvider.getFormsInfo(filter, (error, data) => { + if (error.code) { + console.log('formProvider getFormsInfo, error:' + JSON.stringify(error)); + } else { + console.log('formProvider getFormsInfo, data:' + JSON.stringify(data)); + } +}); +``` + +## getFormsInfo9+ + +getFormsInfo(filter?: formInfo.FormInfoFilter): Promise<Array<formInfo.FormInfo>>; + +获取设备上当前应用程序的卡片信息。 + +**系统能力:** SystemCapability.Ability.Form + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| filter | formInfo.FormInfoFilter | 否 | 过滤卡片信息 | + +**返回值:** + +| 类型 | 说明 | +| :------------ | :---------------------------------- | +| Promise<Array<[FormInfo](./js-apis-formInfo.md#forminfo-1)>> | Promise实例,用于获取异步返回查询到的卡片信息。 | + +**示例:** + +```js +const filter : formInfo.FormInfoFilter = { + moduleName : "entry" +}; +formProvider.getFormsInfo(filter).then((data) => { + console.log('formProvider getFormsInfo, data:' + JSON.stringify(data)); +}).catch((error) => { + console.log('formProvider getFormsInfo, error:' + JSON.stringify(error)); +}); +``` + +## requestPublishForm9+ + +requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback<string>): <void>; + +请求发布一张卡片到使用方。 + +**系统能力:** + +SystemCapability.Ability.Form + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ---------------------------------------------------------------------- | ---- | ---------------- | +| want | [Want](js-apis-application-Want.md) | 是 | abilityName: 目标卡片ability
parameters:
"ohos.extra.param.key.form_dimension"
"ohos.extra.param.key.form_name"
"ohos.extra.param.key.module_name" | +| formBindingData | [FormBindingData](js-apis-formbindingdata.md#formbindingdata) | 是 | 用于创建卡片的数据 | +| callback | AsyncCallback<string> | 是 | callback形式返回卡片标识 | + +**示例:** + + ```js + import formBindingData from '@ohos.application.formBindingData'; + var want = { + abilityName: "FormAbility", + parameters: { + "ohos.extra.param.key.form_dimension": 2, + "ohos.extra.param.key.form_name": "widget", + "ohos.extra.param.key.module_name": "entry" + } + }; + let obj = formBindingData.createFormBindingData({temperature:"22c", time:"22:00"}); + formProvider.requestPublishForm(want, obj, (error, data) => { + if (error.code) { + console.log('formProvider requestPublishForm, error: ' + JSON.stringify(error)); + } else { + console.log('formProvider requestPublishForm, form ID is: ' + JSON.stringify(data)); + } + }); + ``` + +## requestPublishForm9+ + +requestPublishForm(want: Want, callback: AsyncCallback<string>): <void>; + +请求发布一张卡片到使用方。 + +**系统能力:** + +SystemCapability.Ability.Form + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------- | ---- | ------------------------------------------------------------ | +| want | [Want](js-apis-application-Want.md) | 是 | abilityName: 目标卡片ability
parameters:
"ohos.extra.param.key.form_dimension"
"ohos.extra.param.key.form_name"
"ohos.extra.param.key.module_name" | +| callback | AsyncCallback<string> | 是 | callback形式返回卡片标识 | + +**示例:** + + ```js + var want = { + abilityName: "FormAbility", + parameters: { + "ohos.extra.param.key.form_dimension": 2, + "ohos.extra.param.key.form_name": "widget", + "ohos.extra.param.key.module_name": "entry" + } + }; + formProvider.requestPublishForm(want, (error, data) => { + if (error.code) { + console.log('formProvider requestPublishForm, error: ' + JSON.stringify(error)); + } else { + console.log('formProvider requestPublishForm, form ID is: ' + JSON.stringify(data)); + } + }); + ``` + +## requestPublishForm9+ + +requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData): Promise<string>; + +请求发布一张卡片到使用方。 + +**系统能力:** + +SystemCapability.Ability.Form + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | +| want | [Want](js-apis-application-Want.md) | 是 | abilityName: 目标卡片ability
parameters:
"ohos.extra.param.key.form_dimension"
"ohos.extra.param.key.form_name"
"ohos.extra.param.key.module_name" | +| formBindingData | [FormBindingData](js-apis-formbindingdata.md#formbindingdata) | 否 | 用于创建卡片的数据 | +| callback | AsyncCallback<string> | 是 | callback形式返回卡片标识 | + +**示例:** + + ```js + var want = { + abilityName: "FormAbility", + parameters: { + "ohos.extra.param.key.form_dimension": 2, + "ohos.extra.param.key.form_name": "widget", + "ohos.extra.param.key.module_name": "entry" + } + }; + formProvider.requestPublishForm(want).then((data) => { + console.log('formProvider requestPublishForm success, form ID is :' + JSON.stringify(data)); + }).catch((error) => { + console.log('formProvider requestPublishForm, error: ' + JSON.stringify(error)); + }); + ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-hisysevent.md b/zh-cn/application-dev/reference/apis/js-apis-hisysevent.md new file mode 100644 index 0000000000000000000000000000000000000000..15865e87e557611a0b3c9aa52f489d4207618895 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-hisysevent.md @@ -0,0 +1,345 @@ +# 系统事件打点 + +为系统hap应用提供系统事件打点接口。 + +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> - 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> - 本模块的接口为系统接口,三方应用不支持调用。 + + +## 导入模块 + +```js +import hiSysEvent from '@ohos.hiSysEvent'; +``` + +## EventType + +系统事件类型枚举。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +| 名称 | 默认值 | 说明 | +| -------- | -------- | -------- | +| FAULT | 1 | 错误事件类型。 | +| STATISTIC | 2 | 统计事件类型。 | +| SECURITY | 3 | 安全事件类型。 | +| BEHAVIOR | 4 | 用户行为事件类型。 | + +## SysEventInfo + +系统事件信息对象接口。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| domain | string | 是 | 事件领域。 | +| name | string | 是 | 事件名称。 | +| eventType | [EventType](#eventtype) | 是 | 事件类型。 | +| params | object | 否 | 事件参数。 | + + +## hiSysEvent.write + +write(info: SysEventInfo, callback: AsyncCallback<void>): void + +系统事件打点方法,接收[SysEventInfo](#syseventinfo)类型的对象作为事件参数,使用callback方式作为异步回调。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------------------------- | ---- | ------------------------------------------------------------ | +| info | [SysEventInfo](#syseventinfo) | 是 | 系统事件。 | +| callback | AsyncCallback<void> | 是 | 回调函数,可以在回调函数中处理接口返回值。
- 0表示事件校验成功,事件正常异步写入事件文件;
- 正值表示事件打点存在异常,但可以正常写入;
- 负值表示事件打点失败。 | + +**示例:** + +```js +import hiSysEvent from '@ohos.hiSysEvent'; + +hiSysEvent.write({ + domain: "RELIABILITY", + name: "STACK", + eventType: hiSysEvent.EventType.FAULT, + params: { + PID: 487, + UID: 103, + PACKAGE_NAME: "com.ohos.hisysevent.test", + PROCESS_NAME: "syseventservice", + MSG: "no msg." + } +}, (err, val) => { + // do something here. +}) +``` + + +## hiSysEvent.write + +write(info: SysEventInfo): Promise<void> + +系统事件打点方法,接收[SysEventInfo](#syseventinfo)类型的对象作为事件参数,使用promise方式作为异步回调。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ----------------------- | ---- | --------------- | +| eventType | [EventType](#eventtype) | 是 | 应用事件类型。 | + +**返回值:** + +| 类型 | 说明 | +| ------------------- | ------------------------------------------------------------ | +| Promise<void> | Promise实例,可以在其then()、catch()方法中分别对系统事件写入成功、写入异常的回调进行处理。 | + +**示例:** + +```js +import hiSysEvent from '@ohos.hiSysEvent'; + +hiSysEvent.write({ + domain: "RELIABILITY", + name: "STACK", + eventType: hiSysEvent.EventType.FAULT, + params: { + PID: 487, + UID: 103, + PACKAGE_NAME: "com.ohos.hisysevent.test", + PROCESS_NAME: "syseventservice", + MSG: "no msg." + } +}).then( + (val) => { + // do something here. + } +).catch( + (err) => { + // do something here. + } +) +``` + +## RuleType + +匹配规则类型枚举。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +| 名称 | 默认值 | 说明 | +| -------- | -------- | -------- | +| WHOLE_WORD | 1 | 全词匹配类型。 | +| PREFIX | 2 | 前缀匹配类型。 | +| REGULAR | 3 | 正则匹配类型。 | + +## WatchRule + +系统事件订阅规则对象接口。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| domain | string | 是 | 事件领域。 | +| name | string | 是 | 事件名称。 | +| tag | string | 是 | 事件标签。 | +| ruleType | [RuleType](#ruletype) | 是 | 匹配规则类型。 | + +## Watcher + +系统事件订阅者对象接口。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| rules | [WatchRule](#watchrule)[] | 是 | 订阅对象数组,每个订阅者对象包含多个订阅规则。 | +| onEvent | function | 是 | 订阅事件的回调方法(info: [SysEventInfo](#syseventinfo)) => void。 | +| onServiceDied | function | 是 | 系统事件服务关闭的回调方法() => void。 | + +## hiSysEvent.addWatcher + +addWatcher(watcher: Watcher): number + +订阅系统事件,接收[Watcher](#watcher)类型的对象作为事件参数。 + +**需要权限:** ohos.permission.READ_DFX_SYSEVENT + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ----------------------------- | ---- | ------------------------ | +| watcher | [Watcher](#watcher) | 是 | 系统事件订阅者对象。 | + +**返回值:** + +| 类型 | 说明 | +| ------- | -------------------------------------------------- | +| number | 系统事件订阅结果。
-0 表示订阅成功。
-负值 表示订阅失败。 | + +**示例:** + +```js +import hiSysEvent from '@ohos.hiSysEvent'; + +let watcher = { + rules: [{ + domain: "RELIABILITY", + name: "STACK", + tag: "STABILITY", + ruleType: hiSysEvent.RuleType.WHOLE_WORD, + }], + onEvent: (info) => { + // do something here. + }, + onServiceDied: () => { + // do something here. + } +} +let ret = hiSysEvent.addWatcher(watcher) +``` + +## hiSysEvent.removeWatcher + +removeWatcher(wathcer: Watcher): number + +取消订阅系统事件,接收[Watcher](#watcher)类型的对象作为事件参数。 + +**需要权限:** ohos.permission.READ_DFX_SYSEVENT + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------------- | ---- | ------------------------ | +| watcher | [Watcher](#watcher) | 是 | 系统事件订阅者对象。 | + +**返回值:** + +| 类型 | 说明 | +| ------- | ----------------------------------------------------------- | +| number | 取消订阅系统事件的结果。
-0 表示取消订阅成功。
-负值 表示取消订阅失败。 | + +**示例:** + +```js +import hiSysEvent from '@ohos.hiSysEvent'; + +let watcher = { + rules: [{ + domain: "RELIABILITY", + name: "STACK", + tag: "STABILITY", + ruleType: hiSysEvent.RuleType.WHOLE_WORD, + }], + onEvent: (info) => { + // do something here. + }, + onServiceDied: () => { + // do something here. + } +} +let ret = hiSysEvent.addWatcher(watcher) +hiSysEvent.removeWatcher(watcher) +``` + +## QueryArg + +系统事件查询参数对象接口。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| beginTime | number | 是 | 查询的系统事件起始时间(13位时间戳)。 | +| endTime | number | 是 | 查询的系统事件结束时间(13位时间戳)。 | +| maxEvents | number | 是 | 查询的系统事件最多条数。 | + +## QueryRule + +系统事件查询规则对象接口。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| domain | string | 是 | 查询包含的事件领域。 | +| names | string[] | 是 | 查询所包含的多个事件名称,每个查询规则对象包含多个系统事件名称。 | + +## Querier + +系统事件查询者对象接口。 + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| onQuery | function | 是 | 返回查询到的系统事件的回调方法(infos: [SysEventInfo](#syseventinfo)[], seqs: number[]) => void。 | +| onComplete | function | 是 | 查询结果统计的回调方法(reason: number, total: number) => void。 | + +## hiSysEvent.query + +query(queryArg: QueryArg, rules: QueryRule[], querier: Querier): number + +查询系统事件。 + +**需要权限:** ohos.permission.READ_DFX_SYSEVENT + +**系统能力:** SystemCapability.HiviewDFX.HiSysEvent + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ----------------------------- | ---- | ------------------------ | +| queryArg | [QueryArg](#queryarg) | 是 | 查询需要配置的查询参数。 | +| rules | [QueryRule](#queryrule)[] | 是 | 查询规则数组,每次查询可配置多个查询规则。 | +| querier | [Querier](#querier) | 是 | 查询者对象,包含查询结果及结束的相关回调。 | + +**返回值:** + +| 类型 | 说明 | +| ------- | ----------------------------------------------------------- | +| number | 系统事件查询的结果。
-0 表示查询成功.
-负值 表示查询失败。 | + +**示例:** + +```js +import hiSysEvent from '@ohos.hiSysEvent'; + +hiSysEvent.write({ + domain: "RELIABILITY", + name: "STACK", + eventType: hiSysEvent.EventType.FAULT, + params: { + PID: 487, + UID: 103, + PACKAGE_NAME: "com.ohos.hisysevent.test", + PROCESS_NAME: "syseventservice", + MSG: "no msg." + } +}, (err, val) => { + // do something here. +}) +hiSysEvent.query({ + beginTime: -1, + endTime: -1, + maxEvents: 5, +}, [{ + domain: "RELIABILITY", + names: ["STACK"], +}], { + onQuery: function (infos, seqs) { + // do something here. + }, + onComplete: function(reason, total) { + // do something here. + } +}) +``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-huks.md b/zh-cn/application-dev/reference/apis/js-apis-huks.md index 5af82e40e7dee5a9beaaee0b6c3e1325cd05c647..5ce6d3cd5485b9343b7ed1351d4a646b499d39f2 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-huks.md +++ b/zh-cn/application-dev/reference/apis/js-apis-huks.md @@ -85,6 +85,8 @@ import huks from '@ohos.security.huks' | HUKS_ERROR_INVALID_SALT | -123 |表示无效SALT。| | HUKS_ERROR_INVALID_ITERATION | -124 |表示无效的迭代。| | HUKS_ERROR_INVALID_OPERATION | -125 |表示无效操作。| +| HUKS_ERROR_INVALID_WRAPPED_FORMAT9+ | -126 |表示导入加密密钥时,密钥格式错误。| +| HUKS_ERROR_INVALID_USAGE_OF_KEY9+ | -127 |表示导入加密密钥时,密钥用途错误。| | HUKS_ERROR_INTERNAL_ERROR | -999 |表示内部错误。| | HUKS_ERROR_UNKNOWN_ERROR | -1000 |表示未知错误。| @@ -117,6 +119,7 @@ import huks from '@ohos.security.huks' | ---------------------- | ---- | ---------------------------------------- | | HUKS_DIGEST_NONE | 0 | 表示无摘要算法。 | | HUKS_DIGEST_MD5 | 1 | 表示MD5摘要算法。 | +| HUKS_DIGEST_SM39+ | 2 | 表示SM3摘要算法。 | | HUKS_DIGEST_SHA1 | 10 | 表示SHA1摘要算法。 | | HUKS_DIGEST_SHA224 | 11 | 表示SHA224摘要算法。 | | HUKS_DIGEST_SHA256 | 12 | 表示SHA256摘要算法。 | @@ -159,26 +162,28 @@ import huks from '@ohos.security.huks' **系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 -| 名称 | 值 | 说明 | -| ---------------------------- | ---- | ------------------------------------------ | -| HUKS_RSA_KEY_SIZE_512 | 512 | 表示使用RSA算法的密钥长度为512bit。 | -| HUKS_RSA_KEY_SIZE_768 | 768 | 表示使用RSA算法的密钥长度为768bit。 | -| HUKS_RSA_KEY_SIZE_1024 | 1024 | 表示使用RSA算法的密钥长度为1024bit。 | -| HUKS_RSA_KEY_SIZE_2048 | 2048 | 表示使用RSA算法的密钥长度为2048bit。 | -| HUKS_RSA_KEY_SIZE_3072 | 3072 | 表示使用RSA算法的密钥长度为3072bit。 | -| HUKS_RSA_KEY_SIZE_4096 | 4096 | 表示使用RSA算法的密钥长度为4096bit。 | -| HUKS_ECC_KEY_SIZE_224 | 224 | 表示使用ECC算法的密钥长度为224bit。 | -| HUKS_ECC_KEY_SIZE_256 | 256 | 表示使用ECC算法的密钥长度为256bit。 | -| HUKS_ECC_KEY_SIZE_384 | 384 | 表示使用ECC算法的密钥长度为384bit。 | -| HUKS_ECC_KEY_SIZE_521 | 521 | 表示使用ECC算法的密钥长度为521bit。 | -| HUKS_AES_KEY_SIZE_128 | 128 | 表示使用AES算法的密钥长度为128bit。 | -| HUKS_AES_KEY_SIZE_192 | 196 | 表示使用AES算法的密钥长度为196bit。 | -| HUKS_AES_KEY_SIZE_256 | 256 | 表示使用AES算法的密钥长度为256bit。 | -| HUKS_AES_KEY_SIZE_512 | 512 | 表示使用AES算法的密钥长度为512bit。 | -| HUKS_CURVE25519_KEY_SIZE_256 | 256 | 表示使用CURVE25519算法的密钥长度为256bit。 | -| HUKS_DH_KEY_SIZE_2048 | 2048 | 表示使用DH算法的密钥长度为2048bit。 | -| HUKS_DH_KEY_SIZE_3072 | 3072 | 表示使用DH算法的密钥长度为3072bit。 | -| HUKS_DH_KEY_SIZE_4096 | 4096 | 表示使用DH算法的密钥长度为4096bit。 | +| 名称 | 值 | 说明 | +| ---------------------------------- | ---- | ------------------------------------------ | +| HUKS_RSA_KEY_SIZE_512 | 512 | 表示使用RSA算法的密钥长度为512bit。 | +| HUKS_RSA_KEY_SIZE_768 | 768 | 表示使用RSA算法的密钥长度为768bit。 | +| HUKS_RSA_KEY_SIZE_1024 | 1024 | 表示使用RSA算法的密钥长度为1024bit。 | +| HUKS_RSA_KEY_SIZE_2048 | 2048 | 表示使用RSA算法的密钥长度为2048bit。 | +| HUKS_RSA_KEY_SIZE_3072 | 3072 | 表示使用RSA算法的密钥长度为3072bit。 | +| HUKS_RSA_KEY_SIZE_4096 | 4096 | 表示使用RSA算法的密钥长度为4096bit。 | +| HUKS_ECC_KEY_SIZE_224 | 224 | 表示使用ECC算法的密钥长度为224bit。 | +| HUKS_ECC_KEY_SIZE_256 | 256 | 表示使用ECC算法的密钥长度为256bit。 | +| HUKS_ECC_KEY_SIZE_384 | 384 | 表示使用ECC算法的密钥长度为384bit。 | +| HUKS_ECC_KEY_SIZE_521 | 521 | 表示使用ECC算法的密钥长度为521bit。 | +| HUKS_AES_KEY_SIZE_128 | 128 | 表示使用AES算法的密钥长度为128bit。 | +| HUKS_AES_KEY_SIZE_192 | 196 | 表示使用AES算法的密钥长度为196bit。 | +| HUKS_AES_KEY_SIZE_256 | 256 | 表示使用AES算法的密钥长度为256bit。 | +| HUKS_AES_KEY_SIZE_512 | 512 | 表示使用AES算法的密钥长度为512bit。 | +| HUKS_CURVE25519_KEY_SIZE_256 | 256 | 表示使用CURVE25519算法的密钥长度为256bit。 | +| HUKS_DH_KEY_SIZE_2048 | 2048 | 表示使用DH算法的密钥长度为2048bit。 | +| HUKS_DH_KEY_SIZE_3072 | 3072 | 表示使用DH算法的密钥长度为3072bit。 | +| HUKS_DH_KEY_SIZE_4096 | 4096 | 表示使用DH算法的密钥长度为4096bit。 | +| HUKS_SM2_KEY_SIZE_2569+ | 256 | 表示SM2算法的密钥长度为256bit。 | +| HUKS_SM4_KEY_SIZE_1289+ | 128 | 表示SM4算法的密钥长度为128bit。 | ## HuksKeyAlg @@ -186,19 +191,22 @@ import huks from '@ohos.security.huks' **系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 -| 名称 | 值 | 说明 | -| ---------------- | ---- | --------------------- | -| HUKS_ALG_RSA | 1 | 表示使用RSA算法。 | -| HUKS_ALG_ECC | 2 | 表示使用ECC算法。 | -| HUKS_ALG_DSA | 3 | 表示使用DSA算法。 | -| HUKS_ALG_AES | 20 | 表示使用AES算法。 | -| HUKS_ALG_HMAC | 50 | 表示使用HMAC算法。 | -| HUKS_ALG_HKDF | 51 | 表示使用HKDF算法。 | -| HUKS_ALG_PBKDF2 | 52 | 表示使用PBKDF2算法。 | -| HUKS_ALG_ECDH | 100 | 表示使用ECDH算法。 | -| HUKS_ALG_X25519 | 101 | 表示使用X25519算法。 | -| HUKS_ALG_ED25519 | 102 | 表示使用ED25519算法。 | -| HUKS_ALG_DH | 103 | 表示使用DH算法。 | +| 名称 | 值 | 说明 | +| ------------------------- | ---- | --------------------- | +| HUKS_ALG_RSA | 1 | 表示使用RSA算法。 | +| HUKS_ALG_ECC | 2 | 表示使用ECC算法。 | +| HUKS_ALG_DSA | 3 | 表示使用DSA算法。 | +| HUKS_ALG_AES | 20 | 表示使用AES算法。 | +| HUKS_ALG_HMAC | 50 | 表示使用HMAC算法。 | +| HUKS_ALG_HKDF | 51 | 表示使用HKDF算法。 | +| HUKS_ALG_PBKDF2 | 52 | 表示使用PBKDF2算法。 | +| HUKS_ALG_ECDH | 100 | 表示使用ECDH算法。 | +| HUKS_ALG_X25519 | 101 | 表示使用X25519算法。 | +| HUKS_ALG_ED25519 | 102 | 表示使用ED25519算法。 | +| HUKS_ALG_DH | 103 | 表示使用DH算法。 | +| HUKS_ALG_SM29+ | 150 | 表示使用SM2算法。 | +| HUKS_ALG_SM39+ | 151 | 表示使用SM3算法。 | +| HUKS_ALG_SM49+ | 152 | 表示使用SM4算法。 | ## HuksKeyGenerateType @@ -247,6 +255,29 @@ import huks from '@ohos.security.huks' | HUKS_SEND_TYPE_ASYNC | 0 | 表示异步发送TAG。 | | HUKS_SEND_TYPE_SYNC | 1 | 表示同步发送TAG。 | +## HuksUnwrapSuite9+ + +表示导入加密密钥的算法套件。 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 + +| 名称 | 值 | 说明 | +| ---------------------------------------------- | ---- | ----------------------------------------------------- | +| HUKS_UNWRAP_SUITE_X25519_AES_256_GCM_NOPADDING | 1 | 导入加密密钥时,X25519密钥协商后使用AES-256 GCM加密。 | +| HUKS_UNWRAP_SUITE_ECDH_AES_256_GCM_NOPADDING | 2 | 导入加密密钥时,ECDH密钥协商后使用AES-256 GCM加密。 | + +## HuksImportKeyType9+ + +表示导入密钥的密钥类型,默认为导入公钥,导入对称密钥时不需要该字段。 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 + +| 名称 | 值 | 说明 | +| ------------------------- | ---- | ------------------------------ | +| HUKS_KEY_TYPE_PUBLIC_KEY | 0 | 表示导入的密钥类型为公钥。 | +| HUKS_KEY_TYPE_PRIVATE_KEY | 1 | 表示导入的密钥类型为私钥。 | +| HUKS_KEY_TYPE_KEY_PAIR | 2 | 表示导入的密钥类型为公私钥对。 | + ## HuksTagType 表示Tag的数据类型。 @@ -269,84 +300,86 @@ import huks from '@ohos.security.huks' **系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 -| 名称 | 值 | 说明 | -| -------------------------------------- | ---------------------------------------- | -------------------------------------- | -| HUKS_TAG_INVALID | HuksTagType.HUKS_TAG_TYPE_INVALID \| 0 | 表示非法的Tag。 | -| HUKS_TAG_ALGORITHM | HUKS_TAG_TYPE_UINT \| 1 | 表示算法的Tag。 | -| HUKS_TAG_PURPOSE | HuksTagType.HUKS_TAG_TYPE_UINT \| 2 | 表示密钥用途的Tag。 | -| HUKS_TAG_KEY_SIZE | HuksTagType.HUKS_TAG_TYPE_UINT \| 3 | 表示密钥长度的Tag。 | -| HUKS_TAG_DIGEST | HuksTagType.HUKS_TAG_TYPE_UINT \| 4 | 表示摘要算法的Tag。 | -| HUKS_TAG_PADDING | HuksTagType.HUKS_TAG_TYPE_UINT \| 5 | 表示补齐算法的Tag。 | -| HUKS_TAG_BLOCK_MODE | HuksTagType.HUKS_TAG_TYPE_UINT \| 6 | 表示加密模式的Tag。 | -| HUKS_TAG_KEY_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 7 | 表示密钥类型的Tag。 | -| HUKS_TAG_ASSOCIATED_DATA | HuksTagType.HUKS_TAG_TYPE_BYTES \| 8 | 表示附加身份验证数据的Tag。 | -| HUKS_TAG_NONCE | HuksTagType.HUKS_TAG_TYPE_BYTES \| 9 | 表示密钥加解密的字段。 | -| HUKS_TAG_IV | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10 | 表示密钥初始化的向量。 | -| HUKS_TAG_INFO | HuksTagType.HUKS_TAG_TYPE_BYTES \| 11 | 表示密钥派生时的info。 | -| HUKS_TAG_SALT | HuksTagType.HUKS_TAG_TYPE_BYTES \| 12 | 表示密钥派生时的盐值。 | -| HUKS_TAG_PWD | HuksTagType.HUKS_TAG_TYPE_BYTES \| 13 | 表示密钥派生时的password。 | -| HUKS_TAG_ITERATION | HuksTagType.HUKS_TAG_TYPE_UINT \| 14 | 表示密钥派生时的迭代次数。 | -| HUKS_TAG_KEY_GENERATE_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 15 | 表示生成密钥类型的Tag。 | -| HUKS_TAG_DERIVE_MAIN_KEY | HuksTagType.HUKS_TAG_TYPE_BYTES \| 16 | 表示密钥派生时的主密钥。 | -| HUKS_TAG_DERIVE_FACTOR | HuksTagType.HUKS_TAG_TYPE_BYTES \| 17 | 表示密钥派生时的派生因子。 | -| HUKS_TAG_DERIVE_ALG | HuksTagType.HUKS_TAG_TYPE_UINT \| 18 | 表示密钥派生时的算法类型。 | -| HUKS_TAG_AGREE_ALG | HuksTagType.HUKS_TAG_TYPE_UINT \| 19 | 表示密钥协商时的算法类型。 | -| HUKS_TAG_AGREE_PUBLIC_KEY_IS_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BOOL \| 20 | 表示密钥协商时的公钥别名。 | -| HUKS_TAG_AGREE_PRIVATE_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BYTES \| 21 | 表示密钥协商时的私钥别名。 | -| HUKS_TAG_AGREE_PUBLIC_KEY | HuksTagType.HUKS_TAG_TYPE_BYTES \| 22 | 表示密钥协商时的公钥。 | -| HUKS_TAG_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BYTES \| 23 | 表示密钥别名。 | -| HUKS_TAG_DERIVE_KEY_SIZE | HuksTagType.HUKS_TAG_TYPE_UINT \| 24 | 表示派生密钥的大小。 | -| HUKS_TAG_ACTIVE_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 201 | 预留。 | -| HUKS_TAG_ORIGINATION_EXPIRE_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 202 | 预留。 | -| HUKS_TAG_USAGE_EXPIRE_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 203 | 预留。 | -| HUKS_TAG_CREATION_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 204 | 预留。 | -| HUKS_TAG_ALL_USERS | ksTagType.HUKS_TAG_TYPE_BOOL \| 301 | 预留。 | -| HUKS_TAG_USER_ID | HuksTagType.HUKS_TAG_TYPE_UINT \| 302 | 预留。 | -| HUKS_TAG_NO_AUTH_REQUIRED | HuksTagType.HUKS_TAG_TYPE_BOOL \| 303 | 预留。 | -| HUKS_TAG_USER_AUTH_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 304 | 预留。 | -| HUKS_TAG_AUTH_TIMEOUT | HuksTagType.HUKS_TAG_TYPE_UINT \| 305 | 预留。 | -| HUKS_TAG_AUTH_TOKEN | HuksTagType.HUKS_TAG_TYPE_BYTES \| 306 | 预留。 | -| HUKS_TAG_ATTESTATION_CHALLENGE | HuksTagType.HUKS_TAG_TYPE_BYTES \| 501 | 表示attestation时的挑战值。 | -| HUKS_TAG_ATTESTATION_APPLICATION_ID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 502 | 表示attestation时的application Id。 | -| HUKS_TAG_ATTESTATION_ID_BRAND | HuksTagType.HUKS_TAG_TYPE_BYTES \| 503 | 表示设备的brand。 | -| HUKS_TAG_ATTESTATION_ID_DEVICE | HuksTagType.HUKS_TAG_TYPE_BYTES \| 504 | 表示设备的device。 | -| HUKS_TAG_ATTESTATION_ID_PRODUCT | HuksTagType.HUKS_TAG_TYPE_BYTES \| 505 | 表示设备的product。 | -| HUKS_TAG_ATTESTATION_ID_SERIAL | HuksTagType.HUKS_TAG_TYPE_BYTES \| 506 | 表示设备的SN号。 | -| HUKS_TAG_ATTESTATION_ID_IMEI | HuksTagType.HUKS_TAG_TYPE_BYTES \| 507 | 表示设备的IMEI号。 | -| HUKS_TAG_ATTESTATION_ID_MEID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 508 | 表示设备的MEID号。 | -| HUKS_TAG_ATTESTATION_ID_MANUFACTURER | HuksTagType.HUKS_TAG_TYPE_BYTES \| 509 | 表示设备的制造商。 | -| HUKS_TAG_ATTESTATION_ID_MODEL | HuksTagType.HUKS_TAG_TYPE_BYTES \| 510 | 表示设备的型号。 | -| HUKS_TAG_ATTESTATION_ID_ALIAS | HuksTagType.HUKS_TAG_TYPE_BYTES \| 511 | 表示attestation时的密钥别名。 | -| HUKS_TAG_ATTESTATION_ID_SOCID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 512 | 表示设备的SOCID。 | -| HUKS_TAG_ATTESTATION_ID_UDID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 513 | 表示设备的UDID。 | -| HUKS_TAG_ATTESTATION_ID_SEC_LEVEL_INFO | HuksTagType.HUKS_TAG_TYPE_BYTES \| 514 | 表示attestation时的安全凭据。 | -| HUKS_TAG_ATTESTATION_ID_VERSION_INFO | HuksTagType.HUKS_TAG_TYPE_BYTES \| 515 | 表示attestation时的版本号。 | -| HUKS_TAG_IS_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BOOL \| 1001 | 表示是否使用生成key时传入的别名的Tag。 | -| HUKS_TAG_KEY_STORAGE_FLAG | HuksTagType.HUKS_TAG_TYPE_UINT \| 1002 | 表示密钥存储方式的Tag。 | -| HUKS_TAG_IS_ALLOWED_WRAP | HuksTagType.HUKS_TAG_TYPE_BOOL \| 1003 | 预留。 | -| HUKS_TAG_KEY_WRAP_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 1004 | 预留。 | -| HUKS_TAG_KEY_AUTH_ID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 1005 | 预留。 | -| HUKS_TAG_KEY_ROLE | HuksTagType.HUKS_TAG_TYPE_UINT \| 1006 | 预留。 | -| HUKS_TAG_KEY_FLAG | HuksTagType.HUKS_TAG_TYPE_UINT \| 1007 | 表示密钥标志的Tag。 | -| HUKS_TAG_IS_ASYNCHRONIZED | HuksTagType.HUKS_TAG_TYPE_UINT \| 1008 | 预留。 | -| HUKS_TAG_SECURE_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BOOL \| 1009 | 预留。 | -| HUKS_TAG_SECURE_KEY_UUID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 1010 | 预留。 | -| HUKS_TAG_KEY_DOMAIN | HuksTagType.HUKS_TAG_TYPE_UINT \| 1011 | 预留。 | -| HUKS_TAG_PROCESS_NAME | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10001 | 表示进程名称的Tag。 | -| HUKS_TAG_PACKAGE_NAME | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10002 | 预留。 | -| HUKS_TAG_ACCESS_TIME | HuksTagType.HUKS_TAG_TYPE_UINT \| 10003 | 预留。 | -| HUKS_TAG_USES_TIME | HuksTagType.HUKS_TAG_TYPE_UINT \| 10004 | 预留。 | -| HUKS_TAG_CRYPTO_CTX | HuksTagType.HUKS_TAG_TYPE_ULONG \| 10005 | 预留。 | -| HUKS_TAG_KEY | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10006 | 预留。 | -| HUKS_TAG_KEY_VERSION | HuksTagType.HUKS_TAG_TYPE_UINT \| 10007 | 表示密钥版本的Tag。 | -| HUKS_TAG_PAYLOAD_LEN | HuksTagType.HUKS_TAG_TYPE_UINT \| 10008 | 预留。 | -| HUKS_TAG_AE_TAG | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10009 | 预留。 | -| HUKS_TAG_IS_KEY_HANDLE | HuksTagType.HUKS_TAG_TYPE_ULONG \| 10010 | 预留。 | -| HUKS_TAG_OS_VERSION | HuksTagType.HUKS_TAG_TYPE_UINT \| 10101 | 表示操作系统版本的Tag。 | -| HUKS_TAG_OS_PATCHLEVEL | HuksTagType.HUKS_TAG_TYPE_UINT \| 10102 | 表示操作系统补丁级别的Tag。 | -| HUKS_TAG_SYMMETRIC_KEY_DATA | HuksTagType.HUKS_TAG_TYPE_BYTES \| 20001 | 预留。 | -| HUKS_TAG_ASYMMETRIC_PUBLIC_KEY_DATA | HuksTagType.HUKS_TAG_TYPE_BYTES \| 20002 | 预留。 | -| HUKS_TAG_ASYMMETRIC_PRIVATE_KEY_DATA | HuksTagType.HUKS_TAG_TYPE_BYTES \| 20003 | 预留。 | +| 名称 | 值 | 说明 | +| -------------------------------------------- | ---------------------------------------- | -------------------------------------- | +| HUKS_TAG_INVALID | HuksTagType.HUKS_TAG_TYPE_INVALID \| 0 | 表示非法的Tag。 | +| HUKS_TAG_ALGORITHM | HUKS_TAG_TYPE_UINT \| 1 | 表示算法的Tag。 | +| HUKS_TAG_PURPOSE | HuksTagType.HUKS_TAG_TYPE_UINT \| 2 | 表示密钥用途的Tag。 | +| HUKS_TAG_KEY_SIZE | HuksTagType.HUKS_TAG_TYPE_UINT \| 3 | 表示密钥长度的Tag。 | +| HUKS_TAG_DIGEST | HuksTagType.HUKS_TAG_TYPE_UINT \| 4 | 表示摘要算法的Tag。 | +| HUKS_TAG_PADDING | HuksTagType.HUKS_TAG_TYPE_UINT \| 5 | 表示补齐算法的Tag。 | +| HUKS_TAG_BLOCK_MODE | HuksTagType.HUKS_TAG_TYPE_UINT \| 6 | 表示加密模式的Tag。 | +| HUKS_TAG_KEY_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 7 | 表示密钥类型的Tag。 | +| HUKS_TAG_ASSOCIATED_DATA | HuksTagType.HUKS_TAG_TYPE_BYTES \| 8 | 表示附加身份验证数据的Tag。 | +| HUKS_TAG_NONCE | HuksTagType.HUKS_TAG_TYPE_BYTES \| 9 | 表示密钥加解密的字段。 | +| HUKS_TAG_IV | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10 | 表示密钥初始化的向量。 | +| HUKS_TAG_INFO | HuksTagType.HUKS_TAG_TYPE_BYTES \| 11 | 表示密钥派生时的info。 | +| HUKS_TAG_SALT | HuksTagType.HUKS_TAG_TYPE_BYTES \| 12 | 表示密钥派生时的盐值。 | +| HUKS_TAG_PWD | HuksTagType.HUKS_TAG_TYPE_BYTES \| 13 | 表示密钥派生时的password。 | +| HUKS_TAG_ITERATION | HuksTagType.HUKS_TAG_TYPE_UINT \| 14 | 表示密钥派生时的迭代次数。 | +| HUKS_TAG_KEY_GENERATE_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 15 | 表示生成密钥类型的Tag。 | +| HUKS_TAG_DERIVE_MAIN_KEY | HuksTagType.HUKS_TAG_TYPE_BYTES \| 16 | 表示密钥派生时的主密钥。 | +| HUKS_TAG_DERIVE_FACTOR | HuksTagType.HUKS_TAG_TYPE_BYTES \| 17 | 表示密钥派生时的派生因子。 | +| HUKS_TAG_DERIVE_ALG | HuksTagType.HUKS_TAG_TYPE_UINT \| 18 | 表示密钥派生时的算法类型。 | +| HUKS_TAG_AGREE_ALG | HuksTagType.HUKS_TAG_TYPE_UINT \| 19 | 表示密钥协商时的算法类型。 | +| HUKS_TAG_AGREE_PUBLIC_KEY_IS_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BOOL \| 20 | 表示密钥协商时的公钥别名。 | +| HUKS_TAG_AGREE_PRIVATE_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BYTES \| 21 | 表示密钥协商时的私钥别名。 | +| HUKS_TAG_AGREE_PUBLIC_KEY | HuksTagType.HUKS_TAG_TYPE_BYTES \| 22 | 表示密钥协商时的公钥。 | +| HUKS_TAG_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BYTES \| 23 | 表示密钥别名。 | +| HUKS_TAG_DERIVE_KEY_SIZE | HuksTagType.HUKS_TAG_TYPE_UINT \| 24 | 表示派生密钥的大小。 | +| HUKS_TAG_IMPORT_KEY_TYPE9+ | HuksTagType.HUKS_TAG_TYPE_UINT \| 25 | 表示导入的密钥类型 | +| HUKS_TAG_UNWRAP_ALGORITHM_SUITE9+ | HuksTagType.HUKS_TAG_TYPE_UINT \| 26 | 表示导入加密密钥的套件 | +| HUKS_TAG_ACTIVE_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 201 | 预留。 | +| HUKS_TAG_ORIGINATION_EXPIRE_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 202 | 预留。 | +| HUKS_TAG_USAGE_EXPIRE_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 203 | 预留。 | +| HUKS_TAG_CREATION_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 204 | 预留。 | +| HUKS_TAG_ALL_USERS | ksTagType.HUKS_TAG_TYPE_BOOL \| 301 | 预留。 | +| HUKS_TAG_USER_ID | HuksTagType.HUKS_TAG_TYPE_UINT \| 302 | 预留。 | +| HUKS_TAG_NO_AUTH_REQUIRED | HuksTagType.HUKS_TAG_TYPE_BOOL \| 303 | 预留。 | +| HUKS_TAG_USER_AUTH_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 304 | 预留。 | +| HUKS_TAG_AUTH_TIMEOUT | HuksTagType.HUKS_TAG_TYPE_UINT \| 305 | 预留。 | +| HUKS_TAG_AUTH_TOKEN | HuksTagType.HUKS_TAG_TYPE_BYTES \| 306 | 预留。 | +| HUKS_TAG_ATTESTATION_CHALLENGE | HuksTagType.HUKS_TAG_TYPE_BYTES \| 501 | 表示attestation时的挑战值。 | +| HUKS_TAG_ATTESTATION_APPLICATION_ID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 502 | 表示attestation时的application Id。 | +| HUKS_TAG_ATTESTATION_ID_BRAND | HuksTagType.HUKS_TAG_TYPE_BYTES \| 503 | 表示设备的brand。 | +| HUKS_TAG_ATTESTATION_ID_DEVICE | HuksTagType.HUKS_TAG_TYPE_BYTES \| 504 | 表示设备的device。 | +| HUKS_TAG_ATTESTATION_ID_PRODUCT | HuksTagType.HUKS_TAG_TYPE_BYTES \| 505 | 表示设备的product。 | +| HUKS_TAG_ATTESTATION_ID_SERIAL | HuksTagType.HUKS_TAG_TYPE_BYTES \| 506 | 表示设备的SN号。 | +| HUKS_TAG_ATTESTATION_ID_IMEI | HuksTagType.HUKS_TAG_TYPE_BYTES \| 507 | 表示设备的IMEI号。 | +| HUKS_TAG_ATTESTATION_ID_MEID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 508 | 表示设备的MEID号。 | +| HUKS_TAG_ATTESTATION_ID_MANUFACTURER | HuksTagType.HUKS_TAG_TYPE_BYTES \| 509 | 表示设备的制造商。 | +| HUKS_TAG_ATTESTATION_ID_MODEL | HuksTagType.HUKS_TAG_TYPE_BYTES \| 510 | 表示设备的型号。 | +| HUKS_TAG_ATTESTATION_ID_ALIAS | HuksTagType.HUKS_TAG_TYPE_BYTES \| 511 | 表示attestation时的密钥别名。 | +| HUKS_TAG_ATTESTATION_ID_SOCID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 512 | 表示设备的SOCID。 | +| HUKS_TAG_ATTESTATION_ID_UDID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 513 | 表示设备的UDID。 | +| HUKS_TAG_ATTESTATION_ID_SEC_LEVEL_INFO | HuksTagType.HUKS_TAG_TYPE_BYTES \| 514 | 表示attestation时的安全凭据。 | +| HUKS_TAG_ATTESTATION_ID_VERSION_INFO | HuksTagType.HUKS_TAG_TYPE_BYTES \| 515 | 表示attestation时的版本号。 | +| HUKS_TAG_IS_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BOOL \| 1001 | 表示是否使用生成key时传入的别名的Tag。 | +| HUKS_TAG_KEY_STORAGE_FLAG | HuksTagType.HUKS_TAG_TYPE_UINT \| 1002 | 表示密钥存储方式的Tag。 | +| HUKS_TAG_IS_ALLOWED_WRAP | HuksTagType.HUKS_TAG_TYPE_BOOL \| 1003 | 预留。 | +| HUKS_TAG_KEY_WRAP_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 1004 | 预留。 | +| HUKS_TAG_KEY_AUTH_ID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 1005 | 预留。 | +| HUKS_TAG_KEY_ROLE | HuksTagType.HUKS_TAG_TYPE_UINT \| 1006 | 预留。 | +| HUKS_TAG_KEY_FLAG | HuksTagType.HUKS_TAG_TYPE_UINT \| 1007 | 表示密钥标志的Tag。 | +| HUKS_TAG_IS_ASYNCHRONIZED | HuksTagType.HUKS_TAG_TYPE_UINT \| 1008 | 预留。 | +| HUKS_TAG_SECURE_KEY_ALIAS | HuksTagType.HUKS_TAG_TYPE_BOOL \| 1009 | 预留。 | +| HUKS_TAG_SECURE_KEY_UUID | HuksTagType.HUKS_TAG_TYPE_BYTES \| 1010 | 预留。 | +| HUKS_TAG_KEY_DOMAIN | HuksTagType.HUKS_TAG_TYPE_UINT \| 1011 | 预留。 | +| HUKS_TAG_PROCESS_NAME | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10001 | 表示进程名称的Tag。 | +| HUKS_TAG_PACKAGE_NAME | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10002 | 预留。 | +| HUKS_TAG_ACCESS_TIME | HuksTagType.HUKS_TAG_TYPE_UINT \| 10003 | 预留。 | +| HUKS_TAG_USES_TIME | HuksTagType.HUKS_TAG_TYPE_UINT \| 10004 | 预留。 | +| HUKS_TAG_CRYPTO_CTX | HuksTagType.HUKS_TAG_TYPE_ULONG \| 10005 | 预留。 | +| HUKS_TAG_KEY | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10006 | 预留。 | +| HUKS_TAG_KEY_VERSION | HuksTagType.HUKS_TAG_TYPE_UINT \| 10007 | 表示密钥版本的Tag。 | +| HUKS_TAG_PAYLOAD_LEN | HuksTagType.HUKS_TAG_TYPE_UINT \| 10008 | 预留。 | +| HUKS_TAG_AE_TAG | HuksTagType.HUKS_TAG_TYPE_BYTES \| 10009 | 预留。 | +| HUKS_TAG_IS_KEY_HANDLE | HuksTagType.HUKS_TAG_TYPE_ULONG \| 10010 | 预留。 | +| HUKS_TAG_OS_VERSION | HuksTagType.HUKS_TAG_TYPE_UINT \| 10101 | 表示操作系统版本的Tag。 | +| HUKS_TAG_OS_PATCHLEVEL | HuksTagType.HUKS_TAG_TYPE_UINT \| 10102 | 表示操作系统补丁级别的Tag。 | +| HUKS_TAG_SYMMETRIC_KEY_DATA | HuksTagType.HUKS_TAG_TYPE_BYTES \| 20001 | 预留。 | +| HUKS_TAG_ASYMMETRIC_PUBLIC_KEY_DATA | HuksTagType.HUKS_TAG_TYPE_BYTES \| 20002 | 预留。 | +| HUKS_TAG_ASYMMETRIC_PRIVATE_KEY_DATA | HuksTagType.HUKS_TAG_TYPE_BYTES \| 20003 | 预留。 | ## huks.generateKey @@ -542,7 +575,7 @@ var result = huks.getSdkVersion(emptyOptions); importKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void -导入密钥,使用Callback方式回调异步返回结果 。 +导入明文密钥,使用Callback方式回调异步返回结果 。 **系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 @@ -600,7 +633,7 @@ huks.importKey(keyAlias, options, function (err, data){}); importKey(keyAlias: string, options: HuksOptions) : Promise\ -导入密钥,使用Promise方式异步返回结果。 +导入明文密钥,使用Promise方式异步返回结果。 **系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 @@ -661,6 +694,230 @@ var huksoptions = { var result = huks.importKey(keyAlias, huksoptions); ``` +## huks.importWrappedKey9+ + +importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void + +导入加密密钥,使用Callback方式回调异步返回结果 。 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ---------------- | ----------------------------------------- | ---- | -------------------------------------------------- | +| keyAlias | string | 是 | 密钥别名,存放待导入密钥的别名。 | +| wrappingKeyAlias | string | 是 | 密钥别名,对应密钥用于解密加密的密钥数据。 | +| options | [HuksOptions](#huksoptions) | 是 | 用于导入时所需TAG和需要导入的加密的密钥数据。 | +| callback | AsyncCallback\<[HuksResult](#huksresult)> | 是 | 返回HUKS_SUCCESS时表示接口使用成功,其他时为错误。 | + +**示例:** + +```js +var exportWrappingKey; +var alias1 = "importAlias"; +var alias2 = "wrappingKeyAlias"; + +async function TestGenFunc(alias, options) { + await genKey(alias, options) + .then((data) => { + console.log(`test genKey data: ${JSON.stringify(data)}`); + }) + .catch((err) => { + console.log('test genKey err information: ' + JSON.stringify(err)); + }); +} + +function genKey(alias, options) { + return new Promise((resolve, reject) => { + huks.generateKey(alias, options, function (err, data) { + console.log(`test genKey data: ${JSON.stringify(data)}`); + if (err.code !== 0) { + console.log('test genKey err information: ' + JSON.stringify(err)); + reject(err); + } else { + resolve(data); + } + }); + }); +} + +async function TestExportFunc(alias, options) { + await exportKey(alias, options) + .then((data) => { + console.log(`test exportKey data: ${JSON.stringify(data)}`); + }) + .catch((err) => { + console.log('test exportKey err information: ' + JSON.stringify(err)); + }); +} + +function exportKey(alias, options) { + return new Promise((resolve, reject) => { + huks.exportKey(alias, options, function (err, data) { + console.log(`test exportKey data: ${JSON.stringify(data)}`); + if (err.code !== 0) { + console.log('test exportKey err information: ' + JSON.stringify(err)); + reject(err); + } else { + exportWrappingKey = data.outData; + resolve(data); + } + }); + }); +} + +async function TestImportWrappedFunc(alias, wrappingAlias, options) { + await importWrappedKey(alias, wrappingAlias, options) + .then((data) => { + console.log(`TestImportWrappedFunc data: ${JSON.stringify(data)}`); + }) + .catch((err) => { + console.log('test importWrappedKey err information: ' + JSON.stringify(err)); + }); +} + +function importWrappedKey(alias, wrappingAlias, options) { + return new Promise((resolve, reject) => { + huks.importWrappedKey(alias, wrappingAlias, options, function (err, data) { + console.log(`importWrappedKey data: ${JSON.stringify(data)}`); + if (err.code !== 0) { + console.log('importWrappedKey err information: ' + JSON.stringify(err)); + reject(err); + } else { + resolve(data); + } + }); + }); +} + +async function TestImportWrappedKeyFunc( + alias, + wrappingAlias, + genOptions, + importOptions +) { + await TestGenFunc(wrappingAlias, genOptions); + await TestExportFunc(wrappingAlias, genOptions); + + /* 以下操作不需要调用HUKS接口,此处不给出具体实现。 + * 假设待导入的密钥为keyA + * 1.生成ECC公私钥keyB,公钥为keyB_pub, 私钥为keyB_pri + * 2.使用keyB_pri和wrappingAlias密钥中获取的公钥进行密钥协商,协商出共享密钥share_key + * 3.随机生成密钥kek,用于加密keyA,采用AES-GCM加密,加密过程中需要记录:nonce1/aad1/加密后的密文keyA_enc/加密后的tag1。 + * 4.使用share_key加密kek,采用AES-GCM加密,加密过程中需要记录:nonce2/aad2/加密后的密文kek_enc/加密后的tag2。 + * 5.拼接importOptions.inData字段,满足以下格式: + * keyB_pub的长度(4字节) + keyB_pub的数据 + aad2的长度(4字节) + aad2的数据 + + * nonce2的长度(4字节) + nonce2的数据 + tag2的长度(4字节) + tag2的数据 + + * kek_enc的长度(4字节) + kek_enc的数据 + aad1的长度(4字节) + aad1的数据 + + * nonce1的长度(4字节) + nonce1的数据 + tag1的长度(4字节) + tag1的数据 + + * keyA长度占用的内存长度(4字节) + keyA的长度 + keyA_enc的长度(4字节) + keyA_enc的数据 + */ + var inputKey = new Uint8Array([0x02, 0x00, 0x00, 0x00]); + importOptions.inData = inputKey; + await TestImportWrappedFunc(alias, wrappingAlias, importOptions); +} + +function makeGenerateOptions() { + var properties = new Array(); + properties[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_ECC + }; + properties[1] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_ECC_KEY_SIZE_256 + }; + properties[2] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_UNWRAP + }; + properties[3] = { + tag: huks.HuksTag.HUKS_TAG_DIGEST, + value: huks.HuksKeyDigest.HUKS_DIGEST_SHA256 + }; + var options = { + properties: properties + }; + return options; +}; + +function makeImportOptions() { + var properties = new Array(); + properties[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_AES + }; + properties[1] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_AES_KEY_SIZE_256 + }; + properties[2] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_ENCRYPT | huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_DECRYPT + }; + properties[3] = { + tag: huks.HuksTag.HUKS_TAG_BLOCK_MODE, + value: huks.HuksCipherMode.HUKS_MODE_CBC + }; + properties[4] = { + tag: huks.HuksTag.HUKS_TAG_UNWRAP_ALGORITHM_SUITE, + value: huks.HuksUnwrapSuite.HUKS_UNWRAP_SUITE_ECDH_AES_256_GCM_NOPADDING + }; + var options = { + properties: properties + }; + return options; +}; + +function huksImportWrappedKey() { + var genOptions = makeGenerateOptions(); + var importOptions = makeImportOptions(); + TestImportWrappedKeyFunc( + alias1, + alias2, + genOptions, + importOptions + ); +} +``` + +## huks.importWrappedKey9+ + +importWrappedKey(keyAlias: string, wrappingKeyAlias: string, options: HuksOptions) : Promise\ + +导入加密密钥,使用Promise方式异步返回结果。 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Security.Huks。 + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ---------------- | --------------------------- | ---- | --------------------------------------------- | +| keyAlias | string | 是 | 密钥别名,存放待导入密钥的别名。 | +| wrappingKeyAlias | string | 是 | 密钥别名,对应密钥用于解密加密的密钥数据。 | +| options | [HuksOptions](#huksoptions) | 是 | 用于导入时所需TAG和需要导入的加密的密钥数据。 | + +**返回值:** + +| 类型 | 说明 | +| ----------------------------------- | -------------------------------------------------- | +| Promise\<[HuksResult](#huksresult)> | 返回HUKS_SUCCESS时表示接口使用成功,其他时为错误。 | + +**示例:** + +```js +/* 处理流程与callback类似,主要差异点为如下函数: */ +async function TestImportWrappedFunc(alias, wrappingAlias, options) { + var result = await huks.importWrappedKey(alias, wrappingAlias, options); + if (result.errorCode === 0) { + console.log('test importWrappedKey success'); + } else { + console.log('test importWrappedKey fail'); + } +} +``` + ## huks.exportKey exportKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md index 564444daffe89d2300a83a415af4de76bc7b47a7..cd26e2b93f1b4d61b3af72add5cc38d3359f7656 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md @@ -4,7 +4,7 @@ 输入设备管理模块,用于监听输入设备连接、断开和变化,并查看输入设备相关信息。比如监听鼠标插拔,并获取鼠标的id、name和指针移动速度等信息。 -> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> **说明**:
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -21,16 +21,16 @@ on(type: “change”, listener: Callback<DeviceListener>): void 监听设备的热插拔事件。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**参数:** +**参数**: | 参数 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------- | ---- | -------------------- | -| type | string | 是 | 输入设备的事件类型 | -| listener | Callback<[DeviceListener](#devicelistener9+)> | 是 | 可上报的输入设备事件 | +| type | string | 是 | 输入设备的事件类型。 | +| listener | Callback<[DeviceListener](#devicelistener9+)> | 是 | 可上报的输入设备事件。 | -**示例:** +**示例**: ```js let isPhysicalKeyboardExist = true; @@ -56,16 +56,16 @@ off(type: “change”, listener?: Callback<DeviceListener>): void 取消监听设备的热插拔事件。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**参数:** +**参数**: | 参数 | 类型 | 必填 | 说明 | | -------- | ------------------------------------------------- | ---- | -------------------- | -| type | string | 是 | 输入设备的事件类型 | -| listener | Callback<[DeviceListener](#devicelistener9+)> | 否 | 可上报的输入设备事件 | +| type | string | 是 | 输入设备的事件类型。 | +| listener | Callback<[DeviceListener](#devicelistener9+)> | 否 | 可上报的输入设备事件。 | -**示例:** +**示例**: ```js listener: function(data) { @@ -75,9 +75,9 @@ listener: function(data) { // 单独取消listener的监听。 inputDevice.off("change", this.listener); -// 取消所有监听 +// 取消所有监听。 inputDevice.off("change"); -// 取消监听后,软键盘默认都弹出 +// 取消监听后,软键盘默认都弹出。 ``` ## inputDevice.getDeviceIds @@ -86,15 +86,15 @@ getDeviceIds(callback: AsyncCallback<Array<number>>): void 获取所有输入设备的id列表,使用callback方式作为异步方法。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**参数:** +**参数**: -| 参数 | 类型 | 必填 | 说明 | +| 参数 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | ----- | -| callback | AsyncCallback<Array<number>> | 是 | 回调函数。 | +| callback | AsyncCallback<Array<number>> | 是 | 回调函数。 | -**示例:** +**示例**: ```js inputDevice.getDeviceIds((ids)=>{ @@ -108,15 +108,15 @@ function getDeviceIds(): Promise<<Array<number>> 获取所有输入设备的id列表,使用Promise方式作为异步方法。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**返回值:** +**返回值**: | 参数 | 说明 | | ------------------------- | ----------------------------- | -| Promise<Array<number>> | Promise实例,用于异步获取结果 | +| Promise<Array<number>> | Promise实例,用于异步获取结果。 | -**示例:** +**示例**: ```js inputDevice.getDeviceIds().then((ids)=>{ @@ -130,16 +130,16 @@ getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): voi 获取输入设备的描述信息,使用callback方式作为异步方法。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**参数:** +**参数**: | 参数 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------- | ---- | --------------------------- | | deviceId | number | 是 | 需要获取信息的设备id。 | | callback | AsyncCallback<[InputDeviceData](#inputdevicedata)> | 是 | 回调函数,异步返回InputDeviceData对象。 | -**示例:** +**示例**: ```js // 示例获取设备id为1的设备name信息。 @@ -154,21 +154,21 @@ function getDevice(deviceId: number): Promise<InputDeviceData> 获取输入设备的描述信息,使用Promise方式作为异步方法。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**参数:** +**参数**: | 参数 | 类型 | 必填 | 说明 | | -------- | ------ | ---- | ---------------------- | | deviceId | number | 是 | 需要获取信息的设备id。 | -**返回值:** +**返回值**: | 参数 | 说明 | | -------------------------------------------------- | ----------------------------- | -| Promise<[InputDeviceData](#inputdevicedata)> | Promise实例,用于异步获取结果 | +| Promise<[InputDeviceData](#inputdevicedata)> | Promise实例,用于异步获取结果。 | -**示例:** +**示例**: ```js // 示例获取设备id为1的设备name信息。 @@ -181,11 +181,11 @@ inputDevice.getDevice(1).then((inputDevice)=>{ supportKeys(deviceId: number, keys: Array<KeyCode>, callback: Callback<Array<boolean>>): void; -获取输入设备的描述信息,使用callback方式作为异步方法。 +获取输入设备支持的键码值,使用callback方式作为异步方法。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**参数:** +**参数**: | 参数 | 类型 | 必填 | 说明 | | -------- | ------------------------------------ | ---- | ------------------------------------------------------------ | @@ -193,7 +193,7 @@ supportKeys(deviceId: number, keys: Array<KeyCode>, callback: Callback< | keys | Array<KeyCode> | 是 | 需要查询的键码值,最多支持5个按键查询。 | | callback | Callback<Array<boolean>> | 是 | 回调函数,异步返回查询结果。 | -**示例:** +**示例**: ```js // 示例查询id为1的设备对于17、22和2055按键的支持情况。 @@ -206,24 +206,24 @@ inputDevice.supportKeys(1, [17, 22, 2055], (ret)=>{ supportKeys(deviceId: number, keys: Array<KeyCode>): Promise<Array<boolean>>; -获取输入设备的描述信息,使用Promise方式作为异步方法。 +获取输入设备支持的键码值,使用Promise方式作为异步方法。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**参数:** +**参数**: | 参数 | 类型 | 必填 | 说明 | | -------- | -------------------- | ---- | ------------------------------------------------------------ | | deviceId | number | 是 | 输入设备的唯一标识,同一个物理设备反复插拔,其设备id会发生变化。 | | keys | Array<KeyCode> | 是 | 需要查询的键码值,最多支持5个按键查询。 | -**返回值:** +**返回值**: | 参数 | 说明 | | ----------------------------------- | ----------------------------- | -| Promise<Array<boolean>> | Promise实例,用于异步获取结果 | +| Promise<Array<boolean>> | Promise实例,用于异步获取结果。 | -**示例:** +**示例**: ```js // 示例查询id为1的设备对于17、22和2055按键的支持情况。 @@ -238,16 +238,16 @@ getKeyboardType(deviceId: number, callback: AsyncCallback<KeyboardType>): 查询输入设备的键盘类型,使用callback方式作为异步方法。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**参数:** +**参数**: | 参数 | 类型 | 必填 | 说明 | | -------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ | | deviceId | number | 是 | 输入设备的唯一标识,同一个物理设备反复插拔,其设备id会发生变化。 | | callback | AsyncCallback<[KeyboardType](#keyboardtype)> | 是 | 回调函数,异步返回查询结果。 | -**示例:** +**示例**: ```js // 示例查询设备id为1的设备键盘类型。 @@ -262,15 +262,15 @@ getKeyboardType(deviceId: number,): Promise<KeyboardType>; 查询输入设备的键盘类型,使用Promise方式作为异步方法。 -**系统能力:** SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:SystemCapability.MultimodalInput.Input.InputDevice -**返回值:** +**返回值**: | 参数 | 说明 | | -------------------------------------------- | ----------------------------- | -| Promise<[KeyboardType](#keyboardtype)> | Promise实例,用于异步获取结果 | +| Promise<[KeyboardType](#keyboardtype)> | Promise实例,用于异步获取结果。 | -**示例:** +**示例**: ```js // 示例查询设备id为1的设备键盘类型。 @@ -283,7 +283,7 @@ inputDevice.getKeyboardType().then((ret)=>{ 输入设备的描述信息。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice | 名称 | 参数类型 | 说明 | | -------- | --------------------------- | ------------------------------------------------------------ | @@ -294,7 +294,7 @@ inputDevice.getKeyboardType().then((ret)=>{ 输入设备的描述信息。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice | 名称 | 参数类型 | 说明 | | -------------------- | -------------------------------------- | ------------------------------------------------------------ | @@ -313,7 +313,7 @@ inputDevice.getKeyboardType().then((ret)=>{ 输入设备的轴类型 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice | 名称 | 参数类型 | 说明 | | ----------- | -------- | ------------------- | @@ -331,7 +331,7 @@ inputDevice.getKeyboardType().then((ret)=>{ 输入设备的轴信息 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**: 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice | 名称 | 参数类型 | 说明 | | ----------------------- | ------------------------- | ---------------- | @@ -347,7 +347,7 @@ inputDevice.getKeyboardType().then((ret)=>{ 定义这个轴的输入源类型。比如鼠标设备可上报x轴事件,则x轴的源就是鼠标。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice | 名称 | 参数类型 | 说明 | | ----------- | ------ | ----------- | @@ -362,7 +362,7 @@ inputDevice.getKeyboardType().then((ret)=>{ 定义监听设备热插拔事件。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice | 名称 | 参数类型 | 说明 | | ------ | -------- | ------------------ | @@ -373,7 +373,7 @@ inputDevice.getKeyboardType().then((ret)=>{ 定义键盘输入设备的类型。 -**系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice +**系统能力**:以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice | 名称 | 参数类型 | 值 | 说明 | | ------------------- | -------- | ---- | ------------------ | diff --git a/zh-cn/application-dev/reference/apis/js-apis-osAccount.md b/zh-cn/application-dev/reference/apis/js-apis-osAccount.md index 33868672cb9085ebeaf2494672dc0521e36b8797..e8e6d945c80fca9e465529fbd474aed6cf29f363 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-osAccount.md +++ b/zh-cn/application-dev/reference/apis/js-apis-osAccount.md @@ -1739,6 +1739,173 @@ off(type: 'activate' | 'activating', name: string, callback?: Callback<number accountManager.off("activating", "osAccountOnOffNameA", offCallback); ``` +### getBundleIdFromUid9+ + +getBundleIdFromUid(uid: number, callback: AsyncCallback<number>): void; + +通过uid查询对应的bundleId。 + +此接口为系统接口,三方应用不支持调用。 + +**系统能力:** SystemCapability.Account.OsAccount + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------- | ---- | ------------------------------------------------------------ | +| uid | number | 是 | 进程uid。 | +| callback | AsyncCallback<number> | 是 | 回调结果,返回的是与uid对应的bundleId。 | + +**示例:** + + ```js + var testUid = 1000000; + osAccountManager.getBundleIdFromUid(testUid,(err,bundleId)=>{ + console.info("getBundleIdFromUid errInfo:" + JSON.stringify(err)); + console.info("getBundleIdFromUid bundleId:" + JSON.stringify(bundleId)); + }); + ``` +### getBundleIdFromUid9+ + +getBundleIdFromUid(uid: number): Promise<number>; + +通过uid查询对应的bundleId。 + +此接口为系统接口,三方应用不支持调用。 + +**系统能力:** SystemCapability.Account.OsAccount + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ------------ | +| uid | number | 是 | 进程uid。 | + +**返回值:** + +| 类型 | 说明 | +| :-------------------- | :----------------------------------------------------------- | +| Promise<number> | Promise实例,用于获取异步返回结果,返回的是与uid对应的bundleId。 | + +**示例:** + + ```js + var testUid = 1000000; + var bundleIdInfo = await osAccountManager.getBundleIdFromUid(testUid).catch((err)=>{ + console.info("getBundleIdFromUid errInfo:" + JSON.stringify(err));}) + console.info("getBundleIdFromUid bundleId:" + JSON.stringify(bundleIdInfo)); + ``` + +### isMainOsAccount9+ + +isMainOsAccount(callback: AsyncCallback<boolean>): void; + +查询当前进程是否处于主用户。 + +此接口为系统接口,三方应用不支持调用。 + +**系统能力:** SystemCapability.Account.OsAccount + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------- | ---- | ------------------------------------------------------------ | +| callback | AsyncCallback<boolean> | 是 | 回调结果,返回的是当前进程是否处于主用户,是则返回true,否则返回false。 | + +**示例:** + + ```js + osAccountManager.isMainOsAccount((err,result)=>{ + console.info("isMainOsAccount errInfo:" + JSON.stringify(err)); + console.info("isMainOsAccount result:" + JSON.stringify(result)); + }); + ``` +### isMainOsAccount9+ + +isMainOsAccount(): Promise<boolean>; + +查询当前进程是否处于主用户。 + +此接口为系统接口,三方应用不支持调用。 + +**系统能力:** SystemCapability.Account.OsAccount + +**返回值:** + +| 类型 | 说明 | +| :-------------------- | :----------------------------------------------------------- | +| Promise<boolean> | Promise实例,用于获取异步返回结果,回调结果,返回的是当前进程是否处于主用户,是则返回true,否则返回false。 | + +**示例:** + + ```js + var result = await osAccountManager.isMainOsAccount().catch((err)=>{ + console.info("isMainOsAccount errInfo:" + JSON.stringify(err)); + }); + console.info("isMainOsAccount result:" + JSON.stringify(result)); + ``` +### queryOsAccountConstraintSourceTypes9+ + +queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback<Array<ConstraintSourceTypeInfo>>): void; + +查询指定系统帐号的指定约束来源信息。 + +此接口为系统接口,三方应用不支持调用。 + +**需要权限:** ohos.permission.MANAGE_LOCAL_ACCOUNTS + +**系统能力:** SystemCapability.Account.OsAccount + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------- | ---- | ------------------------------------------------------------ | +| localId | number | 是 | 要查询的系统帐号ID | +| constraint | string | 是 | 要查询的[约束](#系统帐号约束列表)名称 | +| callback | AsyncCallback<Array<[ConstraintSourceTypeInfo](#constraintsourcetypeinfo)>> | 是 | 回调结果,返回的是指定系统帐号的指定[约束](#系统帐号约束列表)来源信息。 | + +**示例:** + + ```js + osAccountManager.queryOsAccountConstraintSourceTypes(100, "constraint.wifi",(err,sourceTypeInfos)=>{ + console.info("queryOsAccountConstraintSourceType errInfo:" + JSON.stringify(err)); + console.info("queryOsAccountConstraintSourceType sourceTypeInfos:" + JSON.stringify(sourceTypeInfos)); + }); + ``` + +### queryOsAccountConstraintSourceTypes9+ + +queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise<Array<ConstraintSourceTypeInfo>>; + +查询指定系统帐号的指定约束来源信息。 + +此接口为系统接口,三方应用不支持调用。 + +**需要权限:** ohos.permission.MANAGE_LOCAL_ACCOUNTS + +**系统能力:** SystemCapability.Account.OsAccount + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ------------ | +| localId | number | 是 | 要查询的系统帐号ID | +| constraint | string | 是 | 要查询的[约束](#系统帐号约束列表)名称 | + +**返回值:** + +| 类型 | 说明 | +| :-------------------- | :----------------------------------------------------------- | +| Promise<Array<[ConstraintSourceTypeInfo](#constraintsourcetypeinfo)>> | Promise实例,用于获取异步返回结果,返回的是指定系统帐号的指定[约束](#系统帐号约束列表)来源信息。 | + +**示例:** + + ```js + var sourceTypeInfos = await osAccountManager.queryOsAccountConstraintSourceTypes(100, "constraint.wifi").catch((err)=>{ + console.info("queryOsAccountConstraintSourceType errInfo:" + JSON.stringify(err));}) + console.info("queryOsAccountConstraintSourceType sourceTypeInfos:" + JSON.stringify(sourceTypeInfos)); + ``` + ## OsAccountInfo 系统帐号信息。 @@ -1838,4 +2005,28 @@ off(type: 'activate' | 'activating', name: string, callback?: Callback<number | constraint.ambient.display | 禁止显示环境 | | constraint.screen.timeout.set | 禁止配置屏幕关闭的超时 | | constraint.print | 禁止打印 | -| constraint.private.dns.set | 禁止配置专用DNS | \ No newline at end of file +| constraint.private.dns.set | 禁止配置专用DNS | + +## ConstraintSourceTypeInfo9+ + +域帐号信息。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.OsAccount。 + +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ------ | ---- | ---------- | +| localId | number | 是 | 系统帐号ID | +| type | [ConstraintSourceType](#constraintsourcetype) | 是 | 约束来源类型 | + +## ConstraintSourceType9+ + +枚举,约束来源类型。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.OsAccount。 + +| 参数 | 默认值 | 说明 | +| ------ | ------ | ------------ | +| CONSTRAINT_NOT_EXIST | 0 | 约束不存在 | +| CONSTRAINT_TYPE_BASE | 1 | 约束源自系统设置 | +| CONSTRAINT_TYPE_DEVICE_OWNER | 2 | 约束源自设备所有者设置 | +| CONSTRAINT_TYPE_PROFILE_OWNER | 3 | 约束源自资料所有者设置 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-request.md b/zh-cn/application-dev/reference/apis/js-apis-request.md index 14dabd5c30976a3a7d86732f22c14e42872b74dc..e8412cb6a62b8d9c157a27eb0b5b1e2d190058fd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-request.md +++ b/zh-cn/application-dev/reference/apis/js-apis-request.md @@ -84,7 +84,9 @@ upload(config: UploadConfig): Promise<UploadTask> **示例:** ```js - request.upload({ url: 'https://patch' }).then((data) => { + let file1 = { filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" }; + let uploadTask; + request.upload({ url: 'https://patch', files: [file1] }).then((data) => { uploadTask = data; }).catch((err) => { console.error('Failed to request the upload. Cause: ' + JSON.stringify(err)); @@ -112,7 +114,9 @@ upload(config: UploadConfig, callback: AsyncCallback<UploadTask>): void **示例:** ```js - request.upload({ url: 'https://patch' }, (err, data) => { + let file1 = { filename: "test", name: "test", uri: "internal://cache/test.jpg", type: "jpg" }; + let uploadTask; + request.upload({ url: 'https://patch', files: [file1] }, (err, data) => { if (err) { console.error('Failed to request the upload. Cause: ' + JSON.stringify(err)); return; @@ -385,6 +389,7 @@ download(config: DownloadConfig): Promise<DownloadTask> **示例:** ```js + let downloadTask; request.download({ url: 'https://xxxx/xxxx.hap' }).then((data) => { downloadTask = data; }).catch((err) => { @@ -413,6 +418,7 @@ download(config: DownloadConfig, callback: AsyncCallback<DownloadTask>): v **示例:** ```js + let downloadTask; request.download({ url: 'https://xxxx/xxxxx.hap', filePath: 'xxx/xxxxx.hap'}, (err, data) => { if (err) { @@ -456,6 +462,7 @@ on(type: 'progress', callback:(receivedSize: number, totalSize: number) => vo **示例:** ```js + let downloadTask; request.download({ url: 'https://xxxx/xxxx.hap' }, (err, data)=> { if (err) { console.error('Failed to request download. Cause:' + err); @@ -497,6 +504,7 @@ off(type: 'progress', callback?: (receivedSize: number, totalSize: number) => **示例:** ```js + let downloadTask; request.download({ url: 'https://xxxx/xxxx.hap' }, (err, data)=> { if (err) { console.error('Failed to request download. Cause:' + err); @@ -531,6 +539,7 @@ on(type: 'complete'|'pause'|'remove', callback:() => void): void **示例:** ```js + let downloadTask; request.download({ url: 'https://xxxx/xxxx.hap' }, (err, data)=> { if (err) { console.error('Failed to request download. Cause:' + err); @@ -565,6 +574,7 @@ off(type: 'complete'|'pause'|'remove', callback?:() => void): void **示例:** ```js + let downloadTask; request.download({ url: 'https://xxxx/xxxx.hap' }, (err, data)=> { if (err) { console.error('Failed to request download. Cause:' + JSON.stringify(err)); @@ -605,6 +615,7 @@ on(type: 'fail', callback: (err: number) => void): void **示例:** ```js + let downloadTask; request.download({ url: 'https://xxxx/xxxx.hap' }, (err, data)=> { if (err) { console.error('Failed to request download. Cause:' + err); @@ -645,6 +656,7 @@ off(type: 'fail', callback?: (err: number) => void): void **示例:** ```js + let downloadTask; request.download({ url: 'https://xxxx/xxxx.hap' }, (err, data)=> { if (err) { console.error('Failed to request download. Cause:' + err); diff --git a/zh-cn/application-dev/reference/apis/js-apis-rpc.md b/zh-cn/application-dev/reference/apis/js-apis-rpc.md index 52398d173907df3439a092d7e337843d2d4a1771..107b62b624ecbffa21177990ad7500b75eeea399 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-rpc.md +++ b/zh-cn/application-dev/reference/apis/js-apis-rpc.md @@ -78,7 +78,7 @@ writeRemoteObject(object: [IRemoteObject](#iremoteobject)): boolean ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -119,7 +119,7 @@ readRemoteObject(): IRemoteObject ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -1698,7 +1698,7 @@ writeNoException(): void ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -1901,7 +1901,7 @@ writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -1947,7 +1947,7 @@ readRemoteObjectArray(objects: IRemoteObject[]): void ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -1994,7 +1994,7 @@ readRemoteObjectArray(): IRemoteObject[] ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -2456,7 +2456,7 @@ onRemoteDied(): void ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } ``` @@ -2931,7 +2931,7 @@ addDeathRecipient(recipient : DeathRecipient, flags : number): boolean FA.connectAbility(want, connect); class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } let deathRecipient = new MyDeathRecipient(); @@ -2982,7 +2982,7 @@ removeDeathRecipient(recipient : DeathRecipient, flags : number): boolean FA.connectAbility(want, connect); class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } let deathRecipient = new MyDeathRecipient(); @@ -3362,7 +3362,7 @@ static flushCommands(object : IRemoteObject): number ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3497,7 +3497,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3561,7 +3561,7 @@ sendRequest(code : number, data : MessageParcel, reply : MessageParcel, options ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3627,7 +3627,7 @@ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: Me ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3694,7 +3694,7 @@ sendRequest请求的响应处理函数,服务端在该函数里处理请求, ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3743,7 +3743,7 @@ getCallingUid(): number ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3784,7 +3784,7 @@ getCallingPid(): number ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3830,7 +3830,7 @@ queryLocalInterface(descriptor: string): IRemoteBroker ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3871,7 +3871,7 @@ getInterfaceDescriptor(): string ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -3914,7 +3914,7 @@ attachLocalInterface(localInterface: IRemoteBroker, descriptor: string): void ``` class MyDeathRecipient { onRemoteDied() { - console.log("server is died"); + console.log("server died"); } } class TestRemoteObject extends rpc.RemoteObject { @@ -4189,6 +4189,8 @@ writeToAshmem(buf: number[], size: number, offset: number): boolean ``` let ashmem = rpc.Ashmem.createAshmem("ashmem", 1024*1024); + let mapResult = ashmem.mapReadAndWriteAshmem(); + console.info("RpcTest map ashmem result is " + mapResult); var ByteArrayVar = [1, 2, 3, 4, 5]; let writeResult = ashmem.writeToAshmem(ByteArrayVar, 5, 0); console.log("RpcTest: write to Ashmem result is : " + writeResult); @@ -4219,6 +4221,8 @@ readFromAshmem(size: number, offset: number): number[] ``` let ashmem = rpc.Ashmem.createAshmem("ashmem", 1024*1024); + let mapResult = ashmem.mapReadAndWriteAshmem(); + console.info("RpcTest map ashmem result is " + mapResult); var ByteArrayVar = [1, 2, 3, 4, 5]; let writeResult = ashmem.writeToAshmem(ByteArrayVar, 5, 0); console.log("RpcTest: write to Ashmem result is : " + writeResult); diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-time.md b/zh-cn/application-dev/reference/apis/js-apis-system-time.md index 123327344dd2e66f3d330d386f7ecbe038ef35f9..fbb1fb0d0aa027762f4a6a9adad0336c33babd69 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-time.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-time.md @@ -1,6 +1,6 @@ # 设置系统时间 -本模块用来设置、获取当前系统时间,设置、获取当前系统日期和设置、获取当前系统时区。 +本模块主要由时间、时区和定时三大功能组成。其中,定时服务用来管理和使用时间、时区。开发者可以通过对系统进行设置、获取等操作管理系统时间、时区,也可以通过定时功能实现定时服务如闹钟服务等。 > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -26,13 +26,13 @@ setTime(time : number, callback : AsyncCallback<void>) : void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | time | number | 是 | 目标时间戳(ms)。 | - | callback | AsyncCallback<void> | 是 | 回调函数,可以在回调函数中处理接口返回值。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------------------------ | +| time | number | 是 | 目标时间戳(ms)。 | +| callback | AsyncCallback<void> | 是 | 回调函数,可以在回调函数中处理接口返回值。 | **示例:** - + ```js // time对应的时间为2021-01-20 02:36:25 var time = 1611081385000; @@ -58,18 +58,18 @@ setTime(time : number) : Promise<void> **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | time | number | 是 | 目标时间戳(ms)。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------------------ | +| time | number | 是 | 目标时间戳(ms)。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<void> | 返回的异步回调函数。 | +| 类型 | 说明 | +| ------------------- | -------------------- | +| Promise<void> | 返回的异步回调函数。 | **示例:** - + ```js // time对应的时间为2021-01-20 02:36:25 var time = 1611081385000; @@ -91,13 +91,13 @@ getCurrentTime(isNano?: boolean, callback: AsyncCallback<number>): void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | isNano | boolean | 否 | 如果是true,返回纳秒数;否则返回毫秒数。 | - | callback | AsyncCallback<number> | 是 | 回调函数,返回自 Unix 纪元以来经过的时间。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ------------------------------------------------------------ | +| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
| +| callback | AsyncCallback<number> | 是 | 回调函数,返回自 Unix 纪元以来经过的时间。 | **示例:** - + ```js systemTime.getCurrentTime(true, (error, data) => { if (error) { @@ -119,18 +119,18 @@ getCurrentTime(isNano?: boolean): Promise<number> **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | isNano | boolean | 否 | 如果是true,返回纳秒数;否则返回毫秒数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------- | ---- | ------------------------------------------------------------ | +| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
| **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<number> | 以Promise形式返回结果,返回自 Unix 纪元以来经过的时间。 | +| 类型 | 说明 | +| --------------------- | ------------------------------------------------------------ | +| Promise<number> | 以Promise形式返回结果,返回自 Unix 纪元以来经过的时间。 | **示例:** - + ```js systemTime.getCurrentTime().then((data) => { console.log(`systemTime.getCurrentTime success data : ` + JSON.stringify(data)); @@ -150,13 +150,13 @@ getRealActiveTime(isNano?: boolean, callback: AsyncCallback<number>): void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | isNano | boolean | 否 | 如果是true,返回纳秒数;否则返回毫秒数。 | - | callback | AsyncCallback<number> | 是 | 回调函数,返回自系统启动以来但不包括度睡眠时间经过的时间。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ------------------------------------------------------------ | +| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
| +| callback | AsyncCallback<number> | 是 | 回调函数,返回自系统启动以来经过的时间,但不包括度睡眠时间。 | **示例:** - + ```js systemTime.getRealActiveTime(true, (error, data) => { if (error) { @@ -178,18 +178,18 @@ getRealActiveTime(isNano?: boolean): Promise<number> **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | isNano | boolean | 否 | 如果是true,返回纳秒数;否则返回毫秒数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------- | ---- | ------------------------------------------------------------ | +| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
| **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<number> | 以Promise形式返回结果,返回自系统启动以来经过的时间,但不包括深度睡眠时间。 | +| 类型 | 说明 | +| --------------------- | ------------------------------------------------------------ | +| Promise<number> | 以Promise形式返回结果,返回自系统启动以来经过的时间,但不包括深度睡眠时间。 | **示例:** - + ```js systemTime.getCurrentTime().then((data) => { console.log(`systemTime.getRealActiveTime success data : ` + JSON.stringify(data)); @@ -201,7 +201,7 @@ getRealActiveTime(isNano?: boolean): Promise<number> ## systemTime.getRealTime8+ -getRealTime(isNano?: boolean, callback: AsyncCallback<number>): void +getRealTime(callback: AsyncCallback<number>): void 获取自系统启动以来经过的时间,包括深度睡眠时间,使用callback形式返回结果。 @@ -209,13 +209,13 @@ getRealTime(isNano?: boolean, callback: AsyncCallback<number>): void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | isNano | boolean | 否 | 如果是true,返回纳秒数;否则返回毫秒数。 | - | callback | AsyncCallback<number> | 是 | 回调函数,返回自系统启动以来经过的时间,包括深度睡眠时间。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ------------------------------------------------------------ | +| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
| +| callback | AsyncCallback<number> | 是 | 回调函数,返回自系统启动以来经过的时间,包括深度睡眠时间。 | **示例:** - + ```js systemTime.getRealTime(true, (error, data) => { if (error) { @@ -229,7 +229,7 @@ getRealTime(isNano?: boolean, callback: AsyncCallback<number>): void ## systemTime.getRealTime8+ -getRealTime(isNano?: boolean): Promise<number> +getRealTime(): Promise<number> 获取自系统启动以来经过的时间,包括深度睡眠时间,使用Promise形式返回结果。 @@ -237,18 +237,18 @@ getRealTime(isNano?: boolean): Promise<number> **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | isNano | boolean | 否 | 如果是true,返回纳秒数;否则返回毫秒数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------- | ---- | ------------------------------------------------------------ | +| isNano | boolean | 否 | 返回结果是否为纳秒数。 - true:纳秒数。
- false:毫秒数。
| **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<number> | 以Promise形式返回结果,返回自系统启动以来经过的时间,包括深度睡眠时间。 | +| 类型 | 说明 | +| --------------------- | ------------------------------------------------------------ | +| Promise<number> | 以Promise形式返回结果,返回自系统启动以来经过的时间,包括深度睡眠时间。 | **示例:** - + ```js systemTime.getRealTime().then((data) => { console.log(`systemTime.getRealTime success data: ` + JSON.stringify(data)); @@ -270,13 +270,13 @@ setDate(date: Date, callback: AsyncCallback<void>): void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | date | Date | 是 | 目标日期。 | - | callback | AsyncCallback<void> | 是 | 回调函数,可以在回调函数中处理接口返回值。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------------------------ | +| date | Date | 是 | 目标日期。 | +| callback | AsyncCallback<void> | 是 | 回调函数,可以在回调函数中处理接口返回值。 | **示例:** - + ```js var data = new Date("October 13, 2020 11:13:00"); systemTime.setDate(data,(error, data) => { @@ -301,18 +301,18 @@ setDate(date: Date): Promise<void> **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | date | Date | 是 | 目标日期。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ---- | ---- | ---------- | +| date | Date | 是 | 目标日期。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<void> | 返回的异步回调函数。 | +| 类型 | 说明 | +| ------------------- | -------------------- | +| Promise<void> | 返回的异步回调函数。 | **示例:** - + ```js var data = new Date("October 13, 2020 11:13:00"); systemTime.setDate(data).then((value) => { @@ -333,12 +333,12 @@ getDate(callback: AsyncCallback<Date>): void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<Date> | 是 | 回调函数,返回当前系统日期。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ---------------------------- | +| callback | AsyncCallback<Date> | 是 | 回调函数,返回当前系统日期。 | **示例:** - + ```js systemTime.getDate((error, data) => { if (error) { @@ -360,12 +360,12 @@ getDate(): Promise<Date> **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<Date> | 以Promise形式返回结果,返回当前系统日期。 | +| 类型 | 说明 | +| ------------------- | ----------------------------------------- | +| Promise<Date> | 以Promise形式返回结果,返回当前系统日期。 | **示例:** - + ```js systemTime.getDate().then((data) => { console.log(`systemTime.getDate success data : ` + JSON.stringify(data)); @@ -387,13 +387,13 @@ setTimezone(timezone: string, callback: AsyncCallback<void>): void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | timezone | string | 是 | 系统时区。 | - | callback | AsyncCallback<void> | 是 | 回调函数,可以在回调函数中处理接口返回值。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------------------------ | +| timezone | string | 是 | 系统时区。 | +| callback | AsyncCallback<void> | 是 | 回调函数,可以在回调函数中处理接口返回值。 | **示例:** - + ```js systemTime.setTimezone('Asia/Shanghai', (error, data) => { if (error) { @@ -417,18 +417,18 @@ setTimezone(timezone: string): Promise<void> **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | timezone | string | 是 | 系统时区。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ---------- | +| timezone | string | 是 | 系统时区。 | **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<void> | 返回的异步回调函数。 | +| 类型 | 说明 | +| ------------------- | -------------------- | +| Promise<void> | 返回的异步回调函数。 | **示例:** - + ```js systemTime.setTimezone('Asia/Shanghai').then((data) => { console.log(`systemTime.setTimezone success data : ` + JSON.stringify(data)); @@ -448,12 +448,12 @@ getTimezone(callback: AsyncCallback<string>): void **参数:** - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | callback | AsyncCallback<string> | 是 | 回调函数,返回系统时区。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ------------------------ | +| callback | AsyncCallback<string> | 是 | 回调函数,返回系统时区。 | **示例:** - + ```js systemTime.getTimezone((error, data) => { if (error) { @@ -475,16 +475,16 @@ getTimezone(): Promise<string> **返回值:** - | 类型 | 说明 | - | -------- | -------- | - | Promise<string> | 以Promise形式返回结果,返回系统时区。 | +| 类型 | 说明 | +| --------------------- | ------------------------------------- | +| Promise<string> | 以Promise形式返回结果,返回系统时区。 | **示例:** - + ```js systemTime.getTimezone().then((data) => { console.log(`systemTime.getTimezone success data : ` + JSON.stringify(data)); }).catch((error) => { console.error(`failed to systemTime.getTimezone because ` + JSON.stringify(error)); }); - ``` + ``` \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-update.md b/zh-cn/application-dev/reference/apis/js-apis-update.md index 6a8e9fcf1bc74a5ceb0123124bfefb6bf3442fcd..5f98c5933047cba367d4691e85abcc6f92ea1327 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-update.md +++ b/zh-cn/application-dev/reference/apis/js-apis-update.md @@ -134,11 +134,11 @@ getNewVersionInfo(callback: AsyncCallback\): void **示例:** ``` -update.getNewVersionInfo(info => { +updater.getNewVersionInfo(info => { console.log("getNewVersionInfo success " + info.status); - console.log(`info versionName = ` + info.result[0].versionName); - console.log(`info versionCode = ` + info.result[0].versionCode); - console.log(`info verifyInfo = ` + info.result[0].verifyInfo); + console.log(`info versionName = ` + info.checkResult[0].versionName); + console.log(`info versionCode = ` + info.checkResult[0].versionCode); + console.log(`info verifyInfo = ` + info.checkResult[0].verifyInfo); }); ``` @@ -160,9 +160,9 @@ getNewVersionInfo(): Promise\ ``` updater.getNewVersionInfo().then(value => { - console.log(`info versionName = ` + value.result[0].versionName); - console.log(`info versionCode = ` + value.result[0].versionCode); - console.log(`info verifyInfo = ` + value.result[0].verifyInfo); + console.log(`info versionName = ` + value.checkResult[0].versionName); + console.log(`info versionCode = ` + value.checkResult[0].versionCode); + console.log(`info verifyInfo = ` + value.checkResult[0].verifyInfo); }).catch(err => { console.log("getNewVersionInfo promise error: " + err.code); }); @@ -185,11 +185,11 @@ checkNewVersion(callback: AsyncCallback\): void **示例:** ``` -update.checkNewVersion(info => { +updater.checkNewVersion(info => { console.log("checkNewVersion success " + info.status); - console.log(`info versionName = ` + info.result[0].versionName); - console.log(`info versionCode = ` + info.result[0].versionCode); - console.log(`info verifyInfo = ` + info.result[0].verifyInfo); + console.log(`info versionName = ` + info.checkResult[0].versionName); + console.log(`info versionCode = ` + info.checkResult[0].versionCode); + console.log(`info verifyInfo = ` + info.checkResult[0].verifyInfo); }); ``` @@ -210,10 +210,10 @@ checkNewVersion(): Promise\ **示例:** ``` -update.checkNewVersion().then(value => { - console.log(`info versionName = ` + value.result[0].versionName); - console.log(`info versionCode = ` + value.result[0].versionCode); - console.log(`info verifyInfo = ` + value.result[0].verifyInfo); +updater.checkNewVersion().then(value => { + console.log(`info versionName = ` + value.checkResult[0].versionName); + console.log(`info versionCode = ` + value.checkResult[0].versionCode); + console.log(`info verifyInfo = ` + value.checkResult[0].verifyInfo); }).catch(err => { console.log("checkNewVersion promise error: " + err.code); }); @@ -237,13 +237,13 @@ verifyUpdatePackage(upgradeFile: string, certsFile: string): void **示例:** ``` -update.on("verifyProgress", callback => { +updater.on("verifyProgress", callback => { console.info('on verifyProgress ' + callback.percent); }); update.verifyUpdatePackage("XXX", "XXX"); ``` -### rebootAndCleanUserData +### rebootAndCleanUserData8+ rebootAndCleanUserData(): Promise\ @@ -260,14 +260,14 @@ rebootAndCleanUserData(): Promise\ **示例:** ``` -update.rebootAndCleanUserData().then(result => { +updater.rebootAndCleanUserData().then(result => { console.log("rebootAndCleanUserData " + result); }).catch(err => { console.info("rebootAndCleanUserData promise error: " + err.code); }); ``` -### rebootAndCleanUserData +### rebootAndCleanUserData8+ rebootAndCleanUserData(callback: AsyncCallback\): void @@ -284,7 +284,7 @@ rebootAndCleanUserData(callback: AsyncCallback\): void **示例:** ``` -update.rebootAndCleanUserData(result => { +updater.rebootAndCleanUserData(result => { console.log("rebootAndCleanUserData ", result) }); ``` @@ -306,7 +306,7 @@ applyNewVersion(): Promise\ **示例:** ``` -update.applyNewVersion().then(result => { +updater.applyNewVersion().then(result => { console.log("appVewVersion ", result) }).catch(err => { console.info("applyNewVersion promise error: " + err.code); @@ -330,7 +330,7 @@ applyNewVersion(callback: AsyncCallback\): void **示例:** ``` -update.applyNewVersion(result => { +updater.applyNewVersion(result => { console.log("applyNewVersion ", result) }); ``` @@ -399,7 +399,7 @@ let policy = { autoUpgradeInterval: [ 2, 3 ], autoUpgradeCondition: 2 } -update.setUpdatePolicy(policy, result => { +updater.setUpdatePolicy(policy, result => { console.log("setUpdatePolicy ", result) }); ``` @@ -434,7 +434,7 @@ let policy = { autoUpgradeInterval: [ 2, 3 ], autoUpgradeCondition: 2 } -update.setUpdatePolicy(policy).then(result => +updater.setUpdatePolicy(policy).then(result => console.log("setUpdatePolicy ", result) ).catch(err => { console.log("setUpdatePolicy promise error: " + err.code); @@ -458,7 +458,7 @@ getUpdatePolicy(callback: AsyncCallback\): void **示例:** ``` -update.getUpdatePolicy(policy => { +updater.getUpdatePolicy(policy => { console.log("getUpdatePolicy success"); console.log(`policy autoDownload = ` + policy.autoDownload); console.log(`policy autoDownloadNet = ` + policy.autoDownloadNet); @@ -483,7 +483,7 @@ getUpdatePolicy(): Promise\ **示例:** ``` -update.getUpdatePolicy().then(value => { +updater.getUpdatePolicy().then(value => { console.log(`info autoDownload = ` + value.autoDownload); console.log(`info autoDownloadNet = ` + value.autoDownloadNet); console.log(`info mode = ` + value.mode); diff --git a/zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md b/zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md index feecb98ea5cfefa7c76ed6b25ebcdcabba8560f1..a1662dff876c33ae9d9b658a483353e7f087b75b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md +++ b/zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md @@ -50,7 +50,7 @@ export default { try { console.info("auth onResult result = " + result); console.info("auth onResult extraInfo = " + JSON.stringify(extraInfo)); - if (result == 'SUCCESS') { + if (result == userIAM_userAuth.ResultCode.SUCCESS) { // 此处添加认证成功逻辑 } else { // 此处添加认证失败逻辑 @@ -97,7 +97,7 @@ export default { } }); let cancelCode = this.auth.cancel(contextId); - if (cancelCode == userIAM_userAuth.Result.SUCCESS) { + if (cancelCode == userIAM_userAuth.ResultCode.SUCCESS) { console.info("cancel auth success"); } else { console.error("cancel auth fail"); @@ -443,7 +443,7 @@ onResult: (result : number, extraInfo : AuthResult) => void try { console.info("auth onResult result = " + result); console.info("auth onResult extraInfo = " + JSON.stringify(extraInfo)); - if (result == SUCCESS) { + if (result == userIAM_userAuth.ResultCode.SUCCESS) { // 此处添加认证成功逻辑 } else { // 此处添加认证失败逻辑 @@ -492,7 +492,7 @@ onAcquireInfo ?: (module : number, acquire : number, extraInfo : any) => void try { console.info("auth onResult result = " + result); console.info("auth onResult extraInfo = " + JSON.stringify(extraInfo)); - if (result == SUCCESS) { + if (result == userIAM_userAuth.ResultCode.SUCCESS) { // 此处添加认证成功逻辑 } else { // 此处添加认证失败逻辑 diff --git a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md index a182d75e5c43625492db22e67d1e47174cad4982..ac51fbb7928f57b8069a23c1faafdfabb2f352c7 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md +++ b/zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @@ -914,7 +914,7 @@ WantAgent.equal(wantAgent1, wantAgent2).then((data) => { }); ``` -## WantAgent.getOperationType +## WantAgent.getOperationType9+ getOperationType(agent: WantAgent, callback: AsyncCallback\): void; @@ -975,7 +975,7 @@ WantAgent.getOperationType(wantAgent, (OperationType) => { }) ``` -## WantAgent.getOperationType +## WantAgent.getOperationType9+ getOperationType(agent: WantAgent): Promise\; diff --git a/zh-cn/application-dev/reference/apis/js-apis-wifi.md b/zh-cn/application-dev/reference/apis/js-apis-wifi.md index 0938bf98fe3938c403a6e2d5d73335ad293d74ee..1f8d51e5507b6ca5b96f4ea87b153d2f21a7502e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-wifi.md +++ b/zh-cn/application-dev/reference/apis/js-apis-wifi.md @@ -16,13 +16,11 @@ isWifiActive(): boolean 查询WLAN是否已激活。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | boolean | true:已激活, false:未激活。 | @@ -34,13 +32,11 @@ scan(): boolean 启动WLAN扫描。 -- 需要权限: - ohos.permission.SET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.SET_WIFI_INFO,ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | boolean | true:扫描操作执行成功, false:扫描操作执行失败。 | @@ -52,13 +48,11 @@ getScanInfos(): Promise<Array<WifiScanInfo>> 获取扫描结果,使用promise方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO以及ohos.permission.GET_WIFI_PEERS_MAC和ohos.permission.LOCATION权限中的至少一个。 +**需要权限:** ohos.permission.GET_WIFI_INFO以及ohos.permission.GET_WIFI_PEERS_MAC和ohos.permission.LOCATION权限中的至少一个。 -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | Promise< Array<[WifiScanInfo](#wifiscaninfo)> > | 返回扫描到的热点列表。 | @@ -70,18 +64,16 @@ getScanInfos(callback: AsyncCallback<Array<WifiScanInfo>>): void 获取扫描结果,使用callback方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO以及ohos.permission.GET_WIFI_PEERS_MAC和ohos.permission.LOCATION权限中的至少一个。 +**需要权限:** ohos.permission.GET_WIFI_INFO以及ohos.permission.GET_WIFI_PEERS_MAC和ohos.permission.LOCATION权限中的至少一个。 -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | callback | AsyncCallback< Array<[WifiScanInfo](#wifiscaninfo)>> | 是 | 扫描到的热点列表结果回调函数。 | -- 示例 +**示例:** ```js import wifi from '@ohos.wifi'; @@ -160,18 +152,18 @@ addUntrustedConfig(config: WifiDeviceConfig): Promise<boolean> 添加不可信网络配置,使用promise方式作为异步方法。 -- 需要权限: +**需要权限:** ohos.permission.SET_WIFI_INFO -- 系统能力: +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#WifiDeviceConfig) | 是 | WLAN配置信息。 | -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | Promise<boolean> | 操作结果,ture: 成功, false: 失败。 | @@ -195,13 +187,11 @@ addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean& 添加不可信网络配置,使用callback方式作为异步方法。 -- 需要权限: - ohos.permission.SET_WIFI_INFO +**需要权限:** ohos.permission.SET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#WifiDeviceConfig) | 是 | WLAN配置信息。 | @@ -214,18 +204,16 @@ removeUntrustedConfig(config: WifiDeviceConfig): Promise<boolean> 移除不可信网络配置,使用promise方式作为异步方法。 -- 需要权限: - ohos.permission.SET_WIFI_INFO +**需要权限:** ohos.permission.SET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#WifiDeviceConfig) | 是 | WLAN配置信息。 | -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | Promise<boolean> | 操作结果,ture: 成功, false: 失败。 | @@ -237,13 +225,11 @@ removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boole 移除不可信网络配置,使用callback方式作为异步方法。 -- 需要权限: - ohos.permission.SET_WIFI_INFO +**需要权限:** ohos.permission.SET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | config | [WifiDeviceConfig](#WifiDeviceConfig) | 是 | WLAN配置信息。 | @@ -256,19 +242,17 @@ getSignalLevel(rssi: number, band: number): number 查询WLAN信号强度。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数: +**参数:**: | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | rssi | number | 是 | 热点的信号强度(dBm)。 | | band | number | 是 | WLAN接入点的频段。 | -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | number | 信号强度,取值范围为[0, 4]。 | @@ -280,13 +264,11 @@ getLinkedInfo(): Promise<WifiLinkedInfo> 获取WLAN连接信息,使用promise方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | Promise<[WifiLinkedInfo](#WifiLinkedInfo)> | WLAN连接的相关信息。 | @@ -298,18 +280,16 @@ getLinkedInfo(callback: AsyncCallback<WifiLinkedInfo>): void 获取WLAN连接信息,使用callback方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiLinkedInfo](#WifiLinkedInfo)> | 是 | WLAN连接信息结果回调函数。 | -- 示例 +**示例:** ```js import wifi from '@ohos.wifi'; @@ -370,13 +350,11 @@ isConnected(): boolean 查询WLAN是否已连接。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | boolean | true:已连接, false:未连接。 | @@ -388,35 +366,35 @@ isFeatureSupported(featureId: number): boolean 判断设备是否支持相关WLAN特性。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO + +**系统能力:** SystemCapability.Communication.WiFi.Core -- 系统能力: - SystemCapability.Communication.WiFi.Core +**参数:** -- 参数: | **参数名** | **类型** | 必填 | **说明** | | -------- | -------- | -------- | -------- | | featureId | number | 是 | 特性ID值。 | -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | boolean | true:支持, false:不支持。 | -- 特性ID值枚举。 - | 枚举值 | 说明 | - | -------- | -------- | - | 0x0001 | 基础结构模式特性。 | - | 0x0002 | 5 GHz带宽特性。 | - | 0x0004 | GAS/ANQP特性。 | - | 0x0008 | Wifi-Direct特性。 | - | 0x0010 | Soft AP特性。 | - | 0x0040 | Wi-Fi AWare组网特性。 | - | 0x8000 | AP STA共存特性。 | - | 0x8000000 | WPA3-Personal SAE特性。 | - | 0x10000000 | WPA3-Enterprise Suite-B | - | 0x20000000 | 增强开放特性。 | +**特性ID值枚举:** + +| 枚举值 | 说明 | +| -------- | -------- | +| 0x0001 | 基础结构模式特性。 | +| 0x0002 | 5 GHz带宽特性。 | +| 0x0004 | GAS/ANQP特性。 | +| 0x0008 | Wifi-Direct特性。 | +| 0x0010 | Soft AP特性。 | +| 0x0040 | Wi-Fi AWare组网特性。 | +| 0x8000 | AP STA共存特性。 | +| 0x8000000 | WPA3-Personal SAE特性。 | +| 0x10000000 | WPA3-Enterprise Suite-B | +| 0x20000000 | 增强开放特性。 | ## wifi.getIpInfo7+ @@ -425,13 +403,11 @@ getIpInfo(): IpInfo 获取IP信息。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | [IpInfo](#IpInfo) | IP信息。 | @@ -458,13 +434,11 @@ getCountryCode(): string 获取国家码信息。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.Core +**系统能力:** SystemCapability.Communication.WiFi.Core -- 返回值: +**返回值:** | **类型** | **说明** | | -------- | -------- | | string | 国家码。 | @@ -476,13 +450,11 @@ getP2pLinkedInfo(): Promise<WifiP2pLinkedInfo> 获取P2P连接信息,使用promise方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | Promise<[WifiP2pLinkedInfo](#WifiP2pLinkedInfo)> | P2P连接信息。 | @@ -494,13 +466,11 @@ getP2pLinkedInfo(callback: AsyncCallback<WifiP2pLinkedInfo>): void 获取P2P连接信息,使用callback方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiP2pLinkedInfo](#WifiP2pLinkedInfo)> | 是 | P2P连接信息结果回调函数。 | @@ -533,13 +503,11 @@ getCurrentGroup(): Promise<WifiP2pGroupInfo> 获取P2P当前组信息,使用promise方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | Promise<[WifiP2pGroupInfo](#WifiP2pGroupInfo)> | 当前组信息。 | @@ -551,13 +519,11 @@ getCurrentGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void 获取P2P当前组信息,使用callback方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiP2pGroupInfo](#WifiP2pGroupInfo)> | 是 | 当前组信息的回调函数。 | @@ -610,13 +576,11 @@ getP2pPeerDevices(): Promise<WifiP2pDevice[]> 获取P2P对端设备列表信息,使用promise方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | Promise<[WifiP2pDevice[]](#WifiP2pDevice)> | 对端设备列表信息。 | @@ -628,13 +592,11 @@ getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void 获取P2P对端设备列表信息,使用callback方式作为异步方法。 -- 需要权限: - ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiP2pDevice[]](#WifiP2pDevice)> | 是 | 对端设备列表信息回调函数。 | @@ -646,18 +608,17 @@ createGroup(config: WifiP2PConfig): boolean; 创建群组。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P + +**参数:** -- 参数: | **参数名** | **类型** | 必填 | **说明** | | -------- | -------- | -------- | -------- | | config | [WifiP2PConfig](#WifiP2PConfig) | 是 | 群组配置信息。 | -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | boolean | true:创建群组操作执行成功, false:创建群组操作执行失败。 | @@ -691,13 +652,11 @@ removeGroup(): boolean; 移除群组。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | boolean | true:操作执行成功, false:操作执行失败。 | @@ -709,24 +668,23 @@ p2pConnect(config: WifiP2PConfig): boolean; 执行P2P连接。 -- 需要权限: - ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION + +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**参数:** -- 参数: | **参数名** | **类型** | 必填 | **说明** | | -------- | -------- | -------- | -------- | | config | [WifiP2PConfig](#WifiP2PConfig) | 是 | 连接配置信息。 | -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | boolean | true:操作执行成功, false:操作执行失败。 | -- 示例 +**示例:** ```js import wifi from '@ohos.wifi'; @@ -799,13 +757,11 @@ p2pCancelConnect(): boolean; 取消P2P连接。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | boolean | true:取消连接操作执行成功, false:取消连接操作执行失败。 | @@ -817,13 +773,11 @@ startDiscoverDevices(): boolean; 开始发现设备。 -- 需要权限: - ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | boolean | true:操作执行成功, false:操作执行失败。 | @@ -835,13 +789,11 @@ stopDiscoverDevices(): boolean; 停止发现设备。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 返回值: +**返回值:** | 类型 | 说明 | | -------- | -------- | | boolean | true:操作执行成功,操作执行失败。 | @@ -853,25 +805,24 @@ on(type: "wifiStateChange", callback: Callback<number>): void 注册WLAN状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"wifiStateChange"字符串。 | | callback | Callback<number> | 是 | 状态改变回调函数。 | -- 状态改变事件的枚举。 - | **枚举值** | **说明** | - | -------- | -------- | - | 0 | 未激活。 | - | 1 | 已激活。 | - | 2 | 激活中。 | - | 3 | 去激活中。 | +**状态改变事件的枚举:** + +| **枚举值** | **说明** | +| -------- | -------- | +| 0 | 未激活。 | +| 1 | 已激活。 | +| 2 | 激活中。 | +| 3 | 去激活中。 | ## wifi.off('wifiStateChange')7+ @@ -880,19 +831,17 @@ off(type: "wifiStateChange", callback?: Callback<number>): void 取消注册WLAN状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"wifiStateChange"字符串。 | | callback | Callback<number> | 否 | 状态改变回调函数。如果callback不填,将去注册该事件关联的所有回调函数。 | -- 示例 +**示例:** ```js import wifi from '@ohos.wifi'; @@ -915,23 +864,22 @@ on(type: "wifiConnectionChange", callback: Callback<number>): void 注册WLAN连接状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"wifiConnectionChange"字符串。 | | callback | Callback<number> | 是 | 状态改变回调函数。 | -- 连接状态改变事件的枚举。 - | **枚举值** | **说明** | - | -------- | -------- | - | 0 | 已断开。 | - | 1 | 已连接。 | +**连接状态改变事件的枚举:** + +| **枚举值** | **说明** | +| -------- | -------- | +| 0 | 已断开。 | +| 1 | 已连接。 | ## wifi.off('wifiConnectionChange')7+ @@ -940,13 +888,11 @@ off(type: "wifiConnectionChange", callback?: Callback<number>): void 取消注册WLAN连接状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"wifiConnectionChange"字符串。 | @@ -959,23 +905,22 @@ on(type: "wifiScanStateChange", callback: Callback<number>): void 注册扫描状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"wifiScanStateChange"字符串。 | | callback | Callback<number> | 是 | 状态改变回调函数。 | -- 扫描状态改变事件的枚举。 - | **枚举值** | **说明** | - | -------- | -------- | - | 0 | 扫描失败。 | - | 1 | 扫描成功。 | +**扫描状态改变事件的枚举:** + +| **枚举值** | **说明** | +| -------- | -------- | +| 0 | 扫描失败。 | +| 1 | 扫描成功。 | ## wifi.off('wifiScanStateChange')7+ @@ -984,13 +929,11 @@ off(type: "wifiScanStateChange", callback?: Callback<number>): void 取消注册扫描状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | @@ -1004,13 +947,11 @@ on(type: "wifiRssiChange", callback: Callback<number>): void 注册RSSI状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"wifiRssiChange"字符串。 | @@ -1023,13 +964,11 @@ off(type: "wifiRssiChange", callback?: Callback<number>): void 取消注册RSSI状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.STA +**系统能力:** SystemCapability.Communication.WiFi.STA -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"wifiRssiChange"字符串。 | @@ -1042,25 +981,24 @@ on(type: "hotspotStateChange", callback: Callback<number>): void 注册热点状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.AP.Core +**系统能力:** SystemCapability.Communication.WiFi.AP.Core -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"hotspotStateChange"字符串。 | | callback | Callback<number> | 是 | 状态改变回调函数。 | -- 热点状态改变事件的枚举。 - | **枚举值** | **说明** | - | -------- | -------- | - | 0 | 未激活。 | - | 1 | 已激活。 | - | 2 | 激活中。 | - | 3 | 去激活中。 | +**热点状态改变事件的枚举:** + +| **枚举值** | **说明** | +| -------- | -------- | +| 0 | 未激活。 | +| 1 | 已激活。 | +| 2 | 激活中。 | +| 3 | 去激活中。 | ## wifi.off('hotspotStateChange')7+ @@ -1069,13 +1007,11 @@ off(type: "hotspotStateChange", callback?: Callback<number>): void 取消注册热点状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.AP.Core +**系统能力:** SystemCapability.Communication.WiFi.AP.Core -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"hotspotStateChange"字符串。 | @@ -1088,26 +1024,25 @@ on(type: "p2pStateChange", callback: Callback<number>): void 注册P2P开关状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pStateChange"字符串。 | | callback | Callback<number> | 是 | 状态改变回调函数。 | -- P2P状态改变事件的枚举。 - | **枚举值** | **说明** | - | -------- | -------- | - | 1 | 空闲。 | - | 2 | 打开中。 | - | 3 | 已打开。 | - | 4 | 关闭中。 | - | 5 | 已关闭。 | +**P2P状态改变事件的枚举:** + +| **枚举值** | **说明** | +| -------- | -------- | +| 1 | 空闲。 | +| 2 | 打开中。 | +| 3 | 已打开。 | +| 4 | 关闭中。 | +| 5 | 已关闭。 | ## wifi.off('p2pStateChange')8+ @@ -1115,13 +1050,11 @@ off(type: "p2pStateChange", callback?: Callback<number>): void 取消注册P2P开关状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pStateChange"字符串。 | @@ -1134,13 +1067,11 @@ on(type: "p2pConnectionChange", callback: Callback<WifiP2pLinkedInfo>): vo 注册P2P连接状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pConnectionChange"字符串。 | @@ -1153,13 +1084,11 @@ off(type: "p2pConnectionChange", callback?: Callback<WifiP2pLinkedInfo>): 取消注册P2P连接状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pConnectionChange"字符串。 | @@ -1172,13 +1101,11 @@ on(type: "p2pDeviceChange", callback: Callback<WifiP2pDevice>): void 注册P2P设备状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pDeviceChange"字符串。 | @@ -1191,13 +1118,11 @@ off(type: "p2pDeviceChange", callback?: Callback<WifiP2pDevice>): void 取消注册P2P设备状态改变事件。 -- 需要权限: - ohos.permission.LOCATION +**需要权限:** ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pDeviceChange"字符串。 | @@ -1210,13 +1135,11 @@ on(type: "p2pPeerDeviceChange", callback: Callback<WifiP2pDevice[]>): void 注册P2P对端设备状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION +**需要权限:** ohos.permission.GET_WIFI_INFO,ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pPeerDeviceChange"字符串。 | @@ -1229,13 +1152,11 @@ off(type: "p2pPeerDeviceChange", callback?: Callback<WifiP2pDevice[]>): vo 取消注册P2P对端设备状态改变事件。 -- 需要权限: - ohos.permission.LOCATION +**需要权限:** ohos.permission.LOCATION -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pPeerDeviceChange"字符串。 | @@ -1248,13 +1169,11 @@ on(type: "p2pPersistentGroupChange", callback: Callback<void>): void 注册P2P永久组状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pPersistentGroupChange"字符串。 | @@ -1267,13 +1186,11 @@ off(type: "p2pPersistentGroupChange", callback?: Callback<void>): void 取消注册P2P永久组状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pPersistentGroupChange"字符串。 | @@ -1286,23 +1203,22 @@ on(type: "p2pDiscoveryChange", callback: Callback<number>): void 注册发现设备状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pDiscoveryChange"字符串。 | | callback | Callback<number> | 是 | 状态改变回调函数。 | -- 发现设备状态改变事件的枚举。 - | **枚举值** | **说明** | - | -------- | -------- | - | 0 | 初始状态。 | - | 1 | 发现成功。 | +**发现设备状态改变事件的枚举:** + +| **枚举值** | **说明** | +| -------- | -------- | +| 0 | 初始状态。 | +| 1 | 发现成功。 | ## wifi.off('p2pDiscoveryChange')8+ @@ -1311,13 +1227,11 @@ off(type: "p2pDiscoveryChange", callback?: Callback<number>): void 取消注册发现设备状态改变事件。 -- 需要权限: - ohos.permission.GET_WIFI_INFO +**需要权限:** ohos.permission.GET_WIFI_INFO -- 系统能力: - SystemCapability.Communication.WiFi.P2P +**系统能力:** SystemCapability.Communication.WiFi.P2P -- 参数 +**参数:** | **参数名** | **类型** | **必填** | **说明** | | -------- | -------- | -------- | -------- | | type | string | 是 | 固定填"p2pDiscoveryChange"字符串。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-window.md b/zh-cn/application-dev/reference/apis/js-apis-window.md index 41684d450cc8a2d3d2bff6f12461aa11aa6002b5..7df89e40a7d4b2c50eaf10b212506f0da3154ae9 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-window.md +++ b/zh-cn/application-dev/reference/apis/js-apis-window.md @@ -22,19 +22,19 @@ import window from '@ohos.window'; | ----------------- | ------ | ------------------ | | TYPE_APP | 0 | 表示应用子窗口。 | | TYPE_SYSTEM_ALERT | 1 | 表示系统告警窗口。 | -| TYPE_INPUT_METHOD | 2 | 表示输入法窗口。 | -| TYPE_STATUS_BAR | 3 | 表示状态栏窗口。 | -| TYPE_PANEL | 4 | 表示通知栏。 | -| TYPE_KEYGUARD | 5 | 表示锁屏。 | -| TYPE_VOLUME_OVERLAY | 6 | 表示音量条。 | -| TYPE_NAVIGATION_BAR | 7 | 表示导航栏窗口。 | -| TYPE_FLOAT | 8 | 表示悬浮窗。 | -| TYPE_WALLPAPER | 9 | 表示壁纸。 | -| TYPE_DESKTOP | 10 | 表示桌面。 | -| TYPE_LAUNCHER_RECENT | 11 | 表示多任务中心。 | -| TYPE_LAUNCHER_DOCK | 12 | 表示桌面Dock栏。 | -| TYPE_VOICE_INTERACTION | 13 | 表示智慧语音。 | -| TYPE_POINTER | 14 | 表示鼠标。 | +| TYPE_INPUT_METHOD9+ | 2 | 表示输入法窗口。 | +| TYPE_STATUS_BAR9+ | 3 | 表示状态栏窗口。 | +| TYPE_PANEL9+ | 4 | 表示通知栏。 | +| TYPE_KEYGUARD9+ | 5 | 表示锁屏。 | +| TYPE_VOLUME_OVERLAY9+ | 6 | 表示音量条。 | +| TYPE_NAVIGATION_BAR9+ | 7 | 表示导航栏窗口。 | +| TYPE_FLOAT9+ | 8 | 表示悬浮窗。 | +| TYPE_WALLPAPER9+ | 9 | 表示壁纸。 | +| TYPE_DESKTOP9+ | 10 | 表示桌面。 | +| TYPE_LAUNCHER_RECENT9+ | 11 | 表示多任务中心。 | +| TYPE_LAUNCHER_DOCK9+ | 12 | 表示桌面Dock栏。 | +| TYPE_VOICE_INTERACTION9+ | 13 | 表示智慧语音。 | +| TYPE_POINTER9+ | 14 | 表示鼠标。 | ## AvoidAreaType7+ diff --git a/zh-cn/application-dev/reference/apis/js-apis-zlib.md b/zh-cn/application-dev/reference/apis/js-apis-zlib.md index 16fdf6d9fb2525218b9540ba092ac78fc62d4b66..eb22f10e2c6cf4c523879398dbe290643b7388e0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-zlib.md +++ b/zh-cn/application-dev/reference/apis/js-apis-zlib.md @@ -1,7 +1,5 @@ # Zip模块(JS端SDK接口) -## 使用限制 -无。 ## 导入模块 ```javascript @@ -9,7 +7,7 @@ import zlib from '@ohos.zlib'; ``` ## zlib.zipFile -zipFile(inFile:string, outFile:string, options: Options): Promise; +zipFile(inFile:string, outFile:string, options: Options): Promise\ 压缩接口(Promise形式)。 **系统能力:** SystemCapability.BundleManager.Zlib @@ -72,7 +70,7 @@ zlib.zipFile(inFile , outFile, options).then((data) => { ## zlib.unzipFile -unzipFile(inFile:string, outFile:string, options: Options): Promise; +unzipFile(inFile:string, outFile:string, options: Options): Promise\ 解压文件,解压完成返回执行结果(Promise形式)。 diff --git a/zh-cn/application-dev/reference/arkui-js/js-components-media-video.md b/zh-cn/application-dev/reference/arkui-js/js-components-media-video.md index 3f77fa743784d82260b345a38959ad766b570260..59c95f4de8bc0865ac5393468164552c57e77609 100644 --- a/zh-cn/application-dev/reference/arkui-js/js-components-media-video.md +++ b/zh-cn/application-dev/reference/arkui-js/js-components-media-video.md @@ -25,7 +25,7 @@ ## 属性 -除支持[通用属性](../arkui-js/js-components-common-attributes.md)外,还支持如下样式: +除支持[通用属性](../arkui-js/js-components-common-attributes.md)外,还支持如下属性: | 名称 | 类型 | 默认值 | 必填 | 描述 | | -------- | -------- | -------- | -------- | -------- | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md index 0bd24e1b87d3b506ef4a7b4e3ad540f95f3625aa..7c7545bbe9b30e254109c712b068f528a832aa22 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md @@ -24,41 +24,41 @@ ImageAnimator() ## 属性 -| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | +| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 | | -------- | -------- | -------- | -------- | -------- | -| images | Array<{
src:string,
width?:Length,
height?:Length,
top?:Length,
left?:Length,
duration?:number
}> | [] | 是 | 设置图片帧信息集合。每一帧的帧信息包含图片路径、图片大小、图片位置和图片播放时长信息。详细说明如下:
src:图片路径,图片格式为svg,png和jpg。
width:图片宽度。
height:图片高度。
top:图片相对于组件左上角的纵向坐标。
left:图片相对于组件左上角的横向坐标。
duration:每一帧图片的播放时长,单位毫秒。 | -| state | AnimationStatus | Initial | 否 | 默认为初始状态,用于控制播放状态。 | -| duration | number | 1000 | 否 | 单位为毫秒,默认时长为1000ms;duration为0时,不播放图片;值的改变只会在下一次循环开始时生效;当images中设置了单独的duration后,该属性设置无效。 | -| reverse | boolean | false | 否 | 设置播放顺序。false表示从第1张图片播放到最后1张图片; true表示从最后1张图片播放到第1张图片。 | -| fixedSize | boolean | true | 否 | 设置图片大小是否固定为组件大小。 true表示图片大小与组件大小一致,此时设置图片的width 、height 、top 和left属性是无效的。false表示每一张图片的 width 、height 、top和left属性都要单独设置。 | -| preDecode | number | 0 | 否 | 是否启用预解码,默认值为0,即不启用预解码,如该值设为2,则播放当前页时会提前加载后面两张图片至缓存以提升性能。 | -| fillMode | FillMode | Forwards | 否 | 设置动画开始前和结束后的状态,可选值参见FillMode说明。 | -| iterations | number | 1 | 否 | 默认播放一次,设置为-1时表示无限次播放。 | +| images | Array<{
src:string,
width?:Length,
height?:Length,
top?:Length,
left?:Length,
duration?:number
}> | [] | 是 | 设置图片帧信息集合。每一帧的帧信息包含图片路径、图片大小、图片位置和图片播放时长信息。详细说明如下:
src:图片路径,图片格式为svg,png和jpg。
width:图片宽度。
height:图片高度。
top:图片相对于组件左上角的纵向坐标。
left:图片相对于组件左上角的横向坐标。
duration:每一帧图片的播放时长,单位毫秒。 | +| state | AnimationStatus | Initial | 否 | 默认为初始状态,用于控制播放状态。 | +| duration | number | 1000 | 否 | 单位为毫秒,默认时长为1000ms;duration为0时,不播放图片;值的改变只会在下一次循环开始时生效;当images中设置了单独的duration后,该属性设置无效。 | +| reverse | boolean | false | 否 | 设置播放顺序。false表示从第1张图片播放到最后1张图片; true表示从最后1张图片播放到第1张图片。 | +| fixedSize | boolean | true | 否 | 设置图片大小是否固定为组件大小。 true表示图片大小与组件大小一致,此时设置图片的width 、height 、top 和left属性是无效的。false表示每一张图片的 width 、height 、top和left属性都要单独设置。 | +| preDecode | number | 0 | 否 | 是否启用预解码,默认值为0,即不启用预解码,如该值设为2,则播放当前页时会提前加载后面两张图片至缓存以提升性能。 | +| fillMode | FillMode | Forwards | 否 | 设置动画开始前和结束后的状态,可选值参见FillMode说明。 | +| iterations | number | 1 | 否 | 默认播放一次,设置为-1时表示无限次播放。 | - AnimationStatus枚举说明 - | 名称 | 描述 | + | 名称 | 描述 | | -------- | -------- | - | Initial | 动画初始状态。 | - | Running | 动画处于播放状态。 | - | Paused | 动画处于暂停状态。 | - | Stopped | 动画处于停止状态。 | + | Initial | 动画初始状态。 | + | Running | 动画处于播放状态。 | + | Paused | 动画处于暂停状态。 | + | Stopped | 动画处于停止状态。 | - FillMode枚举值说明 - | 名称 | 描述 | + | 名称 | 描述 | | -------- | -------- | - | None | 播放完成后恢复初始状态。 | - | Forwards | 播放完成后保持动画结束时的状态。 | + | None | 播放完成后恢复初始状态。 | + | Forwards | 播放完成后保持动画结束时的状态。 | ## 事件 -| 名称 | 功能描述 | +| 名称 | 功能描述 | | -------- | -------- | -| onStart() => void | 状态回调,动画开始播放时触发。 | -| onPause() => void | 状态回调,动画暂停播放时触发。 | -| onRepeat() => void | 状态回调,动画重新播放时触发。 | -| onCancel() => void | 状态回调,动画取消播放时触发。 | -| onFinish() => void | 状态回调,动画播放完成时触发。 | +| onStart() => void | 状态回调,动画开始播放时触发。 | +| onPause() => void | 状态回调,动画暂停播放时触发。 | +| onRepeat() => void | 状态回调,动画重新播放时触发。 | +| onCancel() => void | 状态回调,动画取消播放时触发。 | +| onFinish() => void | 状态回调,动画播放完成时触发。 | ## 示例 @@ -76,7 +76,8 @@ struct ImageAnimatorExample { Column({ space:5 }) { ImageAnimator() .images([ - { + { + //comment文件夹与pages同级 src: '/comment/bg1.jpg', duration: 500, width: 325, diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md index 86169b59304c2ed1a9d4588998d1ab4f776e053f..7fb09827d81024613f8a4c701efabc2dbe046023 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-search.md @@ -34,6 +34,7 @@ Search(options?: { value?: string; placeholder?: string; icon?: string; controll | placeholderColor | [ResourceColor](../../ui/ts-types.md) | - | 设置placeholder颜色。 | | placeholderFont | [Font](../../ui/ts-types.md) | - | 设置placeholder文本样式。 | | textFont | [Font](../../ui/ts-types.md) | - | 设置搜索框内文本样式。 | +| copyOption9+ | boolean\|[CopyOption](ts-basic-components-text.md) | true | 设置文本是否可复制。 | ## 事件 diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md index 27e928a439a67555e5efef4b5fcb43cc6c985e61..2ac94baf3f6b65d8768066b21c1ed358e4299360 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textarea.md @@ -39,6 +39,7 @@ TextArea(value?:{placeholder?: string controller?: TextAreaController}) | textAlign | TextAlign | Start | 设置文本水平对齐方式。 | | caretColor | Color | - | 设置输入框光标颜色。 | | inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md)8+,
error?: (value: string)
} | - | 通过正则表达式设置输入过滤器。满足表达式的输入允许显示,不满足的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,不支持过滤8到10位的强密码。
- value:设置正则表达式。
- error:正则匹配失败时,返回被忽略的内容。 | +| copyOption9+ | boolean\|[CopyOption](ts-basic-components-text.md) | true | 设置文本是否可复制。 | - TextAlign枚举说明 | 名称 | 描述 | diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md index d04909ce721b0175e0fe647544f9299f9b35ab24..43ccb241e98b11a594dc60bf389bc356c5df6bde 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-textinput.md @@ -41,6 +41,7 @@ TextInput(value?:{placeholder?: string controller?: TextInputController}) | caretColor | Color | - | 设置输入框光标颜色。 | | maxLength | number | - | 设置文本的最大输入字符数。 | | inputFilter8+ | {
value: [ResourceStr](../../ui/ts-types.md)8+,
error?: (value: string)
} | - | 正则表达式,满足表达式的输入允许显示,不满足正则表达式的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,8到10位的强密码不支持过滤。
- value:设置正则表达式。
- error:正则匹配失败时,返回被忽略的内容。 | +| copyOption9+ | boolean\|[CopyOption](ts-basic-components-text.md) | true | 设置文本是否可复制。 | - EnterKeyType枚举说明 | 名称 | 描述 | diff --git a/zh-cn/application-dev/security/Readme-CN.md b/zh-cn/application-dev/security/Readme-CN.md index 982a4503a1bbe3382a48fc607a53472d3ad4512d..dba654ecce2006d27dd7af5977f0274c35b6ef97 100644 --- a/zh-cn/application-dev/security/Readme-CN.md +++ b/zh-cn/application-dev/security/Readme-CN.md @@ -3,11 +3,13 @@ - 访问控制 - [访问控制开发概述](accesstoken-overview.md) - [访问控制开发指导](accesstoken-guidelines.md) + - [权限定义列表](permission-list.md) - 用户认证 - [用户认证开发概述](userauth-overview.md) - [用户认证开发指导](userauth-guidelines.md) - 密钥管理 - [HUKS开发概述](huks-overview.md) - [HUKS开发指导](huks-guidelines.md) -- Hap包签名工具 +- Hap包签名工具 + - [Hap包签名工具概述](hapsigntool-overview.md) - [Hap包签名工具指导](hapsigntool-guidelines.md) diff --git a/zh-cn/application-dev/security/accesstoken-guidelines.md b/zh-cn/application-dev/security/accesstoken-guidelines.md index 592f93d82d6157605d27551f27fa458a0fc01edc..f110c081d05de027c765c0b126e9eb9e7d93bec4 100644 --- a/zh-cn/application-dev/security/accesstoken-guidelines.md +++ b/zh-cn/application-dev/security/accesstoken-guidelines.md @@ -43,7 +43,7 @@ ```json { "module" : { - "requesetPermissions":[ + "requestPermissions":[ { "name" : "ohos.permission.PERMISSION1", "reason": "$string:reason", @@ -72,7 +72,7 @@ 如上述示例所示,权限"ohos.permission.PERMISSION2"的权限等级为system_basic,高于应用此时应用的APL等级,用户的最佳做法是使用ACL方式。 -**在config.json文件声明的基础上**,应用还需要在profile文件中声明不满足申请条件部分的权限。该场景中,用户应该在字段"acls"中做声明如下: +在config.json文件声明的基础上,应用还需要在[profile文件](../quick-start/app-provision-structure.md)中声明不满足申请条件部分的权限。该场景中,用户应该在字段"acls"中做声明如下: ```json { "version-name": "1.0.0", diff --git a/zh-cn/application-dev/security/accesstoken-overview.md b/zh-cn/application-dev/security/accesstoken-overview.md index 21fc689949dbf7e8a78113afcdbf3d952e3be131..f2e661d3c72267bc7b56e9199a89a9a3d6ef8c38 100644 --- a/zh-cn/application-dev/security/accesstoken-overview.md +++ b/zh-cn/application-dev/security/accesstoken-overview.md @@ -75,7 +75,7 @@ ATM(AccessTokenManager)是OpenHarmony上基于AccessToken构建的统一的应 | normal等级 | 普通应用。 | 默认情况下,应用的APL等级都为normal等级,如果应用需要将自身的APL等级声明为system_basic及以上的APL等级,需要进行以下步骤: -- 开发应用安装包时,需要修改应用的profile文件,在文件的"apl"字段声明应用的APL等级,并使用profile签名工具生成证书。具体签名流程可以查看页面[Hap包签名工具指导](hapsigntool-guidelines.md)。 +- 开发应用安装包时,需要修改应用的[profile文件](../quick-start/app-provision-structure.md),在文件的"apl"字段声明应用的APL等级,并使用profile签名工具生成证书。具体签名流程可以查看页面[Hap包签名工具指导](hapsigntool-guidelines.md)。 ### 权限等级说明 @@ -127,7 +127,7 @@ ACL方式的工作流程可以参考[ACL方式使用说明](#ACL方式使用说 该类型权限不仅需要在安装包中申请权限,还需要在应用动态运行时,通过发送弹窗的方式请求用户授权。在用户手动允许授权后,应用才会真正获取相应权限,从而成功访问操作目标对象。 - 比如说,在[权限定义列表](#权限定义列表)中,麦克风和摄像头对应的权限都是属于用户授权权限,列表中给出了详细的权限使用理由。 + 比如说,在[权限定义列表](permission-list.md)中,麦克风和摄像头对应的权限都是属于用户授权权限,列表中给出了详细的权限使用理由。 应用需要在应用商店的详情页面,向用户展示所申请的user_grant权限列表。 @@ -173,131 +173,3 @@ ACL方式的工作流程可以参考[ACL方式使用说明](#ACL方式使用说 * 开发应用安装包时,需要修改应用的profile文件,在文件的"acl"字段声明目标的访问控制列表,并使用profile签名工具生成证书。具体签名流程可以查看页面[Hap包签名工具指导](hapsigntool-guidelines.md)。 -## 权限定义列表 - -以下给出当前系统定义的权限信息列表。 - -| 权限名 | 权限级别 | 授权方式 | ACL使能 | 权限说明 | -| -------------------------------------------------------- | ------------ | ------------ | ------- | ------------------------------------------------------------ | -| ohos.permission.USE_BLUETOOTH | normal | system_grant | TRUE | 允许应用查看蓝牙的配置。 | -| ohos.permission.DISCOVER_BLUETOOTH | normal | system_grant | TRUE | 允许应用配置本地蓝牙,查找远端设备且与之配对连接。 | -| ohos.permission.MANAGE_BLUETOOTH | system_basic | system_grant | TRUE | 允许应用配对蓝牙设备,并对设备的电话簿或消息进行访问。 | -| ohos.permission.INTERNET | normal | system_grant | TRUE | 允许使用Internet网络。 | -| ohos.permission.MODIFY_AUDIO_SETTINGS | normal | system_grant | TRUE | 允许应用修改音频设置。 | -| ohos.permission.ACCESS_NOTIFICATION_POLICY | normal | system_grant | FALSE | 在本设备上允许应用访问通知策略。 | -| ohos.permission.GET_TELEPHONY_STATE | system_basic | system_grant | TRUE | 允许应用读取电话信息。 | -| ohos.permission.REQUIRE_FORM | system_basic | system_grant | TRUE | 允许应用获取Ability Form。 | -| ohos.permission.GET_NETWORK_INFO | normal | system_grant | TRUE | 允许应用获取数据网络信息。 | -| ohos.permission.PLACE_CALL | system_basic | system_grant | TRUE | 允许应用直接拨打电话。 | -| ohos.permission.SET_NETWORK_INFO | normal | system_grant | TRUE | 允许应用配置数据网络。 | -| ohos.permission.REMOVE_CACHE_FILES | system_basic | system_grant | TRUE | 允许清理指定应用的缓存。 | -| ohos.permission.REBOOT | system_basic | system_grant | TRUE | 允许应用重启设备。 | -| ohos.permission.RUNNING_LOCK | normal | system_grant | TRUE | 允许应用获取运行锁,保证应用在后台的持续运行。 | -| ohos.permission.ENROLL_BIOMETRIC | system_core | system_grant | FALSE | 允许应用录入或删除生物特征数据。 | -| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | FALSE | 允许应用使用生物特征识别能力进行身份认证。 | -| ohos.permission.ACCESS_BIOMETRIC_INTERNAL | system_core | system_grant | FALSE | 允许应用申请或释放生物特征识别的资源。 | -| ohos.permission.RESET_BIOMETRIC_LOCKOUT | system_core | system_grant | FALSE | 允许应用重置生物特征识别的认证失败计数。 | -| ohos.permission.SET_TIME | system_basic | system_grant | TRUE | 允许应用修改系统时间。 | -| ohos.permission.SET_TIME_ZONE | system_basic | system_grant | TRUE | 允许应用修改系统时区。 | -| ohos.permission.DOWNLOAD_SESSION_MANAGER | system_core | system_grant | TRUE | 允许应用管理下载任务会话。 | -| ohos.permission.COMMONEVENT_STICKY | normal | system_grant | TRUE | 允许应用发布粘性公共事件。 | -| ohos.permission.SYSTEM_FLOAT_WINDOW | normal | system_grant | TRUE | 允许应用使用悬浮窗的能力。 | -| ohos.permission.POWER_MANAGER | system_core | system_grant | TRUE | 允许应用调用电源管理子系统的接口,休眠或者唤醒设备。 | -| ohos.permission.REFRESH_USER_ACTION | system_basic | system_grant | TRUE | 允许应用在收到用户事件时,重新计算超时时间。 | -| ohos.permission.POWER_OPTIMIZATION | system_basic | system_grant | TRUE | 允许系统应用设置省电模式、获取省电模式的配置信息并接收配置变化的通知。 | -| ohos.permission.REBOOT_RECOVERY | system_basic | system_grant | TRUE | 允许系统应用重启设备并进入恢复模式。 | -| ohos.permission.MANAGE_LOCAL_ACCOUNTS | system_basic | system_grant | TRUE | 允许应用管理本地用户账号。 | -| ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | system_basic | system_grant | TRUE | 允许多个系统账号之间相互访问。 | -| ohos.permission.VIBRATE | normal | system_grant | TRUE | 允许应用控制马达振动。 | -| ohos.permission.CONNECT_IME_ABILITY | system_core | system_grant | TRUE | 允许绑定输入法Ability(InputMethodAbility)。 | -| ohos.permission.CONNECT_SCREEN_SAVER_ABILITY | system_core | system_grant | TRUE | 允许绑定屏保Ability(ScreenSaverAbility)。 | -| ohos.permission.READ_SCREEN_SAVER | system_basic | system_grant | TRUE | 允许应用查询屏保状态信息。 | -| ohos.permission.WRITE_SCREEN_SAVER | system_basic | system_grant | TRUE | 允许应用修改屏保状态信息。 | -| ohos.permission.SET_WALLPAPER | normal | system_grant | TRUE | 允许应用设置静态壁纸。 | -| ohos.permission.GET_WALLPAPER | system_basic | system_grant | TRUE | 允许应用读取壁纸文件。 | -| ohos.permission.CHANGE_ABILITY_ENABLED_STATE | system_basic | system_grant | TRUE | 允许改变应用或者组件的使能状态。 | -| ohos.permission.ACCESS_MISSIONS | system_basic | system_grant | TRUE | 允许应用访问任务栈信息。 | -| ohos.permission.CLEAN_BACKGROUND_PROCESSES | normal | system_grant | TRUE | 允许应用根据包名清理相关后台进程。 | -| ohos.permission.KEEP_BACKGROUND_RUNNING | normal | system_grant | TRUE | 允许Service Ability在后台持续运行。 | -| ohos.permission.UPDATE_CONFIGURATION | system_basic | system_grant | TRUE | 允许更新系统配置。 | -| ohos.permission.UPDATE_SYSTEM | system_basic | system_grant | TRUE | 允许调用升级接口。 | -| ohos.permission.FACTORY_RESET | system_basic | system_grant | TRUE | 允许调用回复出厂接口。 | -| ohos.permission.GRANT_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用为其他应用授予敏感权限。 | -| ohos.permission.REVOKE_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用撤销给其他应用授予的敏感信息。 | -| ohos.permission.GET_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用读取其他应用的敏感权限的状态。 | -| ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION | system_core | system_grant | TRUE | 允许应用跨用户对其他应用的属性进行设置。 | -| ohos.permission.LISTEN_BUNDLE_CHANGE | system_basic | system_grant | TRUE | 允许应用监听其他应用安装、更新、卸载状态的变化。 | -| ohos.permission.GET_BUNDLE_INFO | normal | system_grant | TRUE | 允许应用查询其他应用的信息。 | -| ohos.permission.ACCELEROMETER | normal | system_grant | TRUE | 允许应用读取加速度传感器的数据。 | -| ohos.permission.GYROSCOPE | normal | system_grant | TRUE | 允许应用读取陀螺仪传感器的数据。 | -| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | system_grant | TRUE | 允许应用查询其他应用的信息。 | -| ohos.permission.INSTALL_BUNDLE | system_core | system_grant | TRUE | 允许应用安装、卸载其他应用。 | -| ohos.permission.MANAGE_SHORTCUTS | system_core | system_grant | TRUE | 允许应用查询其他应用的快捷方式信息、启动其他应用的快捷方式。 | -| ohos.permission.radio.ACCESS_FM_AM | system_core | system_grant | TRUE | 允许应用获取收音机相关服务。 | -| ohos.permission.SET_TELEPHONY_STATE | system_basic | system_grant | TRUE | 允许应用修改telephone的状态。 | -| ohos.permission.START_ABILIIES_FROM_BACKGROUND | system_basic | system_grant | TRUE | 允许应用在后台启动FA。 | -| ohos.permission.BUNDLE_ACTIVE_INFO | system_basic | system_grant | TRUE | 允许系统应用查询其他应用在前台或后台的运行时间。 | -| ohos.permission.START_INVISIBLE_ABILITY | system_core | system_grant | TRUE | 无论Ability是否可见,都允许应用进行调用。 | -| ohos.permission.sec.ACCESS_UDID | system_basic | system_grant | TRUE | 允许系统应用获取UDID | -| ohos.permission.LAUNCH_DATA_PRIVACY_CENTER | system_basic | system_grant | TRUE | 允许应用从其隐私声明页面跳转至"数据与隐私"页面。 | -| ohos.permission.MANAGE_MEDIA_RESOURCES | system_basic | system_grant | TRUE | 允许应用程序获取当前设备正在播放的媒体资源,并对其进行管理。 | -| ohos.permission.PUBLISH_AGENT_REMINDER | normal | system_grant | TRUE | 允许该应用使用后台代理提醒。 | -| ohos.permission.CONTROL_TASK_SYNC_ANIMATOR | system_core | system_grant | TRUE | 允许应用使用同步任务动画。 | -| ohos.permission.INPUT_MONITORING | system_core | system_grant | TRUE | 允许应用监听输入事件,仅系统签名应用可申请此权限。 | -| ohos.permission.MANAGE_MISSIONS | system_core | system_grant | TRUE | 允许用户管理元能力任务栈。 | -| ohos.permission.NOTIFICATION_CONTROLLER | system_core | system_grant | TRUE | 允许应用管理通知和订阅通知。 | -| ohos.permission.CONNECTIVITY_INTERNAL | system_basic | system_grant | TRUE | 允许应用程序获取网络相关的信息或修改网络相关设置。 | -| ohos.permission.SET_ABILITY_CONTROLLER | system_basic | system_grant | TRUE | 允许设置ability组件启动和停止控制权。 | -| ohos.permission.USE_USER_IDM | system_basic | system_grant | FALSE | 允许应用访问系统身份凭据信息。 | -| ohos.permission.MANAGE_USER_IDM | system_basic | system_grant | FALSE | 允许应用使用系统身份凭据管理能力进行口令、人脸、指纹等录入、修改、删除等操作。 | -| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | TRUE | 允许应用使用生物特征识别能力进行身份认证。 | -| ohos.permission.ACCESS_USER_AUTH_INTERNAL | system_basic | system_grant | FALSE | 允许应用使用系统身份认证能力进行用户身份认证或身份识别。 | -| ohos.permission.ACCESS_PIN_AUTH | system_basic | system_grant | FALSE | 允许应用使用口令输入接口,用于系统应用完成口令输入框绘制场景。 | -| ohos.permission.GET_RUNNING_INFO | system_basic | system_grant | TRUE | 允许应用获取运行态信息。 | -| ohos.permission.CLEAN_APPLICATION_DATA | system_basic | system_grant | TRUE | 允许应用清理应用数据。 | -| ohos.permission.RUNNING_STATE_OBSERVER | system_basic | system_grant | TRUE | 允许应用观察应用状态。 | -| ohos.permission.CAPTURE_SCREEN | system_core | system_grant | TRUE | 允许应用截取屏幕图像。 | -| ohos.permission.GET_WIFI_INFO | normal | system_grant | TRUE | 允许应用获取WLAN信息。 | -| ohos.permission.GET_WIFI_INFO_INTERNAL | system_core | system_grant | TRUE | 允许应用获取WLAN信息。 | -| ohos.permission.SET_WIFI_INFO | normal | system_grant | TRUE | 允许应用配置WLAN设备。 | -| ohos.permission.GET_WIFI_PEERS_MAC | system_core | system_grant | TRUE | 允许应用获取对端WLAN或者蓝牙设备的MAC地址。 | -| ohos.permission.GET_WIFI_LOCAL_MAC | system_basic | system_grant | TRUE | 允许应用获取本机WLAN或者蓝牙设备的MAC地址。 | -| ohos.permission.GET_WIFI_CONFIG | system_basic | system_grant | TRUE | 允许应用获取WLAN配置信息。 | -| ohos.permission.SET_WIFI_CONFIG | system_basic | system_grant | TRUE | 允许应用配置WLAN信息。 | -| ohos.permission.MANAGE_WIFI_CONNECTION | system_core | system_grant | TRUE | 允许应用管理WLAN连接。 | -| ohos.permission.MANAGE_WIFI_HOTSPOT | system_core | system_grant | TRUE | 允许应用开启或者关闭WLAN热点。 | -| ohos.permission.GET_ALL_APP_ACCOUNTS | system_core | system_grant | FALSE | 允许应用获取所有应用账户信息。 | -| ohos.permission.MANAGE_SECURE_SETTINGS | system_basic | system_grant | TRUE | 允许应用修改安全类系统设置。 | -| ohos.permission.READ_DFX_SYSEVENT | system_basic | system_grant | FALSE | 允许获取所有应用账号信息。 | -| ohos.permission.MANAGE_ADMIN | system_core | system_grant | TRUE | 允许应用激活设备管理员应用。 | -| ohos.permission.EDM_MANAGE_DATETIME | normal | system_grant | FALSE | 允许设备管理员应用设置系统时间。 | -| ohos.permission.NFC_TAG | normal | system_grant | FALSE | 允许应用读取Tag卡片。 | -| ohos.permission.NFC_CARD_EMULATION | normal | system_grant | FALSE | 允许应用实现卡模拟功能。 | -| ohos.permission.PERMISSION_USED_STATS | system_core | system_grant | TRUE | 允许系统应用访问权限使用记录。 | -| ohos.permission.NOTIFICATION_AGENT_CONTROLLER | system_core | system_grant | TRUE | 允许应用发送代理通知。 | -| ohos.permission.ANSWER_CALL | system_basic | user_grant | TRUE | 允许应用接听来电。 | -| ohos.permission.READ_CALENDAR | normal | user_grant | TRUE | 允许应用读取日历信息。 | -| ohos.permission.READ_CALL_LOG | system_basic | user_grant | TRUE | 允许应用读取通话记录。 | -| ohos.permission.READ_CELL_MESSAGES | system_basic | user_grant | TRUE | 允许应用读取设备收到的小区广播信息。 | -| ohos.permission.READ_CONTACTS | system_basic | user_grant | TRUE | 允许应用读取联系人数据。 | -| ohos.permission.READ_MESSAGES | system_basic | user_grant | TRUE | 允许应用读取短信息。 | -| ohos.permission.RECEIVE_MMS | system_basic | user_grant | TRUE | 允许应用接收和处理彩信。 | -| ohos.permission.RECEIVE_SMS | system_basic | user_grant | TRUE | 允许应用接收和处理短信。 | -| ohos.permission.RECEIVE_WAP_MESSAGES | system_basic | user_grant | TRUE | 允许应用接收和处理WAP消息。 | -| ohos.permission.MICROPHONE | normal | user_grant | TRUE | 允许应用使用麦克风。 | -| ohos.permission.SEND_MESSAGES | system_basic | user_grant | TRUE | 允许应用发送短信。 | -| ohos.permission.WRITE_CALENDAR | normal | user_grant | TRUE | 允许应用添加、移除或更改日历活动。 | -| ohos.permission.WRITE_CALL_LOG | system_basic | user_grant | TRUE | 允许应用添加、移除或更改通话记录。 | -| ohos.permission.WRITE_CONTACTS | system_basic | user_grant | TRUE | 允许应用添加、移除或更改联系人数据。 | -| ohos.permission.DISTRIBUTED_DATASYNC | normal | user_grant | TRUE | 允许不同设备间的数据交换。 | -| ohos.permission.MANAGE_VOICEMAIL | system_basic | user_grant | TRUE | 允许应用在语音信箱中留言 | -| ohos.permission.LOCATION_IN_BACKGROUND | normal | user_grant | FALSE | 允许应用在后台运行时获取设备位置信息。 | -| ohos.permission.LOCATION | normal | user_grant | TRUE | 允许应用获取设备位置信息。 | -| ohos.permission.MEDIA_LOCATION | normal | user_grant | TRUE | 允许应用访问用户媒体文件中的地理位置信息。 | -| ohos.permission.CAMERA | normal | user_grant | TRUE | 允许应用使用相机拍摄照片和录制视频。 | -| ohos.permission.READ_MEDIA | normal | user_grant | TRUE | 允许应用读取用户外部存储中的媒体文件信息。 | -| ohos.permission.WRITE_MEDIA | normal | user_grant | TRUE | 允许应用读写用户外部存储中的媒体文件信息。 | -| ohos.permission.ACTIVITY_MOTION | normal | user_grant | TRUE | 允许应用读取用户当前的运动状态。 | -| ohos.permission.READ_HEALTH_DATA | normal | user_grant | TRUE | 允许应用读取用户的健康数据。 | -| ohos.permission.GET_DEFAULT_APPLICATION | system_core | system_grant | TRUE | 允许应用查询默认应用。 | -| ohos.permission.SET_DEFAULT_APPLICATION | system_core | system_grant | TRUE | 允许应用设置、重置默认应用。 | diff --git a/zh-cn/application-dev/security/hapsigntool-guidelines.md b/zh-cn/application-dev/security/hapsigntool-guidelines.md index 1136d3346364e029669eeb8b726346239898a968..3ae79b89fc1db6e3fc4dff78af497a96d0df0f97 100644 --- a/zh-cn/application-dev/security/hapsigntool-guidelines.md +++ b/zh-cn/application-dev/security/hapsigntool-guidelines.md @@ -1,63 +1,26 @@ # Hap包签名工具指导 -## 概述 - -### 功能简介 -为了保证OpenHarmony应用的完整性和来源可靠,在应用构建时需要对应用进行签名。经过签名的应用才能在真机设备上安装、运行、和调试。[developtools_hapsigner仓](https://gitee.com/openharmony/developtools_hapsigner)提供了签名工具的源码,包含密钥对生成、CSR文件生成、证书生成、Profile文件签名、Hap包签名等功能。 - - -### 基本概念 - -Hap包签名工具支持本地签名需求的开发,为OpenHarmony应用提供完整性保护和来源管控机制,该签名工具基于PKI公钥证书的机制实现,在进行开发前,开发者应了解以下基本概念: - - - 非对称密钥对: - - 非对称密钥算法是数据签名/验签的基础,应用签名工具实现了标准的非对称密钥对生成功能(支持的密钥对类型包括ECC P384/256、RSA2048/3072/4096) - - - CSR: - - CSR(Certificate Signing Request)证书签发请求是生成证书的前提,他包括证书的公钥、证书主题和私钥签名,在申请证书之前,需要先基于密钥对生成CSR,然后提交给CA签发证书。 - - 证书: - - OpenHarmony采用RFC5280标准构建X509证书信任体系。用于应用签名的OpenHarmony证书共有三级,分为:根CA证书、中间CA证书、最终实体证书,其中最终实体证书分为应用签名证书和profile签名证书。应用签名证书表示应用开发者的身份,可保证系统上安装的应用来源可追溯,profile签名证书实现对profile文件的签名进行验签,保证profile文件的完整性。 - - - HAP包: - - HAP(OpenHarmony Ability Package)是Ability的部署包,OpenHarmony应用代码围绕Ability组件展开,它是由一个或者多个Ability组成。 - - - profile文件: - - hap包中的描述文件,该描述文件描述了已授权的证书权限和设备ID信息等信息。 - -### 约束与限制 - - - Hap包签名工具基于Java语言开发,需要Java8以上Java环境运行。 - - - 一键签名等脚本文件基于Python语言开发,使用需配置环境python3.5及以上。 - - - ## 编译构建 1. 该工具基于Gradle 7.1编译构建,请确认环境已安装配置Gradle环境,并且版本高于或等于7.1。 ```shell - gradle -v + gradle -v ``` 2. 下载代码,命令行打开文件目录至developtools_hapsigner/hapsigntool,执行命令进行编译打包。 ```shell - gradle build + gradle build ``` 或 ```shell - gradle jar + gradle jar ``` 3. 编译后得到二进制文件,目录为: ./hap_sign_tool/build/libs/hap-sign-tool.jar。 -## 用户指导 +## 开发指导 ### 场景介绍 @@ -66,24 +29,27 @@ OpenHarmony系统内置密钥库文件,文件名称为OpenHarmony.p12,内含 按照有无应用签名证书可分为以下两种场景: 1. 无应用签名证书场景: -开发者使用该工具对Hap包签名时,需按照签名步骤从第一步生成应用签名证书密钥对依次完成应用签名证书生成、profile文件签名、应用签名流程。 + 开发者使用该工具对Hap包签名时,需按照签名步骤从第一步生成应用签名证书密钥对依次完成应用签名证书生成、profile文件签名、应用签名流程。 2. 有应用签名证书场景: -开发者可直接从签名步骤第三步对profile文件进行签名开始开发 ,使用应用签名证书和包含对应密钥的本地密钥库文件对应用进行签名。 - -### 说明 + 开发者可直接从签名步骤第三步对profile文件进行签名开始开发 ,使用应用签名证书和包含对应密钥的本地密钥库文件对应用进行签名。 -#### 命令说明 -1.输出命令帮助信息 +### 命令说明 - -help # 输出命令帮助信息(不输入参数默认输出命令帮助信息) +1. 输出命令帮助信息。 -2.输出版本信息 + ``` + -help # 输出命令帮助信息(不输入参数默认输出命令帮助信息) + ``` - -version # 输出版本信息 +2. 输出版本信息。 + ``` + -version # 输出版本信息 + ``` -3.生成密钥对 +3. 生成密钥对。 + ``` generate-keypair : 生成密钥对 ├── -keyAlias # 密钥别名,必填项 ├── -keyPwd # 密钥口令,可选项 @@ -91,10 +57,11 @@ OpenHarmony系统内置密钥库文件,文件名称为OpenHarmony.p12,内含 ├── -keySize # 密钥长度,必填项,RSA算法的长度为2048/3072/4096,ECC算法的长度NIST-P-256/NIST-P-384 ├── -keystoreFile # 密钥库文件,必填项,JKS或P12格式 ├── -keystorePwd # 密钥库口令,可选项 + ``` -4.生成证书签名请求 - - generate-csr : 生成证书签名请求 +4. 生成证书签名请求。 + ``` + generate-csr : 生成证书签名请求 ├── -keyAlias # 密钥别名,必填项 ├── -keyPwd # 密钥口令,可选项 ├── -subject # 证书主题,必填项 @@ -102,10 +69,12 @@ OpenHarmony系统内置密钥库文件,文件名称为OpenHarmony.p12,内含 ├── -keystoreFile # 密钥库文件,必填项,JKS或P12格式 ├── -keystorePwd # 密钥库口令,可选项 ├── -outFile # 输出文件,可选项,如果不填,则直接输出到控制台 + ``` + +5. 生成根CA/中间CA证书。 -5.生成根CA/中间CA证书 - - generate-ca : 生成根CA/中间CA证书,如果密钥不存在,一起生成密钥 + ``` + generate-ca : 生成根CA/中间CA证书,如果密钥不存在,一起生成密钥 ├── -keyAlias # 密钥别名,必填项 ├── -keyPwd # 密钥口令,可选项 ├── -keyAlg # 密钥算法,必填项,包括RSA/ECC @@ -122,10 +91,12 @@ OpenHarmony系统内置密钥库文件,文件名称为OpenHarmony.p12,内含 ├── -issuerKeystoreFile # 签发者密钥库文件,可选项,JKS或P12格式 ├── -issuerKeystorePwd # 签发者密钥库口令,可选项 ├── -outFile # 输出文件,可选项,如果不填,则直接输出到控制台 + ``` -6.生成应用调试/发布证书 +6. 生成应用调试/发布证书。 - generate-app-cert : 生成应用调试/发布证书 + ``` + generate-app-cert : 生成应用调试/发布证书 ├── -keyAlias # 密钥别名,必填项 ├── -keyPwd # 密钥口令,可选项 ├── -issuer # 颁发者的主题,必填项 @@ -142,10 +113,12 @@ OpenHarmony系统内置密钥库文件,文件名称为OpenHarmony.p12,内含 ├── -rootCaCertFile # outForm为certChain时必填,根CA证书文件 ├── -subCaCertFile # outForm为certChain时必填,中间CA证书文件 ├── -outFile # 输出证书文件(证书或证书链),可选项,如果不填,则直接输出到控制台 + ``` -7.生成profile调试/发布证书 +7. 生成profile调试/发布证书。 - generate-profile-cert : 生成profile调试/发布证书 + ``` + generate-profile-cert : 生成profile调试/发布证书 ├── -keyAlias # 密钥别名,必填项 ├── -keyPwd # 密钥口令,可选项 ├── -issuer # 颁发者的主题,必填项 @@ -162,62 +135,70 @@ OpenHarmony系统内置密钥库文件,文件名称为OpenHarmony.p12,内含 ├── -rootCaCertFile # outForm为certChain时必填,根CA证书文件 ├── -subCaCertFile # outForm为certChain时必填,中间CA证书文件 ├── -outFile # 输出证书文件(证书或证书链),可选项,如果不填,则直接输出到控制台 - -8.通用证书生成,可以生成自定义证书 - - generate-cert : 通用证书生成,可以生成自定义证书 - ├── -keyAlias # 密钥别名,必填项 - ├── -keyPwd # 密钥口令,可选项 - ├── -issuer # 颁发者的主题,必填项 - ├── -issuerKeyAlias # 颁发者的密钥别名,必填项 - ├── -issuerKeyPwd # 颁发者的密钥口令,可选项 - ├── -subject # 证书主题,必填项 - ├── -validity # 证书有效期,可选项,默认为1095天 - ├── -keyUsage # 密钥用法,必选项,包括digitalSignature, nonRepudiation, keyEncipherment, - ├ dataEncipherment, keyAgreement, certificateSignature, crlSignature, - ├ encipherOnly和decipherOnly,如果证书包括多个密钥用法,用逗号分隔 - ├── -keyUsageCritical # keyUsage是否为关键项,可选项,默认为是 - ├── -extKeyUsage # 扩展密钥用法,可选项,包括clientAuthentication,serverAuthentication, - ├ codeSignature,emailProtection,smartCardLogin,timestamp,ocspSignature - ├── -extKeyUsageCritical # extKeyUsage是否为关键项,可选项,默认为否 - ├── -signAlg # 签名算法,必填项,包括SHA256withRSA/SHA384withRSA/SHA256withECDSA/SHA384withECDSA - ├── -basicConstraints # 是否包含basicConstraints,可选项,默认为否 - ├── -basicConstraintsCritical # basicConstraints是否包含为关键项,可选项,默认为否 - ├── -basicConstraintsCa # 是否为CA,可选项,默认为否 - ├── -basicConstraintsPathLen # 路径长度,可选项,默认为0 - ├── -issuerKeystoreFile # 签发者密钥库文件,可选项,JKS或P12格式 - ├── -issuerKeystorePwd # 签发者密钥库口令,可选项 - ├── -keystoreFile # 密钥库文件,必填项,JKS或P12格式 - ├── -keystorePwd # 密钥库口令,可选项 - ├── -outFile # 输出证书文件,可选项,如果不填,则直接输出到控制台 - -9.ProvisionProfile文件签名 - - sign-profile : ProvisionProfile文件签名 - ├── -mode # 签名模式,必填项,包括localSign,remoteSign - ├── -keyAlias # 密钥别名,必填项 - ├── -keyPwd # 密钥口令,可选项 - ├── -profileCertFile # Profile签名证书(证书链,顺序为最终实体证书-中间CA证书-根证书),必填项 - ├── -inFile # 输入原始的模板Profile文件,文件为json格式,所在目录为developtools_hapsigner/autosign/UnsgnedReleasedProfileTemplate.json,必填项 - ├── -signAlg # 签名算法,必填项,包括SHA256withECDSA / SHA384withECDSA - ├── -keystoreFile # 密钥库文件,localSign模式时为必填项,JKS或P12格式 - ├── -keystorePwd # 密钥库口令,可选项 - ├── -outFile # 输出签名后的Provision Profile文件,p7b格式,必填项 - -10.ProvisionProfile文件验签 - - verify-profile : ProvisionProfile文件验签 - ├── -inFile # 已签名的Provision Profile文件,p7b格式,必填项 - ├── -outFil # 验证结果文件(包含验证结果和profile内容),json格式,可选项;如果不填,则直接输出到控制台 - -11.hap应用包签名 - - sign-app : hap应用包签名 + ``` + +8. 通用证书生成,可以生成自定义证书。 + + ``` + generate-cert : 通用证书生成,可以生成自定义证书 + ├── -keyAlias # 密钥别名,必填项 + ├── -keyPwd # 密钥口令,可选项 + ├── -issuer # 颁发者的主题,必填项 + ├── -issuerKeyAlias # 颁发者的密钥别名,必填项 + ├── -issuerKeyPwd # 颁发者的密钥口令,可选项 + ├── -subject # 证书主题,必填项 + ├── -validity # 证书有效期,可选项,默认为1095天 + ├── -keyUsage # 密钥用法,必选项,包括digitalSignature, nonRepudiation, keyEncipherment, + ├ dataEncipherment, keyAgreement, certificateSignature, crlSignature, + ├ encipherOnly和decipherOnly,如果证书包括多个密钥用法,用逗号分隔 + ├── -keyUsageCritical # keyUsage是否为关键项,可选项,默认为是 + ├── -extKeyUsage # 扩展密钥用法,可选项,包括clientAuthentication,serverAuthentication, + ├ codeSignature,emailProtection,smartCardLogin,timestamp,ocspSignature + ├── -extKeyUsageCritical # extKeyUsage是否为关键项,可选项,默认为否 + ├── -signAlg # 签名算法,必填项,包括SHA256withRSA/SHA384withRSA/SHA256withECDSA/SHA384withECDSA + ├── -basicConstraints # 是否包含basicConstraints,可选项,默认为否 + ├── -basicConstraintsCritical # basicConstraints是否包含为关键项,可选项,默认为否 + ├── -basicConstraintsCa # 是否为CA,可选项,默认为否 + ├── -basicConstraintsPathLen # 路径长度,可选项,默认为0 + ├── -issuerKeystoreFile # 签发者密钥库文件,可选项,JKS或P12格式 + ├── -issuerKeystorePwd # 签发者密钥库口令,可选项 + ├── -keystoreFile # 密钥库文件,必填项,JKS或P12格式 + ├── -keystorePwd # 密钥库口令,可选项 + ├── -outFile # 输出证书文件,可选项,如果不填,则直接输出到控制台 + ``` + +9. profile文件签名。 + + ``` + sign-profile : profile文件签名 + ├── -mode # 签名模式,必填项,包括localSign,remoteSign + ├── -keyAlias # 密钥别名,必填项 + ├── -keyPwd # 密钥口令,可选项 + ├── -profileCertFile # Profile签名证书(证书链,顺序为最终实体证书-中间CA证书-根证书),必填项 + ├── -inFile # 输入原始的模板Profile文件,文件为json格式,所在目录为developtools_hapsigner/autosign/UnsgnedReleasedProfileTemplate.json,必填项 + ├── -signAlg # 签名算法,必填项,包括SHA256withECDSA / SHA384withECDSA + ├── -keystoreFile # 密钥库文件,localSign模式时为必填项,JKS或P12格式 + ├── -keystorePwd # 密钥库口令,可选项 + ├── -outFile # 输出签名后的profile文件,p7b格式,必填项 + ``` + +10. profile文件验签。 + + ``` + verify-profile : profile文件验签 + ├── -inFile # 已签名的profile文件,p7b格式,必填项 + ├── -outFil # 验证结果文件(包含验证结果和profile内容),json格式,可选项;如果不填,则直接输出到控制台 + ``` + +11. hap应用包签名。 + + ``` + sign-app : hap应用包签名 ├── -mode # 签名模式,必填项,包括localSign,remoteSign,remoteResign ├── -keyAlias # 密钥别名,必填项 ├──-keyPwd # 密钥口令,可选项 ├── -appCertFile # 应用签名证书文件(证书链,顺序为最终实体证书-中间CA证书-根证书),必填项 - ├── -profileFile # 签名后的Provision Profile文件名,p7b格式,必填项 + ├── -profileFile # 签名后的profile文件名,p7b格式,必填项 ├── -profileSigned # 指示profile文件是否带有签名,1表示有签名,0表示没有签名,默认为1。可选项 ├── -inForm # 输入的原始文件的格式,zip格式或bin格式,默认zip格式,可选项 ├── -inFile # 输入的原始APP包文件,hap格式或bin格式,必填项 @@ -225,13 +206,17 @@ OpenHarmony系统内置密钥库文件,文件名称为OpenHarmony.p12,内含 ├── -keystoreFile # 密钥库文件,localSign模式时为必填项,JKS或P12格式 ├── -keystorePwd # 密钥库口令,可选项 ├── -outFile # 输出签名后的包文件,必填项 + ``` -12.hap应用包文件验签 +12. hap应用包文件验签。 + ``` verify-app : hap应用包文件验签 - ├── -inFile # 已签名的应用包文件,hap格式或bin格式,必填项 - ├── -outCertchain # 签名的证书链文件,必填项 - ├── -outProfile # 应用包中的profile文件,必填项 + ├── -inFile # 已签名的应用包文件,hap格式或bin格式,必填项 + ├── -outCertchain # 签名的证书链文件,必填项 + ├── -outProfile # 应用包中的profile文件,必填项 + ``` + ### 签名步骤 对hap包签名的完整步骤为: @@ -242,172 +227,176 @@ OpenHarmony系统内置密钥库文件,文件名称为OpenHarmony.p12,内含 > **注意事项:**
- 1.步骤一中的密钥对算法推荐使用ECC,出于安全性考虑,应用签名暂不使用RSA算法;
- 2.建议将待签名hap包、profile文件、密钥库文件OpenHarmony.p12、根CA证书、中间CA证书、签名工具放在同一个目录下,方便操作。在[**developtools_hapsigner/autosign/result**](https://gitee.com/openharmony/developtools_hapsigner/tree/master/autosign/result)路径下,有如下文件:
- OpenHarmony密钥库文件**OpenHarmony.p12**
- 根CA证书**rootCA.cer**
- 中间CA证书**subCA.cer**
- profile签名证书**OpenHarmonyProfileRelease.pem** - - -**1.生成应用签名证书密钥对** - -调用密钥对生成接口,生成签名密钥并保存到密钥库。 - -命令实例: -```shell -java -jar hap-sign-tool.jar generate-keypair -keyAlias "oh-app1-key-v1" -keyAlg "ECC" -keySize "NIST-P-256" -keystoreFile "OpenHarmony.p12" -keyPwd "123456" -keystorePwd "123456" -``` - > ![icon-note.gif](../public_sys-resources/icon-note.gif) **说明:**请记录下**keyAlias、keyStorePwd**和**keyPwd**的值,在后续生成应用签名证书和对Hap包进行签名操作会使用到。 - -该命令的参数说明: - - generate-keypair : 生成应用签名证书密钥对 - ├── -keyAlias #用于生成应用签名证书的密钥别名,存于OpenHarmony.p12密钥库文件中,该参数必填 - ├── -keyAlg #密钥算法,推荐使用ECC,该参数必填 - ├── -keySize #密钥长度,ECC算法的长度NIST-P-256/NIST-P-384,该参数必填 - ├── -keyStoreFile #密钥库文件,推荐使用提供的OpenHarmony.p12密钥库文件,该参数必填 - ├── -keyStorePwd #密钥库口令,OpenHarmony.p12口令默认为“123456”,必填项 - ├── -keyPwd #密钥口令,可选项,该参数不填默认生成的密钥对无口令 +> +> 1. 步骤一中的密钥对算法推荐使用ECC,出于安全性考虑,应用签名暂不使用RSA算法。 +> 2. 建议将待签名hap包、profile文件、密钥库文件OpenHarmony.p12、根CA证书、中间CA证书、签名工具放在同一个目录下,方便操作。在[**developtools_hapsigner/autosign/result**](https://gitee.com/openharmony/developtools_hapsigner/tree/master/autosign/result)路径下,有如下文件:
- OpenHarmony密钥库文件**OpenHarmony.p12**
- 根CA证书**rootCA.cer**
- 中间CA证书**subCA.cer**
- profile签名证书**OpenHarmonyProfileRelease.pem** + +1. **生成应用签名证书密钥对** + + 调用密钥对生成接口,生成签名密钥并保存到密钥库。 + + 命令实例: + + ```shell + java -jar hap-sign-tool.jar generate-keypair -keyAlias "oh-app1-key-v1" -keyAlg "ECC" -keySize "NIST-P-256" -keystoreFile "OpenHarmony.p12" -keyPwd "123456" -keystorePwd "123456" + ``` + + > **说明:** 请记录下**keyAlias、keyStorePwd**和**keyPwd**的值,在后续生成应用 签名证书和对Hap包进行签名操作会使用到。 + + 该命令的参数说明: + + ``` + generate-keypair : 生成应用签名证书密钥对 + ├── -keyAlias #用于生成应用签名证书的密钥别名,存于OpenHarmony.p12密钥库文件中,该参数必填 + ├── -keyAlg #密钥算法,推荐使用ECC,该参数必填 + ├── -keySize #密钥长度,ECC算法的长度NIST-P-256/NIST-P-384,该参数必填 + ├── -keyStoreFile #密钥库文件,推荐使用提供的OpenHarmony.p12密钥库文件,该参数必填 + ├── -keyStorePwd #密钥库口令,OpenHarmony.p12口令默认为“123456”,必填项 + ├── -keyPwd #密钥口令,可选项,该参数不填默认生成的密钥对无口令 + ``` + +2. **生成应用签名证书** + + 调用应用签名证书生成接口,使用本地中间CA证书签发应用签名证书。 + + 命令实例: + + ```shell + java -jar hap-sign-tool.jar generate-app-cert -keyAlias "oh-app1-key-v1" -signAlg "SHA256withECDSA" -issuer "C=CN,O=OpenHarmony,OU=OpenHarmony Team,CN= OpenHarmony Application CA" -issuerKeyAlias "openharmony application ca" -subject "C=CN,O=OpenHarmony,OU=OpenHarmony Team,CN=OpenHarmony Application Release" -keystoreFile "OpenHarmony.p12" -subCaCertFile "subCA.cer" -rootCaCertFile "rootCA.cer" -outForm "certChain" -outFile "app1.pem" -keyPwd "123456" -keystorePwd "123456" -issuerKeyPwd "123456" -validity "365" + ``` + + 该命令的参数说明: + + ``` + generate-app-cert:生成应用签名证书 + ├── -keyAlias # 用于生成应用签名证书的密钥别名,请与第一步生成密钥对的密钥别名-keyAlias保持一致 + ├── -signAlg # 签名算法,必填项,包括 SHA256withECDSA / SHA384withECDSA + ├── -issuer # 颁发者主题,填写已提供的中间CA证书主题,该参数必填且不能修改 + ├── -issuerKeyAlias # 颁发者密钥别名,填写中间CA证书密钥别名,该参数必填且不能修改 + ├── -subject # 证书主题,请参照命令实例中内容保证顺序不变,该参数必填 + ├── -issuerKeyPwd # 颁发者密钥口令,填写中间CA证书密钥口令,该参数必填,指定“123456”,不可修改 + ├── -keystoreFile # 密钥库文件,指定使用提供的OpenHarmony.p12密钥库文件,该参数必填且不可修改 + ├── -rootCaCertFile # 根CA证书文件,指定为已提供的根CA证书,该参数必填且不可修改 + ├── -subCaCertFile # 中间CA证书文件,指定为已提供的中间CA证书,该参数必填且不可修改 + ├── -outForm # 输出证书文件格式,推荐使用certChain + ├── -outFile # 可选项,建议填写,不填则默认输出到控制台 + ├── -keyPwd # 密钥口令,可选项,为第一步生成的密钥对口令 + ├── -keystorePwd # 密钥库口令,默认为“123456” + ├── -validity # 证书有效期,可选项,默认为3650天 + ``` + +3. **对profile文件进行签名** + + 调用profile文件签名接口,使用Profile签名密钥对profile文件进行签名。 + + 命令实例: + + ```shell + java -jar hap-sign-tool.jar sign-profile -keyAlias "openharmony application profile release" -signAlg "SHA256withECDSA" -mode "localSign" -profileCertFile "OpenHarmonyProfileRelease.pem" -inFile "UnsgnedReleasedProfileTemplate.json" -keystoreFile "OpenHarmony.p12" -outFile "app1-profile.p7b" -keyPwd "123456" -keystorePwd "123456" + ``` + + 该命令的参数说明: + + ``` + sign-profile:签名profile文件 + ├── -keyAlias # 生成profile证书的密钥别名,该参数必填且不能修改 + ├── -signAlg # 签名算法,包括 SHA256withECDSA / SHA384withECDSA,该参数必填 + ├── -mode # 签名模式,目前仅支持localSign,该参数必填 + ├── -profileCertFile # Profile签名证书,指定已提供的profile证书文件,该参数必填且不可修改 + ├── -inFile # 输入原始的模板Profile文件,文件为json格式,所在目录为developtools_hapsigner/autosign/UnsgnedReleasedProfileTemplate.json,该参数必填 + ├── -keystoreFile # 密钥库文件,指定使用提供的OpenHarmony.p12密钥库文件,该参数必填且不可修改 + ├── -outFile # 输出签名后的profile文件,p7b格式,该参数必填 + ├── -keyPwd # 密钥口令,OpenHarmony.p12中的口令默认“123456” + ├── -keystorePwd # 密钥库口令,OpenHarmony.p12口令默认为“123456” + ``` + +4. **对Hap包进行签名** + + 调用Hap包签名接口,使用应用签名密钥为Hap包签名。 + + 命令实例: + + ```shell + java -jar hap-sign-tool.jar sign-app -keyAlias "oh-app1-key-v1" -signAlg "SHA256withECDSA" -mode "localSign" -appCertFile "app1.pem" -profileFile "app1-profile.p7b" -inFile "app1-unsigned.zip" -keystoreFile "OpenHarmony.p12" -outFile "app1-signed.hap" -keyPwd "123456" -keystorePwd "123456" + ``` + > **说明**:以下参数说明默认为无应用签名证书场景,当开发场景为有应用签名证书场景时,下列参数需要修改: + > -keyAlias:密钥别名,填写已有应用签名证书对应的密钥别名,参数必填。 + > -appCertFile:应用签名证书,填写已有的应用签名证书,参数必填。 + > -keystoreFile:密钥库文件,填写已有应用签名证书对应的密钥库文件,参数必填。 + > -keyPwd:密钥口令,填写密钥库文件中对应密钥的口令。 + > -keystorePwd:密钥库口令,填写密钥库文件的密钥口令。 + + 该命令的参数说明: + + ``` + sign-app:签名Hap包 + ├── -keyAlias # 密钥别名,为第一步生成的密钥信息别名,该参数必填 + ├── -signAlg # 签名算法,包括 SHA256withECDSA / SHA384withECDSA,该参数必填 + ├── -mode # 签名模式,目前仅支持localSign,该参数必填 + ├── -appCertFile # 应用签名证书(证书链,顺序为最终实体证书-中间CA证书-根证书),填写第二步生成的应用签名证书,该参数必填 + ├── -profileFile # 签名后的profile文件,p7b格式,填写第三步中生成的profile文件,必填项 + ├── -inFile # 输入原始APP包文件,该参数必填 + ├── -keystoreFile # 密钥库文件,请与步骤一中密钥库文件保持一致,该参数必填且不可修改 + ├── -outFile # 输出签名后的包文件,必填项 + ├── -keyPwd # 密钥口令,与第一步生成的密钥对口令保持一致 + ├── -keystorePwd # 密钥库口令,与第一步的密钥库口令保持一致 + ``` - -**2.生成应用签名证书** - -调用应用签名证书生成接口,使用本地中间CA证书签发应用签名证书。 - -命令实例: - -```shell -java -jar hap-sign-tool.jar generate-app-cert -keyAlias "oh-app1-key-v1" -signAlg "SHA256withECDSA" -issuer "C=CN,O=OpenHarmony,OU=OpenHarmony Team,CN= OpenHarmony Application CA" -issuerKeyAlias "openharmony application ca" -subject "C=CN,O=OpenHarmony,OU=OpenHarmony Team,CN=OpenHarmony Application Release" -keystoreFile "OpenHarmony.p12" -subCaCertFile "subCA.cer" -rootCaCertFile "rootCA.cer" -outForm "certChain" -outFile "app1.pem" -keyPwd "123456" -keystorePwd "123456" -issuerKeyPwd "123456" -validity "365" -``` -该命令的参数说明: - - generate-app-cert:生成应用签名证书 - ├── -keyAlias # 用于生成应用签名证书的密钥别名,请与第一步生成密钥对的密钥别名-keyAlias保持一致 - ├── -signAlg # 签名算法,必填项,包括 SHA256withECDSA / SHA384withECDSA - ├── -issuer # 颁发者主题,填写已提供的中间CA证书主题,该参数必填且不能修改 - ├── -issuerKeyAlias # 颁发者密钥别名,填写中间CA证书密钥别名,该参数必填且不能修改 - ├── -subject # 证书主题,请参照命令实例中内容保证顺序不变,该参数必填 - ├── -issuerKeyPwd # 颁发者密钥口令,填写中间CA证书密钥口令,该参数必填,指定“123456”,不可修改 - ├── -keystoreFile # 密钥库文件,指定使用提供的OpenHarmony.p12密钥库文件,该参数必填且不可修改 - ├── -rootCaCertFile # 根CA证书文件,指定为已提供的根CA证书,该参数必填且不可修改 - ├── -subCaCertFile # 中间CA证书文件,指定为已提供的中间CA证书,该参数必填且不可修改 - ├── -outForm # 输出证书文件格式,推荐使用certChain - ├── -outFile # 可选项,建议填写,不填则默认输出到控制台 - ├── -keyPwd # 密钥口令,可选项,为第一步生成的密钥对口令 - ├── -keystorePwd # 密钥库口令,默认为“123456” - ├── -validity # 证书有效期,可选项,默认为3650天 -
- -**3.对profile文件进行签名** - -调用Profile文件签名接口,使用Profile签名密钥对Profile文件进行签名。 - -命令实例: - -```shell -java -jar hap-sign-tool.jar sign-profile -keyAlias "openharmony application profile release" -signAlg "SHA256withECDSA" -mode "localSign" -profileCertFile "OpenHarmonyProfileRelease.pem" -inFile "UnsgnedReleasedProfileTemplate.json" -keystoreFile "OpenHarmony.p12" -outFile "app1-profile.p7b" -keyPwd "123456" -keystorePwd "123456" -``` -该命令的参数说明: - - sign-profile:签名profile文件 - ├── -keyAlias # 生成profile证书的密钥别名,该参数必填且不能修改 - ├── -signAlg # 签名算法,包括 SHA256withECDSA / SHA384withECDSA,该参数必填 - ├── -mode # 签名模式,目前仅支持localSign,该参数必填 - ├── -profileCertFile # Profile签名证书,指定已提供的profile证书文件,该参数必填且不可修改 - ├── -inFile # 输入原始的模板Profile文件,文件为json格式,所在目录为developtools_hapsigner/autosign/UnsgnedReleasedProfileTemplate.json,该参数必填 - ├── -keystoreFile # 密钥库文件,指定使用提供的OpenHarmony.p12密钥库文件,该参数必填且不可修改 - ├── -outFile # 输出签名后的Provision Profile文件,p7b格式,该参数必填 - ├── -keyPwd # 密钥口令,OpenHarmony.p12中的口令默认“123456” - ├── -keystorePwd # 密钥库口令,OpenHarmony.p12口令默认为“123456” -
- -**4.对Hap包进行签名** - -调用Hap包签名接口,使用应用签名密钥为Hap包签名。 - -命令实例: -```shell -java -jar hap-sign-tool.jar sign-app -keyAlias "oh-app1-key-v1" -signAlg "SHA256withECDSA" -mode "localSign" -appCertFile "app1.pem" -profileFile "app1-profile.p7b" -inFile "app1-unsigned.zip" -keystoreFile "OpenHarmony.p12" -outFile "app1-signed.hap" -keyPwd "123456" -keystorePwd "123456" -``` - - > ![icon-note.gif](../public_sys-resources/icon-note.gif) **说明**:以下参数说明默认为无应用签名证书场景,当开发场景为有应用签名证书场景时,下列参数需要修改:
--keyAlias:密钥别名,填写已有应用签名证书对应的密钥别名,参数必填;
--appCertFile:应用签名证书,填写已有的应用签名证书,参数必填;
--keystoreFile:密钥库文件,填写已有应用签名证书对应的密钥库文件,参数必填;
--keyPwd:密钥口令,填写密钥库文件中对应密钥的口令;
--keystorePwd:密钥库口令,填写密钥库文件的密钥口令。
- -该命令的参数说明: - - sign-app:签名Hap包 - ├──-keyAlias # 密钥别名,为第一步生成的密钥信息别名,该参数必填 - ├──-signAlg # 签名算法,包括 SHA256withECDSA / SHA384withECDSA,该参数必填 - ├── -mode # 签名模式,目前仅支持localSign,该参数必填 - ├── -appCertFile # 应用签名证书(证书链,顺序为最终实体证书-中间CA证书-根证书),填写第二步生成的应用签名证书,该参数必填 - ├── -profileFile # 签名后的Provision Profile文件,p7b格式,填写第三步中生成的profile文件,必填项 - ├── -inFile # 输入原始APP包文件,该参数必填 - ├── -keystoreFile # 密钥库文件,请与步骤一中密钥库文件保持一致,该参数必填且不可修改 - ├── -outFile # 输出签名后的包文件,必填项 - ├── -keyPwd # 密钥口令,与第一步生成的密钥对口令保持一致 - ├── -keystorePwd # 密钥库口令,与第一步的密钥库口令保持一致 - - - ## 常见问题 -**1.执行第二步生成应用签名证书命令时,控制台打印结果,无文件输出** - - - **现象描述** - - 生成证书时,只在控制台打印证书内容,无对应文件输出。 - - - **可能原因** - - outFile参数中路径不正确 和 '-outFile'中的'-'非英文格式。 - - - **解决办法** +1. 执行第二步生成应用签名证书命令时,控制台打印结果,无文件输出。 - 检查并修正outFile参数为正确路径,'-outFile'中的'-'为英文格式 + - **现象描述** -**2.执行第三步对profile文件进行签名时,提示签名失败** + 生成证书时,只在控制台打印证书内容,无对应文件输出。 -- **现象描述** + - **可能原因** + + outFile参数中路径不正确 和 '-outFile'中的'-'非英文格式。 + + - **解决办法** + + 检查并修正outFile参数为正确路径,'-outFile'中的'-'为英文格式 - 现象分为以下几种: +2. 执行第三步对profile文件进行签名时,提示签名失败。 - (1).执行命令后提示 "SIGN_ERROR, code: 107. Details: Failed to verify signature: Wrong key usage". + - **现象描述** - (2).执行命令后提示 "NOT_SUPPORT_ERROR, code: 105. Details: Profile cert 'result\profile1.pem' must a cert chain". + 现象分为以下几种: - (3).执行命令后提示 "VERIFY_ERROR, code: 108. Details: Failed to verify signature: unable to find valid certification path to requested target" + (1)执行命令后提示` "SIGN_ERROR, code: 107. Details: Failed to verify signature: Wrong key usage"` + (2)执行命令后提示 `"NOT_SUPPORT_ERROR, code: 105. Details: Profile cert 'result\profile1.pem' must a cert chain"` -- **可能原因** + (3)执行命令后提示` "VERIFY_ERROR, code: 108. Details: Failed to verify signature: unable to find valid certification path to requested target"` - 对应现象描述的可能原因: + - **可能原因** - (1).profile签名证书(最终实体证书)证书链顺序不正确。 + (1)profile签名证书(最终实体证书)证书链顺序不正确。 - (2).profile签名证书(最终实体证书)不是证书链。 + (2)profile签名证书(最终实体证书)不是证书链。 - (3).证书主题顺序不正确 或者 生成应用签名证书时“-issuerKeyAlias”参数填写错误 + (3)证书主题顺序不正确 或者 生成应用签名证书时“-issuerKeyAlias”参数填写错误。 -- **解决办法** + - **解决办法** - (1).检查并修正证书链顺序,只能正序或反序,不可乱序。 + (1)检查并修正证书链顺序,只能正序或反序,不可乱序。 - (2).检查签名时的最终实体证书是否为证书链。 + (2)检查签名时的最终实体证书是否为证书链。 - (3).检查证书主题顺序是否正确,顺序须为C、O、OU、CN。 + (3)检查证书主题顺序是否正确,顺序须为C、O、OU、CN。 -**3.对Hap包进行签名时提示签名错误** +3. 对Hap包进行签名时提示签名错误。 - - **现象描述** + - **现象描述** - 执行命令后提示:NOT_SUPPORT_ERROR, code: 105. Details: SignAlg params is incorrect, signature algorithms include SHA256withECDSA,SHA384withECDSA + 执行命令后提示:`NOT_SUPPORT_ERROR, code: 105. Details: SignAlg params is incorrect, signature algorithms include SHA256withECDSA,SHA384withECDSA` - - **可能原因** + - **可能原因** - 签名算法不支持,signAlg参数填写错误 + 签名算法不支持,signAlg参数填写错误 - - **解决办法** + - **解决办法** - 最终实体证书密钥对推荐使用ECC生成,hap签名算法修改为ECC对应的SHA256withECDSA,SHA384withECDSA + 最终实体证书密钥对推荐使用ECC生成,hap签名算法修改为ECC对应的SHA256withECDSA,SHA384withECDSA diff --git a/zh-cn/application-dev/security/hapsigntool-overview.md b/zh-cn/application-dev/security/hapsigntool-overview.md new file mode 100644 index 0000000000000000000000000000000000000000..34e23a20bf5eac31f2fa0975e7a9c16cdbc4bbc1 --- /dev/null +++ b/zh-cn/application-dev/security/hapsigntool-overview.md @@ -0,0 +1,36 @@ +# Hap包签名工具概述 + +## 功能简介 + +为了保证OpenHarmony应用的完整性和来源可靠,在应用构建时需要对应用进行签名。经过签名的应用才能在真机设备上安装、运行、和调试。[developtools_hapsigner仓](https://gitee.com/openharmony/developtools_hapsigner)提供了签名工具的源码,包含密钥对生成、CSR文件生成、证书生成、Profile文件签名、Hap包签名等功能。 + +## 基本概念 + +Hap包签名工具支持本地签名需求的开发,为OpenHarmony应用提供完整性保护和来源管控机制,该签名工具基于PKI公钥证书的机制实现,在进行开发前,开发者应了解以下基本概念: + + - 非对称密钥对: + + 非对称密钥算法是数据签名/验签的基础,应用签名工具实现了标准的非对称密钥对生成功能(支持的密钥对类型包括ECC P384/256、RSA2048/3072/4096) + + - CSR: + + CSR(Certificate Signing Request)证书签发请求是生成证书的前提,他包括证书的公钥、证书主题和私钥签名,在申请证书之前,需要先基于密钥对生成CSR,然后提交给CA签发证书。 + + - 证书: + + OpenHarmony采用RFC5280标准构建X509证书信任体系。用于应用签名的OpenHarmony证书共有三级,分为:根CA证书、中间CA证书、最终实体证书,其中最终实体证书分为应用签名证书和profile签名证书。应用签名证书表示应用开发者的身份,可保证系统上安装的应用来源可追溯,profile签名证书实现对profile文件的签名进行验签,保证profile文件的完整性。 + + - HAP包: + + HAP(OpenHarmony Ability Package)是Ability的部署包,OpenHarmony应用代码围绕Ability组件展开,它是由一个或者多个Ability组成。 + + - profile文件: + + [HarmonyAppProvision配置文件](../quick-start/app-provision-structure.md),hap包中的描述文件,该描述文件描述了已授权的证书权限和设备ID信息等信息。 + +## 约束与限制 + + - Hap包签名工具基于Java语言开发,需要Java8以上Java环境运行。 + + - 一键签名等脚本文件基于Python语言开发,使用需配置环境python3.5及以上。 + diff --git a/zh-cn/application-dev/security/permission-list.md b/zh-cn/application-dev/security/permission-list.md new file mode 100644 index 0000000000000000000000000000000000000000..d9b781f95426a83b20d347e69e5f44921a498da7 --- /dev/null +++ b/zh-cn/application-dev/security/permission-list.md @@ -0,0 +1,131 @@ +# 权限定义列表 + +以下给出当前系统定义的权限信息列表。 + +权限级别、授权方式、ACL使能的说明,请参考[访问控制开发概述](accesstoken-overview.md)。权限的使用示例请参考[访问控制开发指导](accesstoken-guidelines.md)。 + +| 权限名 | 权限级别 | 授权方式 | ACL使能 | 权限说明 | +| -------------------------------------------------------- | ------------ | ------------ | ------- | ------------------------------------------------------------ | +| ohos.permission.USE_BLUETOOTH | normal | system_grant | TRUE | 允许应用查看蓝牙的配置。 | +| ohos.permission.DISCOVER_BLUETOOTH | normal | system_grant | TRUE | 允许应用配置本地蓝牙,查找远端设备且与之配对连接。 | +| ohos.permission.MANAGE_BLUETOOTH | system_basic | system_grant | TRUE | 允许应用配对蓝牙设备,并对设备的电话簿或消息进行访问。 | +| ohos.permission.INTERNET | normal | system_grant | TRUE | 允许使用Internet网络。 | +| ohos.permission.MODIFY_AUDIO_SETTINGS | normal | system_grant | TRUE | 允许应用修改音频设置。 | +| ohos.permission.ACCESS_NOTIFICATION_POLICY | normal | system_grant | FALSE | 在本设备上允许应用访问通知策略。 | +| ohos.permission.GET_TELEPHONY_STATE | system_basic | system_grant | TRUE | 允许应用读取电话信息。 | +| ohos.permission.REQUIRE_FORM | system_basic | system_grant | TRUE | 允许应用获取Ability Form。 | +| ohos.permission.GET_NETWORK_INFO | normal | system_grant | TRUE | 允许应用获取数据网络信息。 | +| ohos.permission.PLACE_CALL | system_basic | system_grant | TRUE | 允许应用直接拨打电话。 | +| ohos.permission.SET_NETWORK_INFO | normal | system_grant | TRUE | 允许应用配置数据网络。 | +| ohos.permission.REMOVE_CACHE_FILES | system_basic | system_grant | TRUE | 允许清理指定应用的缓存。 | +| ohos.permission.REBOOT | system_basic | system_grant | TRUE | 允许应用重启设备。 | +| ohos.permission.RUNNING_LOCK | normal | system_grant | TRUE | 允许应用获取运行锁,保证应用在后台的持续运行。 | +| ohos.permission.ENROLL_BIOMETRIC | system_core | system_grant | FALSE | 允许应用录入或删除生物特征数据。 | +| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | FALSE | 允许应用使用生物特征识别能力进行身份认证。 | +| ohos.permission.ACCESS_BIOMETRIC_INTERNAL | system_core | system_grant | FALSE | 允许应用申请或释放生物特征识别的资源。 | +| ohos.permission.RESET_BIOMETRIC_LOCKOUT | system_core | system_grant | FALSE | 允许应用重置生物特征识别的认证失败计数。 | +| ohos.permission.SET_TIME | system_basic | system_grant | TRUE | 允许应用修改系统时间。 | +| ohos.permission.SET_TIME_ZONE | system_basic | system_grant | TRUE | 允许应用修改系统时区。 | +| ohos.permission.DOWNLOAD_SESSION_MANAGER | system_core | system_grant | TRUE | 允许应用管理下载任务会话。 | +| ohos.permission.COMMONEVENT_STICKY | normal | system_grant | TRUE | 允许应用发布粘性公共事件。 | +| ohos.permission.SYSTEM_FLOAT_WINDOW | normal | system_grant | TRUE | 允许应用使用悬浮窗的能力。 | +| ohos.permission.POWER_MANAGER | system_core | system_grant | TRUE | 允许应用调用电源管理子系统的接口,休眠或者唤醒设备。 | +| ohos.permission.REFRESH_USER_ACTION | system_basic | system_grant | TRUE | 允许应用在收到用户事件时,重新计算超时时间。 | +| ohos.permission.POWER_OPTIMIZATION | system_basic | system_grant | TRUE | 允许系统应用设置省电模式、获取省电模式的配置信息并接收配置变化的通知。 | +| ohos.permission.REBOOT_RECOVERY | system_basic | system_grant | TRUE | 允许系统应用重启设备并进入恢复模式。 | +| ohos.permission.MANAGE_LOCAL_ACCOUNTS | system_basic | system_grant | TRUE | 允许应用管理本地用户账号。 | +| ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS | system_basic | system_grant | TRUE | 允许多个系统账号之间相互访问。 | +| ohos.permission.VIBRATE | normal | system_grant | TRUE | 允许应用控制马达振动。 | +| ohos.permission.CONNECT_IME_ABILITY | system_core | system_grant | TRUE | 允许绑定输入法Ability(InputMethodAbility)。 | +| ohos.permission.CONNECT_SCREEN_SAVER_ABILITY | system_core | system_grant | TRUE | 允许绑定屏保Ability(ScreenSaverAbility)。 | +| ohos.permission.READ_SCREEN_SAVER | system_basic | system_grant | TRUE | 允许应用查询屏保状态信息。 | +| ohos.permission.WRITE_SCREEN_SAVER | system_basic | system_grant | TRUE | 允许应用修改屏保状态信息。 | +| ohos.permission.SET_WALLPAPER | normal | system_grant | TRUE | 允许应用设置静态壁纸。 | +| ohos.permission.GET_WALLPAPER | system_basic | system_grant | TRUE | 允许应用读取壁纸文件。 | +| ohos.permission.CHANGE_ABILITY_ENABLED_STATE | system_basic | system_grant | TRUE | 允许改变应用或者组件的使能状态。 | +| ohos.permission.ACCESS_MISSIONS | system_basic | system_grant | TRUE | 允许应用访问任务栈信息。 | +| ohos.permission.CLEAN_BACKGROUND_PROCESSES | normal | system_grant | TRUE | 允许应用根据包名清理相关后台进程。 | +| ohos.permission.KEEP_BACKGROUND_RUNNING | normal | system_grant | TRUE | 允许Service Ability在后台持续运行。 | +| ohos.permission.UPDATE_CONFIGURATION | system_basic | system_grant | TRUE | 允许更新系统配置。 | +| ohos.permission.UPDATE_SYSTEM | system_basic | system_grant | TRUE | 允许调用升级接口。 | +| ohos.permission.FACTORY_RESET | system_basic | system_grant | TRUE | 允许调用回复出厂接口。 | +| ohos.permission.GRANT_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用为其他应用授予敏感权限。 | +| ohos.permission.REVOKE_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用撤销给其他应用授予的敏感信息。 | +| ohos.permission.GET_SENSITIVE_PERMISSIONS | system_core | system_grant | TRUE | 允许应用读取其他应用的敏感权限的状态。 | +| ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION | system_core | system_grant | TRUE | 允许应用跨用户对其他应用的属性进行设置。 | +| ohos.permission.LISTEN_BUNDLE_CHANGE | system_basic | system_grant | TRUE | 允许应用监听其他应用安装、更新、卸载状态的变化。 | +| ohos.permission.GET_BUNDLE_INFO | normal | system_grant | TRUE | 允许应用查询其他应用的信息。 | +| ohos.permission.ACCELEROMETER | normal | system_grant | TRUE | 允许应用读取加速度传感器的数据。 | +| ohos.permission.GYROSCOPE | normal | system_grant | TRUE | 允许应用读取陀螺仪传感器的数据。 | +| ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | system_grant | TRUE | 允许应用查询其他应用的信息。 | +| ohos.permission.INSTALL_BUNDLE | system_core | system_grant | TRUE | 允许应用安装、卸载其他应用。 | +| ohos.permission.MANAGE_SHORTCUTS | system_core | system_grant | TRUE | 允许应用查询其他应用的快捷方式信息、启动其他应用的快捷方式。 | +| ohos.permission.radio.ACCESS_FM_AM | system_core | system_grant | TRUE | 允许应用获取收音机相关服务。 | +| ohos.permission.SET_TELEPHONY_STATE | system_basic | system_grant | TRUE | 允许应用修改telephone的状态。 | +| ohos.permission.START_ABILIIES_FROM_BACKGROUND | system_basic | system_grant | TRUE | 允许应用在后台启动FA。 | +| ohos.permission.BUNDLE_ACTIVE_INFO | system_basic | system_grant | TRUE | 允许系统应用查询其他应用在前台或后台的运行时间。 | +| ohos.permission.START_INVISIBLE_ABILITY | system_core | system_grant | TRUE | 无论Ability是否可见,都允许应用进行调用。 | +| ohos.permission.sec.ACCESS_UDID | system_basic | system_grant | TRUE | 允许系统应用获取UDID。 | +| ohos.permission.LAUNCH_DATA_PRIVACY_CENTER | system_basic | system_grant | TRUE | 允许应用从其隐私声明页面跳转至"数据与隐私"页面。 | +| ohos.permission.MANAGE_MEDIA_RESOURCES | system_basic | system_grant | TRUE | 允许应用程序获取当前设备正在播放的媒体资源,并对其进行管理。 | +| ohos.permission.PUBLISH_AGENT_REMINDER | normal | system_grant | TRUE | 允许该应用使用后台代理提醒。 | +| ohos.permission.CONTROL_TASK_SYNC_ANIMATOR | system_core | system_grant | TRUE | 允许应用使用同步任务动画。 | +| ohos.permission.INPUT_MONITORING | system_core | system_grant | TRUE | 允许应用监听输入事件,仅系统签名应用可申请此权限。 | +| ohos.permission.MANAGE_MISSIONS | system_core | system_grant | TRUE | 允许用户管理元能力任务栈。 | +| ohos.permission.NOTIFICATION_CONTROLLER | system_core | system_grant | TRUE | 允许应用管理通知和订阅通知。 | +| ohos.permission.CONNECTIVITY_INTERNAL | system_basic | system_grant | TRUE | 允许应用程序获取网络相关的信息或修改网络相关设置。 | +| ohos.permission.SET_ABILITY_CONTROLLER | system_basic | system_grant | TRUE | 允许设置ability组件启动和停止控制权。 | +| ohos.permission.USE_USER_IDM | system_basic | system_grant | FALSE | 允许应用访问系统身份凭据信息。 | +| ohos.permission.MANAGE_USER_IDM | system_basic | system_grant | FALSE | 允许应用使用系统身份凭据管理能力进行口令、人脸、指纹等录入、修改、删除等操作。 | +| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | TRUE | 允许应用使用生物特征识别能力进行身份认证。 | +| ohos.permission.ACCESS_USER_AUTH_INTERNAL | system_basic | system_grant | FALSE | 允许应用使用系统身份认证能力进行用户身份认证或身份识别。 | +| ohos.permission.ACCESS_PIN_AUTH | system_basic | system_grant | FALSE | 允许应用使用口令输入接口,用于系统应用完成口令输入框绘制场景。 | +| ohos.permission.GET_RUNNING_INFO | system_basic | system_grant | TRUE | 允许应用获取运行态信息。 | +| ohos.permission.CLEAN_APPLICATION_DATA | system_basic | system_grant | TRUE | 允许应用清理应用数据。 | +| ohos.permission.RUNNING_STATE_OBSERVER | system_basic | system_grant | TRUE | 允许应用观察应用状态。 | +| ohos.permission.CAPTURE_SCREEN | system_core | system_grant | TRUE | 允许应用截取屏幕图像。 | +| ohos.permission.GET_WIFI_INFO | normal | system_grant | TRUE | 允许应用获取WLAN信息。 | +| ohos.permission.GET_WIFI_INFO_INTERNAL | system_core | system_grant | TRUE | 允许应用获取WLAN信息。 | +| ohos.permission.SET_WIFI_INFO | normal | system_grant | TRUE | 允许应用配置WLAN设备。 | +| ohos.permission.GET_WIFI_PEERS_MAC | system_core | system_grant | TRUE | 允许应用获取对端WLAN或者蓝牙设备的MAC地址。 | +| ohos.permission.GET_WIFI_LOCAL_MAC | system_basic | system_grant | TRUE | 允许应用获取本机WLAN或者蓝牙设备的MAC地址。 | +| ohos.permission.GET_WIFI_CONFIG | system_basic | system_grant | TRUE | 允许应用获取WLAN配置信息。 | +| ohos.permission.SET_WIFI_CONFIG | system_basic | system_grant | TRUE | 允许应用配置WLAN信息。 | +| ohos.permission.MANAGE_WIFI_CONNECTION | system_core | system_grant | TRUE | 允许应用管理WLAN连接。 | +| ohos.permission.MANAGE_WIFI_HOTSPOT | system_core | system_grant | TRUE | 允许应用开启或者关闭WLAN热点。 | +| ohos.permission.GET_ALL_APP_ACCOUNTS | system_core | system_grant | FALSE | 允许应用获取所有应用账户信息。 | +| ohos.permission.MANAGE_SECURE_SETTINGS | system_basic | system_grant | TRUE | 允许应用修改安全类系统设置。 | +| ohos.permission.READ_DFX_SYSEVENT | system_basic | system_grant | FALSE | 允许获取所有应用账号信息。 | +| ohos.permission.MANAGE_ADMIN | system_core | system_grant | TRUE | 允许应用激活设备管理员应用。 | +| ohos.permission.EDM_MANAGE_DATETIME | normal | system_grant | FALSE | 允许设备管理员应用设置系统时间。 | +| ohos.permission.NFC_TAG | normal | system_grant | FALSE | 允许应用读取Tag卡片。 | +| ohos.permission.NFC_CARD_EMULATION | normal | system_grant | FALSE | 允许应用实现卡模拟功能。 | +| ohos.permission.PERMISSION_USED_STATS | system_core | system_grant | TRUE | 允许系统应用访问权限使用记录。 | +| ohos.permission.NOTIFICATION_AGENT_CONTROLLER | system_core | system_grant | TRUE | 允许应用发送代理通知。 | +| ohos.permission.ANSWER_CALL | system_basic | user_grant | TRUE | 允许应用接听来电。 | +| ohos.permission.READ_CALENDAR | normal | user_grant | TRUE | 允许应用读取日历信息。 | +| ohos.permission.READ_CALL_LOG | system_basic | user_grant | TRUE | 允许应用读取通话记录。 | +| ohos.permission.READ_CELL_MESSAGES | system_basic | user_grant | TRUE | 允许应用读取设备收到的小区广播信息。 | +| ohos.permission.READ_CONTACTS | system_basic | user_grant | TRUE | 允许应用读取联系人数据。 | +| ohos.permission.READ_MESSAGES | system_basic | user_grant | TRUE | 允许应用读取短信息。 | +| ohos.permission.RECEIVE_MMS | system_basic | user_grant | TRUE | 允许应用接收和处理彩信。 | +| ohos.permission.RECEIVE_SMS | system_basic | user_grant | TRUE | 允许应用接收和处理短信。 | +| ohos.permission.RECEIVE_WAP_MESSAGES | system_basic | user_grant | TRUE | 允许应用接收和处理WAP消息。 | +| ohos.permission.MICROPHONE | normal | user_grant | TRUE | 允许应用使用麦克风。 | +| ohos.permission.SEND_MESSAGES | system_basic | user_grant | TRUE | 允许应用发送短信。 | +| ohos.permission.WRITE_CALENDAR | normal | user_grant | TRUE | 允许应用添加、移除或更改日历活动。 | +| ohos.permission.WRITE_CALL_LOG | system_basic | user_grant | TRUE | 允许应用添加、移除或更改通话记录。 | +| ohos.permission.WRITE_CONTACTS | system_basic | user_grant | TRUE | 允许应用添加、移除或更改联系人数据。 | +| ohos.permission.DISTRIBUTED_DATASYNC | normal | user_grant | TRUE | 允许不同设备间的数据交换。 | +| ohos.permission.MANAGE_VOICEMAIL | system_basic | user_grant | TRUE | 允许应用在语音信箱中留言 | +| ohos.permission.LOCATION_IN_BACKGROUND | normal | user_grant | FALSE | 允许应用在后台运行时获取设备位置信息。 | +| ohos.permission.LOCATION | normal | user_grant | TRUE | 允许应用获取设备位置信息。 | +| ohos.permission.MEDIA_LOCATION | normal | user_grant | TRUE | 允许应用访问用户媒体文件中的地理位置信息。 | +| ohos.permission.CAMERA | normal | user_grant | TRUE | 允许应用使用相机拍摄照片和录制视频。 | +| ohos.permission.READ_MEDIA | normal | user_grant | TRUE | 允许应用读取用户外部存储中的媒体文件信息。 | +| ohos.permission.WRITE_MEDIA | normal | user_grant | TRUE | 允许应用读写用户外部存储中的媒体文件信息。 | +| ohos.permission.ACTIVITY_MOTION | normal | user_grant | TRUE | 允许应用读取用户当前的运动状态。 | +| ohos.permission.READ_HEALTH_DATA | normal | user_grant | TRUE | 允许应用读取用户的健康数据。 | +| ohos.permission.GET_DEFAULT_APPLICATION | system_core | system_grant | TRUE | 允许应用查询默认应用。 | +| ohos.permission.SET_DEFAULT_APPLICATION | system_core | system_grant | TRUE | 允许应用设置、重置默认应用。 | +| ohos.permission.MANAGE_DISPOSED_APP_STATUS | system_core | system_grant | TRUE | 允许设置和查询应用的处置状态。 | \ No newline at end of file diff --git a/zh-cn/application-dev/security/userauth-guidelines.md b/zh-cn/application-dev/security/userauth-guidelines.md index 6d0d5e6e72360338e804feac8744e8f1c16c3f51..d30a71e607a2f8492b134e7ecc843347597ceac8 100644 --- a/zh-cn/application-dev/security/userauth-guidelines.md +++ b/zh-cn/application-dev/security/userauth-guidelines.md @@ -68,7 +68,7 @@ userIAM_userAuth模块提供了用户认证的相关方法,包括检测认证 try { console.info("auth onResult result = " + result); console.info("auth onResult extraInfo = " + JSON.stringify(extraInfo)); - if (result == 'SUCCESS') { + if (result == userIAM_userAuth.ResultCode.SUCCESS) { // 此处添加认证成功逻辑 } else { // 此处添加认证失败逻辑 diff --git a/zh-cn/application-dev/ui/Readme-CN.md b/zh-cn/application-dev/ui/Readme-CN.md index 461f345d688ad728e2c98499d03d151287116ef7..c7a2b79e0bccc29a38a355b4d4113e74882dbfbc 100755 --- a/zh-cn/application-dev/ui/Readme-CN.md +++ b/zh-cn/application-dev/ui/Readme-CN.md @@ -112,7 +112,7 @@ - [@Link](ts-component-states-link.md) - 管理应用程序的状态 - [应用程序的数据存储](ts-application-states-appstorage.md) - - [Ability数据存储](ui-ts-local-storage) + - [Ability数据存储](ui-ts-local-storage.md) - [持久化数据管理](ts-application-states-apis-persistentstorage.md) - [环境变量](ts-application-states-apis-environment.md) - 其他类目的状态管理 diff --git a/zh-cn/application-dev/ui/js-framework-resource-restriction.md b/zh-cn/application-dev/ui/js-framework-resource-restriction.md index 740c2e32f8c9ebf539f873059f8a81e7999632eb..7cdbbe2c52a8711c6160620dc64b3c189145d0d9 100644 --- a/zh-cn/application-dev/ui/js-framework-resource-restriction.md +++ b/zh-cn/application-dev/ui/js-framework-resource-restriction.md @@ -25,7 +25,7 @@ | 类型 | 含义与取值说明 | | -------- | -------- | -| 屏幕密度 | 表示设备的屏幕密度(单位为dpi),取值如下:
- ldpi:表示低密度屏幕(~120dpi)(0.75基准密度)
- mdpi:表示中密度屏幕(~160dpi)(基准密度)
- hdpi:表示高密度屏幕(~240dpi)(1.5基准密度)
- xhdpi:表示加高密度屏幕(~320dpi)(2.0基准密度)
- xxhdpi:表示超超高密度屏幕(~480dpi)(3.0基准密度)
- xxxhdpi:表示超超超高密度屏幕(~640dpi)(4.0基准密度) | +| 屏幕密度 | 表示设备的屏幕密度(单位为dpi),取值如下:
- ldpi:表示低密度屏幕(\~120dpi)(0.75基准密度)
- mdpi:表示中密度屏幕(\~160dpi)(基准密度)
- hdpi:表示高密度屏幕(\~240dpi)(1.5基准密度)
- xhdpi:表示加高密度屏幕(\~320dpi)(2.0基准密度)
- xxhdpi:表示超超高密度屏幕(\~480dpi)(3.0基准密度)
- xxxhdpi:表示超超超高密度屏幕(\~640dpi)(4.0基准密度) | ## 限定词与设备状态的匹配规则 @@ -41,7 +41,7 @@ | 属性 | 类型 | 描述 | | -------- | -------- | -------- | -| $r | (key: string) => string | 获取资源限定下具体的资源内容。例如:this.$r('strings.hello')。
参数说明:
- key:定义在资源限定文件中的键值,如strings.hello。
| +| $r | (key: string) => string | 获取资源限定下具体的资源内容。例如:this.$r('strings.hello')。
参数说明:
- key:定义在资源限定文件中的键值,如strings.hello。 | **res-defaults.json示例:**
diff --git a/zh-cn/application-dev/ui/ts-component-based-styles.md b/zh-cn/application-dev/ui/ts-component-based-styles.md index 7bf23b92d5ad1c7b4176c1bc4d6206e39c97d310..c655aaa5e925637bfc945f992e7fa1867d200c3a 100644 --- a/zh-cn/application-dev/ui/ts-component-based-styles.md +++ b/zh-cn/application-dev/ui/ts-component-based-styles.md @@ -48,7 +48,7 @@ struct FancyUse { @Entry @Component struct FancyUse { - @Styles function componentFancy() { + @Styles componentFancy() { .width(50) .height(50) } diff --git a/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md b/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md index d45ce8cea608cd91b59d322f962e7e6211f7c498..6cdb3adfc3b74f1799105112407f875d0694bd0c 100755 --- a/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md +++ b/zh-cn/contribute/OpenHarmony-cpp-coding-style-guide.md @@ -1,14 +1,14 @@ # C++语言编程规范 ## 目的 -规则并不是完美的,通过禁止在特定情况下有用的特性,可能会对代码实现造成影响。但是我们制定规则的目的“为了大多数程序员可以得到更多的好处”, 如果在团队运作中认为某个规则无法遵循,希望可以共同改进该规则。 -参考该规范之前,希望您具有相应的C++语言基础能力,而不是通过该文档来学习C++语言。 +规则并不是完美的,通过禁止在特定情况下有用的特性,可能会对代码实现造成影响。但是我们制定规则的目的“为了大多数程序员可以得到更多的好处”, 如果在团队运作中认为某个规则无法遵循,希望可以共同改进该规则。 +参考该规范之前,希望您具有相应的C++语言基础能力,而不是通过该文档来学习C++语言。 1. 了解C++语言的ISO标准; 2. 熟知C++语言的基本语言特性,包括C++ 03/11/14/17相关特性; 3. 了解C++语言的标准库; ## 总体原则 -代码需要在保证功能正确的前提下,满足**可读、可维护、安全、可靠、可测试、高效、可移植**的特征要求。 +代码需要在保证功能正确的前提下,满足**可读、可维护、安全、可靠、可测试、高效、可移植**的特征要求。 ## 重点关注 1. 约定C++语言的编程风格,比如命名,排版等。 @@ -31,8 +31,8 @@ 在不违背总体原则,经过充分考虑,有充足的理由的前提下,可以适当违背规范中约定。 例外破坏了代码的一致性,请尽量避免。'规则'的例外应该是极少的。 -下列情况,应风格一致性原则优先: -**修改外部开源代码、第三方代码时,应该遵守开源代码、第三方代码已有规范,保持风格统一。** +下列情况,应风格一致性原则优先: +**修改外部开源代码、第三方代码时,应该遵守开源代码、第三方代码已有规范,保持风格统一。** # 2 命名 ## 通用命名 @@ -112,11 +112,11 @@ enum UrlTableErrors { ... ```cpp // namespace namespace OsUtils { - + namespace FileUtils { - + } - + } ``` @@ -153,7 +153,7 @@ int g_activeConnectCount; void Func() { - static int packetCount = 0; + static int packetCount = 0; ... } ``` @@ -253,7 +253,7 @@ int Foo(int a) class MyClass { public: MyClass() : value_(0) {} - + private: int value_; }; @@ -305,7 +305,7 @@ ReturnType result = FunctionName(paramName1, paramName2, // Good:保持与上方参数对齐 paramName3); -ReturnType result = FunctionName(paramName1, paramName2, +ReturnType result = FunctionName(paramName1, paramName2, paramName3, paramName4, paramName5); // Good:参数换行,4 空格缩进 ReturnType result = VeryVeryVeryLongFunctionName( // 行宽不满足第1个参数,直接换行 @@ -340,7 +340,7 @@ if (objectIsNotExist) { // Good:单行条件语句也加大括号 如下是正确的写法: ```cpp -if (someConditions) { +if (someConditions) { DoSomething(); ... } else { // Good: else 与 if 在不同行 @@ -507,40 +507,40 @@ int&p = i; // Bad 编译预处理的"#"统一放在行首,即使编译预处理的代码是嵌入在函数体中的,"#"也应该放在行首。 ### 规则3.13.2 避免使用宏 -宏会忽略作用域,类型系统以及各种规则,容易引发问题。应尽量避免使用宏定义,如果必须使用宏,要保证证宏名的唯一性。 -在C++中,有许多方式来避免使用宏: -- 用const或enum定义易于理解的常量 -- 用namespace避免名字冲突 -- 用inline函数避免函数调用的开销 -- 用template函数来处理多种类型 +宏会忽略作用域,类型系统以及各种规则,容易引发问题。应尽量避免使用宏定义,如果必须使用宏,要保证证宏名的唯一性。 +在C++中,有许多方式来避免使用宏: +- 用const或enum定义易于理解的常量 +- 用namespace避免名字冲突 +- 用inline函数避免函数调用的开销 +- 用template函数来处理多种类型 在文件头保护宏、条件编译、日志记录等必要场景中可以使用宏。 ### 规则3.13.3 禁止使用宏来表示常量 -宏是简单的文本替换,在预处理阶段完成,运行报错时直接报相应的值;跟踪调试时也是显示值,而不是宏名; 宏没有类型检查,不宏全; 宏没有作用域。 +宏是简单的文本替换,在预处理阶段完成,运行报错时直接报相应的值;跟踪调试时也是显示值,而不是宏名; 宏没有类型检查,不安全; 宏没有作用域。 ### 规则3.13.4 禁止使用函数式宏 宏义函数式宏前,应考虑能否用函数替代。对于可替代场景,建议用函数替代宏。 -函数式宏的缺点如下: -- 函数式宏缺乏类型检查,不如函数调用检查严格 -- 宏展开时宏参数不求值,可能会产生非预期结果 -- 宏没有独产的作用域 +函数式宏的缺点如下: +- 函数式宏缺乏类型检查,不如函数调用检查严格 +- 宏展开时宏参数不求值,可能会产生非预期结果 +- 宏没有独立的作用域 - 宏的技巧性太强,例如#的用法和无处不在的括号,影响可读性 -- 在特定场景中必须用编译器对宏的扩展语法,如GCC的statement expression,影响可移植性 -- 宏在预编译阶段展开后,在期后编译、链接和调试时都不可见;而且包含多行的宏会展开为一行。函数式宏难以调试、难以打断点,不利于定位问题 -- 对于包含大量语句的宏,在每个调用点都要展开。如果调用点很多,会造成代码空间的膨胀 +- 在特定场景中必须用编译器对宏的扩展语法,如GCC的statement expression,影响可移植性 +- 宏在预编译阶段展开后,在期后编译、链接和调试时都不可见;而且包含多行的宏会展开为一行。函数式宏难以调试、难以打断点,不利于定位问题 +- 对于包含大量语句的宏,在每个调用点都要展开。如果调用点很多,会造成代码空间的膨胀 函数没有宏的上述缺点。但是,函数相比宏,最大的劣势是执行效率不高(增加函数调用的开销和编译器优化的难度)。 为此,可以在必要时使用内联函数。内联函数跟宏类似,也是在调用点展开。不同之处在于内联函数是在编译时展开。 - -内联函数兼具函数和宏的优点: -- 内联函数执行严格的类型检查 + +内联函数兼具函数和宏的优点: +- 内联函数执行严格的类型检查 - 内联函数的参数求值只会进行一次 - 内联函数就地展开,没有函数调用的开销 -- 内联函数比函数优化得更好 -对于性能要求高的产品代码,可以考虑用内联函数代替函数。 +- 内联函数比函数优化得更好 +对于性能要求高的产品代码,可以考虑用内联函数代替函数。 -例外: -在日志记录场景中,需要通过函数式宏保持调用点的文件名(__FILE__)、行号(__LINE__)等信息。 +例外: +在日志记录场景中,需要通过函数式宏保持调用点的文件名(__FILE__)、行号(__LINE__)等信息。 ## 空格和空行 ### 规则3.14.1 水平空格应该突出关键字和重要信息,避免不必要的留白 @@ -647,19 +647,19 @@ int MyClass::GetValue() const {} // Good: 对于成员函数定义,不要留 // Good: 类的派生需要留有空格 class Sub : public Base { - + }; // 构造函数初始化列表需要留有空格 -MyClass::MyClass(int var) : someVar_(var) +MyClass::MyClass(int var) : someVar_(var) { DoSomething(); } // 位域表示也留有空格 struct XX { - char a : 4; - char b : 5; + char a : 4; + char b : 5; char c : 4; }; ``` @@ -733,7 +733,7 @@ public: // 注意没有缩进 ~MyClass() {} void SomeFunction(); - void SomeFunctionThatDoesNothing() + void SomeFunctionThatDoesNothing() { } @@ -754,7 +754,7 @@ private: ### 规则3.15.2 构造函数初始化列表放在同一行或按四格缩进并排多行 ```cpp // 如果所有变量能放在同一行: -MyClass::MyClass(int var) : someVar_(var) +MyClass::MyClass(int var) : someVar_(var) { DoSomething(); } @@ -770,28 +770,28 @@ MyClass::MyClass(int var) // 如果初始化列表需要置于多行, 需要逐行对齐 MyClass::MyClass(int var) : someVar_(var), // 缩进4个空格 - someOtherVar_(var + 1) -{ + someOtherVar_(var + 1) +{ DoSomething(); } ``` # 4 注释 -一般的,尽量通过清晰的架构逻辑,好的符号命名来提高代码可读性;需要的时候,才辅以注释说明。 +一般的,尽量通过清晰的架构逻辑,好的符号命名来提高代码可读性;需要的时候,才辅以注释说明。 注释是为了帮助阅读者快速读懂代码,所以要从读者的角度出发,**按需注释**。 注释内容要简洁、明了、无二义性,信息全面且不冗余。 -**注释跟代码一样重要。** -写注释时要换位思考,用注释去表达此时读者真正需要的信息。在代码的功能、意图层次上进行注释,即注释解释代码难以表达的意图,不要重复代码信息。 +**注释跟代码一样重要。** +写注释时要换位思考,用注释去表达此时读者真正需要的信息。在代码的功能、意图层次上进行注释,即注释解释代码难以表达的意图,不要重复代码信息。 修改代码时,也要保证其相关注释的一致性。只改代码,不改注释是一种不文明行为,破坏了代码与注释的一致性,让阅读者迷惑、费解,甚至误解。 -使用英文进行注释。 +使用英文进行注释。 ## 注释风格 -在 C++ 代码中,使用 `/*` `*/`和 `//` 都是可以的。 -按注释的目的和位置,注释可分为不同的类型,如文件头注释、函数头注释、代码注释等等; +在 C++ 代码中,使用 `/*` `*/`和 `//` 都是可以的。 +按注释的目的和位置,注释可分为不同的类型,如文件头注释、函数头注释、代码注释等等; 同一类型的注释应该保持统一的风格。 注意:本文示例代码中,大量使用 '//' 后置注释只是为了更精确的描述问题,并不代表这种注释风格更好。 @@ -948,7 +948,7 @@ const int ANOTHER_CONST = 200; /* 上下对齐时,与左侧代码保持间 示例: ```cpp -// Foo.h +// Foo.h #ifndef FOO_H #define FOO_H @@ -957,7 +957,7 @@ class Foo { public: Foo(); void Fun(); - + private: int value_; }; @@ -985,7 +985,7 @@ void Foo::Fun() ## 头文件依赖 ### 规则5.2.1 禁止头文件循环依赖 -头文件循环依赖,指 a.h 包含 b.h,b.h 包含 c.h,c.h 包含 a.h, 导致任何一个头文件修改,都导致所有包含了a.h/b.h/c.h的代码全部重新编译一遍。 +头文件循环依赖,指 a.h 包含 b.h,b.h 包含 c.h,c.h 包含 a.h, 导致任何一个头文件修改,都导致所有包含了a.h/b.h/c.h的代码全部重新编译一遍。 而如果是单向依赖,如a.h包含b.h,b.h包含c.h,而c.h不包含任何头文件,则修改a.h不会导致包含了b.h/c.h的源代码重新编译。 头文件循环依赖直接体现了架构设计上的不合理,可通过优化架构去避免。 @@ -1018,7 +1018,7 @@ void Foo::Fun() ```cpp extern int Fun(); // Bad: 通过extern的方式使用外部函数 -void Bar() +void Bar() { int i = Fun(); ... @@ -1027,7 +1027,7 @@ void Bar() // b.cpp内容 ```cpp -int Fun() +int Fun() { // Do something } @@ -1038,7 +1038,7 @@ int Fun() ```cpp #include "b.h" // Good: 通过包含头文件的方式使用其他.cpp提供的接口 -void Bar() +void Bar() { int i = Fun(); ... @@ -1052,7 +1052,7 @@ int Fun(); // b.cpp内容 ```cpp -int Fun() +int Fun() { // Do something } @@ -1150,7 +1150,7 @@ namespace { void Foo::Fun() { int i = MAX_COUNT; - + InternalFun(); } @@ -1177,14 +1177,14 @@ using namespace NamespaceB; void G() { - Fun(1); + Fun(1); } ``` ```cpp // 源代码a.cpp #include "a.h" -using namespace NamespaceA; +using namespace NamespaceA; #include "b.h" void main() @@ -1267,12 +1267,12 @@ public: static Counter counter; return counter; } // 单实例实现简单举例 - - void Increase() + + void Increase() { value_++; } - + void Print() const { std::cout << value_ << std::endl; @@ -1305,7 +1305,7 @@ Counter::GetInstance().Print(); 构造,拷贝,移动和析构函数提供了对象的生命周期管理方法: - 构造函数(constructor): `X()` - 拷贝构造函数(copy constructor):`X(const X&)` -- 拷贝赋值操作符(copy assignment):`operator=(const X&)` +- 拷贝赋值操作符(copy assignment):`operator=(const X&)` - 移动构造函数(move constructor):`X(X&&)` *C++11以后提供* - 移动赋值操作符(move assignment):`operator=(X&&)` *C++11以后提供* - 析构函数(destructor):`~X()` @@ -1365,7 +1365,7 @@ public: { msgBuffer_ = nullptr; // Bad,不推荐在构造函数中赋值 } - + private: unsigned int msgID_{0}; // Good,C++11中使用 unsigned int msgLength_; @@ -1414,7 +1414,7 @@ private: Foo& operator=(const Foo&); }; ``` -2. 使用C++11提供的delete, 请参见后面现代C++的相关章节。 +2. 使用C++11提供的delete, 请参见后面现代C++的相关章节。 3. 推荐继承NoCopyable、NoMovable,禁止使用DISALLOW_COPY_AND_MOVE,DISALLOW_COPY,DISALLOW_MOVE等宏。 @@ -1502,8 +1502,8 @@ public: 示例:类Base是基类,Sub是派生类 ```cpp -class Base { -public: +class Base { +public: Base(); virtual void Log() = 0; // 不同的派生类调用不同的日志文件 }; @@ -1511,11 +1511,11 @@ public: Base::Base() // 基类构造函数 { Log(); // 调用虚函数Log -} +} -class Sub : public Base { +class Sub : public Base { public: - virtual void Log(); + virtual void Log(); }; ``` @@ -1525,13 +1525,13 @@ public: 同样的道理也适用于析构函数。 ### 规则7.1.7 多态基类中的拷贝构造函数、拷贝赋值操作符、移动构造函数、移动赋值操作符必须为非public函数或者为delete函数 -如果报一个派生类对象直接赋值给基类对象,会发生切片,只拷贝或者移动了基类部分,损害了多态行为。 +如果报一个派生类对象直接赋值给基类对象,会发生切片,只拷贝或者移动了基类部分,损害了多态行为。 【反例】 如下代码中,基类没有定义拷贝构造函数或拷贝赋值操作符,编译器会自动生成这两个特殊成员函数, 如果派生类对象赋值给基类对象时就发生切片。可以将此例中的拷贝构造函数和拷贝赋值操作符声明为delete,编译器可检查出此类赋值行为。 ```cpp -class Base { -public: +class Base { +public: Base() = default; virtual ~Base() = default; ... @@ -1565,8 +1565,8 @@ Foo(d); // 传入的是派生类对象 class Base { public: virtual std::string getVersion() = 0; - - ~Base() + + ~Base() { std::cout << "~Base" << std::endl; } @@ -1577,15 +1577,15 @@ public: class Sub : public Base { public: Sub() : numbers_(nullptr) - { + { } - + ~Sub() { delete[] numbers_; std::cout << "~Sub" << std::endl; } - + int Init() { const size_t numberCount = 100; @@ -1593,12 +1593,12 @@ public: if (numbers_ == nullptr) { return -1; } - + ... } - std::string getVersion() - { + std::string getVersion() + { return std::string("hello!"); } private: @@ -1616,7 +1616,7 @@ int main(int argc, char* args[]) } ``` 由于基类Base的析构函数没有声明为virtual,当对象被销毁时,只会调用基类的析构函数,不会调用派生类Sub的析构函数,导致内存泄漏。 -例外: +例外: NoCopyable、NoMovable这种没有任何行为,仅仅用来做标识符的类,可以不定义虚析构也不定义final。 ### 规则7.2.2 禁止虚函数使用缺省参数值 @@ -1629,7 +1629,7 @@ public: { std::cout << text << std::endl; } - + virtual ~Base(){} }; @@ -1637,9 +1637,9 @@ class Sub : public Base { public: virtual void Display(const std::string& text = "Sub!") { - std::cout << text << std::endl; + std::cout << text << std::endl; } - + virtual ~Sub(){} }; @@ -1647,12 +1647,12 @@ int main() { Base* base = new Sub(); Sub* sub = new Sub(); - + ... - + base->Display(); // 程序输出结果: Base! 而期望输出:Sub! sub->Display(); // 程序输出结果: Sub! - + delete base; delete sub; return 0; @@ -1669,15 +1669,15 @@ public: void Fun(); }; -class Sub : public Base { +class Sub : public Base { public: void Fun(); }; -Sub* sub = new Sub(); +Sub* sub = new Sub(); Base* base = sub; -sub->Fun(); // 调用子类的Fun +sub->Fun(); // 调用子类的Fun base->Fun(); // 调用父类的Fun //... @@ -1719,7 +1719,7 @@ class basic_istream {}; class basic_ostream {}; class basic_iostream : public basic_istream, public basic_ostream { - + }; ``` @@ -1894,7 +1894,7 @@ enum SessionState { ```cpp enum RTCPType { RTCP_SR = 200, - RTCP_MIN_TYPE = RTCP_SR, + RTCP_MIN_TYPE = RTCP_SR, RTCP_RR = 201, RTCP_SDES = 202, RTCP_BYE = 203, @@ -1904,7 +1904,7 @@ enum RTCPType { RTCP_XR = 207, RTCP_RSI = 208, RTCP_PUBPORTS = 209, - RTCP_MAX_TYPE = RTCP_PUBPORTS + RTCP_MAX_TYPE = RTCP_PUBPORTS }; ``` @@ -2006,7 +2006,7 @@ x = Func(i, i); 特例: 如果switch条件变量是枚举类型,并且 case 分支覆盖了所有取值,则加上default分支处理有些多余。 -现代编译器都具备检查是否在switch语句中遗漏了某些枚举值的case分支的能力,会有相应的warning提示。 +现代编译器都具备检查是否在switch语句中遗漏了某些枚举值的case分支的能力,会有相应的warning提示。 ```cpp enum Color { @@ -2031,11 +2031,11 @@ switch (color) { 应当按人的正常阅读、表达习惯,将常量放右边。写成如下方式: ```cpp if (value == MAX) { - + } if (value < MAX) { - + } ``` 也有特殊情况,如:`if (MIN < value && value < MAX)` 用来描述区间时,前半段是常量在左的。 @@ -2102,7 +2102,7 @@ C++提供的类型转换操作比C风格更有针对性,更易读,也更加 ```cpp // 不好的例子 -const int i = 1024; +const int i = 1024; int* p = const_cast(&i); *p = 2048; // 未定义行为 ``` @@ -2113,7 +2113,7 @@ class Foo { public: Foo() : i(3) {} - void Fun(int v) + void Fun(int v) { i = v; } @@ -2180,12 +2180,12 @@ public: { lock_.Acquire(); } - + ~LockGuard() { lock_.Release(); } - + private: LockType lock_; }; @@ -2199,7 +2199,7 @@ bool Update() } else { // 操作数据 } - + return true; } ``` @@ -2317,7 +2317,7 @@ class Foo { public: Foo(int length) : dataLength_(length) {} private: - const int dataLength_; + const int dataLength_; }; ``` @@ -2385,18 +2385,18 @@ C++提供了强大的泛型编程的机制,能够实现非常灵活简洁的 4. 模板如果使用不当,会导致运行时代码过度膨胀。 5. 模板代码难以修改和重构。模板的代码会在很多上下文里面扩展开来, 所以很难确认重构对所有的这些展开的代码有用。 -所以,OpenHarmony大部分部件禁止模板编程,仅有 __少数部件__ 可以使用泛型编程,并且开发的模板要有详细的注释。 -例外: +所以,OpenHarmony大部分部件禁止模板编程,仅有 __少数部件__ 可以使用泛型编程,并且开发的模板要有详细的注释。 +例外: 1. stl适配层可以使用模板 ## 宏 在C++语言中,我们强烈建议尽可能少使用复杂的宏 -- 对于常量定义,请按照前面章节所述,使用const或者枚举; +- 对于常量定义,请按照前面章节所述,使用const或者枚举; - 对于宏函数,尽可能简单,并且遵循下面的原则,并且优先使用内联函数,模板函数等进行替换。 ```cpp // 不推荐使用宏函数 -#define SQUARE(a, b) ((a) * (b)) +#define SQUARE(a, b) ((a) * (b)) // 请使用模板函数,内联函数等来替换。 template T Square(T a, T b) { return a * b; } @@ -2655,7 +2655,7 @@ void func() **理由** 智能指针会自动释放对象资源避免资源泄露,但会带额外的资源开销。如:智能指针自动生成的类、构造和析构的开销、内存占用多等。 -单例、类的成员等对象的所有权不会被多方持有的情况,仅在类析构中释放资源即可。不应该使用智能指针增加额外的开销。 +单例、类的成员等对象的所有权不会被多方持有的情况,仅在类析构中释放资源即可。不应该使用智能指针增加额外的开销。 **示例** @@ -2664,7 +2664,7 @@ class Foo; class Base { public: Base() {} - virtual ~Base() + virtual ~Base() { delete foo_; } diff --git a/zh-cn/device-dev/driver/driver-peripherals-face_auth-des.md b/zh-cn/device-dev/driver/driver-peripherals-face_auth-des.md index 5118cc2020ce544e48ea847f82c1d6f3469670d2..313286f1b44fc71df356d05eb901ec602dcbb495 100644 --- a/zh-cn/device-dev/driver/driver-peripherals-face_auth-des.md +++ b/zh-cn/device-dev/driver/driver-peripherals-face_auth-des.md @@ -438,7 +438,7 @@ export default { try { console.info("auth onResult result = " + result); console.info("auth onResult extraInfo = " + JSON.stringify(extraInfo)); - if (result == 'SUCCESS') { + if (result == userIAM_userAuth.ResultCode.SUCCESS) { // 此处添加认证成功逻辑 } else { // 此处添加认证失败逻辑 @@ -473,7 +473,7 @@ export default { } }); let cancelCode = this.auth.cancel(contextId); - if (cancelCode == userIAM_userAuth.Result.SUCCESS) { + if (cancelCode == userIAM_userAuth.ResultCode.SUCCESS) { console.info("cancel auth success"); } else { console.error("cancel auth fail"); diff --git a/zh-cn/device-dev/porting/Readme-CN.md b/zh-cn/device-dev/porting/Readme-CN.md index 80b56ae99e0caa842ec2efea58fab1ba50695da3..8bc2b0e6820573635290667b8f21f438bcac6e7c 100644 --- a/zh-cn/device-dev/porting/Readme-CN.md +++ b/zh-cn/device-dev/porting/Readme-CN.md @@ -62,5 +62,7 @@ repo init -u https://gitee.com/openharmony-sig/manifest.git -b master -m devboar - 轻量系统芯片移植案例 - [带屏解决方案之恒玄芯片移植案例](porting-bes2600w-on-minisystem-display-demo.md) - [Combo解决方案之ASR芯片移植案例](porting-asr582x-combo-demo.md) + - [物联网解决方案之芯海cst85芯片移植案例](porting-cst85f01-combo-demo.md) - [轻量系统STM32F407芯片移植案例](porting-stm32f407-on-minisystem-eth.md) + - [Combo解决方案之W800芯片移植案例](porting-w800-combo-demo.md) diff --git a/zh-cn/device-dev/porting/figures/cst85_hb_set.png b/zh-cn/device-dev/porting/figures/cst85_hb_set.png new file mode 100755 index 0000000000000000000000000000000000000000..31f67d4b96a221ada999addbf6fe9f0daa99ff4b Binary files /dev/null and b/zh-cn/device-dev/porting/figures/cst85_hb_set.png differ diff --git a/zh-cn/device-dev/porting/figures/cst85_kconfig.png b/zh-cn/device-dev/porting/figures/cst85_kconfig.png new file mode 100755 index 0000000000000000000000000000000000000000..fb5f517615a6966541b507fddf0afb7f3d70fe51 Binary files /dev/null and b/zh-cn/device-dev/porting/figures/cst85_kconfig.png differ diff --git a/zh-cn/device-dev/porting/figures/w800_select.png b/zh-cn/device-dev/porting/figures/w800_select.png new file mode 100755 index 0000000000000000000000000000000000000000..a6b545820a4a07a106c9879a8ab8fe20586a0d0f Binary files /dev/null and b/zh-cn/device-dev/porting/figures/w800_select.png differ diff --git a/zh-cn/device-dev/porting/porting-cst85f01-combo-demo.md b/zh-cn/device-dev/porting/porting-cst85f01-combo-demo.md new file mode 100755 index 0000000000000000000000000000000000000000..f95e4b9d96e8f7383e4025469cb59803736e9a81 --- /dev/null +++ b/zh-cn/device-dev/porting/porting-cst85f01-combo-demo.md @@ -0,0 +1,856 @@ + + +# 物联网解决方案之芯海cst85芯片移植案例 + +本文介绍基于芯海cst85芯片的cst85_wblink开发板移植OpenHarmony LiteOS-M轻量系统的移植案例。开发了Wi-Fi连接样例和XTS测试样例,同时实现了wifi_lite, lwip, startup, utils, xts, hdf等部件基于OpenHarmony LiteOS-M内核的适配。移植架构上采用Board和Soc分离的方案,工具链采用NewLib C库,LiteOS-M内核编译采用gn结合Kconfig图形化配置的方式。 + +## 编译构建适配 + +### 目录规划 + +本方案目录结构使用[Board和SoC解耦的设计思路](https://gitee.com/openharmony-sig/sig-content/blob/master/devboard/docs/board-soc-arch-design.md): + +``` +device +├── board --- 单板厂商目录 +│   └── chipsea --- 单板厂商名字:芯海科技 +│   └── cst85_wblink --- 单板名:cst85_wblink +└── soc --- SoC厂商目录 + └── chipsea --- SoC厂商名字:芯海科技 + └── cst85 --- SoC Series名:cst85 +``` + +产品样例目录规划为: + +``` +vendor +└── chipsea --- 开发产品样例厂商目录,芯海科技的产品样例 + ├── iotlink_demo --- 产品名字:Wi-Fi样例 + └── xts_demo --- 产品名字:XTS测试样例 +``` + +### 产品定义 +以vendor/chipsea/iotlink_demo为例,这里描述了产品使用的内核、单板、子系统等信息。其中,内核、单板型号、单板厂商需要提前规划好,也是预编译指令所关注的信息。这里填入的信息与规划的目录相对应。例如: +``` +{ + "product_name": "iotlink_demo", --- 产品名 + "version": "3.0", --- 系统版本:3.0 + "device_company": "chipsea", --- 单板厂商:chipsea + "board": "cst85_wblink", --- 单板名:cst85_wblink + "kernel_type": "liteos_m", --- 内核类型:liteos_m + "kernel_version": "3.0.0", --- 内核版本:3.0.0 + "subsystems": [] --- 子系统 +} +``` + +### 单板配置 +在产品定义关联到的目录下,以/device/board/chipsea/cst85_wblink为例,需要在liteos_m目录下放置config.gni文件,这个配置文件用于描述该单板的信息,包括cpu, toolchain, kernel, compile_flags等。例如: +``` +# 内核类型 +kernel_type = "liteos_m" + +# 内核版本 +kernel_version = "3.0.0" + +# 单板CPU类型 +board_cpu = "cortex-m4" + +# 工具链,这里使用arm-none-eabi +board_toolchain = "arm-none-eabi" + +# 工具链路径,可以使用系统路径,填"",也可以自定义,如下: +board_toolchain_path = "" + +# 单板相关的编译参数 +board_cflags = [] + +# 单板相关的链接参数 +board_ld_flags = [] + +# 单板相关的头文件 +board_include_dirs = [] + +# Board adapter dir for OHOS components. +board_adapter_dir = "${ohos_root_path}device/soc/chipsea" +``` + +### 预编译 +在正确配置好产品的目录、产品定义、单板配置后,在工程根目录下输入预编译指令hb set,在显示的列表中就可以找到相关的产品。 + +![ohos_config.json](figures/cst85_hb_set.png) + +选择好产品后,输入回车就会在根目录下自动生成`ohos_config.json`文件,这里会列出待编译的产品信息: + +``` +{ + "root_path": "/home/openharmony", + "board": "cst85_wblink", + "kernel": "liteos_m", + "product": "iotlink_demo", + "product_path": "/home/openharmony/vendor/chipsea/iotlink_demo", + "device_path": "/home/openharmony/device/board/chipsea/cst85_wblink/liteos_m", + "device_company": "chipsea", + "os_level": "mini", + "version": "3.0", + "patch_cache": null, + "product_json": "/home/openharmony/vendor/chipsea/iotlink_demo/config.json", + "target_cpu": null, + "target_os": null, + "out_path": "/home/openharmony/out/cst85_wblink/iotlink_demo" +} +``` + + +## 内核移植 + +### Kconfig适配 + +在//kernel/liteos_m的编译中,需要在相应的单板以及SoC目录下使用`Kconfig`文件进行配置。我们分别来看一下单板和Soc目录下的相关配置。 + +单板目录的`Kconfig`,以`//device/board/chipsea`为例: +``` +device/board/chipsea +├── cst85_wblink --- cst85_wblink单板配置目录 +│   ├── Kconfig.liteos_m.board --- 单板的配置选项 +│   ├── Kconfig.liteos_m.defconfig.board --- 单板的默认配置项 +│   └── liteos_m +│   └── config.gni --- 单板的配置文件 +├── Kconfig.liteos_m.boards --- 单板厂商下Boards配置信息 +└── Kconfig.liteos_m.defconfig.boards --- 单板厂商下Boards配置信息 +``` + +在 `cst85_wblink/Kconfig.liteos_m.board`中,配置只有SOC_CST85F01被选后,BOARD_CST85_WBLINK才可被选: +``` +config BOARD_CST85_WBLINK + bool "select board cst85_wblink" + depends on SOC_CST85F01 +``` + +SoC目录的`Kconfig`,以`//device/soc/chipsea`为例: + +``` +device/soc/chipsea/ +├── cst85 --- cst85系列 +│   ├── Kconfig.liteos_m.defconfig.cst85f01 --- cst85f01芯片默认配置 +│   ├── Kconfig.liteos_m.defconfig.series --- cst85系列芯片默认配置 +│   ├── Kconfig.liteos_m.series --- cst85系列配置 +│   └── Kconfig.liteos_m.soc --- cst85芯片配置 +├── Kconfig.liteos_m.defconfig --- SoC默认配置 +├── Kconfig.liteos_m.series --- Series配置 +└── Kconfig.liteos_m.soc --- SoC配置 +``` + +`cst85/Kconfig.liteos_m.series`配置如下: + +``` +config SOC_SERIES_CST85 + bool "Chipsea CST85 Series" + select ARM + select SOC_COMPANY_CHIPSEA + select CPU_CORTEX_M4 + help + Enable support for Chipsea CST85 series +``` + +只有选择了 SOC_SERIES_CST85,在 cst85/Kconfig.liteos_m.soc中才可以选择SOC_CST85F01: + +``` +choice + prompt "Chipsea CST85 series SoC" + depends on SOC_SERIES_CST85 + +config SOC_CST85F01 + bool "SoC CST85F01" + +endchoice +``` + +综上所述,要编译单板BOARD_CST85_WBLINK,则要分别选中:SOC_COMPANY_CHIPSEA、SOC_SERIES_CST85、SOC_CST85F01,可以在`kernel/liteos_m`中执行`make menuconfig`进行选择配置。 + +![cst85_kconfig.json](figures/cst85_kconfig.png) + +配置后的文件会默认保存在`//vendor/chipsea/iotlink_demo/kernel_configs/debug.config`,也可以直接填写debug.config: + +``` +LOSCFG_SOC_SERIES_CST85=y +LOSCFG_KERNEL_BACKTRACE=y +LOSCFG_KERNEL_CPUP=y +LOSCFG_PLATFORM_EXC=y +``` + +### 模块化编译 + +`Board`和`SoC`的编译采用模块化的编译方法,从`kernel/liteos_m/BUILD.gn`开始逐级向下递增。本方案的适配过程如下: + +1. 在`//device/board/chipsea`中新建文件BUILD.gn,新增内容如下: + + ``` + if (ohos_kernel_type == "liteos_m") { + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + module_group(module_name) { + modules = [ + "cst85_wblink" + ] + } + } + ``` + + 在上述BUILD.gn中,cst85_wblink即是按目录层级组织的模块名。 + +2. 在`//device/soc/chipsea`中,使用同样的方法,新建文件BUILD.gn,按目录层级组织,新增内容如下: + + ``` + if (ohos_kernel_type == "liteos_m") { + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + module_group(module_name) { + modules = [ + "cst85", + "hals", + ] + } + } + ``` + +3. 在`//device/soc/chipsea`各个层级模块下,同样新增文件BUILD.gn,将该层级模块加入编译,以`//device/soc/chipsea/cst85/liteos_m/sdk/bsp/arch/BUILD.gn`为例: + + ``` + import("//kernel/liteos_m/liteos.gni") + module_name = "sdk_bsp_arch" + + kernel_module(module_name) { + sources = [ + "boot/armgcc_4_8/boot_startup.S", + "boot/armgcc_4_8/exception.S", + "boot/fault_handler.c", + + "cmsis/cmsis_nvic.c", + + "ll/ll.c", + + "main/arch_main.c", + ] + + include_dirs = [ + "boot", + "boot/armgcc_4_8", + ] + + deps = [ + "//base/startup/bootstrap_lite/services/source:bootstrap", + ] + } + + config("public") { + include_dirs = [ + ".", + "boot", + "compiler", + "cmsis", + "ll", + ] + } + ``` + + 其中,为了组织链接以及一些编译选项,在config("public")填入了相应的参数: + + ``` + config("public") { + include_dirs = [] --- 公共头文件 + ldflags = [] --- 链接参数,包括ld文件 + libs = [] --- 链接库 + defines = [] --- 定义 + } + ``` + + ![](../public_sys-resources/icon-note.gif) **说明:** + 建议公共的参数选项以及头文件不在各个组件中重复填写。 + +### 内核启动适配 + +内核启动适配的文件路径在 `//device/soc/chipsea/cst85/liteos_m/sdk/modules/rtos/src/rtos.c` + +内核启动适配总体思路如下: + +1. 中断向量的初始化` OsVectorInit();` ,初始化中断的处理函数。 +2. 内核初始化`osKernelInitialize` 。 +3. 创建线程`OHOS_SystemInit`OS组件平台初始化。 +4. `DeviceManagerStart(); HDF 初始化`。 +5. 内核启动,开始调度线程`LOS_Start` 。 + +其中,本章节详细对第3步进行展开,其他几步为对内核函数调用,不作详细描述。 + +第3步中在启动`OHOS_SystemInit`之前,需要初始化必要的动作,如下: + +``` +... + LOS_KernelInit(); + DeviceManagerStart(); + OHOS_SystemInit(); + LOS_Start(); + +.... +``` + +### 中断适配 +要使LiteOS-M系统正常的运转起来,有两个中断服务例程必须重定向到LiteOS-M指定的ISR:HalPendSV和OsTickerHandler。而这取决于适配LiteOS-M系统时是否让LiteOS-M来接管中断向量表。 +``` +/** + * @ingroup los_config + * Configuration item for using system defined vector base address and interrupt handlers. + * If LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT is set to 0, vector base address will not be + * modified by system. In arm, it should be noted that PendSV_Handler and SysTick_Handler should + * be redefined to HalPendSV and OsTickHandler respectly in this case, because system depends on + * these interrupt handlers to run normally. What's more, LOS_HwiCreate will not register handler. + */ +#ifndef LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT +#define LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT 1 +#endif +``` + +#### 操作系统接管还是不接管中断向量 +LiteOS接管与否可以通过配置target_config.h中的配置来实现。1接管,0不接管。 +``` +#define LOSCFG_USE_SYSTEM_DEFINED_INTERRUPT 0 +``` + + +如果配置为1,这时LiteOS会修改SCB->VTOR为g_hwiForm。所以需要在启动的时候通过调用LITEOS的"ArchHwiCreate"接口把芯片原先的ISRs(中断服务程序)配置到新的中断向量表g_hwiForm中去, 而PendSV和SysTicke的中断服务例程则重定向到HalPendSV和OsTickerHandler。否则芯片原先的ISRs不会响应。 + +如果配置为0,则使用芯片原有的中断向量表,对于CST85F01而言就是__vectors_start___(NVIC_Vectors_Init会把__isr_vector的内容拷贝过来)。但要想适配LITEOS的话,必须把PendSV和SysTick的中断服务程序重定向到HalPendSV和OsTickHandler才行,否则系统跑不起来。 + +我们这里选择不让LITEOS接管中断处理,为此我们需要在启动的时候,重定向PendSV和SysTick的中断服务程序到HalPendSV和OsTickHandler: +``` +#ifdef CFG_LITEOS +static void OsVectorInit(void) +{ + NVIC_SetVector(PendSV_IRQn, (uint32_t)HalPendSV); + NVIC_SetVector(SysTick_IRQn, (uint32_t)OsTickHandler); +} +#endif +``` + +#### 中断向量表地址对齐 +在Cortex-M的相关文档已经说明,中断向量表的地址最小是32字对齐,也就是0x80。 +举例来说,如果需要21个中断,因为系统中断有16个,所以总共就有37个中断,需要37\*4个表项,一个0x80已经不够了,需要两个0x80,也就是0x100才能覆盖的住。 + +而在cst85f01的适配中, 我们的中断向量LIMIT为128个(target_config.h中定义的): +``` +#define LOSCFG_PLATFORM_HWI_LIMIT 128 +``` +我们需要128个中断,加上系统中断,总共(128+16)=144个中断,需要144\*4个表项,这些表项总共需要4个0x80才能盖的住,也即必须是0x200对齐才行。否则,会出现系统重启的现象。 +为此,我们需要把中断对齐覆盖为0x200: +``` +#ifndef LOSCFG_ARCH_HWI_VECTOR_ALIGN +#define LOSCFG_ARCH_HWI_VECTOR_ALIGN 0x200 +#endif +``` + +### littlefs文件系统适配 + +XTS测试中的syspara的测试对kv的存储涉及到文件的读写,所以需要适配一个文件系统,来让kv存储到flash的某个区间位置。为此,我们进行了littlefs文件系统的适配工作。 + +适配过程中,需要在`device/soc/chipsea/cst85/liteos_m/components/drivers/littlefs`增加适配接口。 + +``` + #define LFS_DEFAULT_START_ADDR 0x081E3000 ---littlefs 起始地址 + #define LFS_DEFAULT_BLOCK_SIZE 4096 ---块大小 + #define LFS_DEFAULT_BLOCK_COUNT 25 ---块数量 + +``` + +最后在`device/soc/chipsea/cst85/liteos_m/components/drivers/littlefs/hal_vfs.c`中对kernel的littlefs接口进行实现。 + +``` +int32_t hal_vfs_init(void) +{ + VfsOps = malloc(sizeof(struct lfs_manager)); + if (VfsOps == NULL) { + printf("+++ hal_vfs_init: NO memory!!\n"); + return -1; + } else { + memset(VfsOps, 0, sizeof(struct lfs_manager)); + } + + VfsOps->LfsOps.read = lfs_block_read; //read flash 接口 + VfsOps->LfsOps.prog = lfs_block_write; //write flash 接口 + VfsOps->LfsOps.erase = lfs_block_erase; //erase flash 接口 + VfsOps->LfsOps.sync = lfs_block_sync; + VfsOps->LfsOps.read_size = 256; + VfsOps->LfsOps.prog_size = 256; + VfsOps->LfsOps.cache_size = 256; + VfsOps->LfsOps.lookahead_size = 16; + VfsOps->LfsOps.block_cycles = 500; + VfsOps->start_addr = LFS_DEFAULT_START_ADDR; + VfsOps->LfsOps.block_size = LFS_DEFAULT_BLOCK_SIZE; + VfsOps->LfsOps.block_count = LFS_DEFAULT_BLOCK_COUNT; + + SetDefaultMountPath(0,"/data"); + if (LOS_FsMount(NULL, "/data", "littlefs", 0, VfsOps) != FS_SUCCESS) { + printf("+++ hal_vfs_init: Mount littlefs faild!\n"); + free(VfsOps); + return -1; + } + + if (LOS_Mkdir("/data", 0777) != 0 ) { + printf("+++ hal_vfs_init: Make dir faild!\n"); + } + + flash_user_data_addr_length_set(LFS_DEFAULT_START_ADDR, + LFS_DEFAULT_BLOCK_SIZE * LFS_DEFAULT_BLOCK_COUNT); + + printf("+++ hal_vfs_init: Mount littlefs success!\n"); + return 0; +} + +``` + + + +### C库适配 + +在轻量系统中,C库适配比较复杂,设计思路请参考[LiteOS-M内核支持musl与newlib平滑切换方案](https://gitee.com/arvinzzz/ohos_kernel_design_specification/blob/master/liteos_m/%E6%94%AF%E6%8C%81newlib/%E5%86%85%E6%A0%B8%E9%80%82%E9%85%8Dnewlib%E6%96%B9%E6%A1%88%E6%80%9D%E8%B7%AF.md), 自带`newlib`的C库,那么系统移植整体采用`newlib`的C库。在`vendor/chipsea/iotlink_demo/kernel_configs/debug.config`选中LOSCFG_LIBC_NEWLIB=y即可。 + + +### printf适配 + +要想让开发者方便的使用C库中的标准函数来输出信息,就需要进行相应的适配,把标准函数要输出的信息输出到我们的硬件(我们这里就是串口)。为此,我们进行了printf函数的适配。 + +在`//device/board/chipsea/cst85_wblink/liteos_m/config.gni`的新增printf函数的`wrap`链接选项。 + +``` +board_ld_flags += [ + "-Wl,--wrap=printf", +] +``` + +在`device/soc/chipsea/cst85/liteos_m/sdk/bsp/wrapper/lite_sys.c`中对"__wrap_printf"进行了实现。 + + +### GPIO的HDF适配 +为了让开发者方便的使用HDF框架来使用GPIO的功能,我们对GPIO进行了HDF框架的适配。 + +1. 芯片驱动适配文件位于`//drivers/adapter/platform`目录,在gpio目录增加gpio_chipsea.c和gpio_chipsea.h文件,在BUILD.gn中增加新增的驱动文件编译条件: + + ``` + if (defined(LOSCFG_SOC_COMPANY_CHIPSEA)) { + sources += [ "gpio_chipsea.c" ] + } + ``` + +2. gpio_chipsea.c中驱动描述文件如下: + + ``` + struct HdfDriverEntry g_gpioDriverEntry = { + .moduleVersion = 1, + .moduleName = "HDF_PLATFORM_GPIO", + .Bind = GpioDriverBind, + .Init = GpioDriverInit, + .Release = GpioDriverRelease, + }; + + HDF_INIT(g_gpioDriverEntry); + ``` + +3. 在cst85/liteos_m/components/hdf_config/device_info.hcs`添加gpio硬件描述信息文件gpio.hcs, 映射后的gpio0控制板卡上的可编程LED,hcs内容如下: + + ``` + root { + platform :: host { + hostName = "platform_host"; + priority = 50; + device_gpio :: device { + gpio0 :: deviceNode { + policy = 0; + priority = 100; + moduleName = "HDF_PLATFORM_GPIO"; + serviceName = "HDF_PLATFORM_GPIO"; + deviceMatchAttr = "gpio_config"; + } + } + } + ``` + + +## OpenHarmony子系统适配 + +### 通信子系统 + +在通信子系统中,我们需要打开wifi_lite组件,并适配与之相关的各个接口。 + +wifi_lite组件的选项配置如下: + +``` +"subsystem": "communication", +"components": [ + { "component": "wifi_lite", "features":[] } + ] +``` + +与Wi-Fi有关的实现在`//device/soc/chipsea/hals/communication/wifi_lite/wifiservice/wifi_device.c`下。 + +``` +…… +WifiErrorCode Scan(void) +{ + WIFI_STATE_INVALID_CHECK(WIFI_INACTIVE); + + int testNum = MEMP_NUM_NETCONN; + dbg("testNum %d\r\n", testNum); + ChipseaWifiMsg msg = { + .eventId = WIFI_START_SCAN, + .payLoad = 0, + }; + + if (WifiCreateLock() != WIFI_SUCCESS) { + return ERROR_WIFI_NOT_AVAILABLE; + } + if (rtos_queue_write(g_wifiData.wifiQueue, &msg, 1, false) != 0) { + dbg("wifiDevice:rtos_queue_write err\r\n"); + WifiUnlock(); + return ERROR_WIFI_NOT_AVAILABLE; + } + WifiUnlock(); + return WIFI_SUCCESS; +} + +…… +int GetSignalLevel(int rssi, int band) +{ + if (band == HOTSPOT_BAND_TYPE_2G) { + if (rssi >= RSSI_LEVEL_4_2_G) + return RSSI_LEVEL_4; + if (rssi >= RSSI_LEVEL_3_2_G) + return RSSI_LEVEL_3; + if (rssi >= RSSI_LEVEL_2_2_G) + return RSSI_LEVEL_2; + if (rssi >= RSSI_LEVEL_1_2_G) + return RSSI_LEVEL_1; + } + + if (band == HOTSPOT_BAND_TYPE_5G) { + if (rssi >= RSSI_LEVEL_4_5_G) + return RSSI_LEVEL_4; + if (rssi >= RSSI_LEVEL_3_5_G) + return RSSI_LEVEL_3; + if (rssi >= RSSI_LEVEL_2_5_G) + return RSSI_LEVEL_2; + if (rssi >= RSSI_LEVEL_1_5_G) + return RSSI_LEVEL_1; + } + return ERROR_WIFI_INVALID_ARGS; +} + +``` + +### kernel子系统 + +kernel子系统,我们需要配置跟wifi密切相关的lwip组件,使用社区的"lwip"三方件,同时指定用于适配三方lwip和wifi系统的目录。 + +`LiteOS-M kernel`目录下默认配置了`lwip`,因而具有编译功能,可以在`kernel`组件中指定`lwip`编译的目录。如下: + +``` + { + "subsystem": "kernel", + "components": [ + { + "component": "liteos_m", + "features": [ + "ohos_kernel_liteos_m_lwip_path = \"//device/soc/chipsea/cst85/liteos_m/sdk/modules/lwip-2.1\"" + --- 指定在芯片厂商目录中进行适配 + ] + } + ] + }, +``` + +在`//device/soc/chipsea/cst85/liteos_m/sdk/modules/lwip-2.1/BUILD.gn`文件中,描述了`lwip`的编译,如下: + +``` +import("//kernel/liteos_m/liteos.gni") +import("$LITEOSTHIRDPARTY/lwip/lwip.gni") +import("$LITEOSTOPDIR/components/net/lwip-2.1/lwip_porting.gni") + +module_switch = defined(LOSCFG_NET_LWIP_SACK) +module_name = "lwip" +kernel_module(module_name) { + sources = LWIP_PORTING_FILES + LWIPNOAPPSFILES - + [ "$LWIPDIR/api/sockets.c" ] + [ "porting/src/ethernetif.c" ] --- 增加ethernetif.c文件,用以适配ethernet网卡的初始化适配 + defines = [ "LITEOS_LWIP=1" ] + defines += [ "CHECKSUM_BY_HARDWARE=1" ] +} + +config("public") { + defines = [ "_BSD_SOURCE=1" ] + include_dirs = + [ "porting/include" ] + LWIP_PORTING_INCLUDE_DIRS + LWIP_INCLUDE_DIRS +} + +``` + +在`//device/soc/chipsea/cst85/liteos_m/sdk/modules/lwip-2.1/porting/include/lwip/lwipopts.h`文件中,说明原有`lwip`配置选项保持不变,软总线会依赖这些配置选项,并且新增硬件适配的配置项,如下: + +``` +#ifndef _PORTING_LWIPOPTS_H_ +#define _PORTING_LWIPOPTS_H_ + +#include_next "lwip/lwipopts.h" --- 保持原来的配置项不变 + +#define LWIP_NETIF_STATUS_CALLBACK 1 +#define LWIP_CHECKSUM_ON_COPY 0 +#define CHECKSUM_GEN_UDP 0 --- 新增硬件适配选项 + +#endif /* _PORTING_LWIPOPTS_H_ */ + +``` + +在`//device/soc/chipsea/cst85/liteos_m/sdk/modules/lwip-2.1/porting/net_al.c`文件中,说明对`ethernet`网卡初始化的适配,如下: + +``` +static err_t net_if_init(struct netif *net_if) +{ + err_t status = ERR_OK; + struct fhost_vif_tag *vif = (struct fhost_vif_tag *)net_if->state; + + #if LWIP_NETIF_HOSTNAME + { + /* Initialize interface hostname */ + net_if->hostname = "CsWlan"; + } + #endif /* LWIP_NETIF_HOSTNAME */ + + net_if->name[ 0 ] = 'w'; + net_if->name[ 1 ] = 'l'; + + net_if->output = etharp_output; + net_if->flags = NETIF_FLAG_BROADCAST | NETIF_FLAG_ETHARP | NETIF_FLAG_LINK_UP | NETIF_FLAG_IGMP; + net_if->hwaddr_len = ETHARP_HWADDR_LEN; + net_if->mtu = LLC_ETHER_MTU; + net_if->linkoutput = net_if_output; + memcpy(net_if->hwaddr, &vif->mac_addr, ETHARP_HWADDR_LEN); + + return status; +} + +``` + +### startup子系统 + +为了运行XTS或者APP_FEATURE_INIT等应用框架,我们适配了startup子系统的bootstrap_lite和syspara_lite组件。 + +在`vendor/chipsea/wblink_demo/config.json`中新增对应的配置选项。 + +``` +{ + "subsystem": "startup", + "components": [ + { + "component": "bootstrap_lite" --- bootstrap_lite 部件 + }, + { + "component": "syspara_lite", --- syspara_lite 部件 + "features": [ + "enable_ohos_startup_syspara_lite_use_posix_file_api = true" + ] + } + ] +}, +``` + +适配`bootstrap_lite`部件时,需要在连接脚本文件`//device/soc/chipsea/cst85/liteos_m/sdk/bsp/out/cst85f01/cst85f01.ld`中手动新增如下段: + +``` + __zinitcall_bsp_start = .; + KEEP (*(.zinitcall.bsp0.init)) + KEEP (*(.zinitcall.bsp1.init)) + KEEP (*(.zinitcall.bsp2.init)) + KEEP (*(.zinitcall.bsp3.init)) + KEEP (*(.zinitcall.bsp4.init)) + __zinitcall_bsp_end = .; + __zinitcall_device_start = .; + KEEP (*(.zinitcall.device0.init)) + KEEP (*(.zinitcall.device1.init)) + KEEP (*(.zinitcall.device2.init)) + KEEP (*(.zinitcall.device3.init)) + KEEP (*(.zinitcall.device4.init)) + __zinitcall_device_end = .; + __zinitcall_core_start = .; + KEEP (*(.zinitcall.core0.init)) + KEEP (*(.zinitcall.core1.init)) + KEEP (*(.zinitcall.core2.init)) + KEEP (*(.zinitcall.core3.init)) + KEEP (*(.zinitcall.core4.init)) + __zinitcall_core_end = .; + __zinitcall_sys_service_start = .; + KEEP (*(.zinitcall.sys.service0.init)) + KEEP (*(.zinitcall.sys.service1.init)) + KEEP (*(.zinitcall.sys.service2.init)) + KEEP (*(.zinitcall.sys.service3.init)) + KEEP (*(.zinitcall.sys.service4.init)) + __zinitcall_sys_service_end = .; + __zinitcall_sys_feature_start = .; + KEEP (*(.zinitcall.sys.feature0.init)) + KEEP (*(.zinitcall.sys.feature1.init)) + KEEP (*(.zinitcall.sys.feature2.init)) + KEEP (*(.zinitcall.sys.feature3.init)) + KEEP (*(.zinitcall.sys.feature4.init)) + __zinitcall_sys_feature_end = .; + __zinitcall_run_start = .; + KEEP (*(.zinitcall.run0.init)) + KEEP (*(.zinitcall.run1.init)) + KEEP (*(.zinitcall.run2.init)) + KEEP (*(.zinitcall.run3.init)) + KEEP (*(.zinitcall.run4.init)) + __zinitcall_run_end = .; + __zinitcall_app_service_start = .; + KEEP (*(.zinitcall.app.service0.init)) + KEEP (*(.zinitcall.app.service1.init)) + KEEP (*(.zinitcall.app.service2.init)) + KEEP (*(.zinitcall.app.service3.init)) + KEEP (*(.zinitcall.app.service4.init)) + __zinitcall_app_service_end = .; + __zinitcall_app_feature_start = .; + KEEP (*(.zinitcall.app.feature0.init)) + KEEP (*(.zinitcall.app.feature1.init)) + KEEP (*(.zinitcall.app.feature2.init)) + KEEP (*(.zinitcall.app.feature3.init)) + KEEP (*(.zinitcall.app.feature4.init)) + __zinitcall_app_feature_end = .; + __zinitcall_test_start = .; + KEEP (*(.zinitcall.test0.init)) + KEEP (*(.zinitcall.test1.init)) + KEEP (*(.zinitcall.test2.init)) + KEEP (*(.zinitcall.test3.init)) + KEEP (*(.zinitcall.test4.init)) + __zinitcall_test_end = .; + __zinitcall_exit_start = .; + KEEP (*(.zinitcall.exit0.init)) + KEEP (*(.zinitcall.exit1.init)) + KEEP (*(.zinitcall.exit2.init)) + KEEP (*(.zinitcall.exit3.init)) + KEEP (*(.zinitcall.exit4.init)) + __zinitcall_exit_end = .; +``` + +需要新增上述段是因为`bootstrap_init`提供的对外接口,采用的是灌段的形式,最终会保存到上述链接段中(见`//utils/native/lite/include/ohos_init.h`文件)。 + +bootstrap提供的自动初始化宏如下表所示: + +| 接口名 | 描述 | +| ---------------------- | -------------------------------- | +| SYS_SERVICE_INIT(func) | 标识核心系统服务的初始化启动入口 | +| SYS_FEATURE_INIT(func) | 标识核心系统功能的初始化启动入口 | +| APP_SERVICE_INIT(func) | 标识应用层服务的初始化启动入口 | +| APP_FEATURE_INIT(func) | 标识应用层功能的初始化启动入口 | + +通过上面加载的组件编译出来的lib文件需要手动加入强制链接。 + +​如在 `vendor/chipsea/wblink_demo/config.json` 中配置了`bootstrap_lite` 部件 + +``` + { + "subsystem": "startup", + "components": [ + { + "component": "bootstrap_lite" + }, + ... + ] + }, +``` + +​`bootstrap_lite`部件会编译`//base/startup/bootstrap_lite/services/source/bootstrap_service.c`,该文件中,通过`SYS_SERVICE_INIT`将`Init`函数符号灌段到`__zinitcall_sys_service_start`和`__zinitcall_sys_service_end`中。 +``` +static void Init(void) +{ + static Bootstrap bootstrap; + bootstrap.GetName = GetName; + bootstrap.Initialize = Initialize; + bootstrap.MessageHandle = MessageHandle; + bootstrap.GetTaskConfig = GetTaskConfig; + bootstrap.flag = FALSE; + SAMGR_GetInstance()->RegisterService((Service *)&bootstrap); +} +SYS_SERVICE_INIT(Init); --- 通过SYS启动即SYS_INIT启动就需要强制链接生成的lib +``` + +在`//base/startup/bootstrap_lite/services/source/BUILD.gn`文件中,把文件添加到编译sources中去: + +``` +static_library("bootstrap") { + sources = [ + "bootstrap_service.c", + "system_init.c", + ] + .... +``` + +由于`Init`函数是没有显式调用它,所以需要将它强制链接到最终的镜像。在这里,我们通过在 `device/board/chipsea/cst85_wblink/config.gni` 中如下配置ld_flags: + +``` + board_ld_flags += [ + "-Wl,--whole-archive", + "-lexample", + "-lhiview_lite", + "-lhilog_lite", + "-lhievent_lite", + "-lbroadcast", + "-lbootstrap", + "-Wl,--no-whole-archive", + ] + +``` + +### utils子系统 + +进行`utils`子系统适配需要添加`kv_store`/`js_builtin`/`timer_task`/`kal_timer`部件,直接在`config.json`配置即可。 + +``` +{ + "subsystem": "utils", + "components": [ + { + "component": "kv_store", + "features": [ + "enable_ohos_utils_native_lite_kv_store_use_posix_kv_api = true" + ] + }, + + ] +}, +``` + +与适配`syspara_lite`部件类似,适配`kv_store`部件时,键值对会写到文件中。在轻量系统中,文件操作相关接口有`POSIX`接口与`HalFiles`接口这两套实现。因为对接内核的文件系统,采用`POSIX`相关的接口,所以`features`需要增加`enable_ohos_utils_native_lite_kv_store_use_posix_kv_api = true`。如果对接`HalFiles`相关的接口实现的,则无须修改。 + + +### xts子系统 + +xts子系统的适配,以`//vendor/chipsea/xts_demo/config.json`为例,需要加入组件选项: + +``` +"subsystem": "xts", +"components": [ + { "component": "xts_acts", "features": + [ + "config_ohos_xts_acts_utils_lite_kv_store_data_path = \"/data\"", + "enable_ohos_test_xts_acts_use_thirdparty_lwip = true" + ] + }, + { "component": "xts_tools", "features":[] } +] +``` +其中需要在`device/board/chipsea/cst85_wblink/liteos_m/config.gni`强制链接xts lib, + +``` + board_ld_flags += [ + "-Wl,--whole-archive", + "-lhctest", + "-lmodule_ActsParameterTest", + "-lmodule_ActsBootstrapTest", + "-lmodule_ActsDfxFuncTest", + "-lmodule_ActsKvStoreTest", + "-lmodule_ActsSamgrTest", + "-lmodule_ActsWifiServiceTest", + "-lmodule_ActsDsoftbusMgrTest", +``` diff --git a/zh-cn/device-dev/porting/porting-w800-combo-demo.md b/zh-cn/device-dev/porting/porting-w800-combo-demo.md new file mode 100755 index 0000000000000000000000000000000000000000..91f4b2021b7a4b8b23c759bbae32b971ed5584f4 --- /dev/null +++ b/zh-cn/device-dev/porting/porting-w800-combo-demo.md @@ -0,0 +1,850 @@ + +# Combo解决方案之W800芯片移植案例 + +本方案基于OpenHarmony LiteOS-M内核,使用联盛德W800芯片的润和软件海王星系列[Neptune100开发板](https://gitee.com/openharmony-sig/device_board_hihope),进行开发移植。移植架构采用`Board`与`SoC`分离方案,支持通过Kconfig图形化配置编译选项,增加玄铁`ck804ef`架构移植,实现了`HDF`、`XTS`等子系统及组件的适配。 + +## 适配准备 + +准备ubuntu20.04系统环境,安装[csky-abiv2-elf-gcc](https://occ.t-head.cn/community/download?id=3885366095506644992)交叉编译工具链。 + +## 编译构建 + +### 目录规划 + +本方案的目录结构使用[Board和Soc解耦的思路](https://gitee.com/openharmony-sig/sig-content/blob/master/devboard/docs/board-soc-arch-design.md): + +芯片适配目录规划为: + ``` + device + ├── board --- 单板厂商目录 + │   └── hihope --- 单板厂商名字:HiHope + │   └── neptune100 --- 单板名:Neptune100 + └── soc --- SoC厂商目录 + └── winnermicro --- SoC厂商名字:联盛德 + └── wm800 --- SoC Series名:w800系列芯片 + ``` + +产品样例目录规划为: + + ``` + vendor + └── hihope --- 开发产品样例厂商目录,润和软件的产品样例 + ├── neptune_iotlink_demo --- 产品名字:Neptune100产品样例代码 + └── ... + ``` + +### 产品定义 + +`vendor/hihope/neptune_iotlink_demo/config.json`文件下,描述了产品使用的内核、单板、子系统等信息。其中,内核、单板型号、单板厂商需提前规划好,是预编译指令`hb set`关注的。例如: + + ``` + { + "product_name": "neptune_iotlink_demo", --- 产品名 + "ohos_version": "OpenHarmony 3.1", --- 使用的OS版本 + "type":"mini", --- 系统类型: mini + "version": "3.0", --- 系统版本: 3.0 + "device_company": "hihope", --- 单板厂商:hihope + "board": "neptune100", --- 单板名:neptune100 + "kernel_type": "liteos_m", --- 内核类型:liteos_m + "kernel_version": "3.0.0", --- 内核版本:3.0.0 + "subsystems": [] --- 子系统 + } +``` +填入的信息与规划的目录相对应,其中`device_company`和`board`用于关联出`device/board//`目录。 + +### 单板配置 + +关联到的目录下,在`device/board/hihope/neptune100/liteos_m`目录下放置`config.gni`文件,该配置文件用于描述该单板信息,包括CPU型号、交叉编译工具链及全局编译、链接参数等重要信息: + +``` +# Kernel type, e.g. "linux", "liteos_a", "liteos_m". +kernel_type = "liteos_m" + +# Kernel version. +kernel_version = "3.0.0" + +# Board CPU type, e.g. "cortex-a7", "riscv32". +board_cpu = "ck804ef" + +# Board arch, e.g. "armv7-a", "rv32imac". +board_arch = "ck803" + +# Toolchain name used for system compiling. +# E.g. gcc-arm-none-eabi, arm-linux-harmonyeabi-gcc, ohos-clang, riscv32-unknown-elf. +# Note: The default toolchain is "ohos-clang". It's not mandatory if you use the default toolchain. +board_toolchain = "csky-elfabiv2-gcc" + +#use_board_toolchain = true + +# The toolchain path installed, it's not mandatory if you have added toolchain path to your ~/.bashrc. +board_toolchain_path = "" + +# Compiler prefix. +board_toolchain_prefix = "csky-elfabiv2-" + +# Compiler type, "gcc" or "clang". +board_toolchain_type = "gcc" + +# config.json parse +if (product_path != "") { + product_conf = read_file("${product_path}/config.json", "json") + product_name = product_conf.product_name + bin_list = product_conf.bin_list +} + +# Board related common compile flags. +board_cflags = [ + "-mcpu=ck804ef", + "-mhard-float", + "-DGCC_COMPILE=1", + "-DTLS_CONFIG_CPU_XT804=1", + "-DNIMBLE_FTR=1", + "-D__CSKY_V2__=1", + "-DCPU_CK804", + "-O2", + "-g3", + "-Wall", + "-ffunction-sections", + "-MMD", + "-MP", +] + +board_cxx_flags = board_cflags + +board_asmflags = [ + "-mcpu=ck804ef", + "-DCPU_CK804", +] + +board_ld_flags = [] + +# Board related headfiles search path. +board_include_dirs = [] + +# Board adapter dir for OHOS components. +board_adapter_dir = "" + +# Sysroot path. +board_configed_sysroot = "" + +# Board storage type, it used for file system generation. +storage_type = "" +``` + +### 预编译 + +在工程根目录下输入预编译指令`hb set`可显示相关产品信息,如下: + +``` +hb set +OHOS Which product do you need? (Use arrow keys) + +hihope + > neptune_iotlink_demo + +OHOS Which product do you need? neptune_iotlink_demo +``` + +执行`hb set`后,会在根目录下自动生成`ohos_config.json`文件,文件中会列出待编译的产品信息。 + +通过`hb env`可以查看选择出来的预编译环境变量。 + +``` +[OHOS INFO] root path: /home/xxxx/openharmony_w800 +[OHOS INFO] board: neptune100 +[OHOS INFO] kernel: liteos_m +[OHOS INFO] product: neptune_iotlink_demo +[OHOS INFO] product path: /home/xxxx/openharmony_w800/vendor/hihope/neptune_iotlink_demo +[OHOS INFO] device path: /home/xxxx/openharmony_w800/device/board/hihope/neptune100/liteos_m +[OHOS INFO] device company: hihope +``` + +至此,预编译适配完成,但工程还不能执行hb build进行编译,还需要准备好后续的LiteOS-M内核移植。 + +## 内核移植 + +### Kconfig适配 + +在`kernel/liteos_m`的编译中,需要在相应的单板以及SoC目录下使用`Kconfig`文件进行索引。 + +1. 在`vendor/hihope/neptune_iotlink_demo`目录下创建kernel_configs目录,并创建`debug.config`空文件。 + +2. 打开`kernel/liteos_m/Kconfig`文件,可以看到在该文件通过orsource命令导入了`device/board`和`device/soc`下多个`Kconfig`文件,后续需要创建并修改这些文件: + + ``` + orsource "../../device/board/*/Kconfig.liteos_m.shields" + orsource "../../device/board/$(BOARD_COMPANY)/Kconfig.liteos_m.defconfig.boards" + orsource "../../device/board/$(BOARD_COMPANY)/Kconfig.liteos_m.boards" + orsource "../../device/soc/*/Kconfig.liteos_m.defconfig" + orsource "../../device/soc/*/Kconfig.liteos_m.series" + orsource "../../device/soc/*/Kconfig.liteos_m.soc" + ``` + +3. 在`device/board/hihope`下创建相应的的`Kconfig`文件: + + ``` + ├── neptune100 --- neptune100单板配置目录 + │ ├── Kconfig.liteos_m.board --- 单板的配置选项 + │   ├── Kconfig.liteos_m.defconfig.board --- 单板的默认配置项 + │   └── liteos_m + │   └── config.gni --- 单板的配置文件 + ├── Kconfig.liteos_m.boards --- 单板厂商下Boards配置信息 + └── Kconfig.liteos_m.defconfig.boards --- 单板厂商下Boards默认配置信息 + ``` + +4. 修改`Board`目录下`Kconfig`文件内容: + + 在 `neptune100/Kconfig.liteos_m.board`中添加, + + ``` + config BOARD_NEPTUNE100 + bool "select board neptune100" + depends on SOC_WM800 + ``` + +配置只有SOC_WM800被选后,BOARD_NEPTUNE100才可被选。 + + 在 `neptune100/Kconfig.liteos_m.defconfig.board`中添加, + + ``` + if BOARD_NEPTUNE100 + + endif #BOARD_NEPTUNE100 + ``` + +用于添加 BOARD_NEPTUNE100默认配置 + +5. 在`device/soc/winnermicro`下创建相应的的`Kconfig`文件: + + ``` + ├── wm800 --- W800系列 + │ ├── Kconfig.liteos_m.defconfig.wm800 --- W800芯片默认配置 + │ ├── Kconfig.liteos_m.defconfig.series --- W800系列默认配置 + │ ├── Kconfig.liteos_m.series --- W800系列配置 + │ └── Kconfig.liteos_m.soc --- W800芯片配置 + ├── Kconfig.liteos_m.defconfig --- SoC默认配置 + ├── Kconfig.liteos_m.series --- Series配置 + └── Kconfig.liteos_m.soc --- SoC配置 + ``` + +6. 修改`Soc`目录下`Kconfig`文件内容: + + 在`wm800/Kconfig.liteos_m.defconfig.wm800`中添加: + + ``` + config SOC + string + default "wm800" + depends on SOC_WM800 + ``` + + 在`wm800/Kconfig.liteos_m.defconfig.series`中添加: + + ``` + if SOC_SERIES_WM800 + + rsource "Kconfig.liteos_m.defconfig.wm800" + + config SOC_SERIES + string + default "wm800" + + endif + ``` + + 在 `wm800/Kconfig.liteos_m.series`中添加: + + ``` + config SOC_SERIES_WM800 + bool "winnermicro 800 Series" + select ARM + select SOC_COMPANY_WINNERMICRO --- 选择 SOC_COMPANY_WINNERMICRO + select CPU_XT804 + help + Enable support for winnermicro 800 series + ``` + + 在选择了 SOC_SERIES_WM800之后,才可选 `wm800/Kconfig.liteos_m.soc`文件中的 SOC_WM800: + + ``` + choice + prompt "Winnermicro 800 series SoC" + depends on SOC_SERIES_WM800 + + config SOC_WM800 --- 选择 SOC_WM800 + bool "SoC WM800" + + endchoice + ``` + +综上所述,要编译单板BOARD_NEPTUNE100,则要分别选中:SOC_COMPANY_WINNERMICRO、SOC_SERIES_WM800、SOC_WM800 +7. 在`kernel/liteos_m`中执行`make menuconfig`进行选择配置,能够对SoC Series进行选择: + +![w800_select.json](figures/w800_select.png) + +配置后的文件会默认保存在`vendor/hihope/neptune_iotlink_demo/kernel_configs/debug.config`,也可以直接填写`debug.config`: + + ``` + LOSCFG_PLATFORM_QEMU_CSKY_SMARTL=y + LOSCFG_SOC_SERIES_WM800=y + ``` + +### 模块化编译 + +`Board`和`SoC`的编译采用模块化的编译方法,从`kernel/liteos_m/BUILD.gn`开始逐级向下递增。本方案的适配过程如下: + +1. 在`device/board/hihope`中新建文件`BUILD.gn`,新增内容如下: + + ``` + if (ohos_kernel_type == "liteos_m") { + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + module_group(module_name) { + modules = [ + "neptune100", --- 单板模块 + "shields", + ] + } + } + ``` + + 在上述`BUILD.gn`中,neptune100以及shields即是按目录层级组织的模块名。 + +2. 在`device/soc/winnermicro`中,新建文件`BUILD.gn`,按目录层级组织,新增内容如下: + + ``` + if (ohos_kernel_type == "liteos_m") { + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + module_group(module_name) { + modules = [ + "hals", + "wm800", + ] + } + } + ``` + +3. 在`device/soc/winnermicro`各个层级模块下,同样新增文件`BUILD.gn`,将该层级模块加入编译。以`device/soc/winnermicro/wm800/board/platform/sys/BUILD.gn`为例: + + ``` + import("//kernel/liteos_m/liteos.gni") + module_name = get_path_info(rebase_path("."), "name") + kernel_module(module_name) { --- 编译的模块 + sources = [ --- 编译的源文件 + "wm_main.c", + ] + include_dirs = [ --- 模块内使用到的头文件 + ".", + ] + } + + ``` + +4. 为了组织链接以及一些编译选项,在`device/soc/winnermicro/wm800/board/BUILD.gn`下的`config("board_config")`填入了相应的参数: + + ``` + config("board_config") { + ldflags = [] --- 链接参数,包括ld文件 + libs = [] --- 链接库 + include_dirs = [] --- 公共头文件 + ``` + + +5. 为了组织一些产品侧的应用,需要强制链接到产品工程中来,本方案在vendor相应的`config.json`加入了相应的list来组织,在`vendor/hihope/neptune_iotlink_demo/config.json`增加对应的list: + + ``` + "bin_list": [ --- demo list + { + "elf_name": "hihope", + "enable": "false", --- list开关 + "force_link_libs": [ + "bootstrap", + "broadcast", + ... + ] + } + ``` + + 将demo应用作为模块库来管理,开启/关闭某个demo,在bin_list中增减相应库文件即可。bin_list在gn中可以直接被读取,在`device/board/hihope/neptune100/liteos_m/config.gni`新增内容: + + ``` + # config.json parse + if (product_path != "") { + product_conf = read_file("${product_path}/config.json", "json") + product_name = product_conf.product_name + bin_list = product_conf.bin_list + } + ``` + + 读取list后即可在相应的链接选项上加入相关的组件库,在`//device/soc/winnermicro/wm800/BUILD.gn`添加内容: + + ``` + foreach(bin_file, bin_list) { + build_enable = bin_file.enable + ... + if(build_enable == "true") + { + ... + foreach(force_link_lib, bin_file.force_link_libs) { + ldflags += [ "-l${force_link_lib}" ] + } + ... + } + } + ``` + +### 内核子系统适配 + +在`vendor/hihope/neptune_iotlink_demo/config.json`添加内核子系统及相关配置,如下: + + ``` + "subsystems": [ + { + "subsystem": "kernel", + "components": [ + { "component": "liteos_m", "features":[] + } + ] + }, + ``` + +### 内核启动适配 + +由于Neptune100开发板的芯片架构为Openharmony不支持的ck804ef架构,需要进行ck804ef架构移植。适配 `kernel\liteos_m\arch\include`中定义的通用的文件以及函数列表,并放在了 `kernel\liteos_m\arch\csky\v2\ck804\gcc`文件夹下。 + +内核初始化示例如下: + + ``` + osStatus_t ret = osKernelInitialize(); --- 内核初始化 + if(ret == osOK) + { + threadId = osThreadNew((osThreadFunc_t)sys_init,NULL,&g_main_task); --- 创建init线程 + if(threadId!=NULL) + { + osKernelStart(); --- 线程调度 + } + } + ``` + +board_main在启动OHOS_SystemInit之前,需要初始化必要的动作,如下: + + ``` + ... + UserMain(); --- 启动OpenHarmony OHOS_SystemInit的之前完成驱动的初始化 + ... + OHOS_SystemInit(); --- 启动OpenHarmony服务,以及组件初始化 + ... + ``` + +UserMain函数在`device/soc/winnermicro/wm800/board/app/main.c`文件中,如下: + + ``` + ... + if (DeviceManagerStart()) { --- HDF初始化 + printf("[%s] No drivers need load by hdf manager!",__func__); + } + ... + ``` + +### HDF驱动框架适配 + +HDF驱动框架提供了一套应用访问硬件的统一接口,可以简化应用开发,添加HDF组件需要在`//vendor/hihope/neptune_iotlink_demo/kernel_configs`添加: + + ``` + LOSCFG_DRIVERS_HDF=y + LOSCFG_DRIVERS_HDF_PLATFORM=y + ``` + +驱动适配相关文件放置在`drivers/adapter/platform`中,对应有gpio,i2c,pwm,spi,uart,watchdog,都是通过HDF机制加载,本章节以GPIO和UART为例进行详细说明。 + +#### GPIO适配 + +1. 芯片驱动适配文件位于`drivers/adapter/platform`目录,在gpio目录增加`gpio_wm.c`文件,在`BUILD.gn`文件中,描述了W800驱动的编译适配。如下: + + ``` + ... + if (defined(LOSCFG_SOC_COMPANY_WINNERMICRO)) { + sources += [ "gpio_wm.c" ] + } + ... + ``` + +2. `gpio_wm.c`中驱动描述文件如下: + + ``` + /* HdfDriverEntry definitions */ + struct HdfDriverEntry g_GpioDriverEntry = { + .moduleVersion = 1, + .moduleName = "WM_GPIO_MODULE_HDF", + .Bind = GpioDriverBind, + .Init = GpioDriverInit, + .Release = GpioDriverRelease, + }; + HDF_INIT(g_GpioDriverEntry); + ``` + +3. 在`device/board/hihope/shields/neptune100/neptune100.hcs`添加gpio硬件描述信息, 添加内容如下: + + ``` + root { + platform { + gpio_config { + match_attr = "gpio_config"; + groupNum = 1; + pinNum = 48; + } + } + } + ``` + +4. 在GpioDriverInit获取hcs参数进行初始化,如下: + + ``` + ... + gpioCntlr = GpioCntlrFromHdfDev(device); --- gpioCntlr节点变量获取具体gpio配置 + if (gpioCntlr == NULL) { + HDF_LOGE("GpioCntlrFromHdfDev fail\r\n"); + return HDF_DEV_ERR_NO_DEVICE_SERVICE; + } + ... + ``` + +#### UART适配 + +1. 芯片驱动适配文件位于`drivers/adapter/platform`目录,在uart目录增加`uart_wm.c`文件,在`BUILD.gn`文件中,描述了W800驱动的编译适配。如下: + + ``` + ... + if (defined(LOSCFG_SOC_COMPANY_WINNERMICRO)) { + sources += [ "uart_wm.c" ] + } + ... + ``` + +2. `uart_wm.c`中驱动描述文件如下: + + ``` + /* HdfDriverEntry definitions */ + struct HdfDriverEntry g_UartDriverEntry = { + .moduleVersion = 1, + .moduleName = "W800_UART_MODULE_HDF", + .Bind = UartDriverBind, + .Init = UartDriverInit, + .Release = UartDriverRelease, + }; + + /* Initialize HdfDriverEntry */ + HDF_INIT(g_UartDriverEntry); + ``` + +3. 在`device/board/hihope/shields/neptune100/neptune100.hcs`添加uart硬件描述信息, 添加内容如下: + + ``` + root { + platform { + uart_config { + /* + uart0 { + match_attr = "uart0_config"; + num = 0; + baudrate = 115200; + parity = 0; + stopBit = 1; + data = 8; + }*/ + uart1 { + match_attr = "uart1_config"; + num = 1; + baudrate = 115200; + parity = 0; + stopBit = 1; + data = 8; + } + } + } + } + ``` + +4. 在UartDriverInit获取hcs参数进行初始化,如下: + + ``` + ... + host = UartHostFromDevice(device); + if (host == NULL) { + HDF_LOGE("%s: host is NULL", __func__); + return HDF_ERR_INVALID_OBJECT; + } + ... + ``` + +## Openharmony子系统适配 + +子系统的编译选项入口在相应产品`config.json`下,如:`vendor/hihope/neptune_iotlink_demo/config.json`。 + +### wifi_lite组件 + +首先,在`config.json`文件中,增加`communication`子系统的`wifi_lite`部件,如下: + + ``` + { + "subsystem": "communication", + "components": [ + { + "component": "wifi_lite", + "optional": "true" + } + ] + }, + ``` + +`wifi_lite`部件在 `build/lite/components/communication.json`文件中,描述如下: + + ``` + { + "component": "wifi_lite", + "targets": [ + "//foundation/communication/wifi_lite:wifi" --- wifi_lite的编译目标 + ], + }, + ``` + +在本案例中,`wifi`适配源码可见`device/soc/winnermicro/wm800/board/src/wifi/wm_wifi.c`,如下: + + ``` + int tls_wifi_netif_add_status_event(tls_wifi_netif_status_event_fn event_fn) ---用于增加wifi事件功能 + { + u32 cpu_sr; + struct tls_wifi_netif_status_event *evt; + //if exist, remove from event list first. + tls_wifi_netif_remove_status_event(event_fn); + evt = tls_mem_alloc(sizeof(struct tls_wifi_netif_status_event)); + if(evt==NULL) + return -1; + memset(evt, 0, sizeof(struct tls_wifi_netif_status_event)); + evt->status_callback = event_fn; + cpu_sr = tls_os_set_critical(); + dl_list_add_tail(&wifi_netif_status_event.list, &evt->list); + tls_os_release_critical(cpu_sr); + + return 0; + } + ``` + +### 系统服务管理子系统适配 +系统服务管理子系统适配添加`samgr_lite`部件,直接在`config.json`配置,如下: + + ``` + { + "subsystem": "distributedschedule", + "components": [ + { + "component": "samgr_lite" + } + ] + }, + ``` + +### 公共基础库子系统适配 + +公共基础库子系统适配添加了`kv_store、file`部件,直接在`config.json`配置,如下: + + ``` + { + "subsystem": "utils", + "components": [ + { + "component": "kv_store", + "features": [ + "enable_ohos_utils_native_lite_kv_store_use_posix_kv_api = true" + ] + }, + { "component": "file", "features":[] } + ] + }, + ``` + +适配`kv_store`部件时,键值对会写到文件中。在轻量系统中,文件操作相关接口有`POSIX`接口与`HalFiles`接口这两套实现。 +因为对接内核的文件系统,采用`POSIX`相关的接口,所以`features`需要增加`enable_ohos_utils_native_lite_kv_store_use_posix_kv_api = true`。 + +### 启动恢复子系统适配 + +启动恢复子系统适配添加了`bootstrap_lite、syspara_lite`部件,直接在`config.json`配置,如下: + + ``` + { + "subsystem": "startup", + "components": [ + { + "component": "bootstrap_lite" + }, + { + "component": "syspara_lite", + "features": [ + "enable_ohos_startup_syspara_lite_use_posix_file_api = true", + "config_ohos_startup_syspara_lite_data_path = \"/data/\"" + ] + } + ] + }, + ``` + +适配bootstrap_lite部件时,需要在链接脚本文件`device/soc/winnermicro/wm800/board/ld/w800/gcc_csky.ld`中手动新增如下段: + + ``` + .zinitcall_array : + { + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_core_start = .); + KEEP (*(SORT(.zinitcall.core*))) + KEEP (*(.zinitcall.core*)) + PROVIDE_HIDDEN (__zinitcall_core_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_device_start = .); + KEEP (*(SORT(.zinitcall.device*))) + KEEP (*(.zinitcall.device*)) + PROVIDE_HIDDEN (__zinitcall_device_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_bsp_start = .); + KEEP (*(SORT(.zinitcall.bsp*))) + KEEP (*(.zinitcall.bsp*)) + PROVIDE_HIDDEN (__zinitcall_bsp_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_sys_service_start = .); + KEEP (*(SORT(.zinitcall.sys.service*))) + KEEP (*(.zinitcall.sys.service*)) + PROVIDE_HIDDEN (__zinitcall_sys_service_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_app_service_start = .); + KEEP (*(SORT(.zinitcall.app.service*))) + KEEP (*(.zinitcall.app.service*)) + PROVIDE_HIDDEN (__zinitcall_app_service_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_sys_feature_start = .); + KEEP (*(SORT(.zinitcall.sys.feature*))) + KEEP (*(.zinitcall.sys.feature*)) + PROVIDE_HIDDEN (__zinitcall_sys_feature_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_app_feature_start = .); + KEEP (*(SORT(.zinitcall.app.feature*))) + KEEP (*(.zinitcall.app.feature*)) + PROVIDE_HIDDEN (__zinitcall_app_feature_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_run_start = .); + KEEP (*(SORT(.zinitcall.run*))) + KEEP (*(.zinitcall.run*)) + PROVIDE_HIDDEN (__zinitcall_run_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_test_start = .); + KEEP (*(SORT(.zinitcall.test*))) + KEEP (*(.zinitcall.test*)) + PROVIDE_HIDDEN (__zinitcall_test_end = .); + . = ALIGN(0x4) ; + PROVIDE_HIDDEN (__zinitcall_exit_start = .); + KEEP (*(SORT(.zinitcall.exit*))) + KEEP (*(.zinitcall.exit*)) + PROVIDE_HIDDEN (__zinitcall_exit_end = .); + } > REGION_RODATA + ``` + +需要新增上述段是因为`bootstrap_init`提供的对外接口,见`utils/native/lite/include/ohos_init.h`文件,采用的是灌段的形式,最终会保存到上述链接段中。主要的服务自动初始化宏如下表格所示: + +| 接口名 | 描述 | +| ---------------------- | -------------------------------- | +| SYS_SERVICE_INIT(func) | 标识核心系统服务的初始化启动入口 | +| SYS_FEATURE_INIT(func) | 标识核心系统功能的初始化启动入口 | +| APP_SERVICE_INIT(func) | 标识应用层服务的初始化启动入口 | +| APP_FEATURE_INIT(func) | 标识应用层功能的初始化启动入口 | + + + +通过上面加载的组件编译出来的lib文件需要手动加入强制链接。 + +如在 `vendor/hihope/neptune_iotlink_demo/config.json` 中配置了`bootstrap_lite` 部件 + + ``` + { + "subsystem": "startup", + "components": [ + { + "component": "bootstrap_lite" + }, + ... + ] + }, + ``` + +​`bootstrap_lite`部件会编译`base/startup/bootstrap_lite/services/source/bootstrap_service.c`,该文件中,通过`SYS_SERVICE_INIT`将`Init`函数符号灌段到`__zinitcall_sys_service_start`和`__zinitcall_sys_service_end`中,由于`Init`函数是没有显式调用它,所以需要将它强制链接到最终的镜像。如下: + + ``` + static void Init(void) + { + static Bootstrap bootstrap; + bootstrap.GetName = GetName; + bootstrap.Initialize = Initialize; + bootstrap.MessageHandle = MessageHandle; + bootstrap.GetTaskConfig = GetTaskConfig; + bootstrap.flag = FALSE; + SAMGR_GetInstance()->RegisterService((Service *)&bootstrap); + } + SYS_SERVICE_INIT(Init); --- 通过SYS启动即SYS_INIT启动就需要强制链接生成的lib + ``` + +​在`base/startup/bootstrap_lite/services/source/BUILD.gn`文件中,描述了在`out/neptune100/neptune_iotlink_demo/libs` 生成 `libbootstrap.a`,如下: + + ``` + static_library("bootstrap") { + sources = [ + "bootstrap_service.c", + "system_init.c", + ] + ... + ``` + + +适配`syspara_lite`部件时,系统参数会最终写到文件中进行持久化保存。在轻量系统中,文件操作相关接口有POSIX接口与HalFiles接口这两套实现。 + +因为对接内核的文件系统,采用POSIX相关的接口,所以features字段中需要增加`enable_ohos_startup_syspara_lite_use_posix_file_api = true`。 + +### XTS子系统适配 + +XTS子系统的适配,直接在`config.json`中加入组件选项: + + ``` + { + "subsystem": "xts", + "components": [ + { + "component": "xts_acts", + "features": + [ + "config_ohos_xts_acts_utils_lite_kv_store_data_path = \"/data\"", + "enable_ohos_test_xts_acts_use_thirdparty_lwip = true" + ] + }, + { "component": "xts_tools", "features":[] } + ] + } + ``` + +另外,XTS功能也使用了list来组织,在`config.json`文件中增减相应模块: + + ``` + "bin_list": [ + { + "enable": "true", + "force_link_libs": [ + "module_ActsParameterTest", + "module_ActsBootstrapTest", + "module_ActsDfxFuncTest", + "module_ActsHieventLiteTest", + "module_ActsSamgrTest", + "module_ActsUtilsFileTest", + "module_ActsKvStoreTest", + "module_ActsWifiServiceTest" + ] + } + ], + ``` + +其它组件的适配过程与官方以及其它厂商的过程类似,不再赘述。 diff --git a/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-listening.md b/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-listening.md index 9157101af654977c4645be895616333320b18f50..8fe100842ba0de74a06f7add5b5764a8975c9fda 100644 --- a/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-listening.md +++ b/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-listening.md @@ -23,16 +23,16 @@ HiSysEvent提供了跨进程订阅机制,开发者可以通过注册订阅接 | 接口名称 | 描述 | | -------- | -------- | -| bool HiSysEventManager::AddEventListener(std::shared_ptr<HiSysEventSubscribeCallBack> listener, std::vector<ListenerRule>& rules) | 接口功能:注册订阅HiSysEvent系统事件侦听对象,可设置规则订阅某些事件。
输入参数:
- listener:订阅回调对象。
- rules:事件订阅规则。
返回值:
- 0:订阅成功,重复订阅。
- 1:订阅成功,初次订阅。
- 其他值:订阅失败。 | -| bool HiSysEventManager::RemoveListener(std::shared_ptr<HiSysEventSubscribeCallBack> listener) | 接口功能:移除订阅hisysevent系统事件侦听对象。
输入参数:
- listener:订阅回调对象。
返回值:
无。 | +| int32_t HiSysEventManager::AddEventListener(std::shared_ptr<HiSysEventSubscribeCallBack> listener,
 std::vector<ListenerRule>& rules) | 接口功能:注册订阅HiSysEvent系统事件侦听对象,可设置规则订阅某些事件。
输入参数:
- listener:订阅回调对象。
- rules:事件订阅规则。
返回值:
- 0:订阅成功。
- 负值:订阅失败。 | +| int32_t HiSysEventManager::RemoveListener(std::shared_ptr<HiSysEventSubscribeCallBack> listener) | 接口功能:移除订阅hisysevent系统事件侦听对象。
输入参数:
- listener:订阅回调对象。
返回值:
- 0:取消订阅成功。
- 负值:取消订阅失败。 | **表2** ListenerRule订阅规则对象 | 接口名称 | 描述 | | -------- | -------- | -| ListenerRule(const std::string& tag, RuleType ruleType = RuleType::WHOLE_WORD) | 接口功能:订阅规则构造函数,创建事件标签订阅规则对象。
输入参数:
- tag:订阅规则的HisysEvent事件标签,字符串类型,最大长度16个字符(含),有效字符包含大小写字母及数字。
- ruleType:订阅规则的规则类型,RuleType枚举类型(参考表3)。 | -| ListenerRule(const std::string& domain, const std::string& eventName, RuleType ruleType = RuleType::WHOLE_WORD) | 接口功能:订阅规则构造函数,创建事件领域与事件名称订阅规则对象。
输入参数:
- domain:订阅规则的HisysEvent事件领域,字符串类型,最大长度16个字符(含),有效字符包含大写字母、数字及下划线。
- eventName:订阅规则的HisysEvent事件名称,字符串类型,最大长度32个字符(含),有效字符包含大写字母、数字及下划线。
- ruleType:订阅规则的规则类型,RuleType枚举类型(参考表3)。 | -| ListenerRule(const std::string& domain, const std::string& eventName, const std::string& tag, RuleType ruleType = RuleType::WHOLE_WORD) | 接口功能:订阅规则构造函数,创建事件领域、事件名称,事件标签订阅规则对象。
输入参数:
- tag:订阅规则的HisysEvent事件标签,字符串类型,最大长度16个字符(含),有效字符包含大小写字母及数字。
- domain:订阅规则的HisysEvent事件领域,字符串类型,最大长度16个字符(含),有效字符包含大写字母、数字及下划线。
- eventName:订阅规则的HisysEvent事件名称,字符串类型,最大长度32个字符(含),有效字符包含大写字母、数字及下划线。
- ruleType:订阅规则的规则类型,RuleType枚举类型(参考表3)。 | +| ListenerRule(const std::string& tag,
 RuleType ruleType = RuleType::WHOLE_WORD) | 接口功能:订阅规则构造函数,创建事件标签订阅规则对象。
输入参数:
- tag:订阅规则的HisysEvent事件标签,字符串类型,最大长度16个字符(含),有效字符包含大小写字母及数字。
- ruleType:订阅规则的规则类型,RuleType枚举类型(参考表3)。 | +| ListenerRule(const std::string& domain,
 const std::string& eventName,
 RuleType ruleType = RuleType::WHOLE_WORD) | 接口功能:订阅规则构造函数,创建事件领域与事件名称订阅规则对象。
输入参数:
- domain:订阅规则的HisysEvent事件领域,字符串类型,最大长度16个字符(含),有效字符包含大写字母、数字及下划线。
- eventName:订阅规则的HisysEvent事件名称,字符串类型,最大长度32个字符(含),有效字符包含大写字母、数字及下划线。
- ruleType:订阅规则的规则类型,RuleType枚举类型(参考表3)。 | +| ListenerRule(const std::string& domain,
 const std::string& eventName,
 const std::string& tag,
 RuleType ruleType = RuleType::WHOLE_WORD) | 接口功能:订阅规则构造函数,创建事件领域、事件名称,事件标签订阅规则对象。
输入参数:
- tag:订阅规则的HisysEvent事件标签,字符串类型,最大长度16个字符(含),有效字符包含大小写字母及数字。
- domain:订阅规则的HisysEvent事件领域,字符串类型,最大长度16个字符(含),有效字符包含大写字母、数字及下划线。
- eventName:订阅规则的HisysEvent事件名称,字符串类型,最大长度32个字符(含),有效字符包含大写字母、数字及下划线。
- ruleType:订阅规则的规则类型,RuleType枚举类型(参考表3)。 | **表3** RuleType类型 @@ -46,7 +46,7 @@ HiSysEvent提供了跨进程订阅机制,开发者可以通过注册订阅接 | 接口名称 | 描述 | | -------- | -------- | -| void HiSysEventSubscribeCallBack::OnHandle(const std::string& domain, const std::string& eventName, const int eventType, const std::string& eventDetail) | 接口功能:订阅事件的回调接口。
输入参数:
- domain:事件所属领域。
- eventName:事件的名称。
- eventType:事件类型。
- eventDetail:包含事件相关信息的字符串,以json的形式体现。
返回值:
无。 | +| void HiSysEventSubscribeCallBack::OnHandle(const std::string& domain,
 const std::string& eventName,
 const int eventType,
 const std::string& eventDetail) | 接口功能:订阅事件的回调接口。
输入参数:
- domain:事件所属领域。
- eventName:事件的名称。
- eventType:事件类型。
- eventDetail:包含事件相关信息的字符串,以json的形式体现。
返回值:
无。 | ## 开发实例 diff --git a/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md b/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md index 07c67f71f5b933d995e71e6b59bbfcfb039e0261..bad9c2129d13db0bba3a8d80ce8c9bc09155ea0b 100644 --- a/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md +++ b/zh-cn/device-dev/subsystems/subsys-dfx-hisysevent-query.md @@ -15,7 +15,7 @@ HiSysEvent提供了查询接口,支持开发者设置条件查询HiSysEvent事 | 接口名 | 描述 | | -------- | -------- | -| bool HiSysEventManager::QueryHiSysEvent(struct QueryArg& queryArg, std::vector<QueryRule>& queryRules, std::shared_ptr<HiSysEventQueryCallBack> queryCallBack) | 接口功能:支持设置查询时间段,事件领域,事件名称等,查询满足条件的HiSysEvent事件。
输入参数:
- queryArg:查询参数。
- queryRules:事件过滤规则。
- queryCallBack:查询接口回调对象。
返回值:
- true:查询成功。
- false:查询失败。 | +| int32_t HiSysEventManager::QueryHiSysEvent(struct QueryArg& queryArg,
 std::vector<QueryRule>& queryRules,
 std::shared_ptr<HiSysEventQueryCallBack> queryCallBack) | 接口功能:支持设置查询时间段,事件领域,事件名称等,查询满足条件的HiSysEvent事件。
输入参数:
- queryArg:查询参数。
- queryRules:事件过滤规则。
- queryCallBack:查询接口回调对象。
返回值:
- 0:查询成功。
- 负值:查询失败。 | **表2** QueryArg查询参数对象 @@ -29,14 +29,14 @@ HiSysEvent提供了查询接口,支持开发者设置条件查询HiSysEvent事 | 接口名称 | 描述 | | -------- | -------- | -| QueryRule(const std::string& domain, const std::vector<std::string>& eventList) | 接口功能:查询规则构造函数,创建查询规则对象。
输入参数:
- domain:string类型,用来标识查询规则对象的事件所属领域,如果传入的是空字符串,则默认事件领域字段匹配成功。
- eventList:std::vector<std::string>类型,事件名称的列表,如果传入的是空字符串,则默认事件名称字段匹配成功。 | +| QueryRule(const std::string& domain,
 const std::vector<std::string>& eventList) | 接口功能:查询规则构造函数,创建查询规则对象。
输入参数:
- domain:string类型,用来标识查询规则对象的事件所属领域,如果传入的是空字符串,则默认事件领域字段匹配成功。
- eventList:std::vector<std::string>类型,事件名称的列表,如果传入的是空字符串,则默认事件名称字段匹配成功。 | **表4** HiSysEventQueryCallBack查询回调对象 | 接口名称 | 描述 | | -------- | -------- | -| void HiSysEventQueryCallBack::OnQuery(const ::std::vector<std::string>& sysEvent, const ::std::vector<int64_t>& seq) | 接口功能:订阅事件查询中的回调。
输入参数:
- sysEvent:返回事件集合。
- seq:事件序列集合。
返回值:
无。 | -| void HiSysEventQueryCallBack::OnComplete(int32_t reason, int32_t total) | 接口功能:订阅事件查询完成的回调。
输入参数:
- reason:查询结束返回原因,目前默认是0。
- total:本次查询总共返回的事件总数量。
返回值:
无。 | +| void HiSysEventQueryCallBack::OnQuery(const ::std::vector<std::string>& sysEvent,
 const ::std::vector<int64_t>& seq) | 接口功能:订阅事件查询中的回调。
输入参数:
- sysEvent:返回事件集合。
- seq:事件序列集合。
返回值:
无。 | +| void HiSysEventQueryCallBack::OnComplete(int32_t reason, int32_t total) | 接口功能:订阅事件查询完成的回调。
输入参数:
- reason:查询结束返回原因,目前默认是0。
- total:本次查询总共返回的事件总数量。
返回值:
无。 | ### 开发实例 diff --git a/zh-cn/release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md b/zh-cn/release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md index a5b51592d530ff1552e6dc4d926825340ade4ba2..fd655bd846e54cf5c8d58cec91668a0a2bafbc20 100644 --- a/zh-cn/release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md +++ b/zh-cn/release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md @@ -4,67 +4,67 @@ OpenHarmony 2.2 Beta2相较于OpenHarmony 2.0 Canary版本的API变更如下: | 模块名称 | 接口名称 | 变更类型 | 变更说明 | | -------- | -------- | -------- | -------- | - | 时间日期数字模块-Locale | constructor(locale: string, options?:options) | 新增 | - | - | 时间日期数字模块-Locale | toString(): string | 新增 | - | - | 时间日期数字模块-Locale | maximize(): Locale | 新增 | - | - | 时间日期数字模块-Locale | minimize(): Locale | 新增 | - | - | 时间日期数字模块-Locale | calendar | 新增 | - | - | 时间日期数字模块-Locale | caseFirst | 新增 | - | - | 时间日期数字模块-Locale | collation | 新增 | - | - | 时间日期数字模块-Locale | hourCycle | 新增 | - | - | 时间日期数字模块-Locale | numberingSystem | 新增 | - | - | 时间日期数字模块-Locale | numeric | 新增 | - | - | 时间日期数字模块-Locale | language | 新增 | - | - | 时间日期数字模块-Locale | script | 新增 | - | - | 时间日期数字模块-Locale | region | 新增 | - | - | 时间日期数字模块-Locale | baseName | 新增 | - | - | 时间日期数字模块-DateTimeFormat | constructor(locale: string, options?:options) | 新增 | - | - | 时间日期数字模块-DateTimeFormat | constructor(locale: string[], options?:options) | 新增 | - | - | 时间日期数字模块-DateTimeFormat | resolvedOptions(): DateTimeOptions | 新增 | - | - | 时间日期数字模块-DateTimeFormat | format(date: Date): string; | 新增 | - | - | 时间日期数字模块-DateTimeFormat | formatRange(fromDate: Date, toDate: Date): string; | 新增 | - | - | 时间日期数字模块-NumberFormat | constructor(locale: string, options?:options) | 新增 | - | - | 时间日期数字模块-NumberFormat | constructor(locale: string[], options?:options) | 新增 | - | - | 时间日期数字模块-NumberFormat | resolvedOptions(): NumberOptions | 新增 | - | - | 时间日期数字模块-NumberFormat | format(number: number): string; | 新增 | - | - | 时间日期数字模块-DateTimeOptions | locale | 新增 | - | - | 时间日期数字模块-DateTimeOptions | dateStyle | 新增 | - | - | 时间日期数字模块-DateTimeOptions | timeStyle | 新增 | - | - | 时间日期数字模块-DateTimeOptions | calendar | 新增 | - | - | 时间日期数字模块-DateTimeOptions | dayPeriod | 新增 | - | - | 时间日期数字模块-DateTimeOptions | numberingSystem | 新增 | - | - | 时间日期数字模块-DateTimeOptions | localeMatcher | 新增 | - | - | 时间日期数字模块-DateTimeOptions | timeZone | 新增 | - | - | 时间日期数字模块-DateTimeOptions | hour12 | 新增 | - | - | 时间日期数字模块-DateTimeOptions | hourCycle | 新增 | - | - | 时间日期数字模块-DateTimeOptions | formatMatcher | 新增 | - | - | 时间日期数字模块-DateTimeOptions | weekday | 新增 | - | - | 时间日期数字模块-DateTimeOptions | era | 新增 | - | - | 时间日期数字模块-DateTimeOptions | year | 新增 | - | - | 时间日期数字模块-DateTimeOptions | month | 新增 | - | - | 时间日期数字模块-DateTimeOptions | day | 新增 | - | - | 时间日期数字模块-DateTimeOptions | hour | 新增 | - | - | 时间日期数字模块-DateTimeOptions | minute | 新增 | - | - | 时间日期数字模块-DateTimeOptions | second | 新增 | - | - | 时间日期数字模块-DateTimeOptions | timeZoneName | 新增 | - | - | 时间日期数字模块-NumberOptions | locale | 新增 | - | - | 时间日期数字模块-NumberOptions | compactDisplay | 新增 | - | - | 时间日期数字模块-NumberOptions | currency | 新增 | - | - | 时间日期数字模块-NumberOptions | currencyDisplay | 新增 | - | - | 时间日期数字模块-NumberOptions | currencySign | 新增 | - | - | 时间日期数字模块-NumberOptions | localeMatcher | 新增 | - | - | 时间日期数字模块-NumberOptions | notation | 新增 | - | - | 时间日期数字模块-NumberOptions | numberingSystem | 新增 | - | - | 时间日期数字模块-NumberOptions | signDisplay | 新增 | - | - | 时间日期数字模块-NumberOptions | style | 新增 | - | - | 时间日期数字模块-NumberOptions | unit | 新增 | - | - | 时间日期数字模块-NumberOptions | unitDisplay | 新增 | - | - | 时间日期数字模块-NumberOptions | useGrouping | 新增 | - | - | 时间日期数字模块-NumberOptions | minimumIntegerDigits | 新增 | - | - | 时间日期数字模块-NumberOptions | minimumFractionDigits | 新增 | - | - | 时间日期数字模块-NumberOptions | maximumFractionDigits | 新增 | - | - | 时间日期数字模块-NumberOptions | minimumSignificantDigits | 新增 | - | - | 时间日期数字模块-NumberOptions | maximumSignificantDigits | 新增 | - | +| 时间日期数字模块-Locale | constructor(locale: string, options?:options) | 新增 | - | +| 时间日期数字模块-Locale | toString(): string | 新增 | - | +| 时间日期数字模块-Locale | maximize(): Locale | 新增 | - | +| 时间日期数字模块-Locale | minimize(): Locale | 新增 | - | +| 时间日期数字模块-Locale | calendar | 新增 | - | +| 时间日期数字模块-Locale | caseFirst | 新增 | - | +| 时间日期数字模块-Locale | collation | 新增 | - | +| 时间日期数字模块-Locale | hourCycle | 新增 | - | +| 时间日期数字模块-Locale | numberingSystem | 新增 | - | +| 时间日期数字模块-Locale | numeric | 新增 | - | +| 时间日期数字模块-Locale | language | 新增 | - | +| 时间日期数字模块-Locale | script | 新增 | - | +| 时间日期数字模块-Locale | region | 新增 | - | +| 时间日期数字模块-Locale | baseName | 新增 | - | +| 时间日期数字模块-DateTimeFormat | constructor(locale: string, options?:options) | 新增 | - | +| 时间日期数字模块-DateTimeFormat | constructor(locale: string[], options?:options) | 新增 | - | +| 时间日期数字模块-DateTimeFormat | resolvedOptions(): DateTimeOptions | 新增 | - | +| 时间日期数字模块-DateTimeFormat | format(date: Date): string; | 新增 | - | +| 时间日期数字模块-DateTimeFormat | formatRange(fromDate: Date, toDate: Date): string; | 新增 | - | +| 时间日期数字模块-NumberFormat | constructor(locale: string, options?:options) | 新增 | - | +| 时间日期数字模块-NumberFormat | constructor(locale: string[], options?:options) | 新增 | - | +| 时间日期数字模块-NumberFormat | resolvedOptions(): NumberOptions | 新增 | - | +| 时间日期数字模块-NumberFormat | format(number: number): string; | 新增 | - | +| 时间日期数字模块-DateTimeOptions | locale | 新增 | - | +| 时间日期数字模块-DateTimeOptions | dateStyle | 新增 | - | +| 时间日期数字模块-DateTimeOptions | timeStyle | 新增 | - | +| 时间日期数字模块-DateTimeOptions | calendar | 新增 | - | +| 时间日期数字模块-DateTimeOptions | dayPeriod | 新增 | - | +| 时间日期数字模块-DateTimeOptions | numberingSystem | 新增 | - | +| 时间日期数字模块-DateTimeOptions | localeMatcher | 新增 | - | +| 时间日期数字模块-DateTimeOptions | timeZone | 新增 | - | +| 时间日期数字模块-DateTimeOptions | hour12 | 新增 | - | +| 时间日期数字模块-DateTimeOptions | hourCycle | 新增 | - | +| 时间日期数字模块-DateTimeOptions | formatMatcher | 新增 | - | +| 时间日期数字模块-DateTimeOptions | weekday | 新增 | - | +| 时间日期数字模块-DateTimeOptions | era | 新增 | - | +| 时间日期数字模块-DateTimeOptions | year | 新增 | - | +| 时间日期数字模块-DateTimeOptions | month | 新增 | - | +| 时间日期数字模块-DateTimeOptions | day | 新增 | - | +| 时间日期数字模块-DateTimeOptions | hour | 新增 | - | +| 时间日期数字模块-DateTimeOptions | minute | 新增 | - | +| 时间日期数字模块-DateTimeOptions | second | 新增 | - | +| 时间日期数字模块-DateTimeOptions | timeZoneName | 新增 | - | +| 时间日期数字模块-NumberOptions | locale | 新增 | - | +| 时间日期数字模块-NumberOptions | compactDisplay | 新增 | - | +| 时间日期数字模块-NumberOptions | currency | 新增 | - | +| 时间日期数字模块-NumberOptions | currencyDisplay | 新增 | - | +| 时间日期数字模块-NumberOptions | currencySign | 新增 | - | +| 时间日期数字模块-NumberOptions | localeMatcher | 新增 | - | +| 时间日期数字模块-NumberOptions | notation | 新增 | - | +| 时间日期数字模块-NumberOptions | numberingSystem | 新增 | - | +| 时间日期数字模块-NumberOptions | signDisplay | 新增 | - | +| 时间日期数字模块-NumberOptions | style | 新增 | - | +| 时间日期数字模块-NumberOptions | unit | 新增 | - | +| 时间日期数字模块-NumberOptions | unitDisplay | 新增 | - | +| 时间日期数字模块-NumberOptions | useGrouping | 新增 | - | +| 时间日期数字模块-NumberOptions | minimumIntegerDigits | 新增 | - | +| 时间日期数字模块-NumberOptions | minimumFractionDigits | 新增 | - | +| 时间日期数字模块-NumberOptions | maximumFractionDigits | 新增 | - | +| 时间日期数字模块-NumberOptions | minimumSignificantDigits | 新增 | - | +| 时间日期数字模块-NumberOptions | maximumSignificantDigits | 新增 | - | |文件存储- system.file|mkdir|新增|-| |文件存储- system.file|rmdir|新增|-| |文件存储- system.file|get|新增|-| @@ -140,20 +140,20 @@ OpenHarmony 2.2 Beta2相较于OpenHarmony 2.0 Canary版本的API变更如下: |设备管理-DeviceManager|ExchangeMedium|新增|-| |设备管理-DeviceManager|ExchangeFreq|新增|-| |设备管理-DeviceManager|SubscribeCap|新增|-| -|设备管理-DeviceManager|createDeviceManager(bundleName: string, callback: AsyncCallback): void|新增|-| +|设备管理-DeviceManager|createDeviceManager(bundleName: string, callback: AsyncCallback\): void|新增|-| |设备管理-DeviceManager|release(): void|新增|-| -|设备管理-DeviceManager|getTrustedDeviceListSync(): Array|新增|-| +|设备管理-DeviceManager|getTrustedDeviceListSync(): Array\|新增|-| |设备管理-DeviceManager|startDeviceDiscovery(subscribeInfo: SubscribeInfo): void|新增|-| |设备管理-DeviceManager|stopDeviceDiscovery(subscribeId: number): void|新增|-| |设备管理-DeviceManager|authenticateDevice(deviceInfo: DeviceInfo): void|新增|-| -|设备管理-DeviceManager|on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void|新增|-| -|设备管理-DeviceManager|off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void|新增|-| -|设备管理-DeviceManager|on(type: 'deviceFound', callback: Callback<{ subscribeId: number, device: DeviceInfo }>): void|新增|-| -|设备管理-DeviceManager|off(type: 'deviceFound', callback?: Callback<{ subscribeId: number, device: DeviceInfo }>): void|新增|-| -|设备管理-DeviceManager|on(type: 'discoverFail', callback: Callback<{ subscribeId: number, reason: number }>): void|新增|-| -|设备管理-DeviceManager|off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void|新增|-| -|设备管理-DeviceManager|on(type: 'authResult', callback: Callback<{ deviceId: string, status: number, reason: number }>): void|新增|-| -|设备管理-DeviceManager|off(type: 'authResult', callback?: Callback<{ deviceId: string, status: number, reason: number }>): void|新增|-| +|设备管理-DeviceManager|on(type: 'deviceStateChange', callback: Callback\<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void|新增|-| +|设备管理-DeviceManager|off(type: 'deviceStateChange', callback?: Callback\<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void|新增|-| +|设备管理-DeviceManager|on(type: 'deviceFound', callback: Callback\<{ subscribeId: number, device: DeviceInfo }>): void|新增|-| +|设备管理-DeviceManager|off(type: 'deviceFound', callback?: Callback\<{ subscribeId: number, device: DeviceInfo }>): void|新增|-| +|设备管理-DeviceManager|on(type: 'discoverFail', callback: Callback\<{ subscribeId: number, reason: number }>): void|新增|-| +|设备管理-DeviceManager|off(type: 'discoverFail', callback?: Callback\<{ subscribeId: number, reason: number }>): void|新增|-| +|设备管理-DeviceManager|on(type: 'authResult', callback: Callback\<{ deviceId: string, status: number, reason: number }>): void|新增|-| +|设备管理-DeviceManager|off(type: 'authResult', callback?: Callback\<{ deviceId: string, status: number, reason: number }>): void|新增|-| |设备管理-DeviceManager|on(type: 'serviceDie', callback: () => void): void|新增|-| |设备管理-DeviceManager|off(type: 'serviceDie', callback?: () => void): void|新增|-| |播放录制|createAudioPlayer(): AudioPlayer|新增|-| @@ -171,7 +171,7 @@ OpenHarmony 2.2 Beta2相较于OpenHarmony 2.0 Canary版本的API变更如下: |播放录制|readonly duration: number|新增|-| |播放录制|readonly state: AudioState|新增|-| |播放录制|on(type: 'play' / 'pause' / 'stop' / 'reset' / 'dataLoad' / 'finish' / 'volumeChange', callback: () => void): void|新增|-| -|播放录制|on(type: 'timeUpdate', callback: Callback): void|新增|-| +|播放录制|on(type: 'timeUpdate', callback: Callback\): void|新增|-| |播放录制|on(type: 'error', callback: ErrorCallback): void|新增|-| |音频管理|getAudioManager(): AudioManager|新增|-| |音频管理|AudioVolumeType|新增|-| @@ -195,38 +195,38 @@ OpenHarmony 2.2 Beta2相较于OpenHarmony 2.0 Canary版本的API变更如下: |音频管理|RINGER_MODE_NORMAL |新增|-| |音频管理|RINGER_MODE_SILENT|新增|-| |音频管理|RINGER_MODE_VIBRATE |新增|-| -|音频管理|setVolume(audioType: AudioVolumeType, volume: number,callback: AsyncCallback): void|新增|-| -|音频管理|setVolume(audioType: AudioVolumeType, volume: number): Promise|新增|-| -|音频管理|getVolume(audioType: AudioVolumeType, callback: AsyncCallback): void|新增|-| -|音频管理|getVolume(audioType: AudioVolumeType): Promise|新增|-| -|音频管理|getMinVolume(audioType: AudioVolumeType, callback: AsyncCallback): void|新增|-| -|音频管理|getMinVolume(audioType: AudioVolumeType): Promise|新增|-| -|音频管理|getMaxVolume(audioType: AudioVolumeType, callback: AsyncCallback): void|新增|-| -|音频管理|getMaxVolume(audioType: AudioVolumeType): Promise|新增|-| -|音频管理|getDevices(deviceFlag: DeviceFlag, callback: AsyncCallback): void|新增|-| -|音频管理|getDevices(deviceFlag: DeviceFlag): Promise|新增|-| -|音频管理|getRingerMode(callback: AsyncCallback): void|新增|-| -|音频管理|getRingerMode(): Promise|新增|-| -|音频管理|setRingerMode(mode: AudioRingMode, callback: AsyncCallback): void|新增|-| -|音频管理|setRingerMode(mode: AudioRingMode): Promise|新增|-| -|音频管理|isMute(volumeType: AudioVolumeType, callback: AsyncCallback): void|新增|-| -|音频管理|isMute(volumeType: AudioVolumeType): Promise|新增|-| -|音频管理|isActive(volumeType: AudioVolumeType, callback: AsyncCallback): void|新增|-| -|音频管理|isActive(volumeType: AudioVolumeType): Promise|新增|-| -|音频管理|isMicrophoneMute(callback: AsyncCallback): void|新增|-| -|音频管理|isMicrophoneMute(): Promise|新增|-| -|音频管理|mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback) : void|新增|-| -|音频管理|mute(volumeType: AudioVolumeType, mute: boolean): Promise|新增|-| -|音频管理|setMicrophoneMute(mute: boolean, callback: AsyncCallback): void|新增|-| -|音频管理|setMicrophoneMute(mute: boolean): Promise|新增|-| -|音频管理|isDeviceActive(deviceType: DeviceType, callback: AsyncCallback): void|新增|-| -|音频管理|isDeviceActive(deviceType: DeviceType): Promise|新增|-| -|音频管理|setDeviceActive(deviceType: DeviceType, active: boolean, callback: AsyncCallback): void|新增|-| -|音频管理|setDeviceActive(deviceType: DeviceType, active: boolean): Promise|新增|-| -|音频管理|getAudioParameter(key: string, callback: AsyncCallback): void|新增|-| -|音频管理|getAudioParameter(key: string): Promise|新增|-| -|音频管理|setAudioParameter(key: string, value: string, callback: AsyncCallback): void|新增|-| -|音频管理|setAudioParameter(key: string, value: string): Promise|新增|-| +|音频管理|setVolume(audioType: AudioVolumeType, volume: number,callback: AsyncCallback\): void|新增|-| +|音频管理|setVolume(audioType: AudioVolumeType, volume: number): Promise\|新增|-| +|音频管理|getVolume(audioType: AudioVolumeType, callback: AsyncCallback\): void|新增|-| +|音频管理|getVolume(audioType: AudioVolumeType): Promise\|新增|-| +|音频管理|getMinVolume(audioType: AudioVolumeType, callback: AsyncCallback\): void|新增|-| +|音频管理|getMinVolume(audioType: AudioVolumeType): Promise\|新增|-| +|音频管理|getMaxVolume(audioType: AudioVolumeType, callback: AsyncCallback\): void|新增|-| +|音频管理|getMaxVolume(audioType: AudioVolumeType): Promise\|新增|-| +|音频管理|getDevices(deviceFlag: DeviceFlag, callback: AsyncCallback\): void|新增|-| +|音频管理|getDevices(deviceFlag: DeviceFlag): Promise\|新增|-| +|音频管理|getRingerMode(callback: AsyncCallback\): void|新增|-| +|音频管理|getRingerMode(): Promise\|新增|-| +|音频管理|setRingerMode(mode: AudioRingMode, callback: AsyncCallback\): void|新增|-| +|音频管理|setRingerMode(mode: AudioRingMode): Promise\|新增|-| +|音频管理|isMute(volumeType: AudioVolumeType, callback: AsyncCallback\): void|新增|-| +|音频管理|isMute(volumeType: AudioVolumeType): Promise\|新增|-| +|音频管理|isActive(volumeType: AudioVolumeType, callback: AsyncCallback\): void|新增|-| +|音频管理|isActive(volumeType: AudioVolumeType): Promise\|新增|-| +|音频管理|isMicrophoneMute(callback: AsyncCallback\): void|新增|-| +|音频管理|isMicrophoneMute(): Promise\|新增|-| +|音频管理|mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback\) : void|新增|-| +|音频管理|mute(volumeType: AudioVolumeType, mute: boolean): Promise\|新增|-| +|音频管理|setMicrophoneMute(mute: boolean, callback: AsyncCallback\): void|新增|-| +|音频管理|setMicrophoneMute(mute: boolean): Promise\|新增|-| +|音频管理|isDeviceActive(deviceType: DeviceType, callback: AsyncCallback\): void|新增|-| +|音频管理|isDeviceActive(deviceType: DeviceType): Promise\|新增|-| +|音频管理|setDeviceActive(deviceType: DeviceType, active: boolean, callback: AsyncCallback\): void|新增|-| +|音频管理|setDeviceActive(deviceType: DeviceType, active: boolean): Promise\|新增|-| +|音频管理|getAudioParameter(key: string, callback: AsyncCallback\): void|新增|-| +|音频管理|getAudioParameter(key: string): Promise\|新增|-| +|音频管理|setAudioParameter(key: string, value: string, callback: AsyncCallback\): void|新增|-| +|音频管理|setAudioParameter(key: string, value: string): Promise\|新增|-| |音频管理|AudioDeviceDescriptor|新增|-| |音频管理|readonly deviceRole: DeviceRole|新增|-| |音频管理|readonly deviceType: DeviceType|新增|-| diff --git a/zh-cn/release-notes/api-change/v3.0-LTS/js-apidiff-v3.0-lts.md b/zh-cn/release-notes/api-change/v3.0-LTS/js-apidiff-v3.0-lts.md index da19b9959afb10882da6e7263bd7db370312f88f..9274215ddacadeaa53a1247f63bb7c88fac53473 100644 --- a/zh-cn/release-notes/api-change/v3.0-LTS/js-apidiff-v3.0-lts.md +++ b/zh-cn/release-notes/api-change/v3.0-LTS/js-apidiff-v3.0-lts.md @@ -39,17 +39,17 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |语言编译器运行时-URL|new URSearchParams(iterable)|新增|-| |语言编译器运行时-URL|append(name: string, value: string): void;|新增|-| |语言编译器运行时-URL|delete(name: string): void;|新增|-| -|语言编译器运行时-URL|entries(): IterableIterator<[string, string]>;|新增|-| +|语言编译器运行时-URL|entries(): IterableIterator\<[string, string]>;|新增|-| |语言编译器运行时-URL|forEach(callbackfn: (value: string, key: string, parent: this) => void, thisArg?: any,): void;|新增|-| |语言编译器运行时-URL|get(name: string): string / null;|新增|-| |语言编译器运行时-URL|getAll(name: string): string[];|新增|-| |语言编译器运行时-URL|has(name: string): boolean;|新增|-| -|语言编译器运行时-URL|keys(): IterableIterator;|新增|-| +|语言编译器运行时-URL|keys(): IterableIterator\;|新增|-| |语言编译器运行时-URL|set(name: string, value: string): void;|新增|-| |语言编译器运行时-URL|sort():void;|新增|-| |语言编译器运行时-URL|toString():string|新增|-| -|语言编译器运行时-URL|values(): IterableIterator;|新增|-| -|语言编译器运行时-URL|URSearchParams[Symbol.iterator]()|新增|-| +|语言编译器运行时-URL|values(): IterableIterator\;|新增|-| +|语言编译器运行时-URL|URSearchParams\[Symbol.iterator]()|新增|-| |语言编译器运行时-URL|hash: string;|新增|-| |语言编译器运行时-URL|host: string;|新增|-| |语言编译器运行时-URL|hostname: string;|新增|-| @@ -66,12 +66,12 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |语言编译器运行时-ChildProcess|readonly ppid: number;|新增|-| |语言编译器运行时-ChildProcess|readonly exitCode: number;|新增|-| |语言编译器运行时-ChildProcess|readonly killed: boolean;|新增|-| -|语言编译器运行时-ChildProcess|wait(): Promise;|新增|-| -|语言编译器运行时-ChildProcess|getOutput(): Promise;|新增|-| -|语言编译器运行时-ChildProcess|getErrorOutput(): Promise;|新增|-| +|语言编译器运行时-ChildProcess|wait(): Promise\;|新增|-| +|语言编译器运行时-ChildProcess|getOutput(): Promise\;|新增|-| +|语言编译器运行时-ChildProcess|getErrorOutput(): Promise\;|新增|-| |语言编译器运行时-ChildProcess|close(): void;|新增|-| |语言编译器运行时-ChildProcess|kill(signal: number): void;|新增|-| -|语言编译器运行时-process|runCmd(command: string,options?: { timeout : number, killSignal : number / string, maxBuffer : number }): ChildProcess;|新增|-| +|语言编译器运行时-process|runCmd(command: string,options?: { timeout : number, killSignal : number string, maxBuffer : number }): ChildProcess;|新增|-| |语言编译器运行时-process|getPid(): number;|新增|-| |语言编译器运行时-process|getPpid(): number;|新增|-| |语言编译器运行时-process|abort(): void;|新增|-| @@ -86,35 +86,35 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |语言编译器运行时-process|uptime(): number;|新增|-| |语言编译器运行时-process|getGroups(): number[];|新增|-| |语言编译器运行时-process|kill(signal?: number, pid?: number): boolean;|新增|-| -|升级服务子系统-Updater|checkNewVersion(): Promise;|新增| -| -|升级服务子系统-Updater|rebootAndCleanUserData(callback: AsyncCallback): void;|新增| -| -|升级服务子系统-Updater|rebootAndCleanCache(): Promise;|新增| -| -|升级服务子系统-Updater|function getUpdaterFromOther(device: string, updateType?: UpdateTypes): Updater;|新增| -| +|升级服务子系统-Updater|checkNewVersion(): Promise\;|新增| -| +|升级服务子系统-Updater|rebootAndCleanUserData(callback: AsyncCallback\): void;|新增| -| +|升级服务子系统-Updater|rebootAndCleanCache(): Promise\;|新增| -| +|升级服务子系统-Updater|getUpdaterFromOther(device: string, updateType?: UpdateTypes): Updater;|新增| -| |升级服务子系统-Updater|cancel(): void;|新增| -| |升级服务子系统-Updater|upgrade(): void;|新增| -| |升级服务子系统-Updater|off(eventType: 'downloadProgress', callback?: UpdateProgressCallback): void;|新增| -| -|升级服务子系统-Updater|getUpdatePolicy(callback: AsyncCallback): void;|新增| -| -|升级服务子系统-Updater|function getUpdaterForOther(device: string, updateType?: UpdateTypes): Updater;|新增| -| -|升级服务子系统-Updater|setUpdatePolicy(policy: UpdatePolicy, callback: AsyncCallback): void;|新增| -| -|升级服务子系统-Updater|getNewVersionInfo(): Promise;|新增| -| -|升级服务子系统-Updater|function getUpdater(updateType?: UpdateTypes): Updater;|新增| -| -|升级服务子系统-Updater|applyNewVersion(callback: AsyncCallback): void;|新增| -| -|升级服务子系统-Updater|rebootAndCleanUserData(): Promise;|新增| -| +|升级服务子系统-Updater|getUpdatePolicy(callback: AsyncCallback\): void;|新增| -| +|升级服务子系统-Updater|getUpdaterForOther(device: string, updateType?: UpdateTypes): Updater;|新增| -| +|升级服务子系统-Updater|setUpdatePolicy(policy: UpdatePolicy, callback: AsyncCallback\): void;|新增| -| +|升级服务子系统-Updater|getNewVersionInfo(): Promise\;|新增| -| +|升级服务子系统-Updater|getUpdater(updateType?: UpdateTypes): Updater;|新增| -| +|升级服务子系统-Updater|applyNewVersion(callback: AsyncCallback\): void;|新增| -| +|升级服务子系统-Updater|rebootAndCleanUserData(): Promise\;|新增| -| |升级服务子系统-Updater|off(eventType: 'verifyProgress', callback?: UpdateProgressCallback): void;|新增| -| |升级服务子系统-Updater|on(eventType: 'upgradeProgress', callback: UpdateProgressCallback): void;|新增| -| -|升级服务子系统-Updater|checkNewVersion(callback: AsyncCallback): void;|新增| -| +|升级服务子系统-Updater|checkNewVersion(callback: AsyncCallback\): void;|新增| -| |升级服务子系统-Updater|on(eventType: 'downloadProgress', callback: UpdateProgressCallback): void;|新增| -| -|升级服务子系统-Updater|getUpdatePolicy(): Promise;|新增| -| +|升级服务子系统-Updater|getUpdatePolicy(): Promise\;|新增| -| |升级服务子系统-Updater|download(): void;|新增| -| |升级服务子系统-Updater|off(eventType: 'upgradeProgress', callback?: UpdateProgressCallback): void;|新增| -| -|升级服务子系统-Updater|getNewVersionInfo(callback: AsyncCallback): void;|新增| -| +|升级服务子系统-Updater|getNewVersionInfo(callback: AsyncCallback\): void;|新增| -| |升级服务子系统-Updater|on(eventType: 'verifyProgress', callback: UpdateProgressCallback): void;|新增| -| |升级服务子系统-Updater|verifyUpdatePackage(upgradeFile: string, certsFile: string): void;|新增| -| -|升级服务子系统-Updater|setUpdatePolicy(policy: UpdatePolicy): Promise;|新增| -| -|升级服务子系统-Updater|rebootAndCleanCache(callback: AsyncCallback): void;|新增| -| -|升级服务子系统-Updater|applyNewVersion(): Promise;|新增| -| -|全球化子系统-I18n|getSystemLanguages(): Array;|新增| -| -|全球化子系统-I18n|getSystemCountries(language: string): Array;|新增| -| +|升级服务子系统-Updater|setUpdatePolicy(policy: UpdatePolicy): Promise\;|新增| -| +|升级服务子系统-Updater|rebootAndCleanCache(callback: AsyncCallback\): void;|新增| -| +|升级服务子系统-Updater|applyNewVersion(): Promise\;|新增| -| +|全球化子系统-I18n|getSystemLanguages(): Array\;|新增| -| +|全球化子系统-I18n|getSystemCountries(language: string): Array\;|新增| -| |全球化子系统-I18n|isSuggested(language: string, region?: string): boolean;|新增| -| |全球化子系统-I18n|getSystemLanguage(): string;|新增| -| |全球化子系统-I18n|setSystemLanguage(language: string);|新增| -| @@ -124,76 +124,76 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |全球化子系统-I18n|getSystemLocale(): string;|新增| -| |全球化子系统-I18n|setSystemLocale(locale: string);|新增| -| |全球化子系统-I18n|"getDisplayLanguage(locale: string, displayLocale: string,sentenceCase?: boolean): string;"|新增| -| -|电话子系统-radio|getNetworkState(callback: AsyncCallback): void;getNetworkState(slotId: number, callback: AsyncCallback): void;getNetworkState(slotId?: number): Promise;|新增| -| -|电话子系统-sim|getSimAccountInfo(slotId: number, callback: AsyncCallback): void;getSimAccountInfo(slotId: number): Promise;|新增| -| -|电话子系统-sim|getDefaultVoiceSlotId(callback: AsyncCallback): void;getDefaultVoiceSlotId(): Promise;|新增| -| -|电话子系统-sim|getSimSpn(slotId: number, callback: AsyncCallback): void;getSimSpn(slotId: number): Promise;|新增| -| -|电话子系统-sim|getISOCountryCodeForSim(slotId: number, callback: AsyncCallback): void;getISOCountryCodeForSim(slotId: number): Promise;|新增| -| -|电话子系统-sim|getSimIccId(slotId: number, callback: AsyncCallback): void;getSimIccId(slotId: number): Promise;|新增| -| -|电话子系统-sim|getSimGid1(slotId: number, callback: AsyncCallback): void;getSimGid1(slotId: number): Promise;|新增| -| -|电话子系统-sim|getISOCountryCodeForSim(slotId: number, callback: AsyncCallback): void;getISOCountryCodeForSim(slotId: number): Promise;|新增| -| -|电话子系统-sim|getSimOperatorNumeric(slotId: number, callback: AsyncCallback): void;getSimOperatorNumeric(slotId: number): Promise;|新增| -| -|电话子系统-sim|getSimSpn(slotId: number, callback: AsyncCallback): void;getSimSpn(slotId: number): Promise;|新增| -| -|电话子系统-sim|getSimIccId(slotId: number, callback: AsyncCallback): void;getSimIccId(slotId: number): Promise;|新增| -| -|电话子系统-sim|getIMSI(slotId: number, callback: AsyncCallback): void;getIMSI(slotId: number): Promise;|新增| -| -|电话子系统-call|combineConference(callId: number, callback: AsyncCallback): void;combineConference(callId: number): Promise;|新增| -| -|电话子系统-call|startDTMF(callId: number, character: string, callback: AsyncCallback): void;startDTMF(callId: number, character: string): Promise;|新增| -| -|电话子系统-call|stopDTMF(callId: number, callback: AsyncCallback): void;stopDTMF(callId: number): Promise;|新增| -| -|电话子系统-sim|setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback): void;setDefaultVoiceSlotId(slotId: number): Promise;|新增| -| -|电话子系统-sim|unlockPin(slotId: number, pin: string, callback: AsyncCallback): void;unlockPin(slotId: number, pin: string): Promise;|新增| -| -|电话子系统-sim|alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback): void;alterPin(slotId: number, newPin: string, oldPin: string): Promise;|新增| -| -|电话子系统-sim|setLockState(slotId: number, pin: string, enable: number, callback: AsyncCallback): void;setLockState(slotId: number, pin: string, enable: number): Promise;|新增| -| -|电话子系统-sim|getSimState(slotId: number, callback: AsyncCallback): void;getSimState(slotId: number): Promise;|新增| -| -|电话子系统-sim|getSimState(slotId: number, callback: AsyncCallback): void;getSimState(slotId: number): Promise;|新增| -| -|电话子系统-sim|getSimState(slotId: number, callback: AsyncCallback): void;getSimState(slotId: number): Promise;|新增| -| -|电话子系统-sim|getSimState(slotId: number, callback: AsyncCallback): void;getSimState(slotId: number): Promise;|新增| -| -|电话子系统-call|isEmergencyPhoneNumber(phoneNumber: string, callback: AsyncCallback): void;isEmergencyPhoneNumber(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback): void;isEmergencyPhoneNumber(phoneNumber: string, options?: EmergencyNumberOptions): Promise;|新增| -| -|电话子系统-sms|createMessage(pdu: Array, specification: string, callback: AsyncCallback): void;createMessage(pdu: Array, specification: string): Promise;|新增| -| -|电话子系统-call|hasCall(callback: AsyncCallback): void;hasCall(): Promise;|新增| -| +|电话子系统-radio|getNetworkState(callback: AsyncCallback\): void;
getNetworkState(slotId: number, callback: AsyncCallback\): void;
getNetworkState(slotId?: number): Promise\;|新增| -| +|电话子系统-sim|getSimAccountInfo(slotId: number, callback: AsyncCallback\): void;
getSimAccountInfo(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getDefaultVoiceSlotId(callback: AsyncCallback\): void;
getDefaultVoiceSlotId(): Promise\;|新增| -| +|电话子系统-sim|getSimSpn(slotId: number, callback: AsyncCallback\): void;
getSimSpn(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getISOCountryCodeForSim(slotId: number, callback: AsyncCallback\): void;
getISOCountryCodeForSim(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getSimIccId(slotId: number, callback: AsyncCallback\): void;
getSimIccId(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getSimGid1(slotId: number, callback: AsyncCallback\): void;
getSimGid1(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getISOCountryCodeForSim(slotId: number, callback: AsyncCallback\): void;
getISOCountryCodeForSim(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getSimOperatorNumeric(slotId: number, callback: AsyncCallback\): void;
getSimOperatorNumeric(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getSimSpn(slotId: number, callback: AsyncCallback\): void;
getSimSpn(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getSimIccId(slotId: number, callback: AsyncCallback\): void;
getSimIccId(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getIMSI(slotId: number, callback: AsyncCallback\): void;
getIMSI(slotId: number): Promise\;|新增| -| +|电话子系统-call|combineConference(callId: number, callback: AsyncCallback\): void;
combineConference(callId: number): Promise\;|新增| -| +|电话子系统-call|startDTMF(callId: number, character: string, callback: AsyncCallback\): void;
startDTMF(callId: number, character: string): Promise\;|新增| -| +|电话子系统-call|stopDTMF(callId: number, callback: AsyncCallback\): void;
stopDTMF(callId: number): Promise\;|新增| -| +|电话子系统-sim|setDefaultVoiceSlotId(slotId: number, callback: AsyncCallback\): void;
setDefaultVoiceSlotId(slotId: number): Promise\;|新增| -| +|电话子系统-sim|unlockPin(slotId: number, pin: string, callback: AsyncCallback\): void;
unlockPin(slotId: number, pin: string): Promise\;|新增| -| +|电话子系统-sim|alterPin(slotId: number, newPin: string, oldPin: string, callback: AsyncCallback\): void;
alterPin(slotId: number, newPin: string, oldPin: string): Promise\;|新增| -| +|电话子系统-sim|setLockState(slotId: number, pin: string, enable: number, callback: AsyncCallback\): void;
setLockState(slotId: number, pin: string, enable: number): Promise\;|新增| -| +|电话子系统-sim|getSimState(slotId: number, callback: AsyncCallback\): void;
getSimState(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getSimState(slotId: number, callback: AsyncCallback\): void;
getSimState(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getSimState(slotId: number, callback: AsyncCallback\): void;
getSimState(slotId: number): Promise\;|新增| -| +|电话子系统-sim|getSimState(slotId: number, callback: AsyncCallback\): void;
getSimState(slotId: number): Promise\;|新增| -| +|电话子系统-call|isEmergencyPhoneNumber(phoneNumber: string, callback: AsyncCallback\): void;
isEmergencyPhoneNumber(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback\): void;
isEmergencyPhoneNumber(phoneNumber: string, options?: EmergencyNumberOptions): Promise\;|新增| -| +|电话子系统-sms|createMessage(pdu: Array\, specification: string, callback: AsyncCallback\): void;
createMessage(pdu: Array\, specification: string): Promise\;|新增| -| +|电话子系统-call|hasCall(callback: AsyncCallback\): void;
hasCall(): Promise\;|新增| -| |电话子系统-sms|sendMessage(options: SendMessageOptions): void;|新增| -| -|电话子系统-call|dial(phoneNumber: string, callback: AsyncCallback): void;dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback): void;dial(phoneNumber: string, options?: DialOptions): Promise;|新增| -| +|电话子系统-call|dial(phoneNumber: string, callback: AsyncCallback\): void;
dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback\): void;
dial(phoneNumber: string, options?: DialOptions): Promise\;|新增| -| |电话子系统-call|interface DialOptions {extras?: boolean; }|新增| -| |电话子系统-sms|sendMessage(options: SendMessageOptions): void;|新增| -| -|电话子系统-sms|getDefaultSmsSlotId(callback: AsyncCallback): void;getDefaultSmsSlotId(): Promise;|新增| -| -|电话子系统-call|formatPhoneNumber(phoneNumber: string, callback: AsyncCallback): void;formatPhoneNumber(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback): void;formatPhoneNumber(phoneNumber: string, options?: NumberFormatOptions): Promise;|新增| -| -|电话子系统-call|formatPhoneNumber(phoneNumber: string, callback: AsyncCallback): void;formatPhoneNumber(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback): void;formatPhoneNumber(phoneNumber: string, options?: NumberFormatOptions): Promise;|新增| -| -|电话子系统-call|formatPhoneNumberToE164(phoneNumber: string, countryCode: string, callback: AsyncCallback): void;formatPhoneNumberToE164(phoneNumber: string, countryCode: string): Promise;|新增| -| -|电话子系统-sms|setDefaultSmsSlotId(slotId: number, callback: AsyncCallback): void;setDefaultSmsSlotId(slotId: number): Promise;|新增| -| -|电话子系统-call|getCallState(callback: AsyncCallback): void;getCallState(): Promise;|新增| -| -|电话子系统-sms|setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback): void;setSmscAddr(slotId: number, smscAddr: string): Promise;|新增| -| -|电话子系统-sms|getSmscAddr(slotId: number, callback: AsyncCallback): void;getSmscAddr(slotId: number): Promise;|新增| -| -|电话子系统-sms|addSimMessage(options: SimMessageOptions, callback: AsyncCallback): void;addSimMessage(options: SimMessageOptions): Promise;|新增| -| -|电话子系统-sms|delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback): void;delSimMessage(slotId: number, msgIndex: number): Promise;|新增| -| -|电话子系统-radio|getISOCountryCodeForNetwork(slotId: number, callback: AsyncCallback): void;getISOCountryCodeForNetwork(slotId: number): Promise;|新增| -| -|电话子系统-sms|updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback): void;updateSimMessage(options: UpdateSimMessageOptions): Promise;|新增| -| -|电话子系统-radio|getISOCountryCodeForNetwork(slotId: number, callback: AsyncCallback): void;getISOCountryCodeForNetwork(slotId: number): Promise;|新增| -| -|电话子系统-sms|getAllSimMessages(slotId: number, callback: AsyncCallback>): void;getAllSimMessages(slotId: number): Promise>;|新增| -| -|电话子系统-call|isInEmergencyCall(callback: AsyncCallback): void;isInEmergencyCall(): Promise;|新增| -| -|电话子系统-sms|setCBConfig(options: CBConfigOptions, callback: AsyncCallback): void;setCBConfig(options: CBConfigOptions): Promise;|新增| -| -|电话子系统-call|answer(callId: number, callback: AsyncCallback): void;answer(callId: number): Promise;|新增| -| -|电话子系统-call|hangup(callId: number, callback: AsyncCallback): void;hangup(callId: number): Promise;|新增| -| -|电话子系统-call|reject(callId: number, callback: AsyncCallback): void;reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void;reject(callId: number, options?: RejectMessageOptions): Promise;|新增| -| -|电话子系统-call|holdCall(callId: number, callback: AsyncCallback): void;holdCall(callId: number): Promise;|新增| -| -|电话子系统-call|unHoldCall(callId: number, callback: AsyncCallback): void;unHoldCall(callId: number): Promise;|新增| -| -|电话子系统-call|switchCall(callId: number, callback: AsyncCallback): void;switchCall(callId: number): Promise;|新增| -| -|电话子系统-radio|setNetworkSelectionMode(options: NetworkSelectionModeOptions, callback: AsyncCallback): void;setNetworkSelectionMode(options: NetworkSelectionModeOptions): Promise;|新增| -| -|电话子系统-radio|getNetworkSearchInformation(slotId: number, callback: AsyncCallback): void;getNetworkSearchInformation(slotId: number): Promise;|新增| -| -|电话子系统-radio|getNetworkSelectionMode(slotId: number, callback: AsyncCallback): void;getNetworkSelectionMode(slotId: number): Promise;|新增| -| -|电话子系统-radio|isRadioOn(callback: AsyncCallback): void;isRadioOn(): Promise;|新增| -| -|电话子系统-radio|turnOnRadio(callback: AsyncCallback): void;turnOnRadio(): Promise;|新增| -| -|电话子系统-radio|turnOffRadio(callback: AsyncCallback): void;turnOffRadio(): Promise;|新增| -| -|电话子系统-radio|getSignalInformation(slotId: number, callback: AsyncCallback>): void;getSignalInformation(slotId: number): Promise>;|新增| -| -|电话子系统-radio|getRadioTech(slotId: number, callback: AsyncCallback<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void;getRadioTech(slotId: number): Promise<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>;|新增| -| -|电话子系统-radio|getRadioTech(slotId: number, callback: AsyncCallback<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void;getRadioTech(slotId: number): Promise<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>;|新增| -| -|电话子系统-radio|getRadioTech(slotId: number, callback: AsyncCallback<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void;getRadioTech(slotId: number): Promise<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>;|新增| -| -|数据管理-distributeddata|put(key:string, value:Uint8Array / string / boolean / number, callback: AsyncCallback):void put(key:string, value:Uint8Array / string / boolean / number):Promise|新增| -| -|数据管理-distributeddata|delete(key: string, callback: AsyncCallback): void delete(key: string): Promise|新增| -| -|数据管理-distributeddata|on(event:'dataChange', subType: SubscribeType, observer: Callback): void|新增| -| -|数据管理-distributeddata|get(key:string, callback:AsyncCallback):void get(key:string):Promise|新增| -| +|电话子系统-sms|getDefaultSmsSlotId(callback: AsyncCallback\): void;
getDefaultSmsSlotId(): Promise\;|新增| -| +|电话子系统-call|formatPhoneNumber(phoneNumber: string, callback: AsyncCallback\): void;
formatPhoneNumber(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback\): void;
formatPhoneNumber(phoneNumber: string, options?: NumberFormatOptions): Promise\;|新增| -| +|电话子系统-call|formatPhoneNumber(phoneNumber: string, callback: AsyncCallback\): void;
formatPhoneNumber(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback\): void;
formatPhoneNumber(phoneNumber: string, options?: NumberFormatOptions): Promise\;|新增| -| +|电话子系统-call|formatPhoneNumberToE164(phoneNumber: string, countryCode: string, callback: AsyncCallback\): void;
formatPhoneNumberToE164(phoneNumber: string, countryCode: string): Promise\;|新增| -| +|电话子系统-sms|setDefaultSmsSlotId(slotId: number, callback: AsyncCallback\): void;
setDefaultSmsSlotId(slotId: number): Promise\;|新增| -| +|电话子系统-call|getCallState(callback: AsyncCallback\): void;
getCallState(): Promise\;|新增| -| +|电话子系统-sms|setSmscAddr(slotId: number, smscAddr: string, callback: AsyncCallback\): void;
setSmscAddr(slotId: number, smscAddr: string): Promise\;|新增| -| +|电话子系统-sms|getSmscAddr(slotId: number, callback: AsyncCallback\): void;
getSmscAddr(slotId: number): Promise\;|新增| -| +|电话子系统-sms|addSimMessage(options: SimMessageOptions, callback: AsyncCallback\): void;
addSimMessage(options: SimMessageOptions): Promise\;|新增| -| +|电话子系统-sms|delSimMessage(slotId: number, msgIndex: number, callback: AsyncCallback\): void;
delSimMessage(slotId: number, msgIndex: number): Promise\;|新增| -| +|电话子系统-radio|getISOCountryCodeForNetwork(slotId: number, callback: AsyncCallback\): void;
getISOCountryCodeForNetwork(slotId: number): Promise\;|新增| -| +|电话子系统-sms|updateSimMessage(options: UpdateSimMessageOptions, callback: AsyncCallback\): void;
updateSimMessage(options: UpdateSimMessageOptions): Promise\;|新增| -| +|电话子系统-radio|getISOCountryCodeForNetwork(slotId: number, callback: AsyncCallback\): void;
getISOCountryCodeForNetwork(slotId: number): Promise\;|新增| -| +|电话子系统-sms|getAllSimMessages(slotId: number, callback: AsyncCallback\>): void;
getAllSimMessages(slotId: number): Promise\>;|新增| -| +|电话子系统-call|isInEmergencyCall(callback: AsyncCallback\): void;
isInEmergencyCall(): Promise\;|新增| -| +|电话子系统-sms|setCBConfig(options: CBConfigOptions, callback: AsyncCallback\): void;
setCBConfig(options: CBConfigOptions): Promise\;|新增| -| +|电话子系统-call|answer(callId: number, callback: AsyncCallback\): void;
answer(callId: number): Promise\;|新增| -| +|电话子系统-call|hangup(callId: number, callback: AsyncCallback\): void;
hangup(callId: number): Promise\;|新增| -| +|电话子系统-call|reject(callId: number, callback: AsyncCallback\): void;
reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback\): void;
reject(callId: number, options?: RejectMessageOptions): Promise\;|新增| -| +|电话子系统-call|holdCall(callId: number, callback: AsyncCallback\): void;
holdCall(callId: number): Promise\;|新增| -| +|电话子系统-call|unHoldCall(callId: number, callback: AsyncCallback\): void;
unHoldCall(callId: number): Promise\;|新增| -| +|电话子系统-call|switchCall(callId: number, callback: AsyncCallback\): void;
switchCall(callId: number): Promise\;|新增| -| +|电话子系统-radio|setNetworkSelectionMode(options: NetworkSelectionModeOptions, callback: AsyncCallback\): void;
setNetworkSelectionMode(options: NetworkSelectionModeOptions): Promise\;|新增| -| +|电话子系统-radio|getNetworkSearchInformation(slotId: number, callback: AsyncCallback\): void;
getNetworkSearchInformation(slotId: number): Promise\;|新增| -| +|电话子系统-radio|getNetworkSelectionMode(slotId: number, callback: AsyncCallback\): void;
getNetworkSelectionMode(slotId: number): Promise\;|新增| -| +|电话子系统-radio|isRadioOn(callback: AsyncCallback\): void;
isRadioOn(): Promise\;|新增| -| +|电话子系统-radio|turnOnRadio(callback: AsyncCallback\): void;
turnOnRadio(): Promise\;|新增| -| +|电话子系统-radio|turnOffRadio(callback: AsyncCallback\): void;
turnOffRadio(): Promise\;|新增| -| +|电话子系统-radio|getSignalInformation(slotId: number, callback: AsyncCallback\>): void;
getSignalInformation(slotId: number): Promise\>;|新增| -| +|电话子系统-radio|getRadioTech(slotId: number, callback: AsyncCallback\<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void;
getRadioTech(slotId: number): Promise\<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>;|新增| -| +|电话子系统-radio|getRadioTech(slotId: number, callback: AsyncCallback\<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void;
getRadioTech(slotId: number): Promise\<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>;|新增| -| +|电话子系统-radio|getRadioTech(slotId: number, callback: AsyncCallback\<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>): void;
getRadioTech(slotId: number): Promise\<{psRadioTech: RadioTechnology, csRadioTech: RadioTechnology}>;|新增| -| +|数据管理-distributeddata|put(key:string, value:Uint8Array / string / boolean / number, callback: AsyncCallback\):void put(key:string, value:Uint8Array / string / boolean / number):Promise\|新增| -| +|数据管理-distributeddata|delete(key: string, callback: AsyncCallback\): void delete(key: string): Promise\|新增| -| +|数据管理-distributeddata|on(event:'dataChange', subType: SubscribeType, observer: Callback\): void|新增| -| +|数据管理-distributeddata|get(key:string, callback:AsyncCallback\):void get(key:string):Promise\|新增| -| |数据管理-distributeddata|sync(deviceIdList:string[], mode:SyncMode, allowedDelayMs?:number):void|新增| -| -|数据管理-distributeddata|createKVManager(config: KVManagerConfig, callback: AsyncCallback): void;createKVManager(config: KVManagerConfig): Promise;|新增| -| -|数据管理-distributeddata|getKVStore(options: Options, storeId: string): Promise;getKVStore(options: Options, storeId: string, callback: AsyncCallback): void;|新增| -| -|数据管理-distributeddata|on(event:'syncComplete', syncCallback: Callback>):void|新增| -| +|数据管理-distributeddata|createKVManager(config: KVManagerConfig, callback: AsyncCallback\): void;
createKVManager(config: KVManagerConfig): Promise\;|新增| -| +|数据管理-distributeddata|getKVStore\(options: Options, storeId: string): Promise\;
getKVStore\(options: Options, storeId: string, callback: AsyncCallback\): void;|新增| -| +|数据管理-distributeddata|on(event:'syncComplete', syncCallback: Callback\>):void|新增| -| |数据管理-rdb|type ValueType = number / string / boolean;|新增| -| |数据管理-rdb|type ValuesBucket = { [key: string]: ValueType / Uint8Array / null; }|新增| -| |数据管理-rdb|name: string;|新增| -| @@ -202,13 +202,13 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |数据管理-rdb|notEqualTo(field: string, value: ValueType): RdbPredicates;|新增| -| |数据管理-rdb|beginWrap(): RdbPredicates;|新增| -| |数据管理-rdb|endWrap(): RdbPredicates;|新增| -| -|数据管理-rdb|function getRdbStore(config: StoreConfig, version: number, callback: AsyncCallback): void;function getRdbStore(config: StoreConfig, version: number): Promise;|新增| -| -|数据管理-rdb|function deleteRdbStore(name: string, callback: AsyncCallback): void;function deleteRdbStore(name: string): Promise;|新增| -| -|数据管理-rdb|insert(name: string, values: ValuesBucket, callback: AsyncCallback): void;insert(name: string, values: ValuesBucket): Promise;|新增| -| -|数据管理-rdb|update(values: ValuesBucket, rdbPredicates: RdbPredicates, callback: AsyncCallback): void;update(values: ValuesBucket, rdbPredicates: RdbPredicates): Promise;|新增| -| -|数据管理-rdb|delete(rdbPredicates: RdbPredicates, callback: AsyncCallback): void;delete(rdbPredicates: RdbPredicates): Promise;|新增| -| -|数据管理-rdb|query(rdbPredicates: RdbPredicates, columns: Array, callback: AsyncCallback): void;query(rdbPredicates: RdbPredicates, columns: Array): Promise;|新增| -| -|数据管理-rdb|executeSql(sql: string, bindArgs: Array, callback: AsyncCallback): void;executeSql(sql: string, bindArgs: Array): Promise;|新增| -| +|数据管理-rdb|getRdbStore(config: StoreConfig, version: number, callback: AsyncCallback\): void;
getRdbStore(config: StoreConfig, version: number): Promise\;|新增| -| +|数据管理-rdb|deleteRdbStore(name: string, callback: AsyncCallback\): void;
deleteRdbStore(name: string): Promise\;|新增| -| +|数据管理-rdb|insert(name: string, values: ValuesBucket, callback: AsyncCallback\): void;
insert(name: string, values: ValuesBucket): Promise\;|新增| -| +|数据管理-rdb|update(values: ValuesBucket, rdbPredicates: RdbPredicates, callback: AsyncCallback\): void;
update(values: ValuesBucket, rdbPredicates: RdbPredicates): Promise\;|新增| -| +|数据管理-rdb|delete(rdbPredicates: RdbPredicates, callback: AsyncCallback\): void;
delete(rdbPredicates: RdbPredicates): Promise\;|新增| -| +|数据管理-rdb|query(rdbPredicates: RdbPredicates, columns: Array\, callback: AsyncCallback\): void;
query(rdbPredicates: RdbPredicates, columns: Array\): Promise\;|新增| -| +|数据管理-rdb|executeSql(sql: string, bindArgs: Array\, callback: AsyncCallback\): void;
executeSql(sql: string, bindArgs: Array\): Promise\;|新增| -| |数据管理-rdb|like(field: string, value: string): RdbPredicates;|新增| -| |数据管理-rdb|glob(field: string, value: string): RdbPredicates;|新增| -| |数据管理-rdb|between(field: string, low: ValueType, high: ValueType): RdbPredicates;|新增| -| @@ -243,10 +243,10 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |数据管理-dataAbility|distinct(): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|limitAs(value: number): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|offsetAs(rowOffset: number): DataAbilityPredicates;|新增| -| -|数据管理-dataAbility|groupBy(fields: Array): DataAbilityPredicates;|新增| -| +|数据管理-dataAbility|groupBy(fields: Array\): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|indexedBy(field: string): DataAbilityPredicates;|新增| -| -|数据管理-dataAbility|in(field: string, value: Array): DataAbilityPredicates;|新增| -| -|数据管理-dataAbility|notIn(field: string, value: Array): DataAbilityPredicates;|新增| -| +|数据管理-dataAbility|in(field: string, value: Array\): DataAbilityPredicates;|新增| -| +|数据管理-dataAbility|notIn(field: string, value: Array\): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|glob(field: string, value: string): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|between(field: string, low: ValueType, high: ValueType): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|notBetween(field: string, low: ValueType, high: ValueType): DataAbilityPredicates;|新增| -| @@ -257,7 +257,7 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |数据管理-dataAbility|orderByAsc(field: string): DataAbilityPredicates;|新增| -| |数据管理-rdb|isColumnNull(columnIndex: number): boolean;|新增| -| |数据管理-rdb|close(): void;|新增| -| -|数据管理-dataAbility|function createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates;|新增| -| +|数据管理-dataAbility|createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): rdb.RdbPredicates;|新增| -| |数据管理-dataAbility|equalTo(field: string, value: ValueType): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|notEqualTo(field: string, value: ValueType): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|beginWrap():DataAbilityPredicates;|新增| -| @@ -267,7 +267,7 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |数据管理-rdb|distinct(): RdbPredicates;|新增| -| |数据管理-rdb|limitAs(value: number): RdbPredicates;|新增| -| |数据管理-rdb|offsetAs(rowOffset: number): RdbPredicates;|新增| -| -|数据管理-rdb|groupBy(fields: Array): RdbPredicates;|新增| -| +|数据管理-rdb|groupBy(fields: Array\): RdbPredicates;|新增| -| |数据管理-rdb|indexedBy(field: string): RdbPredicates;|新增| -| |数据管理-dataAbility|or(): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|and(): DataAbilityPredicates;|新增| -| @@ -277,9 +277,9 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |数据管理-dataAbility|isNull(field: string): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|isNotNull(field: string): DataAbilityPredicates;|新增| -| |数据管理-dataAbility|like(field: string, value: string): DataAbilityPredicates;|新增| -| -|数据管理-rdb|in(field: string, value: Array): RdbPredicates;|新增| -| -|数据管理-rdb|notIn(field: string, value: Array): RdbPredicates;|新增| -| -|数据管理-rdb|columnNames: Array;|新增| -| +|数据管理-rdb|in(field: string, value: Array\): RdbPredicates;|新增| -| +|数据管理-rdb|notIn(field: string, value: Array\): RdbPredicates;|新增| -| +|数据管理-rdb|columnNames: Array\;|新增| -| |数据管理-rdb|columnCount: number;|新增| -| |数据管理-rdb|rowCount: number;|新增| -| |数据管理-rdb|rowIndex: number;|新增| -| @@ -288,7 +288,7 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |事件通知-notification|title: string;|新增| -| |事件通知-notification|sound?: string;|新增| -| |事件通知-notification|text: string;|新增| -| -|事件通知-notification|vibrationValues?: Array;|新增| -| +|事件通知-notification|vibrationValues?: Array\;|新增| -| |事件通知-wantAgent|want?: Want;|新增| -| |事件通知-notification|vibrationEnabled?: boolean;|新增| -| |事件通知-notification|badgeFlag?: boolean;|新增| -| @@ -301,7 +301,7 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |事件通知-notification|briefText: string;|新增| -| |事件通知-notification|bypassDnd?: boolean;|新增| -| |事件通知-notification|additionalText?: string;|新增| -| -|事件通知-wantagent|function cancel(info: WantAgentInfo, callback: AsyncCallback): void;|新增| -| +|事件通知-wantagent|cancel(info: WantAgentInfo, callback: AsyncCallback\): void;|新增| -| |事件通知-wantAgent|enum OperationType|新增| -| |事件通知-wantAgent|enum WantAgentFlags|新增| -| |事件通知-wantAgent|permission?: string;|新增| -| @@ -309,20 +309,20 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |事件通知-notification|normal?: NotificationBasicContent;|新增| -| |事件通知-notification|expandedTitle: string;|新增| -| |事件通知-notification|expandedTitle: string;|新增| -| -|事件通知-wantAgent|function trigger(info: WantAgentInfo, triggerInfo: TriggerInfo, callback: AsyncCallback): void;|新增| -| +|事件通知-wantAgent|trigger(info: WantAgentInfo, triggerInfo: TriggerInfo, callback: AsyncCallback\): void;|新增| -| |事件通知-wantAgent|extraInfo?: {[key: string]: any};|新增| -| |事件通知-notification|multiLine?: NotificationMultiLineContent;|新增| -| |事件通知-notification|level?: notification.SlotLevel;|新增| -| |事件通知-notification|lightColor?: number;|新增| -| |事件通知-notification|lightEnabled?: boolean;|新增| -| -|事件通知-notification|lines: Array;|新增| -| +|事件通知-notification|lines: Array\;|新增| -| |事件通知-notification|lockscreenVisibility?: number;|新增| -| |事件通知-notification|longText: string;|新增| -| -|事件通知-wantAgent|function getBundleName(info: WantAgentInfo, callback: AsyncCallback): void;|新增| -| +|事件通知-wantAgent|getBundleName(info: WantAgentInfo, callback: AsyncCallback\): void;|新增| -| |事件通知-notification|longText?: NotificationLongTextContent;|新增| -| |事件通知-notification|longTitle: string;|新增| -| -|事件通知-wantAgent|function judgeEquality(info: WantAgentInfo, info2: WantAgentInfo, callback: AsyncCallback): void;|新增| -| -|事件通知-wantAgent|function getUid(info: WantAgentInfo, callback: AsyncCallback): void;|新增| -| +|事件通知-wantAgent|judgeEquality(info: WantAgentInfo, info2: WantAgentInfo, callback: AsyncCallback\): void;|新增| -| +|事件通知-wantAgent|getUid(info: WantAgentInfo, callback: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|COMMON_EVENT_IVI_TEMPERATURE_ABNORMAL = common.event.IVI_TEMPERATURE_ABNORMAL,|新增| -| |事件通知-commonEvent|COMMON_EVENT_IVI_VOLTAGE_RECOVERY = common.event.IVI_VOLTAGE_RECOVERY,|新增| -| |事件通知-commonEvent|COMMON_EVENT_IVI_TEMPERATURE_RECOVERY = common.event.IVI_TEMPERATURE_RECOVERY,|新增| -| @@ -391,35 +391,35 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |事件通知-commonEvent|COMMON_EVENT_HWID_LOGOFF = common.event.HWID_LOGOFF,|新增| -| |事件通知-commonEvent|COMMON_EVENT_WIFI_POWER_STATE = usual.event.wifi.POWER_STATE,|新增| -| |事件通知-commonEvent|COMMON_EVENT_WIFI_SCAN_FINISHED = usual.event.wifi.SCAN_FINISHED,|新增| -| -|事件通知-commonEvent|clearAbortCommonEvent(): Promise;|新增| -| +|事件通知-commonEvent|clearAbortCommonEvent(): Promise\;|新增| -| |事件通知-commonEvent|bundleName?: string;|新增| -| |事件通知-commonEvent|code?: number;|新增| -| |事件通知-commonEvent|data?: string;|新增| -| -|事件通知-commonEvent|subscriberPermissions?: Array;|新增| -| +|事件通知-commonEvent|subscriberPermissions?: Array\;|新增| -| |事件通知-commonEvent|isOrdered?: boolean;|新增| -| |事件通知-commonEvent|isSticky?: boolean;|新增| -| -|事件通知-commonEvent|abortCommonEvent(callback: AsyncCallback): void;|新增| -| -|事件通知-commonEvent|abortCommonEvent(): Promise;|新增| -| -|事件通知-commonEvent|function createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise;|新增| -| -|事件通知-commonEvent|function createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback): void;|新增| -| -|事件通知-commonEvent|function subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): void;|新增| -| -|事件通知-commonEvent|function publish(event: string, options: CommonEventPublishData, callback: AsyncCallback): void;|新增| -| -|事件通知-commonEvent|isOrderedCommonEvent(callback: AsyncCallback): void;|新增| -| -|事件通知-commonEvent|isOrderedCommonEvent(): Promise;|新增| -| +|事件通知-commonEvent|abortCommonEvent(callback: AsyncCallback\): void;|新增| -| +|事件通知-commonEvent|abortCommonEvent(): Promise\;|新增| -| +|事件通知-commonEvent|createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise\;|新增| -| +|事件通知-commonEvent|createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback\): void;|新增| -| +|事件通知-commonEvent|subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback\): void;|新增| -| +|事件通知-commonEvent|publish(event: string, options: CommonEventPublishData, callback: AsyncCallback\): void;|新增| -| +|事件通知-commonEvent|isOrderedCommonEvent(callback: AsyncCallback\): void;|新增| -| +|事件通知-commonEvent|isOrderedCommonEvent(): Promise\;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BOOT_COMPLETED = usual.event.BOOT_COMPLETED,|新增| -| |事件通知-commonEvent|COMMON_EVENT_LOCKED_BOOT_COMPLETED = usual.event.LOCKED_BOOT_COMPLETED,|新增| -| |事件通知-commonEvent|COMMON_EVENT_SHUTDOWN = usual.event.SHUTDOWN,|新增| -| -|事件通知-commonEvent|isStickyCommonEvent(): Promise;|新增| -| -|事件通知-commonEvent|getData(callback: AsyncCallback): void;|新增| -| -|事件通知-commonEvent|getData(): Promise;|新增| -| -|事件通知-commonEvent|getSubscribeInfo(callback: AsyncCallback): void;|新增| -| -|事件通知-commonEvent|getSubscribeInfo(): Promise;|新增| -| -|事件通知-commonEvent|function publish(event: string, callback: AsyncCallback): void;|新增| -| +|事件通知-commonEvent|isStickyCommonEvent(): Promise\;|新增| -| +|事件通知-commonEvent|getData(callback: AsyncCallback\): void;|新增| -| +|事件通知-commonEvent|getData(): Promise\;|新增| -| +|事件通知-commonEvent|getSubscribeInfo(callback: AsyncCallback\): void;|新增| -| +|事件通知-commonEvent|getSubscribeInfo(): Promise\;|新增| -| +|事件通知-commonEvent|publish(event: string, callback: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|event: string|新增| -| |事件通知-commonEvent|bundleName?: string;|新增| -| |事件通知-commonEvent|code?: number;|新增| -| |事件通知-commonEvent|data?: string;|新增| -| -|事件通知-commonEvent|setCode(code: number, callback: AsyncCallback): void;|新增| -| +|事件通知-commonEvent|setCode(code: number, callback: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|COMMON_EVENT_DRIVE_MODE = common.event.DRIVE_MODE,|新增| -| |事件通知-commonEvent|COMMON_EVENT_HOME_MODE = common.event.HOME_MODE,|新增| -| |事件通知-commonEvent|COMMON_EVENT_OFFICE_MODE = common.event.OFFICE_MODE,|新增| -| @@ -455,36 +455,36 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |事件通知-commonEvent|COMMON_EVENT_BATTERY_OKAY = usual.event.BATTERY_OKAY,|新增| -| |事件通知-commonEvent|COMMON_EVENT_POWER_CONNECTED = usual.event.POWER_CONNECTED,|新增| -| |事件通知-commonEvent|COMMON_EVENT_POWER_DISCONNECTED = usual.event.POWER_DISCONNECTED,|新增| -| -|事件通知-commonEvent|function unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback): void;|新增| -| +|事件通知-commonEvent|unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_CONNECTED = usual.event.bluetooth.remotedevice.ACL_CONNECTED,|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_ACL_DISCONNECTED = usual.event.bluetooth.remotedevice.ACL_DISCONNECTED,|新增| -| -|事件通知-commonEvent|getAbortCommonEvent(callback: AsyncCallback): void;|新增| -| +|事件通知-commonEvent|getAbortCommonEvent(callback: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_NAME_UPDATE = usual.event.bluetooth.remotedevice.NAME_UPDATE,|新增| -| -|事件通知-commonEvent|getAbortCommonEvent(): Promise;|新增| -| +|事件通知-commonEvent|getAbortCommonEvent(): Promise\;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_CONNECT_STATE_UPDATE = usual.event.bluetooth.handsfreeunit.CONNECT_STATE_UPDATE,|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIR_STATE = usual.event.bluetooth.remotedevice.PAIR_STATE,|新增| -| -|事件通知-commonEvent|getCode(callback: AsyncCallback): void;|新增| -| -|事件通知-commonEvent|setCode(code: number): Promise;|新增| -| +|事件通知-commonEvent|getCode(callback: AsyncCallback\): void;|新增| -| +|事件通知-commonEvent|setCode(code: number): Promise\;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AUDIO_STATE_UPDATE = usual.event.bluetooth.handsfreeunit.AUDIO_STATE_UPDATE,|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_BATTERY_VALUE_UPDATE = usual.event.bluetooth.remotedevice.BATTERY_VALUE_UPDATE,|新增| -| -|事件通知-commonEvent|getCode(): Promise;|新增| -| +|事件通知-commonEvent|getCode(): Promise\;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_COMMON_EVENT = usual.event.bluetooth.handsfreeunit.AG_COMMON_EVENT,|新增| -| -|事件通知-commonEvent|setCodeAndData(code: number, data: string, callback: AsyncCallback): void;|新增| -| +|事件通知-commonEvent|setCodeAndData(code: number, data: string, callback: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_SDP_RESULT = usual.event.bluetooth.remotedevice.SDP_RESULT,|新增| -| -|事件通知-commonEvent|isStickyCommonEvent(callback: AsyncCallback): void;|新增| -| +|事件通知-commonEvent|isStickyCommonEvent(callback: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_HANDSFREEUNIT_AG_CALL_STATE_UPDATE = usual.event.bluetooth.handsfreeunit.AG_CALL_STATE_UPDATE,|新增| -| -|事件通知-commonEvent|setCodeAndData(code: number, data: string): Promise;|新增| -| -|事件通知-commonEvent|events: Array;|新增| -| +|事件通知-commonEvent|setCodeAndData(code: number, data: string): Promise\;|新增| -| +|事件通知-commonEvent|events: Array\;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_HOST_STATE_UPDATE = usual.event.bluetooth.host.STATE_UPDATE,|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_A2DPSOURCE_PLAYING_STATE_UPDATE = usual.event.bluetooth.a2dpsource.PLAYING_STATE_UPDATE,|新增| -| -|事件通知-commonEvent|setData(data: string, callback: AsyncCallback): void;|新增| -| +|事件通知-commonEvent|setData(data: string, callback: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_A2DPSOURCE_AVRCP_CONNECT_STATE_UPDATE = usual.event.bluetooth.a2dpsource.AVRCP_CONNECT_STATE_UPDATE,|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_HOST_REQ_DISCOVERABLE = usual.event.bluetooth.host.REQ_DISCOVERABLE,|新增| -| |事件通知-commonEvent|publisherPermission?: string;|新增| -| -|事件通知-commonEvent|setData(data: string): Promise;|新增| -| +|事件通知-commonEvent|setData(data: string): Promise\;|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_UUID_VALUE = usual.event.bluetooth.remotedevice.UUID_VALUE,|新增| -| |事件通知-commonEvent|publisherDeviceId?: string;|新增| -| -|事件通知-commonEvent|clearAbortCommonEvent(callback: AsyncCallback): void;|新增| -| +|事件通知-commonEvent|clearAbortCommonEvent(callback: AsyncCallback\): void;|新增| -| |事件通知-commonEvent|userId?: number;|新增| -| |事件通知-commonEvent|COMMON_EVENT_TIMEZONE_CHANGED = usual.event.TIMEZONE_CHANGED,|新增| -| |事件通知-commonEvent|COMMON_EVENT_BLUETOOTH_REMOTEDEVICE_PAIRING_REQ = usual.event.bluetooth.remotedevice.PAIRING_REQ,|新增| -| @@ -527,63 +527,63 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |事件通知-notification|badgeIconStyle?: number;|新增| -| |事件通知-notification|showDeliveryTime?: boolean;|新增| -| |事件通知-notification|isAlertOnce?: boolean;|新增| -| -|事件通知-notification|function getActiveNotifications(callback: AsyncCallback>): void;|新增| -| +|事件通知-notification|getActiveNotifications(callback: AsyncCallback\>): void;|新增| -| |事件通知-notification|isStopwatch?: boolean;|新增| -| |事件通知-notification|isCountDown?: boolean;|新增| -| -|事件通知-notification|function getActiveNotifications(): Promise>;|新增| -| -|事件通知-notification|function getActiveNotificationCount(callback: AsyncCallback): void;|新增| -| +|事件通知-notification|getActiveNotifications(): Promise\>;|新增| -| +|事件通知-notification|getActiveNotificationCount(callback: AsyncCallback\): void;|新增| -| |事件通知-notification|readonly creatorUid?: number;|新增| -| -|事件通知-notification|function getActiveNotificationCount(): Promise;|新增| -| +|事件通知-notification|getActiveNotificationCount(): Promise\;|新增| -| |事件通知-notification|readonly creatorPid?: number;|新增| -| -|事件通知-notification|function cancel(id: number, label?: string): Promise;|新增| -| +|事件通知-notification|cancel(id: number, label?: string): Promise\;|新增| -| |事件通知-notification|classification?: string;|新增| -| |事件通知-notification|readonly hashCode?: string;|新增| -| -|事件通知-notification|function cancelAll(callback: AsyncCallback): void;|新增| -| -|事件通知-notification|actionButtons?: Array;|新增| -| -|事件通知-notification|function cancelAll(): Promise;|新增| -| +|事件通知-notification|cancelAll(callback: AsyncCallback\): void;|新增| -| +|事件通知-notification|actionButtons?: Array\;|新增| -| +|事件通知-notification|cancelAll(): Promise\;|新增| -| |事件通知-notification|smallIcon?: image.PixelMap;|新增| -| |事件通知-notification|isUnremovable?: boolean;|新增| -| |事件通知-notification|largeIcon?: image.PixelMap;|新增| -| |事件通知-notification|deliveryTime?: number;|新增| -| |事件通知-notification|readonly creatorBundleName?: string;|新增| -| |事件通知-notification|tapDismissed?: boolean;|新增| -| -|事件通知-notification|function publish(request: NotificationRequest): Promise;|新增| -| +|事件通知-notification|publish(request: NotificationRequest): Promise\;|新增| -| |事件通知-notification|autoDeletedTime?: number;|新增| -| -|事件通知-notification|function cancel(id: number, callback: AsyncCallback): void;|新增| -| +|事件通知-notification|cancel(id: number, callback: AsyncCallback\): void;|新增| -| |事件通知-notification|content: NotificationContent;|新增| -| |事件通知-notification|wantAgent?: WantAgentInfo;|新增| -| -|事件通知-notification|function cancel(id: number, label: string, callback: AsyncCallback): void;|新增| -| -|事件通知-notification|function getSlot(slotType: SlotType, callback: AsyncCallback): void;|新增| -| +|事件通知-notification|cancel(id: number, label: string, callback: AsyncCallback\): void;|新增| -| +|事件通知-notification|getSlot(slotType: SlotType, callback: AsyncCallback\): void;|新增| -| |事件通知-notification|extraInfo?: {[key: string]: any};|新增| -| -|事件通知-notification|function getSlot(slotType: SlotType): Promise;|新增| -| +|事件通知-notification|getSlot(slotType: SlotType): Promise\;|新增| -| |事件通知-notification|SERVICE_INFORMATION = 2,|新增| -| |事件通知-notification|color?: number;|新增| -| |事件通知-notification|id?: number;|新增| -| -|事件通知-notification|function getSlots(callback: AsyncCallback>): void;|新增| -| +|事件通知-notification|getSlots(callback: AsyncCallback\>): void;|新增| -| |事件通知-notification|CONTENT_INFORMATION = 3,|新增| -| |事件通知-notification|slotType?: notification.SlotType;|新增| -| |事件通知-notification|colorEnabled?: boolean;|新增| -| |事件通知-notification|OTHER_TYPES = 0xFFFF,|新增| -| |事件通知-notification|isOngoing?: boolean;|新增| -| -|事件通知-notification|function addSlot(type: SlotType, callback: AsyncCallback): void;|新增| -| +|事件通知-notification|addSlot(type: SlotType, callback: AsyncCallback\): void;|新增| -| |事件通知-notification|id: number;|新增| -| -|事件通知-notification|function addSlot(type: SlotType): Promise;|新增| -| +|事件通知-notification|addSlot(type: SlotType): Promise\;|新增| -| |事件通知-notification|desc?: string;|新增| -| -|事件通知-notification|function publish(request: NotificationRequest, callback: AsyncCallback): void;|新增| -| -|事件通知-notification|function removeAllSlots(callback: AsyncCallback): void;|新增| -| -|事件通知-notification|function removeAllSlots(): Promise;|新增| -| -|事件通知-notification|function getSlots(): Promise>;|新增| -| -|事件通知-notification|function removeSlot(slotType: SlotType, callback: AsyncCallback): void;|新增| -| -|事件通知-notification|function removeSlot(slotType: SlotType): Promise;|新增| -| -|全球化-resourceManager|getString(resId: number, callback: AsyncCallback);getString(resId: number): Promise;|新增| -| -|全球化-resourceManager|getStringArray(resId: number, callback: AsyncCallback>);getStringArray(resId: number): Promise>;|新增| -| -|全球化-resourceManager|getConfiguration(callback: AsyncCallback);getConfiguration(): Promise;|新增| -| -|全球化-resourceManager|getDeviceCapability(callback: AsyncCallback);getDeviceCapability(): Promise;|新增| -| -|全球化-resourceManager|getMedia(resId: number, callback: AsyncCallback);getMedia(resId: number): Promise;getMediaBase64(resId: number, callback: AsyncCallback);getMediaBase64(resId: number): Promise;|新增| -| -|全球化-resourceManager|"getPluralString(resId: number, num: number, callback: AsyncCallback);getPluralString(resId: number, num: number): Promise;"|新增| -| +|事件通知-notification|publish(request: NotificationRequest, callback: AsyncCallback\): void;|新增| -| +|事件通知-notification|removeAllSlots(callback: AsyncCallback\): void;|新增| -| +|事件通知-notification|removeAllSlots(): Promise\;|新增| -| +|事件通知-notification|getSlots(): Promise\>;|新增| -| +|事件通知-notification|removeSlot(slotType: SlotType, callback: AsyncCallback\): void;|新增| -| +|事件通知-notification|removeSlot(slotType: SlotType): Promise\;|新增| -| +|全球化-resourceManager|getString(resId: number, callback: AsyncCallback\);
getString(resId: number): Promise\;|新增| -| +|全球化-resourceManager|getStringArray(resId: number, callback: AsyncCallback\>);
getStringArray(resId: number): Promise\>;|新增| -| +|全球化-resourceManager|getConfiguration(callback: AsyncCallback\);
getConfiguration(): Promise\;|新增| -| +|全球化-resourceManager|getDeviceCapability(callback: AsyncCallback\);
getDeviceCapability(): Promise\;|新增| -| +|全球化-resourceManager|getMedia(resId: number, callback: AsyncCallback\);
getMedia(resId: number): Promise\;
getMediaBase64(resId: number, callback: AsyncCallback\);
getMediaBase64(resId: number): Promise\;|新增| -| +|全球化-resourceManager|"getPluralString(resId: number, num: number, callback: AsyncCallback\);
getPluralString(resId: number, num: number): Promise\;"|新增| -| |全球化-resourceManager|DeviceCapability|新增| -| -|全球化-resourceManager|"getMediaBase64(resId: number, callback: AsyncCallback);getMediaBase64(resId: number): Promise;"|新增| -| -|全球化-resourceManager|"getResourceManager(callback: AsyncCallback);getResourceManager(bundleName: string, callback: AsyncCallback);getResourceManager(): Promise;getResourceManager(bundleName: string): Promise;"|新增| -| +|全球化-resourceManager|"getMediaBase64(resId: number, callback: AsyncCallback\);
getMediaBase64(resId: number): Promise\;"|新增| -| +|全球化-resourceManager|"getResourceManager(callback: AsyncCallback\);
getResourceManager(bundleName: string, callback: AsyncCallback\);
getResourceManager(): Promise\;
getResourceManager(bundleName: string): Promise\;"|新增| -| |全球化-resourceManager|DeviceType|新增| -| |全球化-resourceManager|Direction|新增| -| |全球化-resourceManager|Configuration|新增| -| @@ -615,11 +615,11 @@ OpenHarmony 3.0 LTS相较于OpenHarmony 2.2 Beta2版本的API变更如下: |电源服务-batteryInfo|BatteryPluggedType:AC|新增| -| |电源服务-batteryInfo|BatteryPluggedType:USB|新增| -| |电源服务-runningLock|RunningLock:unlock()|新增| -| -|电源服务-runningLock|runningLock:isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback): void;|新增| -| +|电源服务-runningLock|runningLock:isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback\): void;|新增| -| |电源服务-runningLock|runningLock:createRunningLock(name: string, type: runningLockType): RunningLock|新增| -| |电源服务-runningLock|RunningLock:lock(timeout: number)|新增| -| |电源服务-runningLock|RunningLock:isUsed(): boolean|新增| -| |电源服务-runninglock|RunningLockType:BACKGROUND|新增| -| |电源服务-runninglock|RunningLockType:PROXIMITY_SCREEN_CONTROL|新增| -| |电源服务-power|power:rebootDevice(reason ?: string)|新增| -| -|电源服务-power|power:isScreenOn(callback: AsyncCallback): void;|新增| -| +|电源服务-power|power:isScreenOn(callback: AsyncCallback\): void;|新增| -| diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability.md index 099ecf9f3b762aeee0795ebb62af347783c54569..59a2f0d2cf7bd09ee68db9ea8d2b8808cf925676 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability.md @@ -6,18 +6,18 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,元能力子 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| featureability | FeatureAbility | static getDeviceList(flag: number): Promise; | 新增 | +| featureability | FeatureAbility | static getDeviceList(flag: number): Promise\; | 新增 | | customizeData | CustomizeData | extra: string; | 新增 | | applicationInfo | ApplicationInfo | readonly entityType: string; | 新增 | | applicationInfo | ApplicationInfo | readonly uid: number; | 新增 | | applicationInfo | ApplicationInfo | readonly accessTokenId: number; | 新增 | | applicationInfo | ApplicationInfo | readonly removable: boolean; | 新增 | -| applicationInfo | ApplicationInfo | readonly metaData: Map>; | 新增 | +| applicationInfo | ApplicationInfo | readonly metaData: Map\>; | 新增 | | applicationInfo | ApplicationInfo | readonly codePath: string; | 新增 | -| applicationInfo | ApplicationInfo | readonly moduleInfos: Array; | 新增 | +| applicationInfo | ApplicationInfo | readonly moduleInfos: Array\; | 新增 | | shellCmdResult | ShellCmdResult | exitCode: number; | 新增 | | shellCmdResult | ShellCmdResult | stdResult: String; | 新增 | -| ProcessRunningInfo | ProcessRunningInfo | bundleNames: Array; | 新增 | +| ProcessRunningInfo | ProcessRunningInfo | bundleNames: Array\; | 新增 | | ProcessRunningInfo | ProcessRunningInfo | processName: string; | 新增 | | ProcessRunningInfo | ProcessRunningInfo | uid: number; | 新增 | | ProcessRunningInfo | ProcessRunningInfo | pid: number; | 新增 | @@ -26,29 +26,29 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,元能力子 | abilityDelegatorArgs | AbilityDelegatorArgs | testCaseNames: string; | 新增 | | abilityDelegatorArgs | AbilityDelegatorArgs | parameters: {[key: string]: string}; | 新增 | | abilityDelegatorArgs | AbilityDelegatorArgs | bundleName: string; | 新增 | -| abilityDelegator | AbilityDelegator | executeShellCommand(cmd: string, callback: AsyncCallback): void;
executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback): void;
executeShellCommand(cmd: string, timeoutSecs?: number): Promise; | 新增 | -| abilityDelegator | AbilityDelegator | print(msg: string, callback: AsyncCallback): void;
print(msg: string): Promise; | 新增 | -| context | Context | printDrawnCompleted(callback: AsyncCallback): void;
printDrawnCompleted(): Promise; | 新增 | -| context | Context | isUpdatingConfigurations(callback: AsyncCallback): void;
isUpdatingConfigurations(): Promise; | 新增 | -| context | Context | getAbilityInfo(callback: AsyncCallback): void
getAbilityInfo(): Promise; | 新增 | +| abilityDelegator | AbilityDelegator | executeShellCommand(cmd: string, callback: AsyncCallback\): void;
executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback\): void;
executeShellCommand(cmd: string, timeoutSecs?: number): Promise\; | 新增 | +| abilityDelegator | AbilityDelegator | print(msg: string, callback: AsyncCallback\): void;
print(msg: string): Promise\; | 新增 | +| context | Context | printDrawnCompleted(callback: AsyncCallback\): void;
printDrawnCompleted(): Promise\; | 新增 | +| context | Context | isUpdatingConfigurations(callback: AsyncCallback\): void;
isUpdatingConfigurations(): Promise\; | 新增 | +| context | Context | getAbilityInfo(callback: AsyncCallback\): void
getAbilityInfo(): Promise\; | 新增 | | context | Context | getApplicationContext(): Context; | 新增 | -| context | Context | getAppVersionInfo(callback: AsyncCallback): void
getAppVersionInfo(): Promise; | 新增 | -| context | Context | getHapModuleInfo(callback: AsyncCallback): void
getHapModuleInfo(): Promise; | 新增 | -| context | Context | getAppType(callback: AsyncCallback): void
getAppType(): Promise; | 新增 | -| context | Context | getOrCreateDistributedDir(): Promise;
getOrCreateDistributedDir(callback: AsyncCallback): void; | 新增 | -| context | Context | getCacheDir(callback: AsyncCallback): void;
getCacheDir(): Promise; | 新增 | -| context | Context | getFilesDir(callback: AsyncCallback): void;
getFilesDir(): Promise; | 新增 | -| context | Context | setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback): void
setWakeUpScreen(wakeUp: boolean): Promise; | 新增 | -| context | Context | setShowOnLockScreen(show: boolean, callback: AsyncCallback): void
setShowOnLockScreen(show: boolean): Promise; | 新增 | -| context | Context | setDisplayOrientation(orientation: DisplayOrientation, callback: AsyncCallback): void
setDisplayOrientation(orientation: DisplayOrientation): Promise; | 新增 | -| context | Context | getDisplayOrientation(callback: AsyncCallback): void
getDisplayOrientation(): Promise; | 新增 | +| context | Context | getAppVersionInfo(callback: AsyncCallback\): void
getAppVersionInfo(): Promise\; | 新增 | +| context | Context | getHapModuleInfo(callback: AsyncCallback\): void
getHapModuleInfo(): Promise\; | 新增 | +| context | Context | getAppType(callback: AsyncCallback\): void
getAppType(): Promise\; | 新增 | +| context | Context | getOrCreateDistributedDir(): Promise\;
getOrCreateDistributedDir(callback: AsyncCallback\): void; | 新增 | +| context | Context | getCacheDir(callback: AsyncCallback\): void;
getCacheDir(): Promise\; | 新增 | +| context | Context | getFilesDir(callback: AsyncCallback\): void;
getFilesDir(): Promise\; | 新增 | +| context | Context | setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback\): void
setWakeUpScreen(wakeUp: boolean): Promise\; | 新增 | +| context | Context | setShowOnLockScreen(show: boolean, callback: AsyncCallback\): void
setShowOnLockScreen(show: boolean): Promise\; | 新增 | +| context | Context | setDisplayOrientation(orientation: DisplayOrientation, callback: AsyncCallback\): void
setDisplayOrientation(orientation: DisplayOrientation): Promise\; | 新增 | +| context | Context | getDisplayOrientation(callback: AsyncCallback\): void
getDisplayOrientation(): Promise\; | 新增 | | appVersionInfo | AppVersionInfo | readonly versionName: string; | 新增 | | appVersionInfo | AppVersionInfo | readonly versionCode: number; | 新增 | | appVersionInfo | AppVersionInfo | readonly appName: string; | 新增 | -| dataAbilityHelper | PacMap | [key: string]: number \| string \| boolean \| Array \| null; | 新增 | -| dataAbilityHelper | DataAbilityHelper | executeBatch(uri: string, operations: Array, callback: AsyncCallback>): void;
executeBatch(uri: string, operations: Array): Promise>; | 新增 | -| dataAbilityHelper | DataAbilityHelper | call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback): void;
call(uri: string, method: string, arg: string, extras: PacMap): Promise; | 新增 | -| ohos.application.Want | Want | entities?: Array; | 新增 | +| dataAbilityHelper | PacMap | [key: string]: number \| string \| boolean \| Array\ \| null; | 新增 | +| dataAbilityHelper | DataAbilityHelper | executeBatch(uri: string, operations: Array\, callback: AsyncCallback\>): void;
executeBatch(uri: string, operations: Array\): Promise\>; | 新增 | +| dataAbilityHelper | DataAbilityHelper | call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback\): void;
call(uri: string, method: string, arg: string, extras: PacMap): Promise\; | 新增 | +| ohos.application.Want | Want | entities?: Array\; | 新增 | | ohos.application.Want | Want | parameters?: {[key: string]: any}; | 新增 | | ohos.application.Want | Want | action?: string; | 新增 | | ohos.application.Want | Want | flags?: number; | 新增 | @@ -59,8 +59,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,元能力子 | ohos.application.Want | Want | deviceId?: string; | 新增 | | ohos.application.testRunner | TestRunner | onRun(): void; | 新增 | | ohos.application.testRunner | TestRunner | onPrepare(): void; | 新增 | -| ohos.application.formProvider | formProvider | function updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void;
function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; | 新增 | -| ohos.application.formProvider | formProvider | function setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback): void;
function setFormNextRefreshTime(formId: string, minute: number): Promise; | 新增 | +| ohos.application.formProvider | formProvider | updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback\): void;
updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise\; | 新增 | +| ohos.application.formProvider | formProvider | setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback\): void;
setFormNextRefreshTime(formId: string, minute: number): Promise\; | 新增 | | ohos.application.formInfo | FormParam | TEMPORARY_KEY = "ohos.extra.param.key.form_temporary" | 新增 | | ohos.application.formInfo | FormParam | HEIGHT_KEY = "ohos.extra.param.key.form_height" | 新增 | | ohos.application.formInfo | FormParam | WIDTH_KEY = "ohos.extra.param.key.form_width" | 新增 | @@ -77,7 +77,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,元能力子 | ohos.application.formInfo | ColorMode | MODE_AUTO = -1 | 新增 | | ohos.application.formInfo | FormType | JS = 1 | 新增 | | ohos.application.formInfo | FormInfo | customizeData: {[key: string]: [value: string]}; | 新增 | -| ohos.application.formInfo | FormInfo | supportDimensions: Array; | 新增 | +| ohos.application.formInfo | FormInfo | supportDimensions: Array\; | 新增 | | ohos.application.formInfo | FormInfo | defaultDimension: number; | 新增 | | ohos.application.formInfo | FormInfo | updateDuration: number; | 新增 | | ohos.application.formInfo | FormInfo | formConfigAbility: string; | 新增 | @@ -117,42 +117,42 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,元能力子 | ohos.application.formError | FormError | ERR_PERMISSION_DENY = 2 | 新增 | | ohos.application.formError | FormError | ERR_COMMON = 1 | 新增 | | ohos.application.formBindingData | FormBindingData | data: Object | 新增 | -| ohos.application.formBindingData | formBindingData | function createFormBindingData(obj?: Object \| string): FormBindingData; | 新增 | +| ohos.application.formBindingData | formBindingData | createFormBindingData(obj?: Object \| string): FormBindingData; | 新增 | | ohos.application.ConfigurationConstant | ColorMode | COLOR_MODE_LIGHT = 1 | 新增 | | ohos.application.ConfigurationConstant | ColorMode | COLOR_MODE_DARK = 0 | 新增 | | ohos.application.ConfigurationConstant | ColorMode | COLOR_MODE_NOT_SET = -1 | 新增 | | ohos.application.Configuration | Configuration | colorMode: ConfigurationConstant.ColorMode; | 新增 | | ohos.application.Configuration | Configuration | language: string; | 新增 | -| ohos.application.appManager | appManager | function getAppMemorySize(): Promise;
function getAppMemorySize(callback: AsyncCallback): void; | 新增 | -| ohos.application.appManager | appManager | function isRamConstrainedDevice(): Promise;
function isRamConstrainedDevice(callback: AsyncCallback): void; | 新增 | -| ohos.application.appManager | appManager | function getProcessRunningInfos(): Promise>;
function getProcessRunningInfos(callback: AsyncCallback>): void; | 新增 | -| ohos.application.appManager | appManager | function isRunningInStabilityTest(callback: AsyncCallback): void;
function isRunningInStabilityTest(): Promise; | 新增 | +| ohos.application.appManager | appManager | getAppMemorySize(): Promise\;
getAppMemorySize(callback: AsyncCallback\): void; | 新增 | +| ohos.application.appManager | appManager | isRamConstrainedDevice(): Promise\;
isRamConstrainedDevice(callback: AsyncCallback\): void; | 新增 | +| ohos.application.appManager | appManager | getProcessRunningInfos(): Promise\>;
getProcessRunningInfos(callback: AsyncCallback\>): void; | 新增 | +| ohos.application.appManager | appManager | isRunningInStabilityTest(callback: AsyncCallback\): void;
isRunningInStabilityTest(): Promise\; | 新增 | | ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | DESTROY | 新增 | | ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | BACKGROUND | 新增 | | ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | FOREGROUND | 新增 | | ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | CREATE | 新增 | | ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | UNINITIALIZED | 新增 | -| ohos.application.abilityDelegatorRegistry | abilityDelegatorRegistry | function getArguments(): AbilityDelegatorArgs; | 新增 | -| ohos.application.abilityDelegatorRegistry | abilityDelegatorRegistry | function getAbilityDelegator(): AbilityDelegator; | 新增 | +| ohos.application.abilityDelegatorRegistry | abilityDelegatorRegistry | getArguments(): AbilityDelegatorArgs; | 新增 | +| ohos.application.abilityDelegatorRegistry | abilityDelegatorRegistry | getAbilityDelegator(): AbilityDelegator; | 新增 | | ohos.abilityAccessCtrl | GrantStatus | PERMISSION_GRANTED = 0 | 新增 | | ohos.abilityAccessCtrl | GrantStatus | PERMISSION_DENIED = -1 | 新增 | -| ohos.abilityAccessCtrl | AtManager | verifyAccessToken(tokenID: number, permissionName: string): Promise; | 新增 | -| ohos.abilityAccessCtrl | abilityAccessCtrl | function createAtManager(): AtManager; | 新增 | +| ohos.abilityAccessCtrl | AtManager | verifyAccessToken(tokenID: number, permissionName: string): Promise\; | 新增 | +| ohos.abilityAccessCtrl | abilityAccessCtrl | createAtManager(): AtManager; | 新增 | | ohos.ability.wantConstant | Action | ACTION_APP_ACCOUNT_OAUTH = "ohos.account.appAccount.action.oauth" | 新增 | | ohos.ability.wantConstant | Action | ACTION_VIDEO_CAPTURE = "ohos.want.action.videoCapture" | 新增 | | ohos.ability.wantConstant | Action | ACTION_IMAGE_CAPTURE = "ohos.want.action.imageCapture" | 新增 | | ohos.ability.particleAbility | ErrorCode | INVALID_PARAMETER = -1 | 新增 | -| ohos.ability.particleAbility | particleAbility | function disconnectAbility(connection: number, callback:AsyncCallback): void;
function disconnectAbility(connection: number): Promise; | 新增 | -| ohos.ability.particleAbility | particleAbility | function connectAbility(request: Want, options:ConnectOptions): number; | 新增 | -| ohos.ability.particleAbility | particleAbility | function cancelBackgroundRunning(callback: AsyncCallback): void;
function cancelBackgroundRunning(): Promise; | 新增 | -| ohos.ability.particleAbility | particleAbility | function startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback): void;
function startBackgroundRunning(id: number, request: NotificationRequest): Promise; | 新增 | -| ohos.ability.featureAbility | featureAbility | function getWindow(callback: AsyncCallback): void;
function getWindow(): Promise; | 新增 | +| ohos.ability.particleAbility | particleAbility | disconnectAbility(connection: number, callback:AsyncCallback\): void;
disconnectAbility(connection: number): Promise\; | 新增 | +| ohos.ability.particleAbility | particleAbility | connectAbility(request: Want, options:ConnectOptions): number; | 新增 | +| ohos.ability.particleAbility | particleAbility | cancelBackgroundRunning(callback: AsyncCallback\): void;
cancelBackgroundRunning(): Promise\; | 新增 | +| ohos.ability.particleAbility | particleAbility | startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback\): void;
startBackgroundRunning(id: number, request: NotificationRequest): Promise\; | 新增 | +| ohos.ability.featureAbility | featureAbility | getWindow(callback: AsyncCallback\): void;
getWindow(): Promise\; | 新增 | | ohos.ability.errorCode | ErrorCode | NO_ERROR = 0 | 新增 | | ohos.ability.errorCode | ErrorCode | INVALID_PARAMETER = -1 | 新增 | | ohos.ability.errorCode | ErrorCode | ABILITY_NOT_FOUND = -2 | 新增 | | ohos.ability.errorCode | ErrorCode | PERMISSION_DENY = -3 | 新增 | -| lifecycle | LifecycleData | call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback): void; | 新增 | -| lifecycle | LifecycleData | executeBatch?(ops: Array, callback: AsyncCallback>): void; | 新增 | +| lifecycle | LifecycleData | call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback\): void; | 新增 | +| lifecycle | LifecycleData | executeBatch?(ops: Array\, callback: AsyncCallback\>): void; | 新增 | | lifecycle | LifecycleService | onReconnect?(want: Want): void; | 新增 | | lifecycle | LifecycleApp | onMemoryLevel?(level: number): void; | 新增 | | lifecycle | LifecycleApp | onNewWant?(want: Want): void; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability_api-9-canary.md index 82c68c5665774516bdfc3726a66626b8632ce0a1..b5cc5f1c82848436911a365c33045a44baa5c2ca 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability_api-9-canary.md @@ -7,29 +7,29 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,元能力 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| | AbilityContext | AbilityContext | restoreWindowStage(contentStorage: ContentStorage) : void; | 新增 | -| AbilityContext | AbilityContext | requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback) : void;
requestPermissionsFromUser(permissions: Array) : Promise; | 新增 | -| AbilityContext | AbilityContext | setMissionLabel(label: string, callback:AsyncCallback): void;
setMissionLabel(label: string): Promise; | 新增 | -| AbilityContext | AbilityContext | disconnectAbility(connection: number, callback:AsyncCallback): void;
disconnectAbility(connection: number): Promise; | 新增 | +| AbilityContext | AbilityContext | requestPermissionsFromUser(permissions: Array\, requestCallback: AsyncCallback\) : void;
requestPermissionsFromUser(permissions: Array\) : Promise\; | 新增 | +| AbilityContext | AbilityContext | setMissionLabel(label: string, callback:AsyncCallback\): void;
setMissionLabel(label: string): Promise\; | 新增 | +| AbilityContext | AbilityContext | disconnectAbility(connection: number, callback:AsyncCallback\): void;
disconnectAbility(connection: number): Promise\; | 新增 | | AbilityContext | AbilityContext | connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; | 新增 | | AbilityContext | AbilityContext | connectAbility(want: Want, options: ConnectOptions): number; | 新增 | -| AbilityContext | AbilityContext | terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void;
terminateSelfWithResult(parameter: AbilityResult): Promise; | 新增 | -| AbilityContext | AbilityContext | terminateSelf(callback: AsyncCallback): void;
terminateSelf(): Promise; | 新增 | -| AbilityContext | AbilityContext | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void;
startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void;
startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; | 新增 | -| AbilityContext | AbilityContext | startAbilityForResult(want: Want, callback: AsyncCallback): void;
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback): void;
startAbilityForResult(want: Want, options?: StartOptions): Promise; | 新增 | -| AbilityContext | AbilityContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; | 新增 | -| AbilityContext | AbilityContext | startAbilityByCall(want: Want): Promise; | 新增 | -| AbilityContext | AbilityContext | startAbility(want: Want, callback: AsyncCallback): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void;
startAbility(want: Want, options?: StartOptions): Promise; | 新增 | +| AbilityContext | AbilityContext | terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\): void;
terminateSelfWithResult(parameter: AbilityResult): Promise\; | 新增 | +| AbilityContext | AbilityContext | terminateSelf(callback: AsyncCallback\): void;
terminateSelf(): Promise\; | 新增 | +| AbilityContext | AbilityContext | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void;
startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; | 新增 | +| AbilityContext | AbilityContext | startAbilityForResult(want: Want, callback: AsyncCallback\): void;
startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback\): void;
startAbilityForResult(want: Want, options?: StartOptions): Promise\; | 新增 | +| AbilityContext | AbilityContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; | 新增 | +| AbilityContext | AbilityContext | startAbilityByCall(want: Want): Promise\; | 新增 | +| AbilityContext | AbilityContext | startAbility(want: Want, callback: AsyncCallback\): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback\): void;
startAbility(want: Want, options?: StartOptions): Promise\; | 新增 | | AbilityContext | AbilityContext | config: Configuration; | 新增 | | AbilityContext | AbilityContext | currentHapModuleInfo: HapModuleInfo; | 新增 | | AbilityContext | AbilityContext | abilityInfo: AbilityInfo; | 新增 | -| abilityDelegator | AbilityDelegator | doAbilityBackground(ability: Ability, callback: AsyncCallback): void;
doAbilityBackground(ability: Ability): Promise; | 新增 | -| abilityDelegator | AbilityDelegator | doAbilityForeground(ability: Ability, callback: AsyncCallback): void;
doAbilityForeground(ability: Ability): Promise; | 新增 | -| abilityDelegator | AbilityDelegator | getCurrentTopAbility(callback: AsyncCallback): void;
getCurrentTopAbility(): Promise | 新增 | +| abilityDelegator | AbilityDelegator | doAbilityBackground(ability: Ability, callback: AsyncCallback\): void;
doAbilityBackground(ability: Ability): Promise\; | 新增 | +| abilityDelegator | AbilityDelegator | doAbilityForeground(ability: Ability, callback: AsyncCallback\): void;
doAbilityForeground(ability: Ability): Promise\; | 新增 | +| abilityDelegator | AbilityDelegator | getCurrentTopAbility(callback: AsyncCallback\): void;
getCurrentTopAbility(): Promise\ | 新增 | | abilityDelegator | AbilityDelegator | getAbilityState(ability: Ability): number; | 新增 | | abilityDelegator | AbilityDelegator | getAppContext(): Context; | 新增 | -| abilityDelegator | AbilityDelegator | waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void;
waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback): void;
waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise; | 新增 | -| abilityDelegator | AbilityDelegator | removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void;
removeAbilityMonitor(monitor: AbilityMonitor): Promise; | 新增 | -| abilityDelegator | AbilityDelegator | addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback): void;
addAbilityMonitor(monitor: AbilityMonitor): Promise; | 新增 | +| abilityDelegator | AbilityDelegator | waitAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void;
waitAbilityMonitor(monitor: AbilityMonitor, timeout: number, callback: AsyncCallback\): void;
waitAbilityMonitor(monitor: AbilityMonitor, timeout?: number): Promise\; | 新增 | +| abilityDelegator | AbilityDelegator | removeAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void;
removeAbilityMonitor(monitor: AbilityMonitor): Promise\; | 新增 | +| abilityDelegator | AbilityDelegator | addAbilityMonitor(monitor: AbilityMonitor, callback: AsyncCallback\): void;
addAbilityMonitor(monitor: AbilityMonitor): Promise\; | 新增 | | abilityMonitor | AbilityMonitor | onWindowStageDestroy?:() => void; | 新增 | | abilityMonitor | AbilityMonitor | onWindowStageRestore?:() => void; | 新增 | | abilityMonitor | AbilityMonitor | onWindowStageCreate?:() => void; | 新增 | @@ -61,9 +61,9 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,元能力 | extensionAbilityInfo | ExtensionAbilityInfo | readonly writePermission: string; | 新增 | | extensionAbilityInfo | ExtensionAbilityInfo | readonly readPermission: string; | 新增 | | extensionAbilityInfo | ExtensionAbilityInfo | readonly enabled: boolean; | 新增 | -| extensionAbilityInfo | ExtensionAbilityInfo | readonly metadata: Array; | 新增 | +| extensionAbilityInfo | ExtensionAbilityInfo | readonly metadata: Array\; | 新增 | | extensionAbilityInfo | ExtensionAbilityInfo | readonly applicationInfo: ApplicationInfo; | 新增 | -| extensionAbilityInfo | ExtensionAbilityInfo | readonly permissions: Array; | 新增 | +| extensionAbilityInfo | ExtensionAbilityInfo | readonly permissions: Array\; | 新增 | | extensionAbilityInfo | ExtensionAbilityInfo | readonly extensionAbilityType: bundle.ExtensionAbilityType; | 新增 | | extensionAbilityInfo | ExtensionAbilityInfo | readonly isVisible: boolean; | 新增 | | extensionAbilityInfo | ExtensionAbilityInfo | readonly iconId: number; | 新增 | @@ -75,13 +75,13 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,元能力 | ExtensionContext | ExtensionContext | config: Configuration; | 新增 | | ExtensionContext | ExtensionContext | currentHapModuleInfo: HapModuleInfo; | 新增 | | ExtensionRunningInfo | ExtensionRunningInfo | type: bundle.ExtensionAbilityType; | 新增 | -| ExtensionRunningInfo | ExtensionRunningInfo | clientPackage: Array; | 新增 | +| ExtensionRunningInfo | ExtensionRunningInfo | clientPackage: Array\; | 新增 | | ExtensionRunningInfo | ExtensionRunningInfo | startTime: number; | 新增 | | ExtensionRunningInfo | ExtensionRunningInfo | processName: string; | 新增 | | ExtensionRunningInfo | ExtensionRunningInfo | uid: number; | 新增 | | ExtensionRunningInfo | ExtensionRunningInfo | pid: number; | 新增 | | ExtensionRunningInfo | ExtensionRunningInfo | extension: ElementName; | 新增 | -| FormExtensionContext | FormExtensionContext | updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void;
updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise; | 新增 | +| FormExtensionContext | FormExtensionContext | updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback\): void;
updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise\; | 新增 | | ohos.application.Ability | Ability | onConfigurationUpdated(config: Configuration): void; | 新增 | | ohos.application.Ability | Ability | onNewWant(want: Want): void; | 新增 | | ohos.application.Ability | Ability | onContinue(wantParam : {[key: string]: any}): AbilityConstant.OnContinueResult; | 新增 | @@ -100,8 +100,8 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,元能力 | ohos.application.Ability | Callee | on(method: string, callback: function): void; | 新增 | | ohos.application.Ability | Caller | onRelease(callback: function): void; | 新增 | | ohos.application.Ability | Caller | release(): void; | 新增 | -| ohos.application.Ability | Caller | callWithResult(method: string, data: rpc.Sequenceable): Promise; | 新增 | -| ohos.application.Ability | Caller | call(method: string, data: rpc.Sequenceable): Promise; | 新增 | +| ohos.application.Ability | Caller | callWithResult(method: string, data: rpc.Sequenceable): Promise\; | 新增 | +| ohos.application.Ability | Caller | call(method: string, data: rpc.Sequenceable): Promise\; | 新增 | | ohos.application.AbilityConstant | OnContinueResult | MISMATCH = 2 | 新增 | | ohos.application.AbilityConstant | OnContinueResult | REJECT = 1 | 新增 | | ohos.application.AbilityConstant | OnContinueResult | AGREE = 0 | 新增 | @@ -114,7 +114,7 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,元能力 | ohos.application.AbilityConstant | LaunchReason | UNKNOWN = 0 | 新增 | | ohos.application.AbilityConstant | LaunchParam | lastExitReason: LastExitReason; | 新增 | | ohos.application.AbilityConstant | LaunchParam | launchReason: LaunchReason; | 新增 | -| ohos.application.abilityManager | abilityManager | function getExtensionRunningInfos(upperLimit: number): Promise>;
function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void; | 新增 | +| ohos.application.abilityManager | abilityManager | getExtensionRunningInfos(upperLimit: number): Promise\>;
getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback\>): void; | 新增 | | ohos.application.AbilityStage | AbilityStage | onConfigurationUpdated(config: Configuration): void; | 新增 | | ohos.application.AbilityStage | AbilityStage | onAcceptWant(want: Want): string; | 新增 | | ohos.application.AbilityStage | AbilityStage | onCreate(): void; | 新增 | @@ -132,15 +132,15 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,元能力 | ohos.application.ConfigurationConstant | Direction | DIRECTION_HORIZONTAL = 1 | 新增 | | ohos.application.ConfigurationConstant | Direction | DIRECTION_VERTICAL = 0 | 新增 | | ohos.application.ConfigurationConstant | Direction | DIRECTION_NOT_SET = -1 | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | denormalizeUri?(uri: string, callback: AsyncCallback): void; | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | normalizeUri?(uri: string, callback: AsyncCallback): void; | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | batchInsert?(uri: string, valueBuckets: Array, callback: AsyncCallback): void; | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | getType?(uri: string, callback: AsyncCallback): void; | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | "query?(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void;" | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | delete?(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | "update?(uri: string, valueBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void;" | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback): void; | 新增 | -| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | denormalizeUri?(uri: string, callback: AsyncCallback\): void; | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | normalizeUri?(uri: string, callback: AsyncCallback\): void; | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | batchInsert?(uri: string, valueBuckets: Array\, callback: AsyncCallback\): void; | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | getType?(uri: string, callback: AsyncCallback\): void; | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | "query?(uri: string, columns: Array\, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback\): void;" | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | delete?(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback\): void; | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | "update?(uri: string, valueBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback\): void;" | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback\): void; | 新增 | +| ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback\>): void; | 新增 | | ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | onCreate?(want: Want): void; | 新增 | | ohos.application.DataShareExtensionAbility | DataShareExtensionAbility | context?: ExtensionContext; | 新增 | | ohos.application.FormExtension | FormExtension | onConfigurationUpdated(config: Configuration): void; | 新增 | @@ -176,22 +176,22 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,元能力 | ohos.application.ServiceExtensionAbility | ServiceExtensionAbility | context: ServiceExtensionContext; | 新增 | | ohos.application.StartOptions | StartOptions | displayId?: number; | 新增 | | ohos.application.StartOptions | StartOptions | windowMode?: number; | 新增 | -| ohos.application.uriPermissionManager | uriPermissionManager | function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback): void;
function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise; | 新增 | -| ohos.wantAgent | wantAgent | function getOperationType(agent: WantAgent, callback: AsyncCallback): void;
function getOperationType(agent: WantAgent): Promise; | 新增 | -| PermissionRequestResult | PermissionRequestResult | authResults: Array; | 新增 | -| PermissionRequestResult | PermissionRequestResult | permissions: Array; | 新增 | -| ServiceExtAbilityContext | ServiceExtAbilityContext | disconnectAbility(connection: number, callback:AsyncCallback): void;
disconnectAbility(connection: number): Promise; | 新增 | +| ohos.application.uriPermissionManager | uriPermissionManager | verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback\): void;
verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise\; | 新增 | +| ohos.wantAgent | wantAgent | getOperationType(agent: WantAgent, callback: AsyncCallback\): void;
getOperationType(agent: WantAgent): Promise\; | 新增 | +| PermissionRequestResult | PermissionRequestResult | authResults: Array\; | 新增 | +| PermissionRequestResult | PermissionRequestResult | permissions: Array\; | 新增 | +| ServiceExtAbilityContext | ServiceExtAbilityContext | disconnectAbility(connection: number, callback:AsyncCallback\): void;
disconnectAbility(connection: number): Promise\; | 新增 | | ServiceExtAbilityContext | ServiceExtAbilityContext | connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; | 新增 | | ServiceExtAbilityContext | ServiceExtAbilityContext | connectAbility(want: Want, options: ConnectOptions): number; | 新增 | -| ServiceExtAbilityContext | ServiceExtAbilityContext | terminateSelf(callback: AsyncCallback): void;
terminateSelf(): Promise; | 新增 | -| ServiceExtAbilityContext | ServiceExtAbilityContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; | 新增 | -| ServiceExtAbilityContext | ServiceExtAbilityContext | startAbility(want: Want, callback: AsyncCallback): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void;
startAbility(want: Want, options?: StartOptions): Promise; | 新增 | -| ServiceExtensionContext | ServiceExtensionContext | disconnectAbility(connection: number, callback:AsyncCallback): void;
disconnectAbility(connection: number): Promise; | 新增 | +| ServiceExtAbilityContext | ServiceExtAbilityContext | terminateSelf(callback: AsyncCallback\): void;
terminateSelf(): Promise\; | 新增 | +| ServiceExtAbilityContext | ServiceExtAbilityContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; | 新增 | +| ServiceExtAbilityContext | ServiceExtAbilityContext | startAbility(want: Want, callback: AsyncCallback\): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback\): void;
startAbility(want: Want, options?: StartOptions): Promise\; | 新增 | +| ServiceExtensionContext | ServiceExtensionContext | disconnectAbility(connection: number, callback:AsyncCallback\): void;
disconnectAbility(connection: number): Promise\; | 新增 | | ServiceExtensionContext | ServiceExtensionContext | connectAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number; | 新增 | | ServiceExtensionContext | ServiceExtensionContext | connectAbility(want: Want, options: ConnectOptions): number; | 新增 | -| ServiceExtensionContext | ServiceExtensionContext | terminateSelf(callback: AsyncCallback): void;
terminateSelf(): Promise; | 新增 | -| ServiceExtensionContext | ServiceExtensionContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise; | 新增 | -| ServiceExtensionContext | ServiceExtensionContext | startAbility(want: Want, callback: AsyncCallback): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void;
startAbility(want: Want, options?: StartOptions): Promise; | 新增 | +| ServiceExtensionContext | ServiceExtensionContext | terminateSelf(callback: AsyncCallback\): void;
terminateSelf(): Promise\; | 新增 | +| ServiceExtensionContext | ServiceExtensionContext | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback\): void;
startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise\; | 新增 | +| ServiceExtensionContext | ServiceExtensionContext | startAbility(want: Want, callback: AsyncCallback\): void;
startAbility(want: Want, options: StartOptions, callback: AsyncCallback\): void;
startAbility(want: Want, options?: StartOptions): Promise\; | 新增 | | ServiceExtensionContext | ServiceExtensionContext | extensionAbilityInfo: ExtensionAbilityInfo; | 新增 | | want | Want | extensionAbilityType?: number; | 新增 | | want | Want | extensionAbilityName?: string; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-accessibility.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-accessibility.md index c3dbf5c1e5e29b56ba23e54ae3a5d6293db68fbd..0c9b27cdfed592dbff0c15ea907cf396d3f29554 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-accessibility.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-accessibility.md @@ -11,7 +11,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,无障碍子 | ohos.accessibility | EventInfo | currentIndex?: number; | 新增 | | ohos.accessibility | EventInfo | beginIndex?: number; | 新增 | | ohos.accessibility | EventInfo | lastContent?: string; | 新增 | -| ohos.accessibility | EventInfo | contents?: Array; | 新增 | +| ohos.accessibility | EventInfo | contents?: Array\; | 新增 | | ohos.accessibility | EventInfo | textMoveUnit?: TextMoveUnit; | 新增 | | ohos.accessibility | EventInfo | triggerAction: Action; | 新增 | | ohos.accessibility | EventInfo | description?: string; | 新增 | @@ -21,10 +21,10 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,无障碍子 | ohos.accessibility | EventInfo | windowUpdateType?: WindowUpdateType; | 新增 | | ohos.accessibility | EventInfo | type: EventType; | 新增 | | ohos.accessibility | EventInfo | constructor(jsonObject); | 新增 | -| ohos.accessibility | AccessibilityAbilityInfo | readonly eventTypes: Array; | 新增 | +| ohos.accessibility | AccessibilityAbilityInfo | readonly eventTypes: Array\; | 新增 | | ohos.accessibility | AccessibilityAbilityInfo | readonly description: string; | 新增 | -| ohos.accessibility | AccessibilityAbilityInfo | readonly capabilities: Array; | 新增 | -| ohos.accessibility | AccessibilityAbilityInfo | readonly abilityTypes: Array; | 新增 | +| ohos.accessibility | AccessibilityAbilityInfo | readonly capabilities: Array\; | 新增 | +| ohos.accessibility | AccessibilityAbilityInfo | readonly abilityTypes: Array\; | 新增 | | ohos.accessibility | AccessibilityAbilityInfo | readonly bundleName: string; | 新增 | | ohos.accessibility | AccessibilityAbilityInfo | readonly name: string; | 新增 | | ohos.accessibility | AccessibilityAbilityInfo | readonly id: string; | 新增 | @@ -34,18 +34,18 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,无障碍子 | ohos.accessibility | CaptionsStyle | fontColor: number \| string; | 新增 | | ohos.accessibility | CaptionsStyle | fontScale: number; | 新增 | | ohos.accessibility | CaptionsStyle | fontFamily: CaptionsFontFamily; | 新增 | -| ohos.accessibility | CaptionsManager | off(type: 'styleChange', callback?: Callback): void; | 新增 | -| ohos.accessibility | CaptionsManager | off(type: 'enableChange', callback?: Callback): void; | 新增 | -| ohos.accessibility | CaptionsManager | on(type: 'styleChange', callback: Callback): void; | 新增 | -| ohos.accessibility | CaptionsManager | on(type: 'enableChange', callback: Callback): void; | 新增 | +| ohos.accessibility | CaptionsManager | off(type: 'styleChange', callback?: Callback\): void; | 新增 | +| ohos.accessibility | CaptionsManager | off(type: 'enableChange', callback?: Callback\): void; | 新增 | +| ohos.accessibility | CaptionsManager | on(type: 'styleChange', callback: Callback\): void; | 新增 | +| ohos.accessibility | CaptionsManager | on(type: 'enableChange', callback: Callback\): void; | 新增 | | ohos.accessibility | CaptionsManager | style: CaptionsStyle; | 新增 | | ohos.accessibility | CaptionsManager | enabled: boolean; | 新增 | -| ohos.accessibility | accessibility | function getCaptionsManager(): CaptionsManager; | 新增 | -| ohos.accessibility | accessibility | function off(type: 'touchGuideStateChange', callback?: Callback): void; | 新增 | -| ohos.accessibility | accessibility | function off(type: 'accessibilityStateChange', callback?: Callback): void; | 新增 | -| ohos.accessibility | accessibility | function on(type: 'touchGuideStateChange', callback: Callback): void; | 新增 | -| ohos.accessibility | accessibility | function on(type: 'accessibilityStateChange', callback: Callback): void; | 新增 | -| ohos.accessibility | accessibility | function sendEvent(event: EventInfo, callback: AsyncCallback): void;
function sendEvent(event: EventInfo): Promise; | 新增 | -| ohos.accessibility | accessibility | function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void;
function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise>; | 新增 | -| ohos.accessibility | accessibility | function isOpenTouchGuide(callback: AsyncCallback): void;
function isOpenTouchGuide(): Promise; | 新增 | -| ohos.accessibility | accessibility | function isOpenAccessibility(callback: AsyncCallback): void;
function isOpenAccessibility(): Promise; | 新增 | +| ohos.accessibility | accessibility | getCaptionsManager(): CaptionsManager; | 新增 | +| ohos.accessibility | accessibility | off(type: 'touchGuideStateChange', callback?: Callback\): void; | 新增 | +| ohos.accessibility | accessibility | off(type: 'accessibilityStateChange', callback?: Callback\): void; | 新增 | +| ohos.accessibility | accessibility | on(type: 'touchGuideStateChange', callback: Callback\): void; | 新增 | +| ohos.accessibility | accessibility | on(type: 'accessibilityStateChange', callback: Callback\): void; | 新增 | +| ohos.accessibility | accessibility | sendEvent(event: EventInfo, callback: AsyncCallback\): void;
sendEvent(event: EventInfo): Promise\; | 新增 | +| ohos.accessibility | accessibility | getAbilityLists(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback\>): void;
getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise\>; | 新增 | +| ohos.accessibility | accessibility | isOpenTouchGuide(callback: AsyncCallback\): void;
isOpenTouchGuide(): Promise\; | 新增 | +| ohos.accessibility | accessibility | isOpenAccessibility(callback: AsyncCallback\): void;
isOpenAccessibility(): Promise\; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-account.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-account.md index 295d765dad890f9437a71c1bf4b73c767a494c3c..d3120239d6be93cdaf141b89d64ce5859c36c53b 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-account.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-account.md @@ -1,6 +1,6 @@ -# 账号子系统JS API变更 +# 帐号子系统JS API变更 -OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,账号子系统的API变更如下: +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,帐号子系统的API变更如下: ## 接口变更 @@ -20,27 +20,27 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,账号子系 | ohos.account.osAccount | OsAccountInfo | createTime: number; | 新增 | | ohos.account.osAccount | OsAccountInfo | photo: string; | 新增 | | ohos.account.osAccount | OsAccountInfo | isVerified: boolean; | 新增 | -| ohos.account.osAccount | OsAccountInfo | constraints: Array; | 新增 | +| ohos.account.osAccount | OsAccountInfo | constraints: Array\; | 新增 | | ohos.account.osAccount | OsAccountInfo | type: OsAccountType; | 新增 | | ohos.account.osAccount | OsAccountInfo | localName: string; | 新增 | | ohos.account.osAccount | OsAccountInfo | localId: number; | 新增 | -| ohos.account.osAccount | AccountManager | getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback): void;
getSerialNumberByOsAccountLocalId(localId: number): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback): void;
getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | getDistributedVirtualDeviceId(callback: AsyncCallback): void;
getDistributedVirtualDeviceId(): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | getOsAccountTypeFromProcess(callback: AsyncCallback): void;
getOsAccountTypeFromProcess(): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | queryCurrentOsAccount(callback: AsyncCallback): void;
queryCurrentOsAccount(): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | queryActivatedOsAccountIds(callback: AsyncCallback>): void;
queryActivatedOsAccountIds(): Promise>; | 新增 | -| ohos.account.osAccount | AccountManager | getOsAccountAllConstraints(localId: number, callback: AsyncCallback>): void;
getOsAccountAllConstraints(localId: number): Promise>; | 新增 | -| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void;
getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback): void;
getOsAccountLocalIdFromUid(uid: number): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromProcess(callback: AsyncCallback): void;
getOsAccountLocalIdFromProcess(): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | getCreatedOsAccountsCount(callback: AsyncCallback): void;
getCreatedOsAccountsCount(): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | isOsAccountVerified(callback: AsyncCallback): void;
isOsAccountVerified(localId: number, callback: AsyncCallback): void;
isOsAccountVerified(localId?: number): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | isTestOsAccount(callback: AsyncCallback): void;
isTestOsAccount(): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | isOsAccountConstraintEnable(localId: number, constraint: string, callback: AsyncCallback): void;
isOsAccountConstraintEnable(localId: number, constraint: string): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | isOsAccountActived(localId: number, callback: AsyncCallback): void;
isOsAccountActived(localId: number): Promise; | 新增 | -| ohos.account.osAccount | AccountManager | isMultiOsAccountEnable(callback: AsyncCallback): void;
isMultiOsAccountEnable(): Promise; | 新增 | -| ohos.account.osAccount | osAccount | function getAccountManager(): AccountManager; | 新增 | +| ohos.account.osAccount | AccountManager | getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback\): void;
getSerialNumberByOsAccountLocalId(localId: number): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback\): void;
getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | getDistributedVirtualDeviceId(callback: AsyncCallback\): void;
getDistributedVirtualDeviceId(): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | getOsAccountTypeFromProcess(callback: AsyncCallback\): void;
getOsAccountTypeFromProcess(): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | queryCurrentOsAccount(callback: AsyncCallback\): void;
queryCurrentOsAccount(): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | queryActivatedOsAccountIds(callback: AsyncCallback\>): void;
queryActivatedOsAccountIds(): Promise\>; | 新增 | +| ohos.account.osAccount | AccountManager | getOsAccountAllConstraints(localId: number, callback: AsyncCallback\>): void;
getOsAccountAllConstraints(localId: number): Promise\>; | 新增 | +| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback\): void;
getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback\): void;
getOsAccountLocalIdFromUid(uid: number): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromProcess(callback: AsyncCallback\): void;
getOsAccountLocalIdFromProcess(): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | getCreatedOsAccountsCount(callback: AsyncCallback\): void;
getCreatedOsAccountsCount(): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | isOsAccountVerified(callback: AsyncCallback\): void;
isOsAccountVerified(localId: number, callback: AsyncCallback\): void;
isOsAccountVerified(localId?: number): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | isTestOsAccount(callback: AsyncCallback\): void;
isTestOsAccount(): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | isOsAccountConstraintEnable(localId: number, constraint: string, callback: AsyncCallback\): void;
isOsAccountConstraintEnable(localId: number, constraint: string): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | isOsAccountActived(localId: number, callback: AsyncCallback\): void;
isOsAccountActived(localId: number): Promise\; | 新增 | +| ohos.account.osAccount | AccountManager | isMultiOsAccountEnable(callback: AsyncCallback\): void;
isMultiOsAccountEnable(): Promise\; | 新增 | +| ohos.account.osAccount | osAccount | getAccountManager(): AccountManager; | 新增 | | ohos.account.appAccount | Authenticator | authenticate(name: string, authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | 新增 | | ohos.account.appAccount | Authenticator | addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | 新增 | | ohos.account.appAccount | AuthenticatorCallback | onRequestRedirected: (request: Want) => void; | 新增 | @@ -82,31 +82,31 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,账号子系 | ohos.account.appAccount | OAuthTokenInfo | authType: string; | 新增 | | ohos.account.appAccount | AppAccountInfo | name: string; | 新增 | | ohos.account.appAccount | AppAccountInfo | owner: string; | 新增 | -| ohos.account.appAccount | AppAccountManager | getAuthenticatorInfo(owner: string, callback: AsyncCallback): void;
getAuthenticatorInfo(owner: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | getAuthenticatorCallback(sessionId: string, callback: AsyncCallback): void;
getAuthenticatorCallback(sessionId: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | getOAuthList(name: string, authType: string, callback: AsyncCallback>): void;
getOAuthList(name: string, authType: string): Promise>; | 新增 | -| ohos.account.appAccount | AppAccountManager | getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback>): void;
getAllOAuthTokens(name: string, owner: string): Promise>; | 新增 | -| ohos.account.appAccount | AppAccountManager | checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, callback: AsyncCallback): void;
checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean, callback: AsyncCallback): void;
setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | deleteOAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback): void;
deleteOAuthToken(name: string, owner: string, authType: string, token: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | setOAuthToken(name: string, authType: string, token: string, callback: AsyncCallback): void;
setOAuthToken(name: string, authType: string, token: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback): void;
getOAuthToken(name: string, owner: string, authType: string): Promise; | 新增 | +| ohos.account.appAccount | AppAccountManager | getAuthenticatorInfo(owner: string, callback: AsyncCallback\): void;
getAuthenticatorInfo(owner: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | getAuthenticatorCallback(sessionId: string, callback: AsyncCallback\): void;
getAuthenticatorCallback(sessionId: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | getOAuthList(name: string, authType: string, callback: AsyncCallback\>): void;
getOAuthList(name: string, authType: string): Promise\>; | 新增 | +| ohos.account.appAccount | AppAccountManager | getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback\>): void;
getAllOAuthTokens(name: string, owner: string): Promise\>; | 新增 | +| ohos.account.appAccount | AppAccountManager | checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, callback: AsyncCallback\): void;
checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean, callback: AsyncCallback\): void;
setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | deleteOAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback\): void;
deleteOAuthToken(name: string, owner: string, authType: string, token: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | setOAuthToken(name: string, authType: string, token: string, callback: AsyncCallback\): void;
setOAuthToken(name: string, authType: string, token: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback\): void;
getOAuthToken(name: string, owner: string, authType: string): Promise\; | 新增 | | ohos.account.appAccount | AppAccountManager | authenticate(name: string, owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | 新增 | -| ohos.account.appAccount | AppAccountManager | off(type: 'change', callback?: Callback>): void; | 新增 | -| ohos.account.appAccount | AppAccountManager | on(type: 'change', owners: Array, callback: Callback>): void; | 新增 | -| ohos.account.appAccount | AppAccountManager | getAssociatedData(name: string, key: string, callback: AsyncCallback): void;
getAssociatedData(name: string, key: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | getAccountExtraInfo(name: string, callback: AsyncCallback): void;
getAccountExtraInfo(name: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | getAccountCredential(name: string, credentialType: string, callback: AsyncCallback): void;
getAccountCredential(name: string, credentialType: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | getAllAccounts(owner: string, callback: AsyncCallback>): void;
getAllAccounts(owner: string): Promise>; | 新增 | -| ohos.account.appAccount | AppAccountManager | getAllAccessibleAccounts(callback: AsyncCallback>): void;
getAllAccessibleAccounts(): Promise>; | 新增 | -| ohos.account.appAccount | AppAccountManager | setAssociatedData(name: string, key: string, value: string, callback: AsyncCallback): void;
setAssociatedData(name: string, key: string, value: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback): void;
setAppAccountSyncEnable(name: string, isEnable: boolean): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback): void;
setAccountExtraInfo(name: string, extraInfo: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | setAccountCredential(name: string, credentialType: string, credential: string, callback: AsyncCallback): void;
setAccountCredential(name: string, credentialType: string, credential: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | checkAppAccountSyncEnable(name: string, callback: AsyncCallback): void;
checkAppAccountSyncEnable(name: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | enableAppAccess(name: string, bundleName: string, callback: AsyncCallback): void;
enableAppAccess(name: string, bundleName: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | disableAppAccess(name: string, bundleName: string, callback: AsyncCallback): void;
disableAppAccess(name: string, bundleName: string): Promise; | 新增 | -| ohos.account.appAccount | AppAccountManager | deleteAccount(name: string, callback: AsyncCallback): void;
deleteAccount(name: string): Promise; | 新增 | +| ohos.account.appAccount | AppAccountManager | off(type: 'change', callback?: Callback\>): void; | 新增 | +| ohos.account.appAccount | AppAccountManager | on(type: 'change', owners: Array\, callback: Callback\>): void; | 新增 | +| ohos.account.appAccount | AppAccountManager | getAssociatedData(name: string, key: string, callback: AsyncCallback\): void;
getAssociatedData(name: string, key: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | getAccountExtraInfo(name: string, callback: AsyncCallback\): void;
getAccountExtraInfo(name: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | getAccountCredential(name: string, credentialType: string, callback: AsyncCallback\): void;
getAccountCredential(name: string, credentialType: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | getAllAccounts(owner: string, callback: AsyncCallback\>): void;
getAllAccounts(owner: string): Promise\>; | 新增 | +| ohos.account.appAccount | AppAccountManager | getAllAccessibleAccounts(callback: AsyncCallback\>): void;
getAllAccessibleAccounts(): Promise\>; | 新增 | +| ohos.account.appAccount | AppAccountManager | setAssociatedData(name: string, key: string, value: string, callback: AsyncCallback\): void;
setAssociatedData(name: string, key: string, value: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback\): void;
setAppAccountSyncEnable(name: string, isEnable: boolean): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback\): void;
setAccountExtraInfo(name: string, extraInfo: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | setAccountCredential(name: string, credentialType: string, credential: string, callback: AsyncCallback\): void;
setAccountCredential(name: string, credentialType: string, credential: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | checkAppAccountSyncEnable(name: string, callback: AsyncCallback\): void;
checkAppAccountSyncEnable(name: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | enableAppAccess(name: string, bundleName: string, callback: AsyncCallback\): void;
enableAppAccess(name: string, bundleName: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | disableAppAccess(name: string, bundleName: string, callback: AsyncCallback\): void;
disableAppAccess(name: string, bundleName: string): Promise\; | 新增 | +| ohos.account.appAccount | AppAccountManager | deleteAccount(name: string, callback: AsyncCallback\): void;
deleteAccount(name: string): Promise\; | 新增 | | ohos.account.appAccount | AppAccountManager | addAccountImplicitly(owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | 新增 | -| ohos.account.appAccount | AppAccountManager | addAccount(name: string, callback: AsyncCallback): void;
addAccount(name: string, extraInfo: string, callback: AsyncCallback): void;
addAccount(name: string, extraInfo?: string): Promise; | 新增 | -| ohos.account.appAccount | appAccount | function createAppAccountManager(): AppAccountManager; | 新增 | +| ohos.account.appAccount | AppAccountManager | addAccount(name: string, callback: AsyncCallback\): void;
addAccount(name: string, extraInfo: string, callback: AsyncCallback\): void;
addAccount(name: string, extraInfo?: string): Promise\; | 新增 | +| ohos.account.appAccount | appAccount | createAppAccountManager(): AppAccountManager; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-battery.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-battery.md index ad0dc24796ad462bde3026b73e8e7a63c34249e4..8feccdc17dbb62ffa15329a36637a67e690a0413 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-battery.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-battery.md @@ -6,9 +6,9 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,电源服务 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.thermal | thermal | function getThermalLevel(): ThermalLevel; | 新增 | -| ohos.thermal | thermal | function unsubscribeThermalLevel(callback?: AsyncCallback): void; | 新增 | -| ohos.thermal | thermal | function subscribeThermalLevel(callback: AsyncCallback): void; | 新增 | +| ohos.thermal | thermal | getThermalLevel(): ThermalLevel; | 新增 | +| ohos.thermal | thermal | unsubscribeThermalLevel(callback?: AsyncCallback\): void; | 新增 | +| ohos.thermal | thermal | subscribeThermalLevel(callback: AsyncCallback\): void; | 新增 | | ohos.thermal | ThermalLevel | EMERGENCY = 6 | 新增 | | ohos.thermal | ThermalLevel | WARNING = 5 | 新增 | | ohos.thermal | ThermalLevel | OVERHEATED = 4 | 新增 | @@ -16,5 +16,5 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,电源服务 | ohos.thermal | ThermalLevel | WARM = 2 | 新增 | | ohos.thermal | ThermalLevel | NORMAL = 1 | 新增 | | ohos.thermal | ThermalLevel | COOL = 0 | 新增 | -| ohos.runninglock | runningLock | function createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback): void;
function createRunningLock(name: string, type: RunningLockType): Promise; | 新增 | -| ohos.runninglock | runningLock | function isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback): void;
function isRunningLockTypeSupported(type: RunningLockType): Promise; | 新增 | +| ohos.runninglock | runningLock | createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback\): void;
createRunningLock(name: string, type: RunningLockType): Promise\; | 新增 | +| ohos.runninglock | runningLock | isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback\): void;
isRunningLockTypeSupported(type: RunningLockType): Promise\; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle.md index 6db6e57dad8047a67e61355bf79ef7349fed86a0..64c3481a092dc45084644d4df1f84eae0e2c0ed4 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle.md @@ -14,13 +14,13 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,包管理子 | launcherAbilityInfo | LauncherAbilityInfo | readonly labelId: number; | 新增 | | launcherAbilityInfo | LauncherAbilityInfo | readonly elementName : ElementName; | 新增 | | launcherAbilityInfo | LauncherAbilityInfo | readonly applicationInfo: ApplicationInfo; | 新增 | -| bundleInfo | BundleInfo | readonly reqPermissionStates: Array; | 新增 | -| bundleInfo | BundleInfo | readonly hapModuleInfos: Array; | 新增 | -| bundleInfo | BundleInfo | readonly abilityInfos: Array; | 新增 | +| bundleInfo | BundleInfo | readonly reqPermissionStates: Array\; | 新增 | +| bundleInfo | BundleInfo | readonly hapModuleInfos: Array\; | 新增 | +| bundleInfo | BundleInfo | readonly abilityInfos: Array\; | 新增 | | abilityInfo | AbilityInfo | readonly enabled: boolean; | 新增 | -| abilityInfo | AbilityInfo | readonly metaData: Array; | 新增 | -| ohos.zlib | zlib | function unzipFile(inFile:string, outFile:string, options: Options): Promise; | 新增 | -| ohos.zlib | zlib | function zipFile(inFile:string, outFile:string, options: Options): Promise; | 新增 | +| abilityInfo | AbilityInfo | readonly metaData: Array\; | 新增 | +| ohos.zlib | zlib | unzipFile(inFile:string, outFile:string, options: Options): Promise\; | 新增 | +| ohos.zlib | zlib | zipFile(inFile:string, outFile:string, options: Options): Promise\; | 新增 | | ohos.zlib | Options | strategy?: CompressStrategy; | 新增 | | ohos.zlib | Options | memLevel?: MemLevel; | 新增 | | ohos.zlib | Options | level?: CompressLevel; | 新增 | @@ -38,12 +38,12 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,包管理子 | ohos.zlib | CompressLevel | COMPRESS_LEVEL_NO_COMPRESSION = 0 | 新增 | | ohos.zlib | ErrorCode | ERROR_CODE_ERRNO = -1 | 新增 | | ohos.zlib | ErrorCode | ERROR_CODE_OK = 0 | 新增 | -| ohos.bundle | bundle | function isApplicationEnabled(bundleName: string, callback: AsyncCallback): void;
function isApplicationEnabled(bundleName: string): Promise; | 新增 | -| ohos.bundle | bundle | function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void;
function isAbilityEnabled(info: AbilityInfo): Promise; | 新增 | -| ohos.bundle | bundle | function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback): void;
function getAbilityIcon(bundleName: string, abilityName: string): Promise; | 新增 | -| ohos.bundle | bundle | function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback): void;
function getAbilityLabel(bundleName: string, abilityName: string): Promise; | 新增 | -| ohos.bundle | bundle | function getNameForUid(uid: number, callback: AsyncCallback) : void
function getNameForUid(uid: number) : Promise; | 新增 | -| ohos.bundle | bundle | function getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback): void;
function getAbilityInfo(bundleName: string, abilityName: string): Promise; | 新增 | +| ohos.bundle | bundle | isApplicationEnabled(bundleName: string, callback: AsyncCallback\): void;
isApplicationEnabled(bundleName: string): Promise\; | 新增 | +| ohos.bundle | bundle | isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback\): void;
isAbilityEnabled(info: AbilityInfo): Promise\; | 新增 | +| ohos.bundle | bundle | getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\): void;
getAbilityIcon(bundleName: string, abilityName: string): Promise\; | 新增 | +| ohos.bundle | bundle | getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback\): void;
getAbilityLabel(bundleName: string, abilityName: string): Promise\; | 新增 | +| ohos.bundle | bundle | getNameForUid(uid: number, callback: AsyncCallback\) : void
getNameForUid(uid: number) : Promise\; | 新增 | +| ohos.bundle | bundle | getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback\): void;
getAbilityInfo(bundleName: string, abilityName: string): Promise\; | 新增 | | ohos.bundle | InstallErrorCode | STATUS_UNINSTALL_PERMISSION_DENIED = 0x45 | 新增 | | ohos.bundle | InstallErrorCode | STATUS_INSTALL_PERMISSION_DENIED = 0x44 | 新增 | | ohos.bundle | InstallErrorCode | STATUS_GRANT_REQUEST_PERMISSIONS_FAILED = 0x43 | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle_api-9-canary.md index 5bb6ee87638ff2d3c9a44d23f074927c251d68a2..b671b60d99ceaca6c639d958311f5ef987cb932e 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle_api-9-canary.md @@ -6,14 +6,14 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,包管理 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| bundleInfo | BundleInfo | readonly extensionAbilityInfo: Array; | 新增 | -| hapModuleInfo | HapModuleInfo | readonly metadata: Array; | 新增 | -| hapModuleInfo | HapModuleInfo | readonly extensionAbilityInfo: Array; | 新增 | +| bundleInfo | BundleInfo | readonly extensionAbilityInfo: Array\; | 新增 | +| hapModuleInfo | HapModuleInfo | readonly metadata: Array\; | 新增 | +| hapModuleInfo | HapModuleInfo | readonly extensionAbilityInfo: Array\; | 新增 | | hapModuleInfo | HapModuleInfo | readonly mainElementName: string; | 新增 | | metadata | Metadata | resource: string; | 新增 | | metadata | Metadata | value: string; | 新增 | | metadata | Metadata | name: string; | 新增 | -| ohos.bundle | bundle | function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback>): void;
function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback>): void;
function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise>; | 新增 | +| ohos.bundle | bundle | queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback\>): void;
queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback\>): void;
queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise\>; | 新增 | | ohos.bundle | ExtensionAbilityType | UNSPECIFIED = 9 | 新增 | | ohos.bundle | ExtensionAbilityType | WALLPAPER = 8 | 新增 | | ohos.bundle | ExtensionAbilityType | STATIC_SUBSCRIBER = 7 | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-communicate.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-communicate.md index 0c595eec7e6eeab687fe5cc056530752c028ebad..592c2d7daaa5d845e7bc6e96ff46e17b4a118cb7 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-communicate.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-communicate.md @@ -7,7 +7,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,基础通信 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| | tagSession | TagSession | getMaxSendLength(): number; | 新增 | -| tagSession | TagSession | sendData(data: number[]): Promise;
sendData(data: number[], callback: AsyncCallback): void; | 新增 | +| tagSession | TagSession | sendData(data: number[]): Promise\;
sendData(data: number[], callback: AsyncCallback\): void; | 新增 | | tagSession | TagSession | getSendDataTimeout(): number; | 新增 | | tagSession | TagSession | setSendDataTimeout(timeout: number): boolean; | 新增 | | tagSession | TagSession | isTagConnected(): boolean; | 新增 | @@ -25,11 +25,11 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,基础通信 | ohos.wifiext | PowerModel | THROUGH_WALL = 2 | 新增 | | ohos.wifiext | PowerModel | GENERAL = 1 | 新增 | | ohos.wifiext | PowerModel | SLEEPING = 0 | 新增 | -| ohos.wifiext | wifiext | function setPowerModel(model: PowerModel) : boolean | 新增 | -| ohos.wifiext | wifiext | function getPowerModel (): Promise;
function getPowerModel (callback: AsyncCallback): void; | 新增 | -| ohos.wifiext | wifiext | function getSupportedPowerModel(): Promise>;
function getSupportedPowerModel(callback: AsyncCallback>): void; | 新增 | -| ohos.wifiext | wifiext | function disableHotspot(): boolean; | 新增 | -| ohos.wifiext | wifiext | function enableHotspot(): boolean; | 新增 | +| ohos.wifiext | wifiext | setPowerModel(model: PowerModel) : boolean | 新增 | +| ohos.wifiext | wifiext | getPowerModel (): Promise\;
getPowerModel (callback: AsyncCallback\): void; | 新增 | +| ohos.wifiext | wifiext | getSupportedPowerModel(): Promise\>;
getSupportedPowerModel(callback: AsyncCallback\>): void; | 新增 | +| ohos.wifiext | wifiext | disableHotspot(): boolean; | 新增 | +| ohos.wifiext | wifiext | enableHotspot(): boolean; | 新增 | | ohos.wifi | GroupOwnerBand | GO_BAND_5GHZ = 2 | 新增 | | ohos.wifi | GroupOwnerBand | GO_BAND_2GHZ = 1 | 新增 | | ohos.wifi | GroupOwnerBand | GO_BAND_AUTO = 0 | 新增 | @@ -90,49 +90,49 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,基础通信 | ohos.wifi | WifiLinkedInfo | ssid: string; | 新增 | | ohos.wifi | WifiScanInfo | channelWidth: number; | 新增 | | ohos.wifi | WifiScanInfo | capabilities: string; | 新增 | -| ohos.wifi | wifi | function off(type: "p2pDiscoveryChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "p2pDiscoveryChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "p2pPersistentGroupChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "p2pPersistentGroupChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "p2pPeerDeviceChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "p2pPeerDeviceChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "p2pDeviceChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "p2pDeviceChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "p2pConnectionChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "p2pConnectionChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "p2pStateChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "p2pStateChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "hotspotStateChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "hotspotStateChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "wifiRssiChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "wifiRssiChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "wifiScanStateChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "wifiScanStateChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "wifiConnectionChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "wifiConnectionChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function off(type: "wifiStateChange", callback?: Callback): void; | 新增 | -| ohos.wifi | wifi | function on(type: "wifiStateChange", callback: Callback): void; | 新增 | -| ohos.wifi | wifi | function stopDiscoverDevices(): boolean; | 新增 | -| ohos.wifi | wifi | function startDiscoverDevices(): boolean; | 新增 | -| ohos.wifi | wifi | function p2pCancelConnect(): boolean; | 新增 | -| ohos.wifi | wifi | function p2pConnect(config: WifiP2PConfig): boolean; | 新增 | -| ohos.wifi | wifi | function removeGroup(): boolean; | 新增 | -| ohos.wifi | wifi | function createGroup(config: WifiP2PConfig): boolean; | 新增 | -| ohos.wifi | wifi | function getP2pPeerDevices(): Promise;
function getP2pPeerDevices(callback: AsyncCallback): void; | 新增 | -| ohos.wifi | wifi | function getCurrentGroup(): Promise;
function getCurrentGroup(callback: AsyncCallback): void; | 新增 | -| ohos.wifi | wifi | function getP2pLinkedInfo(): Promise;
function getP2pLinkedInfo(callback: AsyncCallback): void; | 新增 | -| ohos.wifi | wifi | function getCountryCode(): string; | 新增 | -| ohos.wifi | wifi | function getIpInfo(): IpInfo; | 新增 | -| ohos.wifi | wifi | function isFeatureSupported(featureId: number): boolean; | 新增 | -| ohos.wifi | wifi | function isConnected(): boolean; | 新增 | -| ohos.wifi | wifi | function getLinkedInfo(): Promise;
function getLinkedInfo(callback: AsyncCallback): void; | 新增 | -| ohos.wifi | wifi | function removeUntrustedConfig(config: WifiDeviceConfig): Promise;
function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; | 新增 | -| ohos.wifi | wifi | function addUntrustedConfig(config: WifiDeviceConfig): Promise;
function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback): void; | 新增 | +| ohos.wifi | wifi | off(type: "p2pDiscoveryChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "p2pDiscoveryChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "p2pPersistentGroupChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "p2pPersistentGroupChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "p2pPeerDeviceChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "p2pPeerDeviceChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "p2pDeviceChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "p2pDeviceChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "p2pConnectionChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "p2pConnectionChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "p2pStateChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "p2pStateChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "hotspotStateChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "hotspotStateChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "wifiRssiChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "wifiRssiChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "wifiScanStateChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "wifiScanStateChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "wifiConnectionChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "wifiConnectionChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | off(type: "wifiStateChange", callback?: Callback\): void; | 新增 | +| ohos.wifi | wifi | on(type: "wifiStateChange", callback: Callback\): void; | 新增 | +| ohos.wifi | wifi | stopDiscoverDevices(): boolean; | 新增 | +| ohos.wifi | wifi | startDiscoverDevices(): boolean; | 新增 | +| ohos.wifi | wifi | p2pCancelConnect(): boolean; | 新增 | +| ohos.wifi | wifi | p2pConnect(config: WifiP2PConfig): boolean; | 新增 | +| ohos.wifi | wifi | removeGroup(): boolean; | 新增 | +| ohos.wifi | wifi | createGroup(config: WifiP2PConfig): boolean; | 新增 | +| ohos.wifi | wifi | getP2pPeerDevices(): Promise\;
getP2pPeerDevices(callback: AsyncCallback\): void; | 新增 | +| ohos.wifi | wifi | getCurrentGroup(): Promise\;
getCurrentGroup(callback: AsyncCallback\): void; | 新增 | +| ohos.wifi | wifi | getP2pLinkedInfo(): Promise\;
getP2pLinkedInfo(callback: AsyncCallback\): void; | 新增 | +| ohos.wifi | wifi | getCountryCode(): string; | 新增 | +| ohos.wifi | wifi | getIpInfo(): IpInfo; | 新增 | +| ohos.wifi | wifi | isFeatureSupported(featureId: number): boolean; | 新增 | +| ohos.wifi | wifi | isConnected(): boolean; | 新增 | +| ohos.wifi | wifi | getLinkedInfo(): Promise\;
getLinkedInfo(callback: AsyncCallback\): void; | 新增 | +| ohos.wifi | wifi | removeUntrustedConfig(config: WifiDeviceConfig): Promise\;
removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback\): void; | 新增 | +| ohos.wifi | wifi | addUntrustedConfig(config: WifiDeviceConfig): Promise\;
addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback\): void; | 新增 | | ohos.nfc.tag | TagInfo | supportedProfiles: number[]; | 新增 | -| ohos.nfc.tag | tag | function getNfcVTag(tagInfo: TagInfo): NfcVTag | 新增 | -| ohos.nfc.tag | tag | function getNfcFTag(tagInfo: TagInfo): NfcFTag | 新增 | -| ohos.nfc.tag | tag | function getNfcBTag(tagInfo: TagInfo): NfcBTag | 新增 | -| ohos.nfc.tag | tag | function getNfcATag(tagInfo: TagInfo): NfcATag | 新增 | +| ohos.nfc.tag | tag | getNfcVTag(tagInfo: TagInfo): NfcVTag | 新增 | +| ohos.nfc.tag | tag | getNfcFTag(tagInfo: TagInfo): NfcFTag | 新增 | +| ohos.nfc.tag | tag | getNfcBTag(tagInfo: TagInfo): NfcBTag | 新增 | +| ohos.nfc.tag | tag | getNfcATag(tagInfo: TagInfo): NfcATag | 新增 | | ohos.nfc.tag | tag | const MIFARE_ULTRALIGHT = 9; | 新增 | | ohos.nfc.tag | tag | const MIFARE_CLASSIC = 8; | 新增 | | ohos.nfc.tag | tag | const NDEF = 6; | 新增 | @@ -141,33 +141,33 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,基础通信 | ohos.nfc.tag | tag | const ISO_DEP = 3; | 新增 | | ohos.nfc.tag | tag | const NFC_B = 2; | 新增 | | ohos.nfc.tag | tag | const NFC_A = 1; | 新增 | -| ohos.nfc.controller | nfcController | function getNfcState(): NfcState | 新增 | -| ohos.nfc.controller | nfcController | function isNfcOpen(): boolean | 新增 | -| ohos.nfc.controller | nfcController | function closeNfc(): boolean | 新增 | -| ohos.nfc.controller | nfcController | function openNfc(): boolean | 新增 | -| ohos.nfc.controller | nfcController | function off(type: "nfcStateChange", callback?: Callback): void | 新增 | -| ohos.nfc.controller | nfcController | function on(type: "nfcStateChange", callback: Callback): void | 新增 | -| ohos.nfc.controller | nfcController | function isNfcAvailable(): boolean | 新增 | +| ohos.nfc.controller | nfcController | getNfcState(): NfcState | 新增 | +| ohos.nfc.controller | nfcController | isNfcOpen(): boolean | 新增 | +| ohos.nfc.controller | nfcController | closeNfc(): boolean | 新增 | +| ohos.nfc.controller | nfcController | openNfc(): boolean | 新增 | +| ohos.nfc.controller | nfcController | off(type: "nfcStateChange", callback?: Callback\): void | 新增 | +| ohos.nfc.controller | nfcController | on(type: "nfcStateChange", callback: Callback\): void | 新增 | +| ohos.nfc.controller | nfcController | isNfcAvailable(): boolean | 新增 | | ohos.nfc.controller | NfcState | STATE_TURNING_OFF = 4 | 新增 | | ohos.nfc.controller | NfcState | STATE_ON = 3 | 新增 | | ohos.nfc.controller | NfcState | STATE_TURNING_ON = 2 | 新增 | | ohos.nfc.controller | NfcState | STATE_OFF = 1 | 新增 | | ohos.nfc.cardEmulation | HceService | sendResponse(responseApdu: number[]): void; | 新增 | -| ohos.nfc.cardEmulation | HceService | on(type: "hceCmd", callback: AsyncCallback): void; | 新增 | +| ohos.nfc.cardEmulation | HceService | on(type: "hceCmd", callback: AsyncCallback\): void; | 新增 | | ohos.nfc.cardEmulation | HceService | stopHCE(): boolean; | 新增 | | ohos.nfc.cardEmulation | HceService | startHCE(aidList: string[]): boolean; | 新增 | -| ohos.nfc.cardEmulation | cardEmulation | function isSupported(feature: number): boolean; | 新增 | +| ohos.nfc.cardEmulation | cardEmulation | isSupported(feature: number): boolean; | 新增 | | ohos.nfc.cardEmulation | FeatureType | ESE = 2 | 新增 | | ohos.nfc.cardEmulation | FeatureType | UICC = 1 | 新增 | | ohos.nfc.cardEmulation | FeatureType | HCE = 0 | 新增 | | ohos.connectedTag | NfcRfType | NFC_RF_ENTER = 1 | 新增 | | ohos.connectedTag | NfcRfType | NFC_RF_LEAVE = 0 | 新增 | -| ohos.connectedTag | connectedTag | function off(type: "notify", callback?:Callback): void; | 新增 | -| ohos.connectedTag | connectedTag | function on(type: "notify", callback: Callback): void; | 新增 | -| ohos.connectedTag | connectedTag | function writeNdefTag(data: string): Promise;
function writeNdefTag(data: string, callback: AsyncCallback): void; | 新增 | -| ohos.connectedTag | connectedTag | function readNdefTag(): Promise;
function readNdefTag(callback: AsyncCallback): void; | 新增 | -| ohos.connectedTag | connectedTag | function uninit(): boolean; | 新增 | -| ohos.connectedTag | connectedTag | function init(): boolean; | 新增 | +| ohos.connectedTag | connectedTag | off(type: "notify", callback?:Callback\): void; | 新增 | +| ohos.connectedTag | connectedTag | on(type: "notify", callback: Callback\): void; | 新增 | +| ohos.connectedTag | connectedTag | writeNdefTag(data: string): Promise\;
writeNdefTag(data: string, callback: AsyncCallback\): void; | 新增 | +| ohos.connectedTag | connectedTag | readNdefTag(): Promise\;
readNdefTag(callback: AsyncCallback\): void; | 新增 | +| ohos.connectedTag | connectedTag | uninit(): boolean; | 新增 | +| ohos.connectedTag | connectedTag | init(): boolean; | 新增 | | ohos.bluetooth | ProfileId | PROFILE_HANDS_FREE_AUDIO_GATEWAY = 4 | 新增 | | ohos.bluetooth | ProfileId | PROFILE_A2DP_SOURCE = 1 | 新增 | | ohos.bluetooth | PlayingState | STATE_PLAYING | 新增 | @@ -317,9 +317,9 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,基础通信 | ohos.bluetooth | ServiceData | serviceUuid: string; | 新增 | | ohos.bluetooth | ManufactureData | manufactureValue: ArrayBuffer; | 新增 | | ohos.bluetooth | ManufactureData | manufactureId: number; | 新增 | -| ohos.bluetooth | AdvertiseData | serviceData: Array; | 新增 | -| ohos.bluetooth | AdvertiseData | manufactureData: Array; | 新增 | -| ohos.bluetooth | AdvertiseData | serviceUuids: Array; | 新增 | +| ohos.bluetooth | AdvertiseData | serviceData: Array\; | 新增 | +| ohos.bluetooth | AdvertiseData | manufactureData: Array\; | 新增 | +| ohos.bluetooth | AdvertiseData | serviceUuids: Array\; | 新增 | | ohos.bluetooth | AdvertiseSetting | connectable?: boolean; | 新增 | | ohos.bluetooth | AdvertiseSetting | txPower?: number; | 新增 | | ohos.bluetooth | AdvertiseSetting | interval?: number; | 新增 | @@ -369,40 +369,40 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,基础通信 | ohos.bluetooth | BLEDescriptor | descriptorUuid: string; | 新增 | | ohos.bluetooth | BLEDescriptor | characteristicUuid: string; | 新增 | | ohos.bluetooth | BLEDescriptor | serviceUuid: string; | 新增 | -| ohos.bluetooth | BLECharacteristic | descriptors: Array; | 新增 | +| ohos.bluetooth | BLECharacteristic | descriptors: Array\; | 新增 | | ohos.bluetooth | BLECharacteristic | characteristicValue: ArrayBuffer; | 新增 | | ohos.bluetooth | BLECharacteristic | characteristicUuid: string; | 新增 | | ohos.bluetooth | BLECharacteristic | serviceUuid: string; | 新增 | -| ohos.bluetooth | GattService | includeServices?: Array; | 新增 | -| ohos.bluetooth | GattService | characteristics: Array; | 新增 | +| ohos.bluetooth | GattService | includeServices?: Array\; | 新增 | +| ohos.bluetooth | GattService | characteristics: Array\; | 新增 | | ohos.bluetooth | GattService | isPrimary: boolean; | 新增 | | ohos.bluetooth | GattService | serviceUuid: string; | 新增 | -| ohos.bluetooth | GattClientDevice | off(type: "BLEConnectionStateChange", callback?: Callback): void; | 新增 | -| ohos.bluetooth | GattClientDevice | on(type: "BLEConnectionStateChange", callback: Callback): void; | 新增 | -| ohos.bluetooth | GattClientDevice | off(type: "BLECharacteristicChange", callback?: Callback): void; | 新增 | -| ohos.bluetooth | GattClientDevice | on(type: "BLECharacteristicChange", callback: Callback): void; | 新增 | +| ohos.bluetooth | GattClientDevice | off(type: "BLEConnectionStateChange", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | GattClientDevice | on(type: "BLEConnectionStateChange", callback: Callback\): void; | 新增 | +| ohos.bluetooth | GattClientDevice | off(type: "BLECharacteristicChange", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | GattClientDevice | on(type: "BLECharacteristicChange", callback: Callback\): void; | 新增 | | ohos.bluetooth | GattClientDevice | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean; | 新增 | | ohos.bluetooth | GattClientDevice | setBLEMtuSize(mtu: number): boolean; | 新增 | -| ohos.bluetooth | GattClientDevice | getRssiValue(callback: AsyncCallback): void;
getRssiValue(): Promise; | 新增 | +| ohos.bluetooth | GattClientDevice | getRssiValue(callback: AsyncCallback\): void;
getRssiValue(): Promise\; | 新增 | | ohos.bluetooth | GattClientDevice | writeDescriptorValue(descriptor: BLEDescriptor): boolean; | 新增 | | ohos.bluetooth | GattClientDevice | writeCharacteristicValue(characteristic: BLECharacteristic): boolean; | 新增 | -| ohos.bluetooth | GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback): void;
readDescriptorValue(descriptor: BLEDescriptor): Promise; | 新增 | -| ohos.bluetooth | GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback): void;
readCharacteristicValue(characteristic: BLECharacteristic): Promise; | 新增 | -| ohos.bluetooth | GattClientDevice | getServices(callback: AsyncCallback>): void;
getServices(): Promise>; | 新增 | -| ohos.bluetooth | GattClientDevice | getDeviceName(callback: AsyncCallback): void;
getDeviceName(): Promise; | 新增 | +| ohos.bluetooth | GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback\): void;
readDescriptorValue(descriptor: BLEDescriptor): Promise\; | 新增 | +| ohos.bluetooth | GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback\): void;
readCharacteristicValue(characteristic: BLECharacteristic): Promise\; | 新增 | +| ohos.bluetooth | GattClientDevice | getServices(callback: AsyncCallback\>): void;
getServices(): Promise\>; | 新增 | +| ohos.bluetooth | GattClientDevice | getDeviceName(callback: AsyncCallback\): void;
getDeviceName(): Promise\; | 新增 | | ohos.bluetooth | GattClientDevice | close(): boolean; | 新增 | | ohos.bluetooth | GattClientDevice | disconnect(): boolean; | 新增 | | ohos.bluetooth | GattClientDevice | connect(): boolean; | 新增 | -| ohos.bluetooth | GattServer | off(type: "connectStateChange", callback?: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | on(type: "connectStateChange", callback: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | off(type: "descriptorWrite", callback?: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | on(type: "descriptorWrite", callback: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | off(type: "descriptorRead", callback?: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | on(type: "descriptorRead", callback: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | off(type: "characteristicWrite", callback?: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | on(type: "characteristicWrite", callback: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | off(type: "characteristicRead", callback?: Callback): void; | 新增 | -| ohos.bluetooth | GattServer | on(type: "characteristicRead", callback: Callback): void; | 新增 | +| ohos.bluetooth | GattServer | off(type: "connectStateChange", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | on(type: "connectStateChange", callback: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | off(type: "descriptorWrite", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | on(type: "descriptorWrite", callback: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | off(type: "descriptorRead", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | on(type: "descriptorRead", callback: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | off(type: "characteristicWrite", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | on(type: "characteristicWrite", callback: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | off(type: "characteristicRead", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | GattServer | on(type: "characteristicRead", callback: Callback\): void; | 新增 | | ohos.bluetooth | GattServer | sendResponse(serverResponse: ServerResponse): boolean; | 新增 | | ohos.bluetooth | GattServer | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean; | 新增 | | ohos.bluetooth | GattServer | close(): void; | 新增 | @@ -410,54 +410,54 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,基础通信 | ohos.bluetooth | GattServer | addService(service: GattService): boolean; | 新增 | | ohos.bluetooth | GattServer | stopAdvertising(): void; | 新增 | | ohos.bluetooth | GattServer | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | 新增 | -| ohos.bluetooth | BLE | function off(type: "BLEDeviceFind", callback?: Callback>): void; | 新增 | -| ohos.bluetooth | BLE | function on(type: "BLEDeviceFind", callback: Callback>): void; | 新增 | -| ohos.bluetooth | BLE | function stopBLEScan(): void; | 新增 | -| ohos.bluetooth | BLE | function startBLEScan(filters: Array, options?: ScanOptions): void; | 新增 | -| ohos.bluetooth | BLE | function getConnectedBLEDevices(): Array; | 新增 | -| ohos.bluetooth | BLE | function createGattClientDevice(deviceId: string): GattClientDevice; | 新增 | -| ohos.bluetooth | BLE | function createGattServer(): GattServer; | 新增 | -| ohos.bluetooth | HandsFreeAudioGatewayProfile | off(type: "connectionStateChange", callback?: Callback): void; | 新增 | -| ohos.bluetooth | HandsFreeAudioGatewayProfile | on(type: "connectionStateChange", callback: Callback): void; | 新增 | +| ohos.bluetooth | BLE | off(type: "BLEDeviceFind", callback?: Callback\>): void; | 新增 | +| ohos.bluetooth | BLE | on(type: "BLEDeviceFind", callback: Callback\>): void; | 新增 | +| ohos.bluetooth | BLE | stopBLEScan(): void; | 新增 | +| ohos.bluetooth | BLE | startBLEScan(filters: Array\, options?: ScanOptions): void; | 新增 | +| ohos.bluetooth | BLE | getConnectedBLEDevices(): Array\; | 新增 | +| ohos.bluetooth | BLE | createGattClientDevice(deviceId: string): GattClientDevice; | 新增 | +| ohos.bluetooth | BLE | createGattServer(): GattServer; | 新增 | +| ohos.bluetooth | HandsFreeAudioGatewayProfile | off(type: "connectionStateChange", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | HandsFreeAudioGatewayProfile | on(type: "connectionStateChange", callback: Callback\): void; | 新增 | | ohos.bluetooth | HandsFreeAudioGatewayProfile | disconnect(device: string): boolean; | 新增 | | ohos.bluetooth | HandsFreeAudioGatewayProfile | connect(device: string): boolean; | 新增 | | ohos.bluetooth | A2dpSourceProfile | getPlayingState(device: string): PlayingState; | 新增 | -| ohos.bluetooth | A2dpSourceProfile | off(type: "connectionStateChange", callback?: Callback): void; | 新增 | -| ohos.bluetooth | A2dpSourceProfile | on(type: "connectionStateChange", callback: Callback): void; | 新增 | +| ohos.bluetooth | A2dpSourceProfile | off(type: "connectionStateChange", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | A2dpSourceProfile | on(type: "connectionStateChange", callback: Callback\): void; | 新增 | | ohos.bluetooth | A2dpSourceProfile | disconnect(device: string): boolean; | 新增 | | ohos.bluetooth | A2dpSourceProfile | connect(device: string): boolean; | 新增 | | ohos.bluetooth | BaseProfile | getDeviceState(device: string): ProfileConnectionState; | 新增 | -| ohos.bluetooth | BaseProfile | getConnectionDevices(): Array; | 新增 | -| ohos.bluetooth | bluetooth | function getProfile(profileId: ProfileId): A2dpSourceProfile \| HandsFreeAudioGatewayProfile; | 新增 | -| ohos.bluetooth | bluetooth | function off(type: "sppRead", clientSocket: number, callback?: Callback): void; | 新增 | -| ohos.bluetooth | bluetooth | function on(type: "sppRead", clientSocket: number, callback: Callback): void; | 新增 | -| ohos.bluetooth | bluetooth | function sppWrite(clientSocket: number, data: ArrayBuffer): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function sppCloseClientSocket(socket: number): void; | 新增 | -| ohos.bluetooth | bluetooth | function sppCloseServerSocket(socket: number): void; | 新增 | -| ohos.bluetooth | bluetooth | function sppConnect(device: string, option: SppOption, callback: AsyncCallback): void; | 新增 | -| ohos.bluetooth | bluetooth | function sppAccept(serverSocket: number, callback: AsyncCallback): void; | 新增 | -| ohos.bluetooth | bluetooth | function sppListen(name: string, option: SppOption, callback: AsyncCallback): void; | 新增 | -| ohos.bluetooth | bluetooth | function off(type: "stateChange", callback?: Callback): void; | 新增 | -| ohos.bluetooth | bluetooth | function on(type: "stateChange", callback: Callback): void; | 新增 | -| ohos.bluetooth | bluetooth | function off(type: "pinRequired", callback?: Callback): void; | 新增 | -| ohos.bluetooth | bluetooth | function on(type: "pinRequired", callback: Callback): void; | 新增 | -| ohos.bluetooth | bluetooth | function off(type: "bondStateChange", callback?: Callback): void; | 新增 | -| ohos.bluetooth | bluetooth | function on(type: "bondStateChange", callback: Callback): void; | 新增 | -| ohos.bluetooth | bluetooth | function off(type: "bluetoothDeviceFind", callback?: Callback>): void; | 新增 | -| ohos.bluetooth | bluetooth | function on(type: "bluetoothDeviceFind", callback: Callback>): void; | 新增 | -| ohos.bluetooth | bluetooth | function stopBluetoothDiscovery(): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function startBluetoothDiscovery(): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function getBluetoothScanMode(): ScanMode; | 新增 | -| ohos.bluetooth | bluetooth | function setBluetoothScanMode(mode: ScanMode, duration: number): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function setLocalName(name: string): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function setDevicePairingConfirmation(device: string, accept: boolean): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function getProfileConnState(profileId: ProfileId): ProfileConnectionState; | 新增 | -| ohos.bluetooth | bluetooth | function getPairedDevices(): Array; | 新增 | -| ohos.bluetooth | bluetooth | function getLocalName(): string; | 新增 | -| ohos.bluetooth | bluetooth | function disableBluetooth(): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function enableBluetooth(): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function getRemoteDeviceClass(deviceId: string): DeviceClass; | 新增 | -| ohos.bluetooth | bluetooth | function getRemoteDeviceName(deviceId: string): string; | 新增 | -| ohos.bluetooth | bluetooth | function pairDevice(deviceId: string): boolean; | 新增 | -| ohos.bluetooth | bluetooth | function getBtConnectionState(): ProfileConnectionState; | 新增 | -| ohos.bluetooth | bluetooth | function getState(): BluetoothState; | 新增 | +| ohos.bluetooth | BaseProfile | getConnectionDevices(): Array\; | 新增 | +| ohos.bluetooth | bluetooth | getProfile(profileId: ProfileId): A2dpSourceProfile \| HandsFreeAudioGatewayProfile; | 新增 | +| ohos.bluetooth | bluetooth | off(type: "sppRead", clientSocket: number, callback?: Callback\): void; | 新增 | +| ohos.bluetooth | bluetooth | on(type: "sppRead", clientSocket: number, callback: Callback\): void; | 新增 | +| ohos.bluetooth | bluetooth | sppWrite(clientSocket: number, data: ArrayBuffer): boolean; | 新增 | +| ohos.bluetooth | bluetooth | sppCloseClientSocket(socket: number): void; | 新增 | +| ohos.bluetooth | bluetooth | sppCloseServerSocket(socket: number): void; | 新增 | +| ohos.bluetooth | bluetooth | sppConnect(device: string, option: SppOption, callback: AsyncCallback\): void; | 新增 | +| ohos.bluetooth | bluetooth | sppAccept(serverSocket: number, callback: AsyncCallback\): void; | 新增 | +| ohos.bluetooth | bluetooth | sppListen(name: string, option: SppOption, callback: AsyncCallback\): void; | 新增 | +| ohos.bluetooth | bluetooth | off(type: "stateChange", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | bluetooth | on(type: "stateChange", callback: Callback\): void; | 新增 | +| ohos.bluetooth | bluetooth | off(type: "pinRequired", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | bluetooth | on(type: "pinRequired", callback: Callback\): void; | 新增 | +| ohos.bluetooth | bluetooth | off(type: "bondStateChange", callback?: Callback\): void; | 新增 | +| ohos.bluetooth | bluetooth | on(type: "bondStateChange", callback: Callback\): void; | 新增 | +| ohos.bluetooth | bluetooth | off(type: "bluetoothDeviceFind", callback?: Callback\>): void; | 新增 | +| ohos.bluetooth | bluetooth | on(type: "bluetoothDeviceFind", callback: Callback\>): void; | 新增 | +| ohos.bluetooth | bluetooth | stopBluetoothDiscovery(): boolean; | 新增 | +| ohos.bluetooth | bluetooth | startBluetoothDiscovery(): boolean; | 新增 | +| ohos.bluetooth | bluetooth | getBluetoothScanMode(): ScanMode; | 新增 | +| ohos.bluetooth | bluetooth | setBluetoothScanMode(mode: ScanMode, duration: number): boolean; | 新增 | +| ohos.bluetooth | bluetooth | setLocalName(name: string): boolean; | 新增 | +| ohos.bluetooth | bluetooth | setDevicePairingConfirmation(device: string, accept: boolean): boolean; | 新增 | +| ohos.bluetooth | bluetooth | getProfileConnState(profileId: ProfileId): ProfileConnectionState; | 新增 | +| ohos.bluetooth | bluetooth | getPairedDevices(): Array\; | 新增 | +| ohos.bluetooth | bluetooth | getLocalName(): string; | 新增 | +| ohos.bluetooth | bluetooth | disableBluetooth(): boolean; | 新增 | +| ohos.bluetooth | bluetooth | enableBluetooth(): boolean; | 新增 | +| ohos.bluetooth | bluetooth | getRemoteDeviceClass(deviceId: string): DeviceClass; | 新增 | +| ohos.bluetooth | bluetooth | getRemoteDeviceName(deviceId: string): string; | 新增 | +| ohos.bluetooth | bluetooth | pairDevice(deviceId: string): boolean; | 新增 | +| ohos.bluetooth | bluetooth | getBtConnectionState(): ProfileConnectionState; | 新增 | +| ohos.bluetooth | bluetooth | getState(): BluetoothState; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-complier-and-runtime.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-complier-and-runtime.md index 2e95af448cf63bbb852ec368986d02458fbfb889..fb5cfb47df33911f7ac2a8efe5df8c5de8daa7d5 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-complier-and-runtime.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-complier-and-runtime.md @@ -45,21 +45,21 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.xml | XmlSerializer | addEmptyElement(name: string): void; | 新增 | | ohos.xml | XmlSerializer | setAttributes(name: string, value: string): void; | 新增 | | ohos.xml | XmlSerializer | constructor(buffer: ArrayBuffer \| DataView, encoding?: string); | 新增 | -| ohos.util.Vector | Vector | [Symbol.iterator](): IterableIterator; | 新增 | -| ohos.util.Vector | Vector | copyToArray(array: Array): void; | 新增 | +| ohos.util.Vector | Vector | \[Symbol.iterator](): IterableIterator\; | 新增 | +| ohos.util.Vector | Vector | copyToArray(array: Array\): void; | 新增 | | ohos.util.Vector | Vector | trimToCurrentLength(): void; | 新增 | | ohos.util.Vector | Vector | toString(): string; | 新增 | | ohos.util.Vector | Vector | increaseCapacityTo(newCapacity: number): void; | 新增 | | ohos.util.Vector | Vector | isEmpty(): boolean; | 新增 | -| ohos.util.Vector | Vector | convertToArray(): Array; | 新增 | +| ohos.util.Vector | Vector | convertToArray(): Array\; | 新增 | | ohos.util.Vector | Vector | getCapacity(): number; | 新增 | | ohos.util.Vector | Vector | setLength(newSize: number): void; | 新增 | -| ohos.util.Vector | Vector | clone(): Vector; | 新增 | +| ohos.util.Vector | Vector | clone(): Vector\; | 新增 | | ohos.util.Vector | Vector | clear(): void; | 新增 | -| ohos.util.Vector | Vector | subVector(fromIndex: number, toIndex: number): Vector; | 新增 | +| ohos.util.Vector | Vector | subVector(fromIndex: number, toIndex: number): Vector\; | 新增 | | ohos.util.Vector | Vector | sort(comparator?: (firstValue: T, secondValue: T) => number): void; | 新增 | -| ohos.util.Vector | Vector | forEach(callbackfn: (value: T, index?: number, vector?: Vector) => void, thisArg?: Object): void; | 新增 | -| ohos.util.Vector | Vector | replaceAllElements(callbackfn: (value: T, index?: number, vector?: Vector) => T, thisArg?: Object): void; | 新增 | +| ohos.util.Vector | Vector | forEach(callbackfn: (value: T, index?: number, vector?: Vector\) => void, thisArg?: Object): void; | 新增 | +| ohos.util.Vector | Vector | replaceAllElements(callbackfn: (value: T, index?: number, vector?: Vector\) => T, thisArg?: Object): void; | 新增 | | ohos.util.Vector | Vector | removeByRange(fromIndex: number, toIndex: number): void; | 新增 | | ohos.util.Vector | Vector | getIndexFrom(element: T, index: number): number; | 新增 | | ohos.util.Vector | Vector | getLastIndexFrom(element: T, index: number): number; | 新增 | @@ -76,10 +76,10 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.Vector | Vector | add(element: T): boolean; | 新增 | | ohos.util.Vector | Vector | length: number; | 新增 | | ohos.util.Vector | Vector | constructor(); | 新增 | -| ohos.util.TreeSet | TreeSet | [Symbol.iterator](): IterableIterator; | 新增 | -| ohos.util.TreeSet | TreeSet | entries(): IterableIterator<[T, T]>; | 新增 | -| ohos.util.TreeSet | TreeSet | values(): IterableIterator; | 新增 | -| ohos.util.TreeSet | TreeSet | forEach(callbackfn: (value?: T, key?: T, set?: TreeSet) => void, thisArg?: Object): void;| 新增 | +| ohos.util.TreeSet | TreeSet | \[Symbol.iterator](): IterableIterator\; | 新增 | +| ohos.util.TreeSet | TreeSet | entries(): IterableIterator\<[T, T]>; | 新增 | +| ohos.util.TreeSet | TreeSet | values(): IterableIterator\; | 新增 | +| ohos.util.TreeSet | TreeSet | forEach(callbackfn: (value?: T, key?: T, set?: TreeSet\) => void, thisArg?: Object): void; | 新增 | | ohos.util.TreeSet | TreeSet | popLast(): T; | 新增 | | ohos.util.TreeSet | TreeSet | popFirst(): T; | 新增 | | ohos.util.TreeSet | TreeSet | getHigherValue(key: T): T; | 新增 | @@ -93,18 +93,18 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.TreeSet | TreeSet | isEmpty(): boolean; | 新增 | | ohos.util.TreeSet | TreeSet | length: number; | 新增 | | ohos.util.TreeSet | TreeSet | constructor(comparator?: (firstValue: T, secondValue: T) => boolean) | 新增 | -| ohos.util.TreeMap | TreeMap | [Symbol.iterator](): IterableIterator<[K, V]>; | 新增 | -| ohos.util.TreeMap | TreeMap | entries(): IterableIterator<[K, V]>; | 新增 | -| ohos.util.TreeMap | TreeMap | forEach(callbackfn: (value?: V, key?: K, map?: TreeMap) => void, thisArg?: Object): void; | 新增 | +| ohos.util.TreeMap | TreeMap | \[Symbol.iterator](): IterableIterator\<[K, V]>; | 新增 | +| ohos.util.TreeMap | TreeMap | entries(): IterableIterator\<[K, V]>; | 新增 | +| ohos.util.TreeMap | TreeMap | forEach(callbackfn: (value?: V, key?: K, map?: TreeMap\) => void, thisArg?: Object): void; | 新增 | | ohos.util.TreeMap | TreeMap | replace(key: K, newValue: V): boolean; | 新增 | -| ohos.util.TreeMap | TreeMap | values(): IterableIterator; | 新增 | -| ohos.util.TreeMap | TreeMap | keys(): IterableIterator; | 新增 | +| ohos.util.TreeMap | TreeMap | values(): IterableIterator\; | 新增 | +| ohos.util.TreeMap | TreeMap | keys(): IterableIterator\; | 新增 | | ohos.util.TreeMap | TreeMap | getHigherKey(key: K): K; | 新增 | | ohos.util.TreeMap | TreeMap | getLowerKey(key: K): K; | 新增 | | ohos.util.TreeMap | TreeMap | clear(): void; | 新增 | | ohos.util.TreeMap | TreeMap | remove(key: K): V; | 新增 | | ohos.util.TreeMap | TreeMap | set(key: K, value: V): Object; | 新增 | -| ohos.util.TreeMap | TreeMap | setAll(map: TreeMap): void; | 新增 | +| ohos.util.TreeMap | TreeMap | setAll(map: TreeMap\): void; | 新增 | | ohos.util.TreeMap | TreeMap | getLastKey(): K; | 新增 | | ohos.util.TreeMap | TreeMap | getFirstKey(): K; | 新增 | | ohos.util.TreeMap | TreeMap | get(key: K): V; | 新增 | @@ -113,8 +113,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.TreeMap | TreeMap | isEmpty(): boolean; | 新增 | | ohos.util.TreeMap | TreeMap | length: number; | 新增 | | ohos.util.TreeMap | TreeMap | constructor(comparator?: (firstValue: K, secondValue: K) => boolean); | 新增 | -| ohos.util.Stack | Stack | [Symbol.iterator](): IterableIterator; | 新增 | -| ohos.util.Stack | Stack | forEach(callbackfn: (value: T, index?: number, stack?: Stack) => void, thisArg?: Object): void; | 新增 | +| ohos.util.Stack | Stack | \[Symbol.iterator](): IterableIterator\; | 新增 | +| ohos.util.Stack | Stack | forEach(callbackfn: (value: T, index?: number, stack?: Stack\) => void, thisArg?: Object): void; | 新增 | | ohos.util.Stack | Stack | locate(element: T): number; | 新增 | | ohos.util.Stack | Stack | push(item: T): T; | 新增 | | ohos.util.Stack | Stack | pop(): T; | 新增 | @@ -122,15 +122,15 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.Stack | Stack | isEmpty(): boolean; | 新增 | | ohos.util.Stack | Stack | length: number; | 新增 | | ohos.util.Stack | Stack | constructor(); | 新增 | -| ohos.util.Queue | Queue | [Symbol.iterator](): IterableIterator; | 新增 | -| ohos.util.Queue | Queue | forEach(callbackfn: (value: T, index?: number, Queue?: Queue) => void, thisArg?: Object): void; | 新增 | +| ohos.util.Queue | Queue | \[Symbol.iterator](): IterableIterator\; | 新增 | +| ohos.util.Queue | Queue | forEach(callbackfn: (value: T, index?: number, Queue?: Queue\) => void, thisArg?: Object): void; | 新增 | | ohos.util.Queue | Queue | pop(): T; | 新增 | | ohos.util.Queue | Queue | getFirst(): T; | 新增 | | ohos.util.Queue | Queue | add(element: T): boolean; | 新增 | | ohos.util.Queue | Queue | length: number; | 新增 | | ohos.util.Queue | Queue | constructor(); | 新增 | -| ohos.util.PlainArray | PlainArray | [Symbol.iterator](): IterableIterator<[number, T]>; | 新增 | -| ohos.util.PlainArray | PlainArray | forEach(callbackfn: (value: T, index?: number, PlainArray?: PlainArray) => void, thisArg?: Object): void; | 新增 | +| ohos.util.PlainArray | PlainArray | \[Symbol.iterator](): IterableIterator\<[number, T]>; | 新增 | +| ohos.util.PlainArray | PlainArray | forEach(callbackfn: (value: T, index?: number, PlainArray?: PlainArray\) => void, thisArg?: Object): void; | 新增 | | ohos.util.PlainArray | PlainArray | getValueAt(index: number): T; | 新增 | | ohos.util.PlainArray | PlainArray | toString(): String; | 新增 | | ohos.util.PlainArray | PlainArray | setValueAt(index: number, value: T): void; | 新增 | @@ -143,19 +143,19 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.PlainArray | PlainArray | getIndexOfKey(key: number): number; | 新增 | | ohos.util.PlainArray | PlainArray | get(key: number): T; | 新增 | | ohos.util.PlainArray | PlainArray | has(key: number): boolean; | 新增 | -| ohos.util.PlainArray | PlainArray | clone(): PlainArray; | 新增 | +| ohos.util.PlainArray | PlainArray | clone(): PlainArray\; | 新增 | | ohos.util.PlainArray | PlainArray | clear(): void; | 新增 | | ohos.util.PlainArray | PlainArray | add(key: number, value: T): void; | 新增 | | ohos.util.PlainArray | PlainArray | length: number; | 新增 | | ohos.util.PlainArray | PlainArray | constructor(); | 新增 | -| ohos.util.List | List | [Symbol.iterator](): IterableIterator; | 新增 | +| ohos.util.List | List | \[Symbol.iterator](): IterableIterator\; | 新增 | | ohos.util.List | List | isEmpty(): boolean; | 新增 | -| ohos.util.List | List | convertToArray(): Array; | 新增 | -| ohos.util.List | List | replaceAllElements(callbackfn: (value: T, index?: number, list?: List) => T, thisArg?: Object): void; | 新增 | -| ohos.util.List | List | getSubList(fromIndex: number, toIndex: number): List; | 新增 | +| ohos.util.List | List | convertToArray(): Array\; | 新增 | +| ohos.util.List | List | replaceAllElements(callbackfn: (value: T, index?: number, list?: List\) => T, thisArg?: Object): void; | 新增 | +| ohos.util.List | List | getSubList(fromIndex: number, toIndex: number): List\; | 新增 | | ohos.util.List | List | clear(): void; | 新增 | | ohos.util.List | List | sort(comparator: (firstValue: T, secondValue: T) => number): void; | 新增 | -| ohos.util.List | List | forEach(callbackfn: (value: T, index?: number, List?: List) => void, thisArg?: Object): void; | 新增 | +| ohos.util.List | List | forEach(callbackfn: (value: T, index?: number, List?: List\) => void, thisArg?: Object): void; | 新增 | | ohos.util.List | List | equal(obj: Object): boolean; | 新增 | | ohos.util.List | List | set(index: number, element: T): T; | 新增 | | ohos.util.List | List | getLast(): T; | 新增 | @@ -170,11 +170,11 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.List | List | add(element: T): boolean; | 新增 | | ohos.util.List | List | length: number; | 新增 | | ohos.util.List | List | constructor(); | 新增 | -| ohos.util.LinkedList | LinkedList | [Symbol.iterator](): IterableIterator; | 新增 | -| ohos.util.LinkedList | LinkedList | convertToArray(): Array; | 新增 | -| ohos.util.LinkedList | LinkedList | clone(): LinkedList; | 新增 | +| ohos.util.LinkedList | LinkedList | \[Symbol.iterator](): IterableIterator\; | 新增 | +| ohos.util.LinkedList | LinkedList | convertToArray(): Array\; | 新增 | +| ohos.util.LinkedList | LinkedList | clone(): LinkedList\; | 新增 | | ohos.util.LinkedList | LinkedList | clear(): void; | 新增 | -| ohos.util.LinkedList | LinkedList | forEach(callbackfn: (value: T, index?: number, LinkedList?: LinkedList) => void, thisArg?: Object): void; | 新增 | +| ohos.util.LinkedList | LinkedList | forEach(callbackfn: (value: T, index?: number, LinkedList?: LinkedList\) => void, thisArg?: Object): void; | 新增 | | ohos.util.LinkedList | LinkedList | set(index: number, element: T): T; | 新增 | | ohos.util.LinkedList | LinkedList | getLast(): T; | 新增 | | ohos.util.LinkedList | LinkedList | getFirst(): T; | 新增 | @@ -194,13 +194,13 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.LinkedList | LinkedList | length: number; | 新增 | | ohos.util.LinkedList | LinkedList | constructor(); | 新增 | | ohos.util.LightWeightSet | LightWeightSet | isEmpty(): boolean; | 新增 | -| ohos.util.LightWeightSet | LightWeightSet | entries(): IterableIterator<[T, T]>; | 新增 | -| ohos.util.LightWeightSet | LightWeightSet | values(): IterableIterator; | 新增 | +| ohos.util.LightWeightSet | LightWeightSet | entries(): IterableIterator\<[T, T]>; | 新增 | +| ohos.util.LightWeightSet | LightWeightSet | values(): IterableIterator\; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | getValueAt(index: number): T; | 新增 | -| ohos.util.LightWeightSet | LightWeightSet | toArray(): Array; | 新增 | +| ohos.util.LightWeightSet | LightWeightSet | toArray(): Array\; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | toString(): String; | 新增 | -| ohos.util.LightWeightSet | LightWeightSet | [Symbol.iterator](): IterableIterator; | 新增 | -| ohos.util.LightWeightSet | LightWeightSet | forEach(callbackfn: (value?: T, key?: T, set?: LightWeightSet) => void, thisArg?: Object): void; | 新增 | +| ohos.util.LightWeightSet | LightWeightSet | \[Symbol.iterator](): IterableIterator\; | 新增 | +| ohos.util.LightWeightSet | LightWeightSet | forEach(callbackfn: (value?: T, key?: T, set?: LightWeightSet\) => void, thisArg?: Object): void; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | clear(): void; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | removeAt(index: number): boolean; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | remove(key: T): T; | 新增 | @@ -208,39 +208,39 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.LightWeightSet | LightWeightSet | increaseCapacityTo(minimumCapacity: number): void; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | equal(obj: Object): boolean; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | has(key: T): boolean; | 新增 | -| ohos.util.LightWeightSet | LightWeightSet | hasAll(set: LightWeightSet): boolean; | 新增 | -| ohos.util.LightWeightSet | LightWeightSet | addAll(set: LightWeightSet): boolean; | 新增 | +| ohos.util.LightWeightSet | LightWeightSet | hasAll(set: LightWeightSet\): boolean; | 新增 | +| ohos.util.LightWeightSet | LightWeightSet | addAll(set: LightWeightSet\): boolean; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | add(obj: T): boolean; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | length: number; | 新增 | | ohos.util.LightWeightSet | LightWeightSet | constructor(); | 新增 | -| ohos.util.LightWeightMap | LightWeightMap | values(): IterableIterator; | 新增 | +| ohos.util.LightWeightMap | LightWeightMap | values(): IterableIterator\; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | getValueAt(index: number): V; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | toString(): String; | 新增 | -| ohos.util.LightWeightMap | LightWeightMap | [Symbol.iterator](): IterableIterator<[K, V]>; | 新增 | -| ohos.util.LightWeightMap | LightWeightMap | forEach(callbackfn: (value?: V, key?: K, map?: LightWeightMap) => void, thisArg?: Object): void; | 新增 | +| ohos.util.LightWeightMap | LightWeightMap | \[Symbol.iterator](): IterableIterator\<[K, V]>; | 新增 | +| ohos.util.LightWeightMap | LightWeightMap | forEach(callbackfn: (value?: V, key?: K, map?: LightWeightMap\) => void, thisArg?: Object): void; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | setValueAt(index: number, newValue: V): boolean; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | clear(): void; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | removeAt(index: number): boolean; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | remove(key: K): V; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | set(key: K, value: V): Object; | 新增 | -| ohos.util.LightWeightMap | LightWeightMap | setAll(map: LightWeightMap): void; | 新增 | -| ohos.util.LightWeightMap | LightWeightMap | keys(): IterableIterator; | 新增 | +| ohos.util.LightWeightMap | LightWeightMap | setAll(map: LightWeightMap\): void; | 新增 | +| ohos.util.LightWeightMap | LightWeightMap | keys(): IterableIterator\; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | getKeyAt(index: number): K; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | isEmpty(): boolean; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | getIndexOfValue(value: V): number; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | getIndexOfKey(key: K): number; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | get(key: K): V; | 新增 | -| ohos.util.LightWeightMap | LightWeightMap | entries(): IterableIterator<[K, V]>; | 新增 | +| ohos.util.LightWeightMap | LightWeightMap | entries(): IterableIterator\<[K, V]>; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | increaseCapacityTo(minimumCapacity: number): void; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | hasValue(value: V): boolean; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | hasKey(key: K): boolean; | 新增 | -| ohos.util.LightWeightMap | LightWeightMap | hasAll(map: LightWeightMap): boolean; | 新增 | +| ohos.util.LightWeightMap | LightWeightMap | hasAll(map: LightWeightMap\): boolean; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | length: number; | 新增 | | ohos.util.LightWeightMap | LightWeightMap | constructor(); | 新增 | -| ohos.util.HashSet | HashSet | [Symbol.iterator](): IterableIterator; | 新增 | -| ohos.util.HashSet | HashSet | entries(): IterableIterator<[T, T]>; | 新增 | -| ohos.util.HashSet | HashSet | values(): IterableIterator; | 新增 | -| ohos.util.HashSet | HashSet | forEach(callbackfn: (value?: T, key?: T, set?: HashSet) => void, thisArg?: Object): void; | 新增 | +| ohos.util.HashSet | HashSet | \[Symbol.iterator](): IterableIterator\; | 新增 | +| ohos.util.HashSet | HashSet | entries(): IterableIterator\<[T, T]>; | 新增 | +| ohos.util.HashSet | HashSet | values(): IterableIterator\; | 新增 | +| ohos.util.HashSet | HashSet | forEach(callbackfn: (value?: T, key?: T, set?: HashSet\) => void, thisArg?: Object): void; | 新增 | | ohos.util.HashSet | HashSet | clear(): void; | 新增 | | ohos.util.HashSet | HashSet | remove(value: T): boolean; | 新增 | | ohos.util.HashSet | HashSet | add(value: T): boolean; | 新增 | @@ -248,24 +248,24 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util.HashSet | HashSet | isEmpty(): boolean; | 新增 | | ohos.util.HashSet | HashSet | length: number; | 新增 | | ohos.util.HashSet | HashSet | constructor(); | 新增 | -| ohos.util.HashMap | HashMap | [Symbol.iterator](): IterableIterator<[K, V]>; | 新增 | -| ohos.util.HashMap | HashMap | entries(): IterableIterator<[K, V]>; | 新增 | -| ohos.util.HashMap | HashMap | forEach(callbackfn: (value?: V, key?: K, map?: HashMap) => void, thisArg?: Object): void; | 新增 | +| ohos.util.HashMap | HashMap | \[Symbol.iterator](): IterableIterator\<[K, V]>; | 新增 | +| ohos.util.HashMap | HashMap | entries(): IterableIterator\<[K, V]>; | 新增 | +| ohos.util.HashMap | HashMap | forEach(callbackfn: (value?: V, key?: K, map?: HashMap\) => void, thisArg?: Object): void; | 新增 | | ohos.util.HashMap | HashMap | replace(key: K, newValue: V): boolean; | 新增 | -| ohos.util.HashMap | HashMap | values(): IterableIterator; | 新增 | -| ohos.util.HashMap | HashMap | keys(): IterableIterator; | 新增 | +| ohos.util.HashMap | HashMap | values(): IterableIterator\; | 新增 | +| ohos.util.HashMap | HashMap | keys(): IterableIterator\; | 新增 | | ohos.util.HashMap | HashMap | clear(): void; | 新增 | | ohos.util.HashMap | HashMap | remove(key: K): V; | 新增 | | ohos.util.HashMap | HashMap | set(key: K, value: V): Object; | 新增 | -| ohos.util.HashMap | HashMap | setAll(map: HashMap): void; | 新增 | +| ohos.util.HashMap | HashMap | setAll(map: HashMap\): void; | 新增 | | ohos.util.HashMap | HashMap | get(key: K): V; | 新增 | | ohos.util.HashMap | HashMap | hasValue(value: V): boolean; | 新增 | | ohos.util.HashMap | HashMap | hasKey(key: K): boolean; | 新增 | | ohos.util.HashMap | HashMap | isEmpty(): boolean; | 新增 | | ohos.util.HashMap | HashMap | length: number; | 新增 | | ohos.util.HashMap | HashMap | constructor(); | 新增 | -| ohos.util.Deque | Deque | [Symbol.iterator](): IterableIterator; | 新增 | -| ohos.util.Deque | Deque | forEach(callbackfn: (value: T, index?: number, deque?: Deque) => void, thisArg?: Object): void; | 新增 | +| ohos.util.Deque | Deque | \[Symbol.iterator](): IterableIterator\; | 新增 | +| ohos.util.Deque | Deque | forEach(callbackfn: (value: T, index?: number, deque?: Deque\) => void, thisArg?: Object): void; | 新增 | | ohos.util.Deque | Deque | popLast(): T; | 新增 | | ohos.util.Deque | Deque | popFirst(): T; | 新增 | | ohos.util.Deque | Deque | getLast(): T; | 新增 | @@ -321,18 +321,18 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,公共基础 | ohos.util | LruBuffer | getCapacity(): number; | 新增 | | ohos.util | LruBuffer | length:number | 新增 | | ohos.util | RationalNumber | valueOf(): number; | 新增 | -| ohos.util.ArrayList | ArrayList | [Symbol.iterator](): IterableIterator; | 新增 | +| ohos.util.ArrayList | ArrayList | \[Symbol.iterator](): IterableIterator\; | 新增 | | ohos.util.ArrayList | ArrayList | trimToCurrentLength(): void; | 新增 | | ohos.util.ArrayList | ArrayList | increaseCapacityTo(newCapacity: number): void; | 新增 | | ohos.util.ArrayList | ArrayList | isEmpty(): boolean; | 新增 | -| ohos.util.ArrayList | ArrayList | convertToArray(): Array; | 新增 | +| ohos.util.ArrayList | ArrayList | convertToArray(): Array\; | 新增 | | ohos.util.ArrayList | ArrayList | getCapacity(): number; | 新增 | -| ohos.util.ArrayList | ArrayList | clone(): ArrayList; | 新增 | +| ohos.util.ArrayList | ArrayList | clone(): ArrayList\; | 新增 | | ohos.util.ArrayList | ArrayList | clear(): void; | 新增 | -| ohos.util.ArrayList | ArrayList | subArrayList(fromIndex: number, toIndex: number): ArrayList; | 新增 | +| ohos.util.ArrayList | ArrayList | subArrayList(fromIndex: number, toIndex: number): ArrayList\; | 新增 | | ohos.util.ArrayList | ArrayList | sort(comparator?: (firstValue: T, secondValue: T) => number): void; | 新增 | -| ohos.util.ArrayList | ArrayList | forEach(callbackfn: (value: T, index?: number, arrlist?: ArrayList) => void, thisArg?: Object): void; | 新增 | -| ohos.util.ArrayList | ArrayList | replaceAllElements(callbackfn: (value: T, index?: number, arrlist?: ArrayList) => T, thisArg?: Object): void; | 新增 | +| ohos.util.ArrayList | ArrayList | forEach(callbackfn: (value: T, index?: number, arrlist?: ArrayList\) => void, thisArg?: Object): void; | 新增 | +| ohos.util.ArrayList | ArrayList | replaceAllElements(callbackfn: (value: T, index?: number, arrlist?: ArrayList\) => T, thisArg?: Object): void; | 新增 | | ohos.util.ArrayList | ArrayList | removeByRange(fromIndex: number, toIndex: number): void; | 新增 | | ohos.util.ArrayList | ArrayList | getLastIndexOf(element: T): number; | 新增 | | ohos.util.ArrayList | ArrayList | remove(element: T): boolean; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-dfx.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-dfx.md index cbe08e0a2e50290c85ab96b2d673cb4a9d7c5071..b65caef7fb1b21db8cffc58291c2f9c583a792e9 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-dfx.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-dfx.md @@ -6,19 +6,19 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,DFX子系统 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.hiTraceMeter | hiTraceMeter | function traceByValue(name: string, count: number): void; | 新增 | -| ohos.hiTraceMeter | hiTraceMeter | function finishTrace(name: string, taskId: number): void; | 新增 | -| ohos.hiTraceMeter | hiTraceMeter | function startTrace(name: string, taskId: number): void; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function enableFlag(id: HiTraceId, flag: HiTraceFlag): void; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function isValid(id: HiTraceId): boolean; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function tracepoint(mode: HiTraceCommunicationMode, type: HiTraceTracepointType, id: HiTraceId, msg?: string): void; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function createSpan(): HiTraceId; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function clearId(): void; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function setId(id: HiTraceId): void; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function getId(): HiTraceId; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function end(id: HiTraceId): void; | 新增 | -| ohos.hiTraceChain | hiTraceChain | function begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId; | 新增 | +| ohos.hiTraceMeter | hiTraceMeter | traceByValue(name: string, count: number): void; | 新增 | +| ohos.hiTraceMeter | hiTraceMeter | finishTrace(name: string, taskId: number): void; | 新增 | +| ohos.hiTraceMeter | hiTraceMeter | startTrace(name: string, taskId: number): void; | 新增 | +| ohos.hiTraceChain | hiTraceChain | enableFlag(id: HiTraceId, flag: HiTraceFlag): void; | 新增 | +| ohos.hiTraceChain | hiTraceChain | isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean; | 新增 | +| ohos.hiTraceChain | hiTraceChain | isValid(id: HiTraceId): boolean; | 新增 | +| ohos.hiTraceChain | hiTraceChain | tracepoint(mode: HiTraceCommunicationMode, type: HiTraceTracepointType, id: HiTraceId, msg?: string): void; | 新增 | +| ohos.hiTraceChain | hiTraceChain | createSpan(): HiTraceId; | 新增 | +| ohos.hiTraceChain | hiTraceChain | clearId(): void; | 新增 | +| ohos.hiTraceChain | hiTraceChain | setId(id: HiTraceId): void; | 新增 | +| ohos.hiTraceChain | hiTraceChain | getId(): HiTraceId; | 新增 | +| ohos.hiTraceChain | hiTraceChain | end(id: HiTraceId): void; | 新增 | +| ohos.hiTraceChain | hiTraceChain | begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId; | 新增 | | ohos.hiTraceChain | HiTraceId | flags?: number; | 新增 | | ohos.hiTraceChain | HiTraceId | parentSpanId?: number; | 新增 | | ohos.hiTraceChain | HiTraceId | spanId?: number; | 新增 | @@ -45,24 +45,24 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,DFX子系统 | ohos.hilog | LogLevel | WARN = 5 | 新增 | | ohos.hilog | LogLevel | INFO = 4 | 新增 | | ohos.hilog | LogLevel | DEBUG = 3 | 新增 | -| ohos.hilog | hilog | function isLoggable(domain: number, tag: string, level: LogLevel) : boolean; | 新增 | -| ohos.hilog | hilog | function fatal(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | -| ohos.hilog | hilog | function error(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | -| ohos.hilog | hilog | function warn(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | -| ohos.hilog | hilog | function info(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | -| ohos.hilog | hilog | function debug(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | -| ohos.hidebug | hidebug | function dumpHeapData(filename : string) : void; | 新增 | -| ohos.hidebug | hidebug | function stopProfiling() : void; | 新增 | -| ohos.hidebug | hidebug | function startProfiling(filename : string) : void; | 新增 | -| ohos.hidebug | hidebug | function getSharedDirty() : bigint; | 新增 | -| ohos.hidebug | hidebug | function getPss() : bigint; | 新增 | -| ohos.hidebug | hidebug | function getNativeHeapFreeSize() : bigint; | 新增 | -| ohos.hidebug | hidebug | function getNativeHeapAllocatedSize() : bigint; | 新增 | -| ohos.hidebug | hidebug | function getNativeHeapSize() : bigint; | 新增 | -| ohos.hichecker | hichecker | function contains(rule: bigint) : boolean; | 新增 | -| ohos.hichecker | hichecker | function getRule() : bigint; | 新增 | -| ohos.hichecker | hichecker | function removeRule(rule: bigint) : void; | 新增 | -| ohos.hichecker | hichecker | function addRule(rule: bigint) : void; | 新增 | +| ohos.hilog | hilog | isLoggable(domain: number, tag: string, level: LogLevel) : boolean; | 新增 | +| ohos.hilog | hilog | fatal(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | +| ohos.hilog | hilog | error(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | +| ohos.hilog | hilog | warn(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | +| ohos.hilog | hilog | info(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | +| ohos.hilog | hilog | debug(domain: number, tag: string, format: string, ...args: any[]) : void; | 新增 | +| ohos.hidebug | hidebug | dumpHeapData(filename : string) : void; | 新增 | +| ohos.hidebug | hidebug | stopProfiling() : void; | 新增 | +| ohos.hidebug | hidebug | startProfiling(filename : string) : void; | 新增 | +| ohos.hidebug | hidebug | getSharedDirty() : bigint; | 新增 | +| ohos.hidebug | hidebug | getPss() : bigint; | 新增 | +| ohos.hidebug | hidebug | getNativeHeapFreeSize() : bigint; | 新增 | +| ohos.hidebug | hidebug | getNativeHeapAllocatedSize() : bigint; | 新增 | +| ohos.hidebug | hidebug | getNativeHeapSize() : bigint; | 新增 | +| ohos.hichecker | hichecker | contains(rule: bigint) : boolean; | 新增 | +| ohos.hichecker | hichecker | getRule() : bigint; | 新增 | +| ohos.hichecker | hichecker | removeRule(rule: bigint) : void; | 新增 | +| ohos.hichecker | hichecker | addRule(rule: bigint) : void; | 新增 | | ohos.hichecker | hichecker | const RULE_CHECK_ABILITY_CONNECTION_LEAK: 8589934592n; | 新增 | | ohos.hichecker | hichecker | const RULE_THREAD_CHECK_SLOW_PROCESS: 1n; | 新增 | | ohos.hichecker | hichecker | const RULE_CAUTION_TRIGGER_CRASH: 4611686018427387904n; | 新增 | @@ -75,7 +75,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,DFX子系统 | ohos.faultLogger | FaultLogInfo | type: FaultType; | 新增 | | ohos.faultLogger | FaultLogInfo | uid: number; | 新增 | | ohos.faultLogger | FaultLogInfo | pid: number; | 新增 | -| ohos.faultLogger | FaultLogger | function querySelfFaultLog(faultType: FaultType, callback: AsyncCallback>) : void;
function querySelfFaultLog(faultType: FaultType) : Promise>; | 新增 | +| ohos.faultLogger | FaultLogger | querySelfFaultLog(faultType: FaultType, callback: AsyncCallback\>) : void;
querySelfFaultLog(faultType: FaultType) : Promise\>; | 新增 | | ohos.faultLogger | FaultType | APP_FREEZE = 4 | 新增 | | ohos.faultLogger | FaultType | JS_CRASH = 3 | 新增 | | ohos.faultLogger | FaultType | CPP_CRASH = 2 | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data.md index 47513c750ffc9a63a72a8f14ee9e73a286376bd4..6c2569149ea5dda24e31af54cdf71082502ed9e5 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data.md @@ -7,57 +7,57 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,分布式数 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| | ohos.data.rdb | RdbPredicates | inAllDevices(): RdbPredicates; | 新增 | -| ohos.data.rdb | RdbPredicates | inDevices(devices: Array): RdbPredicates; | 新增 | -| ohos.data.rdb | RdbStore | off(event:'dataChange', type: SubscribeType, observer: Callback>): void; | 新增 | -| ohos.data.rdb | RdbStore | on(event: 'dataChange', type: SubscribeType, observer: Callback>): void; | 新增 | -| ohos.data.rdb | RdbStore | sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback>): void;
sync(mode: SyncMode, predicates: RdbPredicates): Promise>; | 新增 | -| ohos.data.rdb | RdbStore | obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void;
obtainDistributedTableName(device: string, table: string): Promise; | 新增 | -| ohos.data.rdb | RdbStore | setDistributedTables(tables: Array, callback: AsyncCallback): void;
setDistributedTables(tables: Array): Promise; | 新增 | +| ohos.data.rdb | RdbPredicates | inDevices(devices: Array\): RdbPredicates; | 新增 | +| ohos.data.rdb | RdbStore | off(event:'dataChange', type: SubscribeType, observer: Callback\>): void; | 新增 | +| ohos.data.rdb | RdbStore | on(event: 'dataChange', type: SubscribeType, observer: Callback\>): void; | 新增 | +| ohos.data.rdb | RdbStore | sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback\>): void;
sync(mode: SyncMode, predicates: RdbPredicates): Promise\>; | 新增 | +| ohos.data.rdb | RdbStore | obtainDistributedTableName(device: string, table: string, callback: AsyncCallback\): void;
obtainDistributedTableName(device: string, table: string): Promise\; | 新增 | +| ohos.data.rdb | RdbStore | setDistributedTables(tables: Array\, callback: AsyncCallback\): void;
setDistributedTables(tables: Array\): Promise\; | 新增 | | ohos.data.rdb | RdbStore | rollBack():void; | 新增 | | ohos.data.rdb | RdbStore | commit():void; | 新增 | | ohos.data.rdb | RdbStore | beginTransaction():void; | 新增 | -| ohos.data.rdb | RdbStore | querySql(sql: string, bindArgs: Array, callback: AsyncCallback): void;
querySql(sql: string, bindArgs?: Array): Promise; | 新增 | +| ohos.data.rdb | RdbStore | querySql(sql: string, bindArgs: Array\, callback: AsyncCallback\): void;
querySql(sql: string, bindArgs?: Array\): Promise\; | 新增 | | ohos.data.rdb | SubscribeType | SUBSCRIBE_TYPE_REMOTE = 0 | 新增 | | ohos.data.rdb | SyncMode | SYNC_MODE_PULL = 1 | 新增 | | ohos.data.rdb | SyncMode | SYNC_MODE_PUSH = 0 | 新增 | -| ohos.data.distributedDataObject | DistributedObject | off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }>): void; | 新增 | -| ohos.data.distributedDataObject | DistributedObject | on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }>): void; | 新增 | -| ohos.data.distributedDataObject | DistributedObject | off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array }>): void; | 新增 | -| ohos.data.distributedDataObject | DistributedObject | on(type: 'change', callback: Callback<{ sessionId: string, fields: Array }>): void; | 新增 | +| ohos.data.distributedDataObject | DistributedObject | off(type: 'status', callback?: Callback\<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }>): void; | 新增 | +| ohos.data.distributedDataObject | DistributedObject | on(type: 'status', callback: Callback\<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }>): void; | 新增 | +| ohos.data.distributedDataObject | DistributedObject | off(type: 'change', callback?: Callback\<{ sessionId: string, fields: Array\ }>): void; | 新增 | +| ohos.data.distributedDataObject | DistributedObject | on(type: 'change', callback: Callback\<{ sessionId: string, fields: Array\ }>): void; | 新增 | | ohos.data.distributedDataObject | DistributedObject | setSessionId(sessionId?: string): boolean; | 新增 | -| ohos.data.distributedDataObject | distributedDataObject | function genSessionId(): string; | 新增 | -| ohos.data.distributedDataObject | distributedDataObject | function createDistributedObject(source: object): DistributedObject; | 新增 | -| ohos.data.distributedData | KVManager | off(event: 'distributedDataServiceDie', deathCallback?: Callback): void; | 新增 | -| ohos.data.distributedData | KVManager | on(event: 'distributedDataServiceDie', deathCallback: Callback): void; | 新增 | -| ohos.data.distributedData | KVManager | getAllKVStoreId(appId: string, callback: AsyncCallback): void;
getAllKVStoreId(appId: string): Promise; | 新增 | -| ohos.data.distributedData | KVManager | deleteKVStore(appId: string, storeId: string, callback: AsyncCallback): void;
deleteKVStore(appId: string, storeId: string): Promise; | 新增 | -| ohos.data.distributedData | KVManager | closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback): void;
closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise; | 新增 | -| ohos.data.distributedData | DeviceKVStore | off(event: 'syncComplete', syncCallback?: Callback>): void; | 新增 | -| ohos.data.distributedData | DeviceKVStore | on(event: 'syncComplete', syncCallback: Callback>): void; | 新增 | +| ohos.data.distributedDataObject | distributedDataObject | genSessionId(): string; | 新增 | +| ohos.data.distributedDataObject | distributedDataObject | createDistributedObject(source: object): DistributedObject; | 新增 | +| ohos.data.distributedData | KVManager | off(event: 'distributedDataServiceDie', deathCallback?: Callback\): void; | 新增 | +| ohos.data.distributedData | KVManager | on(event: 'distributedDataServiceDie', deathCallback: Callback\): void; | 新增 | +| ohos.data.distributedData | KVManager | getAllKVStoreId(appId: string, callback: AsyncCallback\): void;
getAllKVStoreId(appId: string): Promise\; | 新增 | +| ohos.data.distributedData | KVManager | deleteKVStore(appId: string, storeId: string, callback: AsyncCallback\): void;
deleteKVStore(appId: string, storeId: string): Promise\; | 新增 | +| ohos.data.distributedData | KVManager | closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback\): void;
closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise\; | 新增 | +| ohos.data.distributedData | DeviceKVStore | off(event: 'syncComplete', syncCallback?: Callback\>): void; | 新增 | +| ohos.data.distributedData | DeviceKVStore | on(event: 'syncComplete', syncCallback: Callback\>): void; | 新增 | | ohos.data.distributedData | DeviceKVStore | sync(deviceIdList: string[], mode: SyncMode, allowedDelayMs?: number): void; | 新增 | -| ohos.data.distributedData | DeviceKVStore | removeDeviceData(deviceId: string, callback: AsyncCallback): void;
removeDeviceData(deviceId: string): Promise; | 新增 | -| ohos.data.distributedData | DeviceKVStore | getResultSize(query: Query, callback: AsyncCallback): void;
getResultSize(query: Query): Promise;
getResultSize(deviceId: string, query: Query, callback: AsyncCallback): void;
getResultSize(deviceId: string, query: Query): Promise; | 新增 | -| ohos.data.distributedData | DeviceKVStore | closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void;
closeResultSet(resultSet: KvStoreResultSet): Promise; | 新增 | -| ohos.data.distributedData | DeviceKVStore | getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback): void;
getResultSet(deviceId: string, keyPrefix: string): Promise;
getResultSet(query: Query, callback: AsyncCallback): void;
getResultSet(query: Query): Promise;
getResultSet(deviceId: string, query: Query, callback: AsyncCallback): void;
getResultSet(deviceId: string, query: Query): Promise; | 新增 | -| ohos.data.distributedData | DeviceKVStore | getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback): void;
getEntries(deviceId: string, keyPrefix: string): Promise;
getEntries(query: Query, callback: AsyncCallback): void;
getEntries(query: Query): Promise;
getEntries(deviceId: string, query: Query, callback: AsyncCallback): void;
getEntries(deviceId: string, query: Query): Promise; | 新增 | -| ohos.data.distributedData | DeviceKVStore | get(deviceId: string, key: string, callback: AsyncCallback): void;
get(deviceId: string, key: string): Promise; | 新增 | -| ohos.data.distributedData | SingleKVStore | getSecurityLevel(callback: AsyncCallback): void;
getSecurityLevel(): Promise; | 新增 | -| ohos.data.distributedData | SingleKVStore | setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback): void;
setSyncParam(defaultAllowedDelayMs: number): Promise; | 新增 | -| ohos.data.distributedData | SingleKVStore | off(event: 'syncComplete', syncCallback?: Callback>): void; | 新增 | -| ohos.data.distributedData | SingleKVStore | on(event: 'syncComplete', syncCallback: Callback>): void; | 新增 | -| ohos.data.distributedData | SingleKVStore | removeDeviceData(deviceId: string, callback: AsyncCallback): void;
removeDeviceData(deviceId: string): Promise; | 新增 | -| ohos.data.distributedData | SingleKVStore | getResultSize(query: Query, callback: AsyncCallback): void;
getResultSize(query: Query): Promise; | 新增 | -| ohos.data.distributedData | SingleKVStore | closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback): void;
closeResultSet(resultSet: KvStoreResultSet): Promise; | 新增 | -| ohos.data.distributedData | SingleKVStore | getResultSet(keyPrefix: string, callback: AsyncCallback): void;
getResultSet(keyPrefix: string): Promise;
getResultSet(query: Query, callback: AsyncCallback): void;
getResultSet(query: Query): Promise; | 新增 | -| ohos.data.distributedData | SingleKVStore | getEntries(keyPrefix: string, callback: AsyncCallback): void;
getEntries(keyPrefix: string): Promise;
getEntries(query: Query, callback: AsyncCallback): void;
getEntries(query: Query): Promise; | 新增 | -| ohos.data.distributedData | KVStore | setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback): void;
setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise; | 新增 | -| ohos.data.distributedData | KVStore | enableSync(enabled: boolean, callback: AsyncCallback): void;
enableSync(enabled: boolean): Promise; | 新增 | -| ohos.data.distributedData | KVStore | rollback(callback: AsyncCallback): void;
rollback(): Promise; | 新增 | -| ohos.data.distributedData | KVStore | commit(callback: AsyncCallback): void;
commit(): Promise; | 新增 | -| ohos.data.distributedData | KVStore | startTransaction(callback: AsyncCallback): void;
startTransaction(): Promise; | 新增 | -| ohos.data.distributedData | KVStore | deleteBatch(keys: string[], callback: AsyncCallback): void;
deleteBatch(keys: string[]): Promise; | 新增 | -| ohos.data.distributedData | KVStore | putBatch(entries: Entry[], callback: AsyncCallback): void;
putBatch(entries: Entry[]): Promise; | 新增 | -| ohos.data.distributedData | KVStore | off(event:'dataChange', observer?: Callback): void; | 新增 | +| ohos.data.distributedData | DeviceKVStore | removeDeviceData(deviceId: string, callback: AsyncCallback\): void;
removeDeviceData(deviceId: string): Promise\; | 新增 | +| ohos.data.distributedData | DeviceKVStore | getResultSize(query: Query, callback: AsyncCallback\): void;
getResultSize(query: Query): Promise\;
getResultSize(deviceId: string, query: Query, callback: AsyncCallback\): void;
getResultSize(deviceId: string, query: Query): Promise\; | 新增 | +| ohos.data.distributedData | DeviceKVStore | closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback\): void;
closeResultSet(resultSet: KvStoreResultSet): Promise\; | 新增 | +| ohos.data.distributedData | DeviceKVStore | getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback\): void;
getResultSet(deviceId: string, keyPrefix: string): Promise\;
getResultSet(query: Query, callback: AsyncCallback\): void;
getResultSet(query: Query): Promise\;
getResultSet(deviceId: string, query: Query, callback: AsyncCallback\): void;
getResultSet(deviceId: string, query: Query): Promise\; | 新增 | +| ohos.data.distributedData | DeviceKVStore | getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback\): void;
getEntries(deviceId: string, keyPrefix: string): Promise\;
getEntries(query: Query, callback: AsyncCallback\): void;
getEntries(query: Query): Promise\;
getEntries(deviceId: string, query: Query, callback: AsyncCallback\): void;
getEntries(deviceId: string, query: Query): Promise\; | 新增 | +| ohos.data.distributedData | DeviceKVStore | get(deviceId: string, key: string, callback: AsyncCallback\): void;
get(deviceId: string, key: string): Promise\; | 新增 | +| ohos.data.distributedData | SingleKVStore | getSecurityLevel(callback: AsyncCallback\): void;
getSecurityLevel(): Promise\; | 新增 | +| ohos.data.distributedData | SingleKVStore | setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback\): void;
setSyncParam(defaultAllowedDelayMs: number): Promise\; | 新增 | +| ohos.data.distributedData | SingleKVStore | off(event: 'syncComplete', syncCallback?: Callback\>): void; | 新增 | +| ohos.data.distributedData | SingleKVStore | on(event: 'syncComplete', syncCallback: Callback\>): void; | 新增 | +| ohos.data.distributedData | SingleKVStore | removeDeviceData(deviceId: string, callback: AsyncCallback\): void;
removeDeviceData(deviceId: string): Promise\; | 新增 | +| ohos.data.distributedData | SingleKVStore | getResultSize(query: Query, callback: AsyncCallback\): void;
getResultSize(query: Query): Promise\; | 新增 | +| ohos.data.distributedData | SingleKVStore | closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback\): void;
closeResultSet(resultSet: KvStoreResultSet): Promise\; | 新增 | +| ohos.data.distributedData | SingleKVStore | getResultSet(keyPrefix: string, callback: AsyncCallback\): void;
getResultSet(keyPrefix: string): Promise\;
getResultSet(query: Query, callback: AsyncCallback\): void;
getResultSet(query: Query): Promise\; | 新增 | +| ohos.data.distributedData | SingleKVStore | getEntries(keyPrefix: string, callback: AsyncCallback\): void;
getEntries(keyPrefix: string): Promise\;
getEntries(query: Query, callback: AsyncCallback\): void;
getEntries(query: Query): Promise\; | 新增 | +| ohos.data.distributedData | KVStore | setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback\): void;
setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise\; | 新增 | +| ohos.data.distributedData | KVStore | enableSync(enabled: boolean, callback: AsyncCallback\): void;
enableSync(enabled: boolean): Promise\; | 新增 | +| ohos.data.distributedData | KVStore | rollback(callback: AsyncCallback\): void;
rollback(): Promise\; | 新增 | +| ohos.data.distributedData | KVStore | commit(callback: AsyncCallback\): void;
commit(): Promise\; | 新增 | +| ohos.data.distributedData | KVStore | startTransaction(callback: AsyncCallback\): void;
startTransaction(): Promise\; | 新增 | +| ohos.data.distributedData | KVStore | deleteBatch(keys: string[], callback: AsyncCallback\): void;
deleteBatch(keys: string[]): Promise\; | 新增 | +| ohos.data.distributedData | KVStore | putBatch(entries: Entry[], callback: AsyncCallback\): void;
putBatch(entries: Entry[]): Promise\; | 新增 | +| ohos.data.distributedData | KVStore | off(event:'dataChange', observer?: Callback\): void; | 新增 | | ohos.data.distributedData | Query | getSqlLike():string; | 新增 | | ohos.data.distributedData | Query | deviceId(deviceId:string):Query; | 新增 | | ohos.data.distributedData | Query | setSuggestIndex(index: string): Query; | 新增 | @@ -105,7 +105,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,分布式数 | ohos.data.distributedData | FieldNode | constructor(name: string) | 新增 | | ohos.data.distributedData | Schema | skip: number; | 新增 | | ohos.data.distributedData | Schema | mode: number; | 新增 | -| ohos.data.distributedData | Schema | indexes: Array; | 新增 | +| ohos.data.distributedData | Schema | indexes: Array\; | 新增 | | ohos.data.distributedData | Schema | root: FieldNode; | 新增 | | ohos.data.distributedData | Schema | constructor() | 新增 | | ohos.data.distributedData | Options | schema?: Schema; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data_api-9-canary.md index 53f2107aff4ec9e4678d31af6f1215842f546b5b..a421c508f4d33966bded8b64859b11c367d56cc7 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data_api-9-canary.md @@ -6,16 +6,16 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,分布式 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.data.dataShare | DataShareHelper | notifyChange(uri: string, callback: AsyncCallback): void;
notifyChange(uri: string): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | denormalizeUri(uri: string, callback: AsyncCallback): void;
denormalizeUri(uri: string): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | normalizeUri(uri: string, callback: AsyncCallback): void;
normalizeUri(uri: string): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | getFileTypes(uri: string, mimeTypeFilter:string, callback: AsyncCallback>): void;
getFileTypes(uri: string, mimeTypeFilter: string): Promise>; | 新增 | -| ohos.data.dataShare | DataShareHelper | getType(uri: string, callback: AsyncCallback): void;
getType(uri: string): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | batchInsert(uri: string, values: Array, callback: AsyncCallback): void;
batchInsert(uri: string, values: Array): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | update(uri: string, value: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void;
update(uri: string, value: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void;
query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void;
delete(uri: string, predicates: dataAbility.DataAbilityPredicates): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | insert(uri: string, value: rdb.ValuesBucket, callback: AsyncCallback): void;
insert(uri: string, value: rdb.ValuesBucket): Promise; | 新增 | -| ohos.data.dataShare | DataShareHelper | off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; | 新增 | -| ohos.data.dataShare | DataShareHelper | on(type: 'dataChange', uri: string, callback: AsyncCallback): void; | 新增 | -| ohos.data.dataShare | dataShare | function createDataShareHelper(context: Context, want: Want, uri: string): DataShareHelper; | 新增 | +| ohos.data.dataShare | DataShareHelper | notifyChange(uri: string, callback: AsyncCallback\): void;
notifyChange(uri: string): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | denormalizeUri(uri: string, callback: AsyncCallback\): void;
denormalizeUri(uri: string): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | normalizeUri(uri: string, callback: AsyncCallback\): void;
normalizeUri(uri: string): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | getFileTypes(uri: string, mimeTypeFilter:string, callback: AsyncCallback\>): void;
getFileTypes(uri: string, mimeTypeFilter: string): Promise\>; | 新增 | +| ohos.data.dataShare | DataShareHelper | getType(uri: string, callback: AsyncCallback\): void;
getType(uri: string): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | batchInsert(uri: string, values: Array\, callback: AsyncCallback\): void;
batchInsert(uri: string, values: Array\): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | update(uri: string, value: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback\): void;
update(uri: string, value: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | query(uri: string, columns: Array\, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback\): void;
query(uri: string, columns: Array\, predicates: dataAbility.DataAbilityPredicates): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback\): void;
delete(uri: string, predicates: dataAbility.DataAbilityPredicates): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | insert(uri: string, value: rdb.ValuesBucket, callback: AsyncCallback\): void;
insert(uri: string, value: rdb.ValuesBucket): Promise\; | 新增 | +| ohos.data.dataShare | DataShareHelper | off(type: 'dataChange', uri: string, callback?: AsyncCallback\): void; | 新增 | +| ohos.data.dataShare | DataShareHelper | on(type: 'dataChange', uri: string, callback: AsyncCallback\): void; | 新增 | +| ohos.data.dataShare | dataShare | createDataShareHelper(context: Context, want: Want, uri: string): DataShareHelper; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-hardware.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-hardware.md index 694e03c4ec8d7f4ad99d7dc6c1549d1afd241292..46b998e72989ac6d6cb730fa3c0ee06217f2c4a7 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-hardware.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-hardware.md @@ -7,8 +7,8 @@ OpenHarmony 3.1 LTS版本相较于OpenHarmony 3.1 Beta版本的API变更如下: | 模块名称 | 接口名称 | 变更类型 | 变更说明 | | -------- | -------- | -------- | -------- | | 分布式硬件子系统-DeviceManager | release(): void | 删除 | 为了降低安全风险,删除设备管理JS API | -| 分布式硬件子系统-DeviceManager | getTrustedDeviceListSync(): Array | 删除 | 为了降低安全风险,删除设备管理JS API | -| 分布式硬件子系统-DeviceManager | on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | 删除 | 为了降低安全风险,删除设备管理JS API | -| 分布式硬件子系统-DeviceManager | off(type: 'deviceStateChange', callback?: Call back<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | 删除 | 为了降低安全风险,删除设备管理JS API | +| 分布式硬件子系统-DeviceManager | getTrustedDeviceListSync(): Array\ | 删除 | 为了降低安全风险,删除设备管理JS API | +| 分布式硬件子系统-DeviceManager | on(type: 'deviceStateChange', callback: Callback\<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | 删除 | 为了降低安全风险,删除设备管理JS API | +| 分布式硬件子系统-DeviceManager | off(type: 'deviceStateChange', callback?: Callback\<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | 删除 | 为了降低安全风险,删除设备管理JS API | | 分布式硬件子系统-DeviceManager | on(type: 'serviceDie', callback: () => void): void | 删除 | 为了降低安全风险,删除设备管理JS API | | 分布式硬件子系统-DeviceManager | off(type: 'serviceDie', callback?: () => void): void | 删除 | 为了降低安全风险,删除设备管理JS API | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification.md index 3b7cb75a1f4407df5f92c06cc9d397f92ac74b35..0e26a47c1e47a4eeac22a5bef73ff84cf0eebe1f 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification.md @@ -9,8 +9,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,事件通知 | notificationUserInput | NotificationUserInput | inputKey: string; | 新增 | | notificationTemplate | NotificationTemplate | data: {[key: string]: Object}; | 新增 | | notificationTemplate | NotificationTemplate | name: string; | 新增 | -| notificationRequest | DistributedOptions | supportOperateDevices?: Array; | 新增 | -| notificationRequest | DistributedOptions | supportDisplayDevices?: Array; | 新增 | +| notificationRequest | DistributedOptions | supportOperateDevices?: Array\; | 新增 | +| notificationRequest | DistributedOptions | supportDisplayDevices?: Array\; | 新增 | | notificationRequest | DistributedOptions | isDistributed?: boolean; | 新增 | | notificationRequest | NotificationRequest | readonly notificationFlags?: NotificationFlags; | 新增 | | notificationRequest | NotificationRequest | distributedOption?: DistributedOptions; | 新增 | @@ -18,10 +18,10 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,事件通知 | notificationRequest | NotificationRequest | readonly creatorUserId?: number; | 新增 | | notificationRequest | NotificationRequest | groupName?: string; | 新增 | | notificationActionButton | NotificationActionButton | userInput?: NotificationUserInput; | 新增 | -| ohos.notification | notification | function isDistributedEnabled(callback: AsyncCallback): void;
function isDistributedEnabled(): Promise; | 新增 | -| ohos.notification | notification | function requestEnableNotification(callback: AsyncCallback): void;
function requestEnableNotification(): Promise; | 新增 | -| ohos.notification | notification | function isSupportTemplate(templateName: string, callback: AsyncCallback): void;
function isSupportTemplate(templateName: string): Promise; | 新增 | -| ohos.notification | notification | function cancelGroup(groupName: string, callback: AsyncCallback): void;
function cancelGroup(groupName: string): Promise; | 新增 | +| ohos.notification | notification | isDistributedEnabled(callback: AsyncCallback\): void;
isDistributedEnabled(): Promise\; | 新增 | +| ohos.notification | notification | requestEnableNotification(callback: AsyncCallback\): void;
requestEnableNotification(): Promise\; | 新增 | +| ohos.notification | notification | isSupportTemplate(templateName: string, callback: AsyncCallback\): void;
isSupportTemplate(templateName: string): Promise\; | 新增 | +| ohos.notification | notification | cancelGroup(groupName: string, callback: AsyncCallback\): void;
cancelGroup(groupName: string): Promise\; | 新增 | | ohos.events.emitter | EventPriority | IDLE | 新增 | | ohos.events.emitter | EventPriority | LOW | 新增 | | ohos.events.emitter | EventPriority | HIGH | 新增 | @@ -29,9 +29,9 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,事件通知 | ohos.events.emitter | InnerEvent | priority?: EventPriority; | 新增 | | ohos.events.emitter | InnerEvent | eventId: number; | 新增 | | ohos.events.emitter | EventData | data?: {[key: string]: any}; | 新增 | -| ohos.events.emitter | emitter | function emit(event: InnerEvent, data?: EventData): void; | 新增 | -| ohos.events.emitter | emitter | function off(eventId: number): void; | 新增 | -| ohos.events.emitter | emitter | function once(event: InnerEvent, callback: Callback): void; | 新增 | -| ohos.events.emitter | emitter | function on(event: InnerEvent, callback: Callback): void; | 新增 | +| ohos.events.emitter | emitter | emit(event: InnerEvent, data?: EventData): void; | 新增 | +| ohos.events.emitter | emitter | off(eventId: number): void; | 新增 | +| ohos.events.emitter | emitter | once(event: InnerEvent, callback: Callback\): void; | 新增 | +| ohos.events.emitter | emitter | on(event: InnerEvent, callback: Callback\): void; | 新增 | | ohos.commonEvent | Support | COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN" | 新增 | | ohos.commonEvent | Support | COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED" | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification_api-9-canary.md index f0a8548a251577295639f4c4592da095f4413bef..1b84a6a50afbd3bed049619bcaf2d0e4d080f233 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification_api-9-canary.md @@ -6,7 +6,7 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,事件通 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| commonEventSubscriber | CommonEventSubscriber | finishCommonEvent(callback: AsyncCallback): void;
finishCommonEvent(): Promise; | 新增 | +| commonEventSubscriber | CommonEventSubscriber | finishCommonEvent(callback: AsyncCallback\): void;
finishCommonEvent(): Promise\; | 新增 | | ohos.commonEvent | Support | COMMON_EVENT_VOLUME_EJECT = "usual.event.data.VOLUME_EJECT" | 新增 | | ohos.commonEvent | Support | COMMON_EVENT_VOLUME_BAD_REMOVAL = "usual.event.data.VOLUME_BAD_REMOVAL" | 新增 | | ohos.commonEvent | Support | COMMON_EVENT_VOLUME_MOUNTED = "usual.event.data.VOLUME_MOUNTED" | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management.md index a5d28bf4980001a228e693e25f2e7c6bd9d93479..1f8bf9c7ffbb259373a61eedb436faa24ffa900d 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management.md @@ -6,53 +6,53 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,文件管理 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.statfs | Statfs | function getTotalBytes(path: string, callback: AsyncCallback): void;
function getTotalBytes(path: string): Promise; | 新增 | -| ohos.statfs | Statfs | function getFreeBytes(path: string, callback: AsyncCallback): void;
function getFreeBytes(path: string): Promise; | 新增 | -| ohos.fileio | Watcher | stop(): Promise;
stop(callback: AsyncCallback): void; | 新增 | +| ohos.statfs | Statfs | getTotalBytes(path: string, callback: AsyncCallback\): void;
getTotalBytes(path: string): Promise\; | 新增 | +| ohos.statfs | Statfs | getFreeBytes(path: string, callback: AsyncCallback\): void;
getFreeBytes(path: string): Promise\; | 新增 | +| ohos.fileio | Watcher | stop(): Promise\;
stop(callback: AsyncCallback\): void; | 新增 | | ohos.fileio | ReadOut | buffer: ArrayBuffer; | 新增 | | ohos.fileio | ReadOut | offset: number; | 新增 | | ohos.fileio | ReadOut | bytesRead: number; | 新增 | -| ohos.fileio | Stream | read(buffer: ArrayBuffer, options?: { position?: number; offset?: number; length?: number; }): Promise;
read(buffer: ArrayBuffer, callback: AsyncCallback): void;
read(buffer: ArrayBuffer, options: { position?: number; offset?: number; length?: number; }, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | Stream | write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): Promise;
write(buffer: ArrayBuffer \| string, callback: AsyncCallback): void;
write(buffer: ArrayBuffer \| string, options: { offset?: number; length?: number; position?: number; encoding?: string; }, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | Stream | flush(): Promise;
flush(callback: AsyncCallback): void; | 新增 | -| ohos.fileio | Stream | close(): Promise;
close(callback: AsyncCallback): void; | 新增 | -| ohos.fileio | Dir | close(): Promise;
close(callback: AsyncCallback): void; | 新增 | -| ohos.fileio | Dir | read(): Promise;
read(callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function createWatcher(filename: string, events: number, callback: AsyncCallback): Watcher; | 新增 | -| ohos.fileio | fileIO | function write(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): Promise;
function write(fd: number, buffer: ArrayBuffer \| string, callback: AsyncCallback): void;
function write(fd: number, buffer: ArrayBuffer \| string, options: { offset?: number; length?: number; position?: number; encoding?: string; }, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function unlink(path: string): Promise;
function unlink(path: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function truncate(path: string, len?: number): Promise;
function truncate(path: string, callback: AsyncCallback): void;
function truncate(path: string, len: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function symlinkSync(target: string, srcPath: string): void; | 新增 | -| ohos.fileio | fileIO | function symlink(target: string, srcPath: string): Promise;
function symlink(target: string, srcPath: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function stat(path: string): Promise;
function stat(path: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function rmdir(path: string): Promise;
function rmdir(path: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function rename(oldPath: string, newPath: string): Promise;
function rename(oldPath: string, newPath: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): Promise
function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback): void;
function read(fd: number, buffer: ArrayBuffer, options: { offset?: number; length?: number; position?: number; }, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string;| 新增 | -| ohos.fileio | fileIO | function readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): Promise;
function readText(filePath: string, options: { position?: number; length?: number; encoding?: string; }, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function opendir(path: string): Promise;
function opendir(path: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function open(path: string, flags?: number, mode?: number): Promise;
function open(path: string, callback: AsyncCallback): void;
function open(path: string, flags: number, callback: AsyncCallback): void;
function open(path: string, flags: number, mode: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function mkdtempSync(prefix: string): string; | 新增 | -| ohos.fileio | fileIO | function mkdtemp(prefix: string): Promise;
function mkdtemp(prefix: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function mkdir(path: string, mode?: number): Promise;
function mkdir(path: string, callback: AsyncCallback): void;
function mkdir(path: string, mode: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function lstatSync(path: string): Stat; | 新增 | -| ohos.fileio | fileIO | function lstat(path: string): Promise;
function lstat(path: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function lchownSync(path: string, uid: number, gid: number): void; | 新增 | -| ohos.fileio | fileIO | function lchown(path: string, uid: number, gid: number): Promise;
function lchown(path: string, uid: number, gid: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function hash(path: string, algorithm: string): Promise;
function hash(path: string, algorithm: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function fdopenStream(fd: number, mode: string): Promise;
function fdopenStream(fd: number, mode: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function fchmod(fd: number, mode: number): Promise;
function fchmod(fd: number, mode: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function fchown(fd: number, uid: number, gid: number): Promise;
function fchown(fd: number, uid: number, gid: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function fdatasyncSync(fd: number): void; | 新增 | -| ohos.fileio | fileIO | function fdatasync(fd: number): Promise;
function fdatasync(fd: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function fstat(fd: number): Promise;
function fstat(fd: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function fsync(fd: number): Promise;
function fsync(fd: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function ftruncate(fd: number, len?: number): Promise;
function ftruncate(fd: number, callback: AsyncCallback): void;
function ftruncate(fd: number, len: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function chmod(path: string, mode: number): Promise;
function chmod(path: string, mode: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function chown(path: string, uid: number, gid: number): Promise;
function chown(path: string, uid: number, gid: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function createStream(path: string, mode: string): Promise;
function createStream(path: string, mode: string, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function copyFile(src: string \| number, dest: string \| number, mode?: number): Promise;
function copyFile(src: string \| number, dest: string \| number, callback: AsyncCallback): void;
function copyFile(src: string \| number, dest: string \| number, mode: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function close(fd: number): Promise;
function close(fd: number, callback: AsyncCallback): void; | 新增 | -| ohos.fileio | fileIO | function access(path: string, mode?: number): Promise;
function access(path: string, callback: AsyncCallback): void;
function access(path: string, mode: number, callback: AsyncCallback): void; | 新增 | -| ohos.document | document | function show(uri: string, type: string): Promise;
function show(uri: string, type: string, callback: AsyncCallback): void; | 新增 | -| ohos.document | document | function choose(types?: string[]): Promise;
function choose(callback: AsyncCallback): void;
function choose(types: string[], callback: AsyncCallback): void; | 新增 | +| ohos.fileio | Stream | read(buffer: ArrayBuffer, options?: { position?: number; offset?: number; length?: number; }): Promise\;
read(buffer: ArrayBuffer, callback: AsyncCallback\): void;
read(buffer: ArrayBuffer, options: { position?: number; offset?: number; length?: number; }, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | Stream | write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): Promise\;
write(buffer: ArrayBuffer \| string, callback: AsyncCallback\): void;
write(buffer: ArrayBuffer \| string, options: { offset?: number; length?: number; position?: number; encoding?: string; }, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | Stream | flush(): Promise\;
flush(callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | Stream | close(): Promise\;
close(callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | Dir | close(): Promise\;
close(callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | Dir | read(): Promise\;
read(callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | createWatcher(filename: string, events: number, callback: AsyncCallback\): Watcher; | 新增 | +| ohos.fileio | fileIO | write(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): Promise\;
write(fd: number, buffer: ArrayBuffer \| string, callback: AsyncCallback\): void;
write(fd: number, buffer: ArrayBuffer \| string, options: { offset?: number; length?: number; position?: number; encoding?: string; }, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | unlink(path: string): Promise\;
unlink(path: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | truncate(path: string, len?: number): Promise\;
truncate(path: string, callback: AsyncCallback\): void;
truncate(path: string, len: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | symlinkSync(target: string, srcPath: string): void; | 新增 | +| ohos.fileio | fileIO | symlink(target: string, srcPath: string): Promise\;
symlink(target: string, srcPath: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | stat(path: string): Promise\;
stat(path: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | rmdir(path: string): Promise\;
rmdir(path: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | rename(oldPath: string, newPath: string): Promise\;
rename(oldPath: string, newPath: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): Promise\
read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback\): void;
read(fd: number, buffer: ArrayBuffer, options: { offset?: number; length?: number; position?: number; }, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string; | 新增 | +| ohos.fileio | fileIO | readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): Promise\;
readText(filePath: string, options: { position?: number; length?: number; encoding?: string; }, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | opendir(path: string): Promise\;
opendir(path: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | open(path: string, flags?: number, mode?: number): Promise\;
open(path: string, callback: AsyncCallback\): void;
open(path: string, flags: number, callback: AsyncCallback\): void;
open(path: string, flags: number, mode: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | mkdtempSync(prefix: string): string; | 新增 | +| ohos.fileio | fileIO | mkdtemp(prefix: string): Promise\;
mkdtemp(prefix: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | mkdir(path: string, mode?: number): Promise\;
mkdir(path: string, callback: AsyncCallback\): void;
mkdir(path: string, mode: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | lstatSync(path: string): Stat; | 新增 | +| ohos.fileio | fileIO | lstat(path: string): Promise\;
lstat(path: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | lchownSync(path: string, uid: number, gid: number): void; | 新增 | +| ohos.fileio | fileIO | lchown(path: string, uid: number, gid: number): Promise\;
lchown(path: string, uid: number, gid: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | hash(path: string, algorithm: string): Promise\;
hash(path: string, algorithm: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | fdopenStream(fd: number, mode: string): Promise\;
fdopenStream(fd: number, mode: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | fchmod(fd: number, mode: number): Promise\;
fchmod(fd: number, mode: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | fchown(fd: number, uid: number, gid: number): Promise\;
fchown(fd: number, uid: number, gid: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | fdatasyncSync(fd: number): void; | 新增 | +| ohos.fileio | fileIO | fdatasync(fd: number): Promise\;
fdatasync(fd: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | fstat(fd: number): Promise\;
fstat(fd: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | fsync(fd: number): Promise\;
fsync(fd: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | ftruncate(fd: number, len?: number): Promise\;
ftruncate(fd: number, callback: AsyncCallback\): void;
ftruncate(fd: number, len: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | chmod(path: string, mode: number): Promise\;
chmod(path: string, mode: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | chown(path: string, uid: number, gid: number): Promise\;
chown(path: string, uid: number, gid: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | createStream(path: string, mode: string): Promise\;
createStream(path: string, mode: string, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | copyFile(src: string \| number, dest: string \| number, mode?: number): Promise\;
copyFile(src: string \| number, dest: string \| number, callback: AsyncCallback\): void;
copyFile(src: string \| number, dest: string \| number, mode: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | close(fd: number): Promise\;
close(fd: number, callback: AsyncCallback\): void; | 新增 | +| ohos.fileio | fileIO | access(path: string, mode?: number): Promise\;
access(path: string, callback: AsyncCallback\): void;
access(path: string, mode: number, callback: AsyncCallback\): void; | 新增 | +| ohos.document | document | show(uri: string, type: string): Promise\;
show(uri: string, type: string, callback: AsyncCallback\): void; | 新增 | +| ohos.document | document | choose(types?: string[]): Promise\;
choose(callback: AsyncCallback\): void;
choose(types: string[], callback: AsyncCallback\): void; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management_api-9-canary.md index 1303270ddb85fcc8df976832b419bab62c0351d5..9fb86d418b627cc67ae846722527720308eddc05 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management_api-9-canary.md @@ -6,13 +6,13 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,文件管 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.storageStatistics | storageStatistics | function getBundleStats(packageName: string, callback: AsyncCallback): void;
function getBundleStats(packageName: string): Promise; | 新增 | +| ohos.storageStatistics | storageStatistics | getBundleStats(packageName: string, callback: AsyncCallback\): void;
getBundleStats(packageName: string): Promise\; | 新增 | | ohos.storageStatistics | BundleStats | dataSize: number; | 新增 | | ohos.storageStatistics | BundleStats | cacheSize: number; | 新增 | | ohos.storageStatistics | BundleStats | appSize: number; | 新增 | -| ohos.volumeManager | volumeManager | function unmount(volumeId: string, callback: AsyncCallback): void;
function unmount(volumeId: string): Promise; | 新增 | -| ohos.volumeManager | volumeManager | function mount(volumeId: string, callback: AsyncCallback): void;
function mount(volumeId: string): Promise; | 新增 | -| ohos.volumeManager | volumeManager | function getAllVolumes(callback: AsyncCallback>): void;
function getAllVolumes(): Promise>; | 新增 | +| ohos.volumeManager | volumeManager | unmount(volumeId: string, callback: AsyncCallback\): void;
unmount(volumeId: string): Promise\; | 新增 | +| ohos.volumeManager | volumeManager | mount(volumeId: string, callback: AsyncCallback\): void;
mount(volumeId: string): Promise\; | 新增 | +| ohos.volumeManager | volumeManager | getAllVolumes(callback: AsyncCallback\>): void;
getAllVolumes(): Promise\>; | 新增 | | ohos.volumeManager | Volume | path: string; | 新增 | | ohos.volumeManager | Volume | state: number; | 新增 | | ohos.volumeManager | Volume | removable: boolean; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-geolocation.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-geolocation.md index 3f7e47b88f0d24e099f2ef11062ff95f8beae0fb..11a88e2d322ea9b8417d80d570076d891678d595 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-geolocation.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-geolocation.md @@ -29,7 +29,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,位置服务 | ohos.geolocation | LocationRequestPriority | ACCURACY | 新增 | | ohos.geolocation | LocationRequestPriority | UNSET = 0x200 | 新增 | | ohos.geolocation | Location | additionSize?: number; | 新增 | -| ohos.geolocation | Location | additions?: Array; | 新增 | +| ohos.geolocation | Location | additions?: Array\; | 新增 | | ohos.geolocation | Location | timeSinceBoot: number; | 新增 | | ohos.geolocation | Location | direction: number; | 新增 | | ohos.geolocation | Location | timeStamp: number; | 新增 | @@ -48,7 +48,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,位置服务 | ohos.geolocation | LocationRequest | scenario?: LocationRequestScenario; | 新增 | | ohos.geolocation | LocationRequest | priority?: LocationRequestPriority; | 新增 | | ohos.geolocation | GeoAddress | descriptionsSize?: number; | 新增 | -| ohos.geolocation | GeoAddress | descriptions?: Array; | 新增 | +| ohos.geolocation | GeoAddress | descriptions?: Array\; | 新增 | | ohos.geolocation | GeoAddress | addressUrl?: string; | 新增 | | ohos.geolocation | GeoAddress | phoneNumber?: string; | 新增 | | ohos.geolocation | GeoAddress | postalCode?: string; | 新增 | @@ -85,31 +85,31 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,位置服务 | ohos.geolocation | GeofenceRequest | priority: LocationRequestPriority; | 新增 | | ohos.geolocation | CachedGnssLocationsRequest | wakeUpCacheQueueFull: boolean; | 新增 | | ohos.geolocation | CachedGnssLocationsRequest | reportingPeriodSec: number; | 新增 | -| ohos.geolocation | SatelliteStatusInfo | carrierFrequencies: Array; | 新增 | -| ohos.geolocation | SatelliteStatusInfo | azimuths: Array; | 新增 | -| ohos.geolocation | SatelliteStatusInfo | altitudes: Array; | 新增 | -| ohos.geolocation | SatelliteStatusInfo | carrierToNoiseDensitys: Array; | 新增 | -| ohos.geolocation | SatelliteStatusInfo | satelliteIds: Array; | 新增 | +| ohos.geolocation | SatelliteStatusInfo | carrierFrequencies: Array\; | 新增 | +| ohos.geolocation | SatelliteStatusInfo | azimuths: Array\; | 新增 | +| ohos.geolocation | SatelliteStatusInfo | altitudes: Array\; | 新增 | +| ohos.geolocation | SatelliteStatusInfo | carrierToNoiseDensitys: Array\; | 新增 | +| ohos.geolocation | SatelliteStatusInfo | satelliteIds: Array\; | 新增 | | ohos.geolocation | SatelliteStatusInfo | satellitesNumber: number; | 新增 | -| ohos.geolocation | geolocation | function sendCommand(command: LocationCommand, callback: AsyncCallback) : void;
function sendCommand(command: LocationCommand) : Promise; | 新增 | -| ohos.geolocation | geolocation | function flushCachedGnssLocations(callback: AsyncCallback) : void;
function flushCachedGnssLocations() : Promise; | 新增 | -| ohos.geolocation | geolocation | function getCachedGnssLocationsSize(callback: AsyncCallback) : void;
function getCachedGnssLocationsSize() : Promise; | 新增 | -| ohos.geolocation | geolocation | function isGeoServiceAvailable(callback: AsyncCallback) : void;
function isGeoServiceAvailable() : Promise; | 新增 | -| ohos.geolocation | geolocation | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback>) : void;
function getAddressesFromLocationName(request: GeoCodeRequest) : Promise>; | 新增 | -| ohos.geolocation | geolocation | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback>) : void;
function getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise>; | 新增 | -| ohos.geolocation | geolocation | function requestEnableLocation(callback: AsyncCallback) : void;
function requestEnableLocation() : Promise; | 新增 | -| ohos.geolocation | geolocation | function isLocationEnabled(callback: AsyncCallback) : void;
function isLocationEnabled() : Promise; | 新增 | -| ohos.geolocation | geolocation | function getLastLocation(callback: AsyncCallback) : void;
function getLastLocation() : Promise; | 新增 | -| ohos.geolocation | geolocation | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback) : void;
function getCurrentLocation(callback: AsyncCallback) : void;
function getCurrentLocation(request?: CurrentLocationRequest) : Promise; | 新增 | -| ohos.geolocation | geolocation | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | 新增 | -| ohos.geolocation | geolocation | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | 新增 | -| ohos.geolocation | geolocation | function off(type: 'nmeaMessageChange', callback?: Callback) : void; | 新增 | -| ohos.geolocation | geolocation | function on(type: 'nmeaMessageChange', callback: Callback) : void; | 新增 | -| ohos.geolocation | geolocation | function off(type: 'gnssStatusChange', callback?: Callback) : void; | 新增 | -| ohos.geolocation | geolocation | function on(type: 'gnssStatusChange', callback: Callback) : void; | 新增 | -| ohos.geolocation | geolocation | function off(type: 'cachedGnssLocationsReporting', callback?: Callback>) : void; | 新增 | -| ohos.geolocation | geolocation | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback>) : void; | 新增 | -| ohos.geolocation | geolocation | function off(type: 'locationServiceState', callback?: Callback) : void; | 新增 | -| ohos.geolocation | geolocation | function on(type: 'locationServiceState', callback: Callback) : void; | 新增 | -| ohos.geolocation | geolocation | function off(type: 'locationChange', callback?: Callback) : void; | 新增 | -| ohos.geolocation | geolocation | function on(type: 'locationChange', request: LocationRequest, callback: Callback) : void; | 新增 | +| ohos.geolocation | geolocation | sendCommand(command: LocationCommand, callback: AsyncCallback\) : void;
sendCommand(command: LocationCommand) : Promise\; | 新增 | +| ohos.geolocation | geolocation | flushCachedGnssLocations(callback: AsyncCallback\) : void;
flushCachedGnssLocations() : Promise\; | 新增 | +| ohos.geolocation | geolocation | getCachedGnssLocationsSize(callback: AsyncCallback\) : void;
getCachedGnssLocationsSize() : Promise\; | 新增 | +| ohos.geolocation | geolocation | isGeoServiceAvailable(callback: AsyncCallback\) : void;
isGeoServiceAvailable() : Promise\; | 新增 | +| ohos.geolocation | geolocation | getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback\>) : void;
getAddressesFromLocationName(request: GeoCodeRequest) : Promise\>; | 新增 | +| ohos.geolocation | geolocation | getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback\>) : void;
getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise\>; | 新增 | +| ohos.geolocation | geolocation | requestEnableLocation(callback: AsyncCallback\) : void;
requestEnableLocation() : Promise\; | 新增 | +| ohos.geolocation | geolocation | isLocationEnabled(callback: AsyncCallback\) : void;
isLocationEnabled() : Promise\; | 新增 | +| ohos.geolocation | geolocation | getLastLocation(callback: AsyncCallback\) : void;
getLastLocation() : Promise\; | 新增 | +| ohos.geolocation | geolocation | getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback\) : void;
getCurrentLocation(callback: AsyncCallback\) : void;
getCurrentLocation(request?: CurrentLocationRequest) : Promise\; | 新增 | +| ohos.geolocation | geolocation | off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | 新增 | +| ohos.geolocation | geolocation | on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | 新增 | +| ohos.geolocation | geolocation | off(type: 'nmeaMessageChange', callback?: Callback\) : void; | 新增 | +| ohos.geolocation | geolocation | on(type: 'nmeaMessageChange', callback: Callback\) : void; | 新增 | +| ohos.geolocation | geolocation | off(type: 'gnssStatusChange', callback?: Callback\) : void; | 新增 | +| ohos.geolocation | geolocation | on(type: 'gnssStatusChange', callback: Callback\) : void; | 新增 | +| ohos.geolocation | geolocation | off(type: 'cachedGnssLocationsReporting', callback?: Callback\>) : void; | 新增 | +| ohos.geolocation | geolocation | on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback\>) : void; | 新增 | +| ohos.geolocation | geolocation | off(type: 'locationServiceState', callback?: Callback\) : void; | 新增 | +| ohos.geolocation | geolocation | on(type: 'locationServiceState', callback: Callback\) : void; | 新增 | +| ohos.geolocation | geolocation | off(type: 'locationChange', callback?: Callback\) : void; | 新增 | +| ohos.geolocation | geolocation | on(type: 'locationChange', request: LocationRequest, callback: Callback\) : void; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-global.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-global.md index 4b1831bb1e3c609570f1ea7339bcc3f3cf88624a..d04216ccf6accd3e27bcb845060843f8cc77350a 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-global.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-global.md @@ -10,12 +10,12 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,全球化子 | rawFileDescriptor | RawFileDescriptor | offset: number; | 新增 | | rawFileDescriptor | RawFileDescriptor | fd: number; | 新增 | | ohos.resourceManager | ResourceManager | release(); | 新增 | -| ohos.resourceManager | ResourceManager | closeRawFileDescriptor(path: string, callback: AsyncCallback): void;
closeRawFileDescriptor(path: string): Promise; | 新增 | -| ohos.resourceManager | ResourceManager | getRawFileDescriptor(path: string, callback: AsyncCallback): void;
getRawFileDescriptor(path: string): Promise; | 新增 | -| ohos.resourceManager | ResourceManager | getRawFile(path: string, callback: AsyncCallback): void;
getRawFile(path: string): Promise; | 新增 | -| ohos.resourceManager | resourceManager | function getResourceManager(callback: AsyncCallback): void;
export function getResourceManager(bundleName: string, callback: AsyncCallback): void;
export function getResourceManager(): Promise;
export function getResourceManager(bundleName: string): Promise; | 新增 | +| ohos.resourceManager | ResourceManager | closeRawFileDescriptor(path: string, callback: AsyncCallback\): void;
closeRawFileDescriptor(path: string): Promise\; | 新增 | +| ohos.resourceManager | ResourceManager | getRawFileDescriptor(path: string, callback: AsyncCallback\): void;
getRawFileDescriptor(path: string): Promise\; | 新增 | +| ohos.resourceManager | ResourceManager | getRawFile(path: string, callback: AsyncCallback\): void;
getRawFile(path: string): Promise\; | 新增 | +| ohos.resourceManager | resourceManager | getResourceManager(callback: AsyncCallback\): void;
getResourceManager(bundleName: string, callback: AsyncCallback\): void;
getResourceManager(): Promise\;
getResourceManager(bundleName: string): Promise\; | 新增 | | ohos.intl | RelativeTimeFormat | resolvedOptions(): RelativeTimeFormatResolvedOptions; | 新增 | -| ohos.intl | RelativeTimeFormat | formatToParts(value: number, unit: string): Array; | 新增 | +| ohos.intl | RelativeTimeFormat | formatToParts(value: number, unit: string): Array\; | 新增 | | ohos.intl | RelativeTimeFormat | format(value: number, unit: string): string; | 新增 | | ohos.intl | RelativeTimeFormat | constructor(); | 新增 | | ohos.intl | RelativeTimeFormatResolvedOptions | numberingSystem: string; | 新增 | @@ -55,13 +55,13 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,全球化子 | ohos.i18n | TimeZone | getRawOffset(): number; | 新增 | | ohos.i18n | TimeZone | getDisplayName(locale?: string, isDST?: boolean): string; | 新增 | | ohos.i18n | TimeZone | getID(): string; | 新增 | -| ohos.i18n | i18n | function getTimeZone(zoneID?: string): TimeZone; | 新增 | -| ohos.i18n | i18n | function getFirstPreferredLanguage(): string; | 新增 | -| ohos.i18n | i18n | function getPreferredLanguageList(): Array; | 新增 | -| ohos.i18n | i18n | function removePreferredLanguage(index: number): boolean; | 新增 | -| ohos.i18n | i18n | function addPreferredLanguage(language: string, index?: number): boolean; | 新增 | -| ohos.i18n | i18n | function set24HourClock(option: boolean): boolean; | 新增 | -| ohos.i18n | i18n | function is24HourClock(): boolean; | 新增 | +| ohos.i18n | i18n | getTimeZone(zoneID?: string): TimeZone; | 新增 | +| ohos.i18n | i18n | getFirstPreferredLanguage(): string; | 新增 | +| ohos.i18n | i18n | getPreferredLanguageList(): Array\; | 新增 | +| ohos.i18n | i18n | removePreferredLanguage(index: number): boolean; | 新增 | +| ohos.i18n | i18n | addPreferredLanguage(language: string, index?: number): boolean; | 新增 | +| ohos.i18n | i18n | set24HourClock(option: boolean): boolean; | 新增 | +| ohos.i18n | i18n | is24HourClock(): boolean; | 新增 | | ohos.i18n | Character | getType(char: string): string; | 新增 | | ohos.i18n | Character | isUpperCase(char: string): boolean; | 新增 | | ohos.i18n | Character | isLowerCase(char: string): boolean; | 新增 | @@ -73,8 +73,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,全球化子 | ohos.i18n | Character | isDigit(char: string): boolean; | 新增 | | ohos.i18n | IndexUtil | getIndex(text: string): string; | 新增 | | ohos.i18n | IndexUtil | addLocale(locale: string): void; | 新增 | -| ohos.i18n | IndexUtil | getIndexList(): Array; | 新增 | -| ohos.i18n | i18n | function getInstance(locale?:string): IndexUtil; | 新增 | +| ohos.i18n | IndexUtil | getIndexList(): Array\; | 新增 | +| ohos.i18n | i18n | getInstance(locale?:string): IndexUtil; | 新增 | | ohos.i18n | BreakIterator | isBoundary(offset: number): boolean; | 新增 | | ohos.i18n | BreakIterator | getLineBreakText(): string; | 新增 | | ohos.i18n | BreakIterator | following(offset: number): number; | 新增 | @@ -84,8 +84,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,全球化子 | ohos.i18n | BreakIterator | last(): number; | 新增 | | ohos.i18n | BreakIterator | first(): number; | 新增 | | ohos.i18n | BreakIterator | current(): number; | 新增 | -| ohos.i18n | i18n | function getLineInstance(locale: string): BreakIterator; | 新增 | -| ohos.i18n | i18n | function isRTL(locale: string): boolean; | 新增 | +| ohos.i18n | i18n | getLineInstance(locale: string): BreakIterator; | 新增 | +| ohos.i18n | i18n | isRTL(locale: string): boolean; | 新增 | | ohos.i18n | Calendar | isWeekend(date?: Date): boolean; | 新增 | | ohos.i18n | Calendar | getDisplayName(locale: string): string; | 新增 | | ohos.i18n | Calendar | get(field: string): number; | 新增 | @@ -97,7 +97,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,全球化子 | ohos.i18n | Calendar | setTimeZone(timezone: string): void; | 新增 | | ohos.i18n | Calendar | set(year: number, month: number, date:number, hour?: number, minute?: number, second?: number): void; | 新增 | | ohos.i18n | Calendar | setTime(date: Date): void;
setTime(time: number): void; | 新增 | -| ohos.i18n | i18n | function getCalendar(locale: string, type?: string): Calendar; | 新增 | +| ohos.i18n | i18n | getCalendar(locale: string, type?: string): Calendar; | 新增 | | ohos.i18n | PhoneNumberFormat | format(number: string): string; | 新增 | | ohos.i18n | PhoneNumberFormat | isValidNumber(number: string): boolean; | 新增 | | ohos.i18n | PhoneNumberFormat | constructor(country: string, options?: PhoneNumberFormatOptions); | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc.md index a12057932b7903ddf3a79990bfdfc0028eaeb5b8..dc4c28e0c2b3449f70132442760db12bdad5562d 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc.md @@ -10,34 +10,34 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件 | ohos.wallpaper | RgbaColor | blue: number; | 新增 | | ohos.wallpaper | RgbaColor | green: number; | 新增 | | ohos.wallpaper | RgbaColor | red: number; | 新增 | -| ohos.wallpaper | wallpaper | function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void; | 新增 | -| ohos.wallpaper | wallpaper | function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void; | 新增 | -| ohos.wallpaper | wallpaper | function setWallpaper(source: string \| image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void;
function setWallpaper(source: string \| image.PixelMap, wallpaperType: WallpaperType): Promise; | 新增 | -| ohos.wallpaper | wallpaper | function reset(wallpaperType: WallpaperType, callback: AsyncCallback): void;
function reset(wallpaperType: WallpaperType): Promise; | 新增 | -| ohos.wallpaper | wallpaper | function isOperationAllowed(callback: AsyncCallback): void;
function isOperationAllowed(): Promise; | 新增 | -| ohos.wallpaper | wallpaper | function isChangePermitted(callback: AsyncCallback): void;
function isChangePermitted(): Promise; | 新增 | -| ohos.wallpaper | wallpaper | function getMinWidth(callback: AsyncCallback): void;
function getMinWidth(): Promise; | 新增 | -| ohos.wallpaper | wallpaper | function getMinHeight(callback: AsyncCallback): void;
function getMinHeight(): Promise; | 新增 | -| ohos.wallpaper | wallpaper | function getFile(wallpaperType: WallpaperType, callback: AsyncCallback): void;
function getFile(wallpaperType: WallpaperType): Promise; | 新增 | -| ohos.wallpaper | wallpaper | function getId(wallpaperType: WallpaperType, callback: AsyncCallback): void;
function getId(wallpaperType: WallpaperType): Promise; | 新增 | -| ohos.wallpaper | wallpaper | function getColors(wallpaperType: WallpaperType, callback: AsyncCallback>): void;
function getColors(wallpaperType: WallpaperType): Promise>; | 新增 | +| ohos.wallpaper | wallpaper | function off(type: 'colorChange', callback?: (colors: Array\, wallpaperType: WallpaperType) => void): void; | 新增 | +| ohos.wallpaper | wallpaper | function on(type: 'colorChange', callback: (colors: Array\, wallpaperType: WallpaperType) => void): void; | 新增 | +| ohos.wallpaper | wallpaper | function setWallpaper(source: string \| image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback\): void;
function setWallpaper(source: string \| image.PixelMap, wallpaperType: WallpaperType): Promise\; | 新增 | +| ohos.wallpaper | wallpaper | function reset(wallpaperType: WallpaperType, callback: AsyncCallback\): void;
function reset(wallpaperType: WallpaperType): Promise\; | 新增 | +| ohos.wallpaper | wallpaper | function isOperationAllowed(callback: AsyncCallback\): void;
function isOperationAllowed(): Promise\; | 新增 | +| ohos.wallpaper | wallpaper | function isChangePermitted(callback: AsyncCallback\): void;
function isChangePermitted(): Promise\; | 新增 | +| ohos.wallpaper | wallpaper | function getMinWidth(callback: AsyncCallback\): void;
function getMinWidth(): Promise\; | 新增 | +| ohos.wallpaper | wallpaper | function getMinHeight(callback: AsyncCallback\): void;
function getMinHeight(): Promise\; | 新增 | +| ohos.wallpaper | wallpaper | function getFile(wallpaperType: WallpaperType, callback: AsyncCallback\): void;
function getFile(wallpaperType: WallpaperType): Promise\; | 新增 | +| ohos.wallpaper | wallpaper | function getId(wallpaperType: WallpaperType, callback: AsyncCallback\): void;
function getId(wallpaperType: WallpaperType): Promise\; | 新增 | +| ohos.wallpaper | wallpaper | function getColors(wallpaperType: WallpaperType, callback: AsyncCallback\>): void;
function getColors(wallpaperType: WallpaperType): Promise\>; | 新增 | | ohos.wallpaper | WallpaperType | WALLPAPER_LOCKSCREEN | 新增 | | ohos.wallpaper | WallpaperType | WALLPAPER_SYSTEM | 新增 | -| ohos.systemTime | systemTime | function getTimezone(callback: AsyncCallback): void;
function getTimezone(): Promise; | 新增 | -| ohos.systemTime | systemTime | function getDate(callback: AsyncCallback): void;
function getDate(): Promise; | 新增 | -| ohos.systemTime | systemTime | function getRealTime(isNano?: boolean, callback: AsyncCallback): void;
function getRealTime(isNano?: boolean): Promise; | 新增 | -| ohos.systemTime | systemTime | function getRealActiveTime(isNano?: boolean, callback: AsyncCallback): void;
function getRealActiveTime(isNano?: boolean): Promise; | 新增 | -| ohos.systemTime | systemTime | function getCurrentTime(isNano?: boolean, callback: AsyncCallback): void;
function getCurrentTime(isNano?: boolean): Promise; | 新增 | -| ohos.screenLock | screenLock | function unlockScreen(callback: AsyncCallback): void;
function unlockScreen():Promise; | 新增 | -| ohos.screenLock | screenLock | function isSecureMode(callback: AsyncCallback): void;
function isSecureMode(): Promise; | 新增 | -| ohos.screenLock | screenLock | function isScreenLocked(callback: AsyncCallback): void;
function isScreenLocked(): Promise; | 新增 | -| ohos.request | UploadTask | remove(callback: AsyncCallback): void;
remove(): Promise; | 新增 | +| ohos.systemTime | systemTime | function getTimezone(callback: AsyncCallback\): void;
function getTimezone(): Promise\; | 新增 | +| ohos.systemTime | systemTime | function getDate(callback: AsyncCallback\): void;
function getDate(): Promise\; | 新增 | +| ohos.systemTime | systemTime | function getRealTime(isNano?: boolean, callback: AsyncCallback\): void;
function getRealTime(isNano?: boolean): Promise\; | 新增 | +| ohos.systemTime | systemTime | function getRealActiveTime(isNano?: boolean, callback: AsyncCallback\): void;
function getRealActiveTime(isNano?: boolean): Promise\; | 新增 | +| ohos.systemTime | systemTime | function getCurrentTime(isNano?: boolean, callback: AsyncCallback\): void;
function getCurrentTime(isNano?: boolean): Promise\; | 新增 | +| ohos.screenLock | screenLock | function unlockScreen(callback: AsyncCallback\): void;
function unlockScreen():Promise\; | 新增 | +| ohos.screenLock | screenLock | function isSecureMode(callback: AsyncCallback\): void;
function isSecureMode(): Promise\; | 新增 | +| ohos.screenLock | screenLock | function isScreenLocked(callback: AsyncCallback\): void;
function isScreenLocked(): Promise\; | 新增 | +| ohos.request | UploadTask | remove(callback: AsyncCallback\): void;
remove(): Promise\; | 新增 | | ohos.request | UploadTask | off(type: 'headerReceive', callback?: (header: object) => void): void; | 新增 | | ohos.request | UploadTask | on(type: 'headerReceive', callback: (header: object) => void): void; | 新增 | | ohos.request | UploadTask | off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) => void): void; | 新增 | | ohos.request | UploadTask | on(type: 'progress', callback: (uploadedSize: number, totalSize: number) => void): void; | 新增 | -| ohos.request | UploadConfig | data: Array; | 新增 | -| ohos.request | UploadConfig | files: Array; | 新增 | +| ohos.request | UploadConfig | data: Array\; | 新增 | +| ohos.request | UploadConfig | files: Array\; | 新增 | | ohos.request | UploadConfig | method: string; | 新增 | | ohos.request | UploadConfig | header: Object; | 新增 | | ohos.request | UploadConfig | url: string; | 新增 | @@ -47,11 +47,11 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件 | ohos.request | File | uri: string; | 新增 | | ohos.request | File | name: string; | 新增 | | ohos.request | File | filename: string; | 新增 | -| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback): void;
queryMimeType(): Promise; | 新增 | -| ohos.request | DownloadTask | query(callback: AsyncCallback): void;
query(): Promise; | 新增 | -| ohos.request | DownloadTask | resume(callback: AsyncCallback): void;
resume(): Promise; | 新增 | -| ohos.request | DownloadTask | pause(callback: AsyncCallback): void;
pause(): Promise; | 新增 | -| ohos.request | DownloadTask | remove(callback: AsyncCallback): void;
remove(): Promise; | 新增 | +| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback\): void;
queryMimeType(): Promise\; | 新增 | +| ohos.request | DownloadTask | query(callback: AsyncCallback\): void;
query(): Promise\; | 新增 | +| ohos.request | DownloadTask | resume(callback: AsyncCallback\): void;
resume(): Promise\; | 新增 | +| ohos.request | DownloadTask | pause(callback: AsyncCallback\): void;
pause(): Promise\; | 新增 | +| ohos.request | DownloadTask | remove(callback: AsyncCallback\): void;
remove(): Promise\; | 新增 | | ohos.request | DownloadTask | off(type: 'fail', callback?: (err: number) => void): void; | 新增 | | ohos.request | DownloadTask | on(type: 'fail', callback: (err: number) => void): void; | 新增 | | ohos.request | DownloadTask | off(type: 'complete' \| 'pause' \| 'remove', callback?: () => void): void; | 新增 | @@ -81,8 +81,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件 | ohos.request | DownloadConfig | enableMetered?: boolean; | 新增 | | ohos.request | DownloadConfig | header?: Object; | 新增 | | ohos.request | DownloadConfig | url: string; | 新增 | -| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback): void;
function upload(config: UploadConfig): Promise; | 新增 | -| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback): void;
function download(config: DownloadConfig): Promise; | 新增 | +| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback\): void;
function upload(config: UploadConfig): Promise\; | 新增 | +| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback\): void;
function download(config: DownloadConfig): Promise\; | 新增 | | ohos.request | request | const SESSION_SUCCESSFUL: number; | 新增 | | ohos.request | request | const SESSION_RUNNING: number; | 新增 | | ohos.request | request | const SESSION_PENDING: number; | 新增 | @@ -103,10 +103,10 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件 | ohos.request | request | const ERROR_CANNOT_RESUME: number; | 新增 | | ohos.request | request | const NETWORK_WIFI: number; | 新增 | | ohos.request | request | const NETWORK_MOBILE: number; | 新增 | -| ohos.pasteboard | SystemPasteboard | setPasteData(data: PasteData, callback: AsyncCallback): void;
setPasteData(data: PasteData): Promise; | 新增 | -| ohos.pasteboard | SystemPasteboard | hasPasteData(callback: AsyncCallback): void;
hasPasteData(): Promise; | 新增 | -| ohos.pasteboard | SystemPasteboard | getPasteData(callback: AsyncCallback): void;
getPasteData(): Promise; | 新增 | -| ohos.pasteboard | SystemPasteboard | clear(callback: AsyncCallback): void;
clear(): Promise; | 新增 | +| ohos.pasteboard | SystemPasteboard | setPasteData(data: PasteData, callback: AsyncCallback\): void;
setPasteData(data: PasteData): Promise\; | 新增 | +| ohos.pasteboard | SystemPasteboard | hasPasteData(callback: AsyncCallback\): void;
hasPasteData(): Promise\; | 新增 | +| ohos.pasteboard | SystemPasteboard | getPasteData(callback: AsyncCallback\): void;
getPasteData(): Promise\; | 新增 | +| ohos.pasteboard | SystemPasteboard | clear(callback: AsyncCallback\): void;
clear(): Promise\; | 新增 | | ohos.pasteboard | SystemPasteboard | off(type: 'update', callback?: () => void): void; | 新增 | | ohos.pasteboard | SystemPasteboard | on(type: 'update', callback: () => void): void; | 新增 | | ohos.pasteboard | PasteData | replaceRecordAt(index: number, record: PasteDataRecord): boolean; | 新增 | @@ -121,13 +121,13 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件 | ohos.pasteboard | PasteData | getPrimaryMimeType(): string; | 新增 | | ohos.pasteboard | PasteData | getPrimaryWant(): Want; | 新增 | | ohos.pasteboard | PasteData | getPrimaryHtml(): string; | 新增 | -| ohos.pasteboard | PasteData | getMimeTypes(): Array; | 新增 | +| ohos.pasteboard | PasteData | getMimeTypes(): Array\; | 新增 | | ohos.pasteboard | PasteData | addUriRecord(uri: string): void; | 新增 | | ohos.pasteboard | PasteData | addTextRecord(text: string): void; | 新增 | | ohos.pasteboard | PasteData | addRecord(record: PasteDataRecord): void; | 新增 | | ohos.pasteboard | PasteData | addWantRecord(want: Want): void; | 新增 | | ohos.pasteboard | PasteData | addHtmlRecord(htmlText: string): void; | 新增 | -| ohos.pasteboard | PasteDataRecord | convertToText(callback: AsyncCallback): void;
convertToText(): Promise; | 新增 | +| ohos.pasteboard | PasteDataRecord | convertToText(callback: AsyncCallback\): void;
convertToText(): Promise\; | 新增 | | ohos.pasteboard | PasteDataRecord | uri: string; | 新增 | | ohos.pasteboard | PasteDataRecord | plainText: string; | 新增 | | ohos.pasteboard | PasteDataRecord | mimeType: string; | 新增 | @@ -136,7 +136,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件 | ohos.pasteboard | PasteDataProperty | localOnly: boolean; | 新增 | | ohos.pasteboard | PasteDataProperty | readonly timestamp: number; | 新增 | | ohos.pasteboard | PasteDataProperty | tag: string; | 新增 | -| ohos.pasteboard | PasteDataProperty | readonly mimeTypes: Array; | 新增 | +| ohos.pasteboard | PasteDataProperty | readonly mimeTypes: Array\; | 新增 | | ohos.pasteboard | PasteDataProperty | additions: { [key: string]: object } | 新增 | | ohos.pasteboard | pasteboard | function getSystemPasteboard(): SystemPasteboard; | 新增 | | ohos.pasteboard | pasteboard | function createUriRecord(uri: string): PasteDataRecord; | 新增 | @@ -166,20 +166,20 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件 | ohos.inputmethodengine | KeyboardDelegate | off(type: 'keyDown'\|'keyUp', callback?: (event: KeyEvent) => boolean): void; | 新增 | | ohos.inputmethodengine | KeyboardDelegate | on(type: 'keyDown'\|'keyUp', callback: (event: KeyEvent) => boolean): void; | 新增 | | ohos.inputmethodengine | KeyboardDelegate | on(type: 'keyDown'\|'keyUp', callback: (event: KeyEvent) => boolean): void; | 新增 | -| ohos.inputmethodengine | TextInputClient | getEditorAttribute(callback: AsyncCallback): void;
getEditorAttribute(): Promise; | 新增 | -| ohos.inputmethodengine | TextInputClient | getBackward(length: number, callback: AsyncCallback): void;
getBackward(length: number): Promise; | 新增 | -| ohos.inputmethodengine | TextInputClient | getForward(length: number, callback: AsyncCallback): void;
getForward(length: number): Promise; | 新增 | -| ohos.inputmethodengine | TextInputClient | insertText(text: string, callback: AsyncCallback): void;
insertText(text: string): Promise; | 新增 | -| ohos.inputmethodengine | TextInputClient | deleteBackward(length: number, callback: AsyncCallback): void;
deleteBackward(length: number): Promise; | 新增 | -| ohos.inputmethodengine | TextInputClient | deleteForward(length: number, callback: AsyncCallback): void;
deleteForward(length: number): Promise; | 新增 | -| ohos.inputmethodengine | TextInputClient | sendKeyFunction(action: number, callback: AsyncCallback): void;
sendKeyFunction(action: number): Promise; | 新增 | +| ohos.inputmethodengine | TextInputClient | getEditorAttribute(callback: AsyncCallback\): void;
getEditorAttribute(): Promise\; | 新增 | +| ohos.inputmethodengine | TextInputClient | getBackward(length: number, callback: AsyncCallback\): void;
getBackward(length: number): Promise\; | 新增 | +| ohos.inputmethodengine | TextInputClient | getForward(length: number, callback: AsyncCallback\): void;
getForward(length: number): Promise\; | 新增 | +| ohos.inputmethodengine | TextInputClient | insertText(text: string, callback: AsyncCallback\): void;
insertText(text: string): Promise\; | 新增 | +| ohos.inputmethodengine | TextInputClient | deleteBackward(length: number, callback: AsyncCallback\): void;
deleteBackward(length: number): Promise\; | 新增 | +| ohos.inputmethodengine | TextInputClient | deleteForward(length: number, callback: AsyncCallback\): void;
deleteForward(length: number): Promise\; | 新增 | +| ohos.inputmethodengine | TextInputClient | sendKeyFunction(action: number, callback: AsyncCallback\): void;
sendKeyFunction(action: number): Promise\; | 新增 | | ohos.inputmethodengine | InputMethodEngine | off(type: 'keyboardShow'\|'keyboardHide', callback?: () => void): void; | 新增 | | ohos.inputmethodengine | InputMethodEngine | off(type: 'keyboardShow'\|'keyboardHide', callback?: () => void): void; | 新增 | | ohos.inputmethodengine | InputMethodEngine | on(type: 'keyboardShow'\|'keyboardHide', callback: () => void): void; | 新增 | | ohos.inputmethodengine | InputMethodEngine | on(type: 'keyboardShow'\|'keyboardHide', callback: () => void): void; | 新增 | | ohos.inputmethodengine | InputMethodEngine | off(type: 'inputStart', callback?: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; | 新增 | | ohos.inputmethodengine | InputMethodEngine | on(type: 'inputStart', callback: (kbController: KeyboardController, textInputClient: TextInputClient) => void): void; | 新增 | -| ohos.inputmethodengine | KeyboardController | hideKeyboard(callback: AsyncCallback): void;
hideKeyboard(): Promise; | 新增 | +| ohos.inputmethodengine | KeyboardController | hideKeyboard(callback: AsyncCallback\): void;
hideKeyboard(): Promise\; | 新增 | | ohos.inputmethodengine | inputMethodEngine | function createKeyboardDelegate(): KeyboardDelegate; | 新增 | | ohos.inputmethodengine | inputMethodEngine | function getInputMethodEngine(): InputMethodEngine; | 新增 | | ohos.inputmethodengine | inputMethodEngine | const OPTION_NO_FULLSCREEN: number; | 新增 | @@ -210,9 +210,9 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,杂散软件 | ohos.inputmethodengine | inputMethodEngine | const ENTER_KEY_TYPE_UNSPECIFIED: number; | 新增 | | ohos.inputmethod | InputMethodProperty | readonly methodId: string; | 新增 | | ohos.inputmethod | InputMethodProperty | readonly packageName: string; | 新增 | -| ohos.inputmethod | InputMethodController | stopInput(callback: AsyncCallback): void;
stopInput(): Promise; | 新增 | -| ohos.inputmethod | InputMethodSetting | displayOptionalInputMethod(callback: AsyncCallback): void;
displayOptionalInputMethod(): Promise; | 新增 | -| ohos.inputmethod | InputMethodSetting | listInputMethod(callback: AsyncCallback>): void;
listInputMethod(): Promise>; | 新增 | +| ohos.inputmethod | InputMethodController | stopInput(callback: AsyncCallback\): void;
stopInput(): Promise\; | 新增 | +| ohos.inputmethod | InputMethodSetting | displayOptionalInputMethod(callback: AsyncCallback\): void;
displayOptionalInputMethod(): Promise\; | 新增 | +| ohos.inputmethod | InputMethodSetting | listInputMethod(callback: AsyncCallback\>): void;
listInputMethod(): Promise\>; | 新增 | | ohos.inputmethod | inputMethod | function getInputMethodController(): InputMethodController; | 新增 | | ohos.inputmethod | inputMethod | function getInputMethodSetting(): InputMethodSetting; | 新增 | | ohos.inputmethod | inputMethod | const MAX_TYPE_NUM: number | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc_api-9-canary.md index 2ec8d94273ce9c2098e8a19ef8999ae5275efd30..56d6ca307a24eccf68f3feee46d9a05614ad6241 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc_api-9-canary.md @@ -6,29 +6,29 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,杂散软 | 模块名* | 类名 | 函数* | 变更类型 | |---|---|---|---| -| ohos.screenLock | screenLock | function sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback): void;
function sendScreenLockEvent(event: String, parameter: number): Promise; | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | "function off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void;" | 新增 | -| ohos.screenLock | screenLock | function on(type: 'screenlockEnabled', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback): void; | 新增 | -| ohos.screenLock | screenLock | function on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback): void; | 新增 | +| ohos.screenLock | screenLock | sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback\): void;
sendScreenLockEvent(event: String, parameter: number): Promise\; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | off(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation' \| 'screenlockEnabled' \| 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'screenlockEnabled', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginSleep' \| 'endSleep' \| 'changeUser', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 新增 | +| ohos.screenLock | screenLock | on(type: 'beginWakeUp' \| 'endWakeUp' \| 'beginScreenOn' \| 'endScreenOn' \| 'beginScreenOff' \| 'endScreenOff' \| 'unlockScreen' \| 'beginExitAnimation', callback: Callback\): void; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multi-modal-input.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multi-modal-input.md index ce8227af06338fcd25c05563b45d7740824cee1c..5a7985da20d5abf1697db8399e920d8d205c042b 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multi-modal-input.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multi-modal-input.md @@ -6,10 +6,10 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,多模输入 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.multimodalInput.inputDevice | inputDevice | function getDevice(deviceId: number, callback: AsyncCallback): void;
function getDevice(deviceId: number): Promise; | 新增 | -| ohos.multimodalInput.inputDevice | inputDevice | function getDeviceIds(callback: AsyncCallback>): void;
function getDeviceIds(): Promise>; | 新增 | -| ohos.multimodalInput.inputDevice | InputDeviceData | axisRanges : Array; | 新增 | -| ohos.multimodalInput.inputDevice | InputDeviceData | sources : Array; | 新增 | +| ohos.multimodalInput.inputDevice | inputDevice | function getDevice(deviceId: number, callback: AsyncCallback\): void;
function getDevice(deviceId: number): Promise\; | 新增 | +| ohos.multimodalInput.inputDevice | inputDevice | function getDeviceIds(callback: AsyncCallback>): void;
function getDeviceIds(): Promise>; | 新增 | +| ohos.multimodalInput.inputDevice | InputDeviceData | axisRanges : Array\; | 新增 | +| ohos.multimodalInput.inputDevice | InputDeviceData | sources : Array\; | 新增 | | ohos.multimodalInput.inputDevice | InputDeviceData | name: string; | 新增 | | ohos.multimodalInput.inputDevice | InputDeviceData | id: number; | 新增 | | ohos.multimodalInput.inputDevice | AxisRange | min: number; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia.md index 2b81aaeffed583812c2de0ac67dd67a25b178772..d1e60062d87226b91db9b8f6c98b3f693b903e71 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia.md @@ -8,36 +8,36 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 |---|---|---|---| | ohos.multimedia.mediaLibrary | Size | height: number; | 新增 | | ohos.multimedia.mediaLibrary | Size | width: number; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | startMediaSelect(option: MediaSelectOption, callback: AsyncCallback>): void;
startMediaSelect(option: MediaSelectOption): Promise>; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | startImagePreview(images: Array, index: number, callback: AsyncCallback): void;
startImagePreview(images: Array, callback: AsyncCallback): void;
startImagePreview(images: Array, index?: number): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback): void;
storeMediaAsset(option: MediaAssetOption): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | getAlbums(options: MediaFetchOptions, callback: AsyncCallback>): void;
getAlbums(options: MediaFetchOptions): Promise>; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback): void;
createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback): void; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | getFileAssets(options: MediaFetchOptions, callback: AsyncCallback): void;
getFileAssets(options: MediaFetchOptions): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | MediaLibrary | getPublicDirectory(type: DirectoryType, callback: AsyncCallback): void;
getPublicDirectory(type: DirectoryType): Promise; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\>): void;
startMediaSelect(option: MediaSelectOption): Promise\>; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | startImagePreview(images: Array\, index: number, callback: AsyncCallback\): void;
startImagePreview(images: Array\, callback: AsyncCallback\): void;
startImagePreview(images: Array\, index?: number): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\): void;
storeMediaAsset(option: MediaAssetOption): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | getAlbums(options: MediaFetchOptions, callback: AsyncCallback\>): void;
getAlbums(options: MediaFetchOptions): Promise\>; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\): void;
createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void;
getFileAssets(options: MediaFetchOptions): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | MediaLibrary | getPublicDirectory(type: DirectoryType, callback: AsyncCallback\): void;
getPublicDirectory(type: DirectoryType): Promise\; | 新增 | | ohos.multimedia.mediaLibrary | DirectoryType | DIR_DOWNLOAD | 新增 | | ohos.multimedia.mediaLibrary | DirectoryType | DIR_DOCUMENTS | 新增 | | ohos.multimedia.mediaLibrary | DirectoryType | DIR_AUDIO | 新增 | | ohos.multimedia.mediaLibrary | DirectoryType | DIR_IMAGE | 新增 | | ohos.multimedia.mediaLibrary | DirectoryType | DIR_VIDEO | 新增 | | ohos.multimedia.mediaLibrary | DirectoryType | DIR_CAMERA = 0 | 新增 | -| ohos.multimedia.mediaLibrary | Album | getFileAssets(callback: AsyncCallback): void;
getFileAssets(options: MediaFetchOptions, callback: AsyncCallback): void;
getFileAssets(options?: MediaFetchOptions): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | Album | commitModify(callback: AsyncCallback): void;
commitModify(): Promise; | 新增 | +| ohos.multimedia.mediaLibrary | Album | getFileAssets(callback: AsyncCallback\): void;
getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void;
getFileAssets(options?: MediaFetchOptions): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | Album | commitModify(callback: AsyncCallback\): void;
commitModify(): Promise\; | 新增 | | ohos.multimedia.mediaLibrary | Album | readonly coverUri: string; | 新增 | | ohos.multimedia.mediaLibrary | Album | readonly relativePath: string; | 新增 | | ohos.multimedia.mediaLibrary | Album | readonly count: number; | 新增 | @@ -45,11 +45,11 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.mediaLibrary | Album | readonly albumUri: string; | 新增 | | ohos.multimedia.mediaLibrary | Album | albumName: string; | 新增 | | ohos.multimedia.mediaLibrary | Album | readonly albumId: number; | 新增 | -| ohos.multimedia.mediaLibrary | FetchFileResult | getAllObject(callback: AsyncCallback>): void;
getAllObject(): Promise>; | 新增 | -| ohos.multimedia.mediaLibrary | FetchFileResult | getPositionObject(index: number, callback: AsyncCallback): void;
getPositionObject(index: number): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FetchFileResult | getLastObject(callback: AsyncCallback): void;
getLastObject(): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FetchFileResult | getNextObject(callback: AsyncCallback): void;
getNextObject(): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FetchFileResult | getFirstObject(callback: AsyncCallback): void;
getFirstObject(): Promise; | 新增 | +| ohos.multimedia.mediaLibrary | FetchFileResult | getAllObject(callback: AsyncCallback\>): void;
getAllObject(): Promise\>; | 新增 | +| ohos.multimedia.mediaLibrary | FetchFileResult | getPositionObject(index: number, callback: AsyncCallback\): void;
getPositionObject(index: number): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FetchFileResult | getLastObject(callback: AsyncCallback\): void;
getLastObject(): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FetchFileResult | getNextObject(callback: AsyncCallback\): void;
getNextObject(): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FetchFileResult | getFirstObject(callback: AsyncCallback\): void;
getFirstObject(): Promise\; | 新增 | | ohos.multimedia.mediaLibrary | FetchFileResult | close(): void; | 新增 | | ohos.multimedia.mediaLibrary | FetchFileResult | isAfterLast(): boolean; | 新增 | | ohos.multimedia.mediaLibrary | FetchFileResult | getCount(): number; | 新增 | @@ -57,7 +57,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.mediaLibrary | MediaFetchOptions | networkId?: string; | 新增 | | ohos.multimedia.mediaLibrary | MediaFetchOptions | uri?: string; | 新增 | | ohos.multimedia.mediaLibrary | MediaFetchOptions | order?: string; | 新增 | -| ohos.multimedia.mediaLibrary | MediaFetchOptions | selectionArgs: Array; | 新增 | +| ohos.multimedia.mediaLibrary | MediaFetchOptions | selectionArgs: Array\; | 新增 | | ohos.multimedia.mediaLibrary | MediaFetchOptions | selections: string; | 新增 | | ohos.multimedia.mediaLibrary | FileKey | ALBUM_NAME = "bucket_display_name" | 新增 | | ohos.multimedia.mediaLibrary | FileKey | ALBUM_ID = "bucket_id" | 新增 | @@ -78,15 +78,15 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.mediaLibrary | FileKey | DISPLAY_NAME = "display_name" | 新增 | | ohos.multimedia.mediaLibrary | FileKey | RELATIVE_PATH = "relative_path" | 新增 | | ohos.multimedia.mediaLibrary | FileKey | ID = "file_id" | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | isTrash(callback: AsyncCallback): void;
isTrash():Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | trash(isTrash: boolean, callback: AsyncCallback): void;
trash(isTrash: boolean): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | isFavorite(callback: AsyncCallback): void;
isFavorite():Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | favorite(isFavorite: boolean, callback: AsyncCallback): void;
favorite(isFavorite: boolean): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | getThumbnail(callback: AsyncCallback): void;
getThumbnail(size: Size, callback: AsyncCallback): void;
getThumbnail(size?: Size): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | close(fd: number, callback: AsyncCallback): void;
close(fd: number): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | open(mode: string, callback: AsyncCallback): void;
open(mode: string): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | commitModify(callback: AsyncCallback): void;
commitModify(): Promise; | 新增 | -| ohos.multimedia.mediaLibrary | FileAsset | isDirectory(callback: AsyncCallback): void;
isDirectory():Promise; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | isTrash(callback: AsyncCallback\): void;
isTrash():Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | trash(isTrash: boolean, callback: AsyncCallback\): void;
trash(isTrash: boolean): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | isFavorite(callback: AsyncCallback\): void;
isFavorite():Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | favorite(isFavorite: boolean, callback: AsyncCallback\): void;
favorite(isFavorite: boolean): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | getThumbnail(callback: AsyncCallback\): void;
getThumbnail(size: Size, callback: AsyncCallback\): void;
getThumbnail(size?: Size): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | close(fd: number, callback: AsyncCallback\): void;
close(fd: number): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | open(mode: string, callback: AsyncCallback\): void;
open(mode: string): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | commitModify(callback: AsyncCallback\): void;
commitModify(): Promise\; | 新增 | +| ohos.multimedia.mediaLibrary | FileAsset | isDirectory(callback: AsyncCallback\): void;
isDirectory():Promise\; | 新增 | | ohos.multimedia.mediaLibrary | FileAsset | readonly albumName: string; | 新增 | | ohos.multimedia.mediaLibrary | FileAsset | readonly albumUri: string; | 新增 | | ohos.multimedia.mediaLibrary | FileAsset | readonly albumId: number; | 新增 | @@ -117,7 +117,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.mediaLibrary | MediaType | VIDEO | 新增 | | ohos.multimedia.mediaLibrary | MediaType | IMAGE | 新增 | | ohos.multimedia.mediaLibrary | MediaType | FILE = 0 | 新增 | -| ohos.multimedia.mediaLibrary | mediaLibrary | function getMediaLibrary(): MediaLibrary;
function getMediaLibrary(context: Context): MediaLibrary; | 新增 | +| ohos.multimedia.mediaLibrary | mediaLibrary | getMediaLibrary(): MediaLibrary;
getMediaLibrary(context: Context): MediaLibrary; | 新增 | | ohos.multimedia.media | CodecMimeType | AUDIO_FLAC = 'audio/flac' | 新增 | | ohos.multimedia.media | CodecMimeType | AUDIO_VORBIS = 'audio/vorbis' | 新增 | | ohos.multimedia.media | CodecMimeType | AUDIO_AAC = 'audio/mp4a-latm' | 新增 | @@ -145,10 +145,10 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.media | ContainerFormatType | CFT_MPEG_4 = "mp4" | 新增 | | ohos.multimedia.media | VideoPlayer | on(type: 'error', callback: ErrorCallback): void; | 新增 | | ohos.multimedia.media | VideoPlayer | on(type: 'videoSizeChanged', callback: (width: number, height: number) => void): void; | 新增 | -| ohos.multimedia.media | VideoPlayer | on(type: 'startRenderFrame', callback: Callback): void; | 新增 | +| ohos.multimedia.media | VideoPlayer | on(type: 'startRenderFrame', callback: Callback\): void; | 新增 | | ohos.multimedia.media | VideoPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void; | 新增 | -| ohos.multimedia.media | VideoPlayer | on(type: 'playbackCompleted', callback: Callback): void; | 新增 | -| ohos.multimedia.media | VideoPlayer | setSpeed(speed:number, callback: AsyncCallback): void;
setSpeed(speed:number): Promise; | 新增 | +| ohos.multimedia.media | VideoPlayer | on(type: 'playbackCompleted', callback: Callback\): void; | 新增 | +| ohos.multimedia.media | VideoPlayer | setSpeed(speed:number, callback: AsyncCallback\): void;
setSpeed(speed:number): Promise\; | 新增 | | ohos.multimedia.media | VideoPlayer | readonly height: number; | 新增 | | ohos.multimedia.media | VideoPlayer | readonly width: number; | 新增 | | ohos.multimedia.media | VideoPlayer | readonly state: VideoPlayState; | 新增 | @@ -156,16 +156,16 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.media | VideoPlayer | readonly currentTime: number; | 新增 | | ohos.multimedia.media | VideoPlayer | loop: boolean; | 新增 | | ohos.multimedia.media | VideoPlayer | url: string; | 新增 | -| ohos.multimedia.media | VideoPlayer | getTrackDescription(callback: AsyncCallback>): void;
getTrackDescription() : Promise>; | 新增 | -| ohos.multimedia.media | VideoPlayer | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.media | VideoPlayer | setVolume(vol: number, callback: AsyncCallback): void;
setVolume(vol: number): Promise; | 新增 | -| ohos.multimedia.media | VideoPlayer | seek(timeMs: number, callback: AsyncCallback): void;
seek(timeMs: number, mode:SeekMode, callback: AsyncCallback): void;
seek(timeMs: number, mode?:SeekMode): Promise; | 新增 | -| ohos.multimedia.media | VideoPlayer | reset(callback: AsyncCallback): void;
reset(): Promise; | 新增 | -| ohos.multimedia.media | VideoPlayer | stop(callback: AsyncCallback): void;
stop(): Promise; | 新增 | -| ohos.multimedia.media | VideoPlayer | pause(callback: AsyncCallback): void;
pause(): Promise; | 新增 | -| ohos.multimedia.media | VideoPlayer | play(callback: AsyncCallback): void;
play(): Promise; | 新增 | -| ohos.multimedia.media | VideoPlayer | prepare(callback: AsyncCallback): void;
prepare(): Promise; | 新增 | -| ohos.multimedia.media | VideoPlayer | setDisplaySurface(surfaceId: string, callback: AsyncCallback): void;
setDisplaySurface(surfaceId: string): Promise; | 新增 | +| ohos.multimedia.media | VideoPlayer | getTrackDescription(callback: AsyncCallback\>): void;
getTrackDescription() : Promise\>; | 新增 | +| ohos.multimedia.media | VideoPlayer | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.media | VideoPlayer | setVolume(vol: number, callback: AsyncCallback\): void;
setVolume(vol: number): Promise\; | 新增 | +| ohos.multimedia.media | VideoPlayer | seek(timeMs: number, callback: AsyncCallback\): void;
seek(timeMs: number, mode:SeekMode, callback: AsyncCallback\): void;
seek(timeMs: number, mode?:SeekMode): Promise\; | 新增 | +| ohos.multimedia.media | VideoPlayer | reset(callback: AsyncCallback\): void;
reset(): Promise\; | 新增 | +| ohos.multimedia.media | VideoPlayer | stop(callback: AsyncCallback\): void;
stop(): Promise\; | 新增 | +| ohos.multimedia.media | VideoPlayer | pause(callback: AsyncCallback\): void;
pause(): Promise\; | 新增 | +| ohos.multimedia.media | VideoPlayer | play(callback: AsyncCallback\): void;
play(): Promise\; | 新增 | +| ohos.multimedia.media | VideoPlayer | prepare(callback: AsyncCallback\): void;
prepare(): Promise\; | 新增 | +| ohos.multimedia.media | VideoPlayer | setDisplaySurface(surfaceId: string, callback: AsyncCallback\): void;
setDisplaySurface(surfaceId: string): Promise\; | 新增 | | ohos.multimedia.media | PlaybackSpeed | SPEED_FORWARD_2_00_X = 4 | 新增 | | ohos.multimedia.media | PlaybackSpeed | SPEED_FORWARD_1_75_X = 3 | 新增 | | ohos.multimedia.media | PlaybackSpeed | SPEED_FORWARD_1_25_X = 2 | 新增 | @@ -209,7 +209,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.media | AudioEncoder | DEFAULT = 0 | 新增 | | ohos.multimedia.media | AudioPlayer | on(type: 'play' \| 'pause' \| 'stop' \| 'reset' \| 'dataLoad' \| 'finish' \| 'volumeChange', callback: () => void): void; | 新增 | | ohos.multimedia.media | AudioPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void; | 新增 | -| ohos.multimedia.media | AudioPlayer | getTrackDescription(callback: AsyncCallback>): void;
getTrackDescription() : Promise>; | 新增 | +| ohos.multimedia.media | AudioPlayer | getTrackDescription(callback: AsyncCallback\>): void;
getTrackDescription() : Promise\>; | 新增 | | ohos.multimedia.media | AudioPlayer | reset(): void; | 新增 | | ohos.multimedia.media | BufferingInfoType | CACHED_DURATION = 4 | 新增 | | ohos.multimedia.media | BufferingInfoType | BUFFERING_PERCENT = 3 | 新增 | @@ -225,28 +225,28 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.media | MediaErrorCode | MSERR_OPERATION_NOT_PERMIT = 2 | 新增 | | ohos.multimedia.media | MediaErrorCode | MSERR_NO_MEMORY = 1 | 新增 | | ohos.multimedia.media | MediaErrorCode | MSERR_OK = 0 | 新增 | -| ohos.multimedia.media | media | function createVideoPlayer(callback: AsyncCallback): void;
function createVideoPlayer() : Promise; | 新增 | -| ohos.multimedia.media | media | function createAudioRecorder(): AudioRecorder; | 新增 | -| ohos.multimedia.image | ImagePacker | readonly supportedFormats: Array; | 新增 | -| ohos.multimedia.image | ImagePacker | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.image | ImagePacker | packing(source: ImageSource, option: PackingOption, callback: AsyncCallback): void;
packing(source: ImageSource, option: PackingOption): Promise;
packing(source: PixelMap, option: PackingOption, callback: AsyncCallback): void;
packing(source: PixelMap, option: PackingOption): Promise; | 新增 | -| ohos.multimedia.image | ImageSource | readonly supportedFormats: Array; | 新增 | -| ohos.multimedia.image | ImageSource | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.image | ImageSource | getImageProperty(key:string, options?: GetImagePropertyOptions): Promise;
getImageProperty(key:string, callback: AsyncCallback): void;
getImageProperty(key:string, options: GetImagePropertyOptions, callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.image | ImageSource | createPixelMap(options?: DecodingOptions): Promise;
createPixelMap(callback: AsyncCallback): void;
createPixelMap(options: DecodingOptions, callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.image | ImageSource | getImageInfo(index: number, callback: AsyncCallback): void;
getImageInfo(callback: AsyncCallback): void;
getImageInfo(index?: number): Promise; | 新增 | -| ohos.multimedia.image | PixelMap | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | +| ohos.multimedia.media | media | createVideoPlayer(callback: AsyncCallback\): void;
createVideoPlayer() : Promise\; | 新增 | +| ohos.multimedia.media | media | createAudioRecorder(): AudioRecorder; | 新增 | +| ohos.multimedia.image | ImagePacker | readonly supportedFormats: Array\; | 新增 | +| ohos.multimedia.image | ImagePacker | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.image | ImagePacker | packing(source: ImageSource, option: PackingOption, callback: AsyncCallback\): void;
packing(source: ImageSource, option: PackingOption): Promise\;
packing(source: PixelMap, option: PackingOption, callback: AsyncCallback\): void;
packing(source: PixelMap, option: PackingOption): Promise\; | 新增 | +| ohos.multimedia.image | ImageSource | readonly supportedFormats: Array\; | 新增 | +| ohos.multimedia.image | ImageSource | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.image | ImageSource | getImageProperty(key:string, options?: GetImagePropertyOptions): Promise\;
getImageProperty(key:string, callback: AsyncCallback\): void;
getImageProperty(key:string, options: GetImagePropertyOptions, callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.image | ImageSource | createPixelMap(options?: DecodingOptions): Promise\;
createPixelMap(callback: AsyncCallback\): void;
createPixelMap(options: DecodingOptions, callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.image | ImageSource | getImageInfo(index: number, callback: AsyncCallback\): void;
getImageInfo(callback: AsyncCallback\): void;
getImageInfo(index?: number): Promise\; | 新增 | +| ohos.multimedia.image | PixelMap | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | | ohos.multimedia.image | PixelMap | getPixelBytesNumber(): number; | 新增 | | ohos.multimedia.image | PixelMap | getBytesNumberPerRow(): number; | 新增 | -| ohos.multimedia.image | PixelMap | getImageInfo(): Promise;
getImageInfo(callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.image | PixelMap | writeBufferToPixels(src: ArrayBuffer): Promise;
writeBufferToPixels(src: ArrayBuffer, callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.image | PixelMap | writePixels(area: PositionArea): Promise;
writePixels(area: PositionArea, callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.image | PixelMap | readPixels(area: PositionArea): Promise;
readPixels(area: PositionArea, callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.image | PixelMap | readPixelsToBuffer(dst: ArrayBuffer): Promise;
readPixelsToBuffer(dst: ArrayBuffer, callback: AsyncCallback): void; | 新增 | +| ohos.multimedia.image | PixelMap | getImageInfo(): Promise\;
getImageInfo(callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.image | PixelMap | writeBufferToPixels(src: ArrayBuffer): Promise\;
writeBufferToPixels(src: ArrayBuffer, callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.image | PixelMap | writePixels(area: PositionArea): Promise\;
writePixels(area: PositionArea, callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.image | PixelMap | readPixels(area: PositionArea): Promise\;
readPixels(area: PositionArea, callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.image | PixelMap | readPixelsToBuffer(dst: ArrayBuffer): Promise\;
readPixelsToBuffer(dst: ArrayBuffer, callback: AsyncCallback\): void; | 新增 | | ohos.multimedia.image | PixelMap | readonly isEditable: boolean; | 新增 | -| ohos.multimedia.image | image | function createImagePacker(): ImagePacker; | 新增 | -| ohos.multimedia.image | image | function createImageSource(uri: string): ImageSource;
function createImageSource(fd: number): ImageSource; | 新增 | -| ohos.multimedia.image | image | function createPixelMap(colors: ArrayBuffer, options: InitializationOptions, callback: AsyncCallback): void;
function createPixelMap(colors: ArrayBuffer, options: InitializationOptions): Promise; | 新增 | +| ohos.multimedia.image | image | createImagePacker(): ImagePacker; | 新增 | +| ohos.multimedia.image | image | createImageSource(uri: string): ImageSource;
createImageSource(fd: number): ImageSource; | 新增 | +| ohos.multimedia.image | image | createPixelMap(colors: ArrayBuffer, options: InitializationOptions, callback: AsyncCallback\): void;
createPixelMap(colors: ArrayBuffer, options: InitializationOptions): Promise\; | 新增 | | ohos.multimedia.image | InitializationOptions | editable?: boolean; | 新增 | | ohos.multimedia.image | InitializationOptions | pixelFormat?: PixelMapFormat; | 新增 | | ohos.multimedia.image | InitializationOptions | size: Size; | 新增 | @@ -282,19 +282,19 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.image | PixelMapFormat | RGBA_8888 = 3 | 新增 | | ohos.multimedia.image | PixelMapFormat | RGB_565 = 2 | 新增 | | ohos.multimedia.image | PixelMapFormat | UNKNOWN = 0 | 新增 | -| ohos.multimedia.audio | AudioCapturer | on(type: "stateChange", callback: Callback): void; | 新增 | +| ohos.multimedia.audio | AudioCapturer | on(type: "stateChange", callback: Callback\): void; | 新增 | | ohos.multimedia.audio | AudioCapturer | off(type: "periodReach"): void; | 新增 | | ohos.multimedia.audio | AudioCapturer | on(type: "periodReach", frame: number, callback: (position: number) => {}): void; | 新增 | | ohos.multimedia.audio | AudioCapturer | off(type: "markReach"): void; | 新增 | | ohos.multimedia.audio | AudioCapturer | on(type: "markReach", frame: number, callback: (position: number) => {}): void; | 新增 | -| ohos.multimedia.audio | AudioCapturer | getBufferSize(callback: AsyncCallback): void;
getBufferSize(): Promise; | 新增 | -| ohos.multimedia.audio | AudioCapturer | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.audio | AudioCapturer | stop(callback: AsyncCallback): void;
stop(): Promise; | 新增 | -| ohos.multimedia.audio | AudioCapturer | getAudioTime(callback: AsyncCallback): void;
getAudioTime(): Promise; | 新增 | -| ohos.multimedia.audio | AudioCapturer | read(size: number, isBlockingRead: boolean, callback: AsyncCallback): void;
read(size: number, isBlockingRead: boolean): Promise; | 新增 | -| ohos.multimedia.audio | AudioCapturer | start(callback: AsyncCallback): void;
start(): Promise; | 新增 | -| ohos.multimedia.audio | AudioCapturer | getStreamInfo(callback: AsyncCallback): void;
getStreamInfo(): Promise; | 新增 | -| ohos.multimedia.audio | AudioCapturer | getCapturerInfo(callback: AsyncCallback): void;
getCapturerInfo(): Promise; | 新增 | +| ohos.multimedia.audio | AudioCapturer | getBufferSize(callback: AsyncCallback\): void;
getBufferSize(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioCapturer | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioCapturer | stop(callback: AsyncCallback\): void;
stop(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioCapturer | getAudioTime(callback: AsyncCallback\): void;
getAudioTime(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioCapturer | read(size: number, isBlockingRead: boolean, callback: AsyncCallback\): void;
read(size: number, isBlockingRead: boolean): Promise\; | 新增 | +| ohos.multimedia.audio | AudioCapturer | start(callback: AsyncCallback\): void;
start(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioCapturer | getStreamInfo(callback: AsyncCallback\): void;
getStreamInfo(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioCapturer | getCapturerInfo(callback: AsyncCallback\): void;
getCapturerInfo(): Promise\; | 新增 | | ohos.multimedia.audio | AudioCapturer | readonly state: AudioState; | 新增 | | ohos.multimedia.audio | AudioCapturerOptions | capturerInfo: AudioCapturerInfo; | 新增 | | ohos.multimedia.audio | AudioCapturerOptions | streamInfo: AudioStreamInfo; | 新增 | @@ -303,23 +303,23 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.audio | SourceType | SOURCE_TYPE_VOICE_COMMUNICATION = 7 | 新增 | | ohos.multimedia.audio | SourceType | SOURCE_TYPE_MIC = 0 | 新增 | | ohos.multimedia.audio | SourceType | SOURCE_TYPE_INVALID = -1 | 新增 | -| ohos.multimedia.audio | AudioRenderer | on(type: "stateChange", callback: Callback): void; | 新增 | +| ohos.multimedia.audio | AudioRenderer | on(type: "stateChange", callback: Callback\): void; | 新增 | | ohos.multimedia.audio | AudioRenderer | off(type: "periodReach"): void; | 新增 | | ohos.multimedia.audio | AudioRenderer | on(type: "periodReach", frame: number, callback: (position: number) => {}): void; | 新增 | | ohos.multimedia.audio | AudioRenderer | off(type: "markReach"): void; | 新增 | | ohos.multimedia.audio | AudioRenderer | on(type: "markReach", frame: number, callback: (position: number) => {}): void; | 新增 | -| ohos.multimedia.audio | AudioRenderer | getRenderRate(callback: AsyncCallback): void;
getRenderRate(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | setRenderRate(rate: AudioRendererRate, callback: AsyncCallback): void;
setRenderRate(rate: AudioRendererRate): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | getBufferSize(callback: AsyncCallback): void;
getBufferSize(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | stop(callback: AsyncCallback): void;
stop(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | pause(callback: AsyncCallback): void;
pause(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | drain(callback: AsyncCallback): void;
drain(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | getAudioTime(callback: AsyncCallback): void;
getAudioTime(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | write(buffer: ArrayBuffer, callback: AsyncCallback): void;
write(buffer: ArrayBuffer): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | start(callback: AsyncCallback): void;
start(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | getStreamInfo(callback: AsyncCallback): void;
getStreamInfo(): Promise; | 新增 | -| ohos.multimedia.audio | AudioRenderer | getRendererInfo(callback: AsyncCallback): void;
getRendererInfo(): Promise; | 新增 | +| ohos.multimedia.audio | AudioRenderer | getRenderRate(callback: AsyncCallback\): void;
getRenderRate(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | setRenderRate(rate: AudioRendererRate, callback: AsyncCallback\): void;
setRenderRate(rate: AudioRendererRate): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | getBufferSize(callback: AsyncCallback\): void;
getBufferSize(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | stop(callback: AsyncCallback\): void;
stop(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | pause(callback: AsyncCallback\): void;
pause(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | drain(callback: AsyncCallback\): void;
drain(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | getAudioTime(callback: AsyncCallback\): void;
getAudioTime(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | write(buffer: ArrayBuffer, callback: AsyncCallback\): void;
write(buffer: ArrayBuffer): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | start(callback: AsyncCallback\): void;
start(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | getStreamInfo(callback: AsyncCallback\): void;
getStreamInfo(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioRenderer | getRendererInfo(callback: AsyncCallback\): void;
getRendererInfo(): Promise\; | 新增 | | ohos.multimedia.audio | AudioRenderer | readonly state: AudioState; | 新增 | | ohos.multimedia.audio | DeviceChangeAction | deviceDescriptors: AudioDeviceDescriptors; | 新增 | | ohos.multimedia.audio | DeviceChangeAction | type: DeviceChangeType; | 新增 | @@ -330,22 +330,22 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.audio | InterruptAction | hint?: InterruptHint; | 新增 | | ohos.multimedia.audio | InterruptAction | type?: InterruptType; | 新增 | | ohos.multimedia.audio | InterruptAction | actionType: InterruptActionType; | 新增 | -| ohos.multimedia.audio | AudioManager | off(type: 'interrupt', interrupt: AudioInterrupt, callback?: Callback): void; | 新增 | -| ohos.multimedia.audio | AudioManager | on(type: 'interrupt', interrupt: AudioInterrupt, callback: Callback): void; | 新增 | -| ohos.multimedia.audio | AudioManager | off(type: 'deviceChange', callback?: Callback): void; | 新增 | -| ohos.multimedia.audio | AudioManager | on(type: 'deviceChange', callback: Callback): void; | 新增 | -| ohos.multimedia.audio | AudioManager | getAudioScene(callback: AsyncCallback): void;
getAudioScene(): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | isDeviceActive(deviceType: ActiveDeviceType, callback: AsyncCallback): void;
isDeviceActive(deviceType: ActiveDeviceType): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | setDeviceActive(deviceType: ActiveDeviceType, active: boolean, callback: AsyncCallback): void;
setDeviceActive(deviceType: ActiveDeviceType, active: boolean): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | getAudioParameter(key: string, callback: AsyncCallback): void;
getAudioParameter(key: string): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | setAudioParameter(key: string, value: string, callback: AsyncCallback): void;
setAudioParameter(key: string, value: string): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | getRingerMode(callback: AsyncCallback): void;
getRingerMode(): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | setRingerMode(mode: AudioRingMode, callback: AsyncCallback): void;
setRingerMode(mode: AudioRingMode): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | isMicrophoneMute(callback: AsyncCallback): void;
isMicrophoneMute(): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | setMicrophoneMute(mute: boolean, callback: AsyncCallback): void;
setMicrophoneMute(mute: boolean): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | isActive(volumeType: AudioVolumeType, callback: AsyncCallback): void;
isActive(volumeType: AudioVolumeType): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | isMute(volumeType: AudioVolumeType, callback: AsyncCallback): void;
isMute(volumeType: AudioVolumeType): Promise; | 新增 | -| ohos.multimedia.audio | AudioManager | mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback): void;
mute(volumeType: AudioVolumeType, mute: boolean): Promise; | 新增 | +| ohos.multimedia.audio | AudioManager | off(type: 'interrupt', interrupt: AudioInterrupt, callback?: Callback\): void; | 新增 | +| ohos.multimedia.audio | AudioManager | on(type: 'interrupt', interrupt: AudioInterrupt, callback: Callback\): void; | 新增 | +| ohos.multimedia.audio | AudioManager | off(type: 'deviceChange', callback?: Callback\): void; | 新增 | +| ohos.multimedia.audio | AudioManager | on(type: 'deviceChange', callback: Callback\): void; | 新增 | +| ohos.multimedia.audio | AudioManager | getAudioScene(callback: AsyncCallback\): void;
getAudioScene(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | isDeviceActive(deviceType: ActiveDeviceType, callback: AsyncCallback\): void;
isDeviceActive(deviceType: ActiveDeviceType): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | setDeviceActive(deviceType: ActiveDeviceType, active: boolean, callback: AsyncCallback\): void;
setDeviceActive(deviceType: ActiveDeviceType, active: boolean): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | getAudioParameter(key: string, callback: AsyncCallback\): void;
getAudioParameter(key: string): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | setAudioParameter(key: string, value: string, callback: AsyncCallback\): void;
setAudioParameter(key: string, value: string): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | getRingerMode(callback: AsyncCallback\): void;
getRingerMode(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | setRingerMode(mode: AudioRingMode, callback: AsyncCallback\): void;
setRingerMode(mode: AudioRingMode): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | isMicrophoneMute(callback: AsyncCallback\): void;
isMicrophoneMute(): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | setMicrophoneMute(mute: boolean, callback: AsyncCallback\): void;
setMicrophoneMute(mute: boolean): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | isActive(volumeType: AudioVolumeType, callback: AsyncCallback\): void;
isActive(volumeType: AudioVolumeType): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | isMute(volumeType: AudioVolumeType, callback: AsyncCallback\): void;
isMute(volumeType: AudioVolumeType): Promise\; | 新增 | +| ohos.multimedia.audio | AudioManager | mute(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback\): void;
mute(volumeType: AudioVolumeType, mute: boolean): Promise\; | 新增 | | ohos.multimedia.audio | AudioScene | AUDIO_SCENE_VOICE_CHAT | 新增 | | ohos.multimedia.audio | AudioScene | AUDIO_SCENE_DEFAULT = 0 | 新增 | | ohos.multimedia.audio | DeviceChangeType | DISCONNECT = 1 | 新增 | @@ -395,8 +395,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.audio | AudioSamplingRate | SAMPLE_RATE_12000 = 12000 | 新增 | | ohos.multimedia.audio | AudioSamplingRate | SAMPLE_RATE_11025 = 11025 | 新增 | | ohos.multimedia.audio | AudioSamplingRate | SAMPLE_RATE_8000 = 8000 | 新增 | -| ohos.multimedia.audio | AudioChannel | CHANNEL_2 = 0x1 << 1 | 新增 | -| ohos.multimedia.audio | AudioChannel | CHANNEL_1 = 0x1 << 0 | 新增 | +| ohos.multimedia.audio | AudioChannel | CHANNEL_2 = 0x1 \<\< 1 | 新增 | +| ohos.multimedia.audio | AudioChannel | CHANNEL_1 = 0x1 \<\< 0 | 新增 | | ohos.multimedia.audio | AudioSampleFormat | SAMPLE_FORMAT_S32LE = 3 | 新增 | | ohos.multimedia.audio | AudioSampleFormat | SAMPLE_FORMAT_S24LE = 2 | 新增 | | ohos.multimedia.audio | AudioSampleFormat | SAMPLE_FORMAT_S16LE = 1 | 新增 | @@ -419,5 +419,5 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,媒体子系 | ohos.multimedia.audio | AudioState | STATE_PREPARED | 新增 | | ohos.multimedia.audio | AudioState | STATE_NEW | 新增 | | ohos.multimedia.audio | AudioState | STATE_INVALID = -1 | 新增 | -| ohos.multimedia.audio | audio | function createAudioRenderer(options: AudioRendererOptions, callback: AsyncCallback): void;
function createAudioRenderer(options: AudioRendererOptions): Promise; | 新增 | -| ohos.multimedia.audio | audio | function createAudioCapturer(options: AudioCapturerOptions, callback: AsyncCallback): void;
function createAudioCapturer(options: AudioCapturerOptions): Promise; | 新增 | +| ohos.multimedia.audio | audio | createAudioRenderer(options: AudioRendererOptions, callback: AsyncCallback\): void;
createAudioRenderer(options: AudioRendererOptions): Promise\; | 新增 | +| ohos.multimedia.audio | audio | createAudioCapturer(options: AudioCapturerOptions, callback: AsyncCallback\): void;
createAudioCapturer(options: AudioCapturerOptions): Promise\; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia_api-9-canary.md index e3789726f74ffc155ea7176da3db9530631bbc96..dff7111aef3b96cff30847b05eb4d588b238c8dd 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia_api-9-canary.md @@ -7,7 +7,7 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,媒体子 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.multimedia.audio | AudioRenderer | on(type: 'interrupt', callback: Callback): void; | 新增 | +| ohos.multimedia.audio | AudioRenderer | on(type: 'interrupt', callback: Callback\): void; | 新增 | | ohos.multimedia.audio | InterruptEvent | hintType: InterruptHint; | 新增 | | ohos.multimedia.audio | InterruptEvent | forceType: InterruptForceType; | 新增 | | ohos.multimedia.audio | InterruptEvent | eventType: InterruptType; | 新增 | @@ -15,25 +15,25 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,媒体子 | ohos.multimedia.audio | InterruptForceType | INTERRUPT_FORCE = 0 | 新增 | | ohos.multimedia.camera | VideoOutputError | code: VideoOutputErrorCode; | 新增 | | ohos.multimedia.camera | VideoOutputErrorCode | ERROR_UNKNOWN = -1 | 新增 | -| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.multimedia.camera | VideoOutput | on(type: 'frameEnd', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | VideoOutput | on(type: 'frameStart', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | VideoOutput | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.camera | VideoOutput | stop(callback: AsyncCallback): void;
stop(): Promise; | 新增 | -| ohos.multimedia.camera | VideoOutput | start(callback: AsyncCallback): void;
start(): Promise; | 新增 | -| ohos.multimedia.camera | camera | function createVideoOutput(surfaceId: string, callback: AsyncCallback): void;
function createVideoOutput(surfaceId: string): Promise; | 新增 | +| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback\): void; | 新增 | +| ohos.multimedia.camera | VideoOutput | on(type: 'frameEnd', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | VideoOutput | on(type: 'frameStart', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | VideoOutput | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.camera | VideoOutput | stop(callback: AsyncCallback\): void;
stop(): Promise\; | 新增 | +| ohos.multimedia.camera | VideoOutput | start(callback: AsyncCallback\): void;
start(): Promise\; | 新增 | +| ohos.multimedia.camera | camera | createVideoOutput(surfaceId: string, callback: AsyncCallback\): void;
createVideoOutput(surfaceId: string): Promise\; | 新增 | | ohos.multimedia.camera | PhotoOutputError | code: PhotoOutputErrorCode; | 新增 | | ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_UNKNOWN = -1 | 新增 | | ohos.multimedia.camera | CaptureEndInfo | frameCount: number; | 新增 | | ohos.multimedia.camera | CaptureEndInfo | captureId: number; | 新增 | | ohos.multimedia.camera | FrameShutterInfo | timestamp: number; | 新增 | | ohos.multimedia.camera | FrameShutterInfo | captureId: number; | 新增 | -| ohos.multimedia.camera | PhotoOutput | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.multimedia.camera | PhotoOutput | on(type: 'captureEnd', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | PhotoOutput | on(type: 'frameShutter', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | PhotoOutput | on(type: 'captureStart', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | PhotoOutput | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.camera | PhotoOutput | capture(callback: AsyncCallback): void;
capture(setting: PhotoCaptureSetting, callback: AsyncCallback): void;
capture(setting?: PhotoCaptureSetting): Promise; | 新增 | +| ohos.multimedia.camera | PhotoOutput | on(type: 'error', callback: ErrorCallback\): void; | 新增 | +| ohos.multimedia.camera | PhotoOutput | on(type: 'captureEnd', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | PhotoOutput | on(type: 'frameShutter', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | PhotoOutput | on(type: 'captureStart', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | PhotoOutput | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.camera | PhotoOutput | capture(callback: AsyncCallback\): void;
capture(setting: PhotoCaptureSetting, callback: AsyncCallback\): void;
capture(setting?: PhotoCaptureSetting): Promise\; | 新增 | | ohos.multimedia.camera | PhotoCaptureSetting | rotation?: ImageRotation; | 新增 | | ohos.multimedia.camera | PhotoCaptureSetting | quality?: QualityLevel; | 新增 | | ohos.multimedia.camera | QualityLevel | QUALITY_LEVEL_LOW | 新增 | @@ -43,27 +43,27 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,媒体子 | ohos.multimedia.camera | ImageRotation | ROTATION_180 = 180 | 新增 | | ohos.multimedia.camera | ImageRotation | ROTATION_90 = 90 | 新增 | | ohos.multimedia.camera | ImageRotation | ROTATION_0 = 0 | 新增 | -| ohos.multimedia.camera | camera | function createPhotoOutput(surfaceId: string, callback: AsyncCallback): void;
function createPhotoOutput(surfaceId: string): Promise; | 新增 | +| ohos.multimedia.camera | camera | createPhotoOutput(surfaceId: string, callback: AsyncCallback\): void;
createPhotoOutput(surfaceId: string): Promise\; | 新增 | | ohos.multimedia.camera | PreviewOutputError | code: PreviewOutputErrorCode; | 新增 | | ohos.multimedia.camera | PreviewOutputErrorCode | ERROR_UNKNOWN = -1 | 新增 | -| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.multimedia.camera | PreviewOutput | on(type: 'frameEnd', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | PreviewOutput | on(type: 'frameStart', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | PreviewOutput | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.camera | camera | function createPreviewOutput(surfaceId: string, callback: AsyncCallback): void;
function createPreviewOutput(surfaceId: string): Promise; | 新增 | +| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback\): void; | 新增 | +| ohos.multimedia.camera | PreviewOutput | on(type: 'frameEnd', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | PreviewOutput | on(type: 'frameStart', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | PreviewOutput | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.camera | camera | createPreviewOutput(surfaceId: string, callback: AsyncCallback\): void;
createPreviewOutput(surfaceId: string): Promise\; | 新增 | | ohos.multimedia.camera | CaptureSessionError | code: CaptureSessionErrorCode; | 新增 | | ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_UNKNOWN = -1 | 新增 | -| ohos.multimedia.camera | CaptureSession | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.multimedia.camera | CaptureSession | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.camera | CaptureSession | stop(callback: AsyncCallback): void;
stop(): Promise; | 新增 | -| ohos.multimedia.camera | CaptureSession | start(callback: AsyncCallback): void;
start(): Promise; | 新增 | -| ohos.multimedia.camera | CaptureSession | removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void;
removeOutput(previewOutput: PreviewOutput): Promise;
removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void;
removeOutput(photoOutput: PhotoOutput): Promise;
removeOutput(videoOutput: VideoOutput, callback: AsyncCallback): void;
removeOutput(videoOutput: VideoOutput): Promise; | 新增 | -| ohos.multimedia.camera | CaptureSession | removeInput(cameraInput: CameraInput, callback: AsyncCallback): void;
removeInput(cameraInput: CameraInput): Promise; | 新增 | -| ohos.multimedia.camera | CaptureSession | addOutput(previewOutput: PreviewOutput, callback: AsyncCallback): void;
addOutput(previewOutput: PreviewOutput): Promise;
addOutput(photoOutput: PhotoOutput, callback: AsyncCallback): void;
addOutput(photoOutput: PhotoOutput): Promise;
addOutput(videoOutput: VideoOutput, callback: AsyncCallback): void;
addOutput(videoOutput: VideoOutput): Promise; | 新增 | -| ohos.multimedia.camera | CaptureSession | addInput(cameraInput: CameraInput, callback: AsyncCallback): void;
addInput(cameraInput: CameraInput): Promise; | 新增 | -| ohos.multimedia.camera | CaptureSession | commitConfig(callback: AsyncCallback): void;
commitConfig(): Promise; | 新增 | -| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback): void;
beginConfig(): Promise; | 新增 | -| ohos.multimedia.camera | camera | function createCaptureSession(context: Context, callback: AsyncCallback): void;
function createCaptureSession(context: Context): Promise; | 新增 | +| ohos.multimedia.camera | CaptureSession | on(type: 'error', callback: ErrorCallback\): void; | 新增 | +| ohos.multimedia.camera | CaptureSession | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.camera | CaptureSession | stop(callback: AsyncCallback\): void;
stop(): Promise\; | 新增 | +| ohos.multimedia.camera | CaptureSession | start(callback: AsyncCallback\): void;
start(): Promise\; | 新增 | +| ohos.multimedia.camera | CaptureSession | removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback\): void;
removeOutput(previewOutput: PreviewOutput): Promise\;
removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback\): void;
removeOutput(photoOutput: PhotoOutput): Promise\;
removeOutput(videoOutput: VideoOutput, callback: AsyncCallback\): void;
removeOutput(videoOutput: VideoOutput): Promise\; | 新增 | +| ohos.multimedia.camera | CaptureSession | removeInput(cameraInput: CameraInput, callback: AsyncCallback\): void;
removeInput(cameraInput: CameraInput): Promise\; | 新增 | +| ohos.multimedia.camera | CaptureSession | addOutput(previewOutput: PreviewOutput, callback: AsyncCallback\): void;
addOutput(previewOutput: PreviewOutput): Promise\;
addOutput(photoOutput: PhotoOutput, callback: AsyncCallback\): void;
addOutput(photoOutput: PhotoOutput): Promise\;
addOutput(videoOutput: VideoOutput, callback: AsyncCallback\): void;
addOutput(videoOutput: VideoOutput): Promise\; | 新增 | +| ohos.multimedia.camera | CaptureSession | addInput(cameraInput: CameraInput, callback: AsyncCallback\): void;
addInput(cameraInput: CameraInput): Promise\; | 新增 | +| ohos.multimedia.camera | CaptureSession | commitConfig(callback: AsyncCallback\): void;
commitConfig(): Promise\; | 新增 | +| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback\): void;
beginConfig(): Promise\; | 新增 | +| ohos.multimedia.camera | camera | createCaptureSession(context: Context, callback: AsyncCallback\): void;
createCaptureSession(context: Context): Promise\; | 新增 | | ohos.multimedia.camera | FocusState | FOCUS_STATE_UNFOCUSED | 新增 | | ohos.multimedia.camera | FocusState | FOCUS_STATE_FOCUSED | 新增 | | ohos.multimedia.camera | FocusState | FOCUS_STATE_SCAN = 0 | 新增 | @@ -77,20 +77,20 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,媒体子 | ohos.multimedia.camera | FlashMode | FLASH_MODE_CLOSE = 0 | 新增 | | ohos.multimedia.camera | CameraInputError | code: CameraInputErrorCode; | 新增 | | ohos.multimedia.camera | CameraInputErrorCode | ERROR_UNKNOWN = -1 | 新增 | -| ohos.multimedia.camera | CameraInput | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.multimedia.camera | CameraInput | on(type: 'focusStateChange', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
setZoomRatio(zoomRatio: number): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback): void;
getZoomRatio(): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback>): void;
getZoomRatioRange(): Promise>; | 新增 | -| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
setFocusMode(afMode: FocusMode): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback): void;
getFocusMode(): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
isFocusModeSupported(afMode: FocusMode): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
setFlashMode(flashMode: FlashMode): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | getFlashMode(callback: AsyncCallback): void;
getFlashMode(): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
isFlashModeSupported(flashMode: FlashMode): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | hasFlash(callback: AsyncCallback): void;
hasFlash(): Promise; | 新增 | -| ohos.multimedia.camera | CameraInput | getCameraId(callback: AsyncCallback): void;
getCameraId(): Promise; | 新增 | +| ohos.multimedia.camera | CameraInput | on(type: 'error', callback: ErrorCallback\): void; | 新增 | +| ohos.multimedia.camera | CameraInput | on(type: 'focusStateChange', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback\): void;
setZoomRatio(zoomRatio: number): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback\): void;
getZoomRatio(): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback\>): void;
getZoomRatioRange(): Promise\>; | 新增 | +| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback\): void;
setFocusMode(afMode: FocusMode): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback\): void;
getFocusMode(): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback\): void;
isFocusModeSupported(afMode: FocusMode): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | setFlashMode(flashMode: FlashMode, callback: AsyncCallback\): void;
setFlashMode(flashMode: FlashMode): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | getFlashMode(callback: AsyncCallback\): void;
getFlashMode(): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback\): void;
isFlashModeSupported(flashMode: FlashMode): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | hasFlash(callback: AsyncCallback\): void;
hasFlash(): Promise\; | 新增 | +| ohos.multimedia.camera | CameraInput | getCameraId(callback: AsyncCallback\): void;
getCameraId(): Promise\; | 新增 | | ohos.multimedia.camera | Size | width: number; | 新增 | | ohos.multimedia.camera | Size | height: number; | 新增 | | ohos.multimedia.camera | Camera | readonly connectionType: ConnectionType; | 新增 | @@ -110,28 +110,28 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,媒体子 | ohos.multimedia.camera | CameraPosition | CAMERA_POSITION_UNSPECIFIED = 0 | 新增 | | ohos.multimedia.camera | CameraStatusInfo | status: CameraStatus; | 新增 | | ohos.multimedia.camera | CameraStatusInfo | camera: Camera; | 新增 | -| ohos.multimedia.camera | CameraManager | on(type: 'cameraStatus', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.camera | CameraManager | createCameraInput(cameraId: string, callback: AsyncCallback): void;
createCameraInput(cameraId: string): Promise;
createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void;
createCameraInput(position: CameraPosition, type: CameraType): Promise; | 新增 | -| ohos.multimedia.camera | CameraManager | getCameras(callback: AsyncCallback>): void;
getCameras(): Promise>; | 新增 | +| ohos.multimedia.camera | CameraManager | on(type: 'cameraStatus', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.camera | CameraManager | createCameraInput(cameraId: string, callback: AsyncCallback\): void;
createCameraInput(cameraId: string): Promise\;
createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback\): void;
createCameraInput(position: CameraPosition, type: CameraType): Promise\; | 新增 | +| ohos.multimedia.camera | CameraManager | getCameras(callback: AsyncCallback\>): void;
getCameras(): Promise\>; | 新增 | | ohos.multimedia.camera | CameraStatus | CAMERA_STATUS_UNAVAILABLE | 新增 | | ohos.multimedia.camera | CameraStatus | CAMERA_STATUS_AVAILABLE | 新增 | | ohos.multimedia.camera | CameraStatus | CAMERA_STATUS_DISAPPEAR | 新增 | | ohos.multimedia.camera | CameraStatus | CAMERA_STATUS_APPEAR = 0 | 新增 | -| ohos.multimedia.camera | camera | function getCameraManager(context: Context, callback: AsyncCallback): void;
function getCameraManager(context: Context): Promise; | 新增 | -| ohos.multimedia.image | ImageReceiver | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.image | ImageReceiver | on(type: 'imageArrival', callback: AsyncCallback): void; | 新增 | -| ohos.multimedia.image | ImageReceiver | readNextImage(callback: AsyncCallback): void;
readNextImage(): Promise; | 新增 | -| ohos.multimedia.image | ImageReceiver | readLatestImage(callback: AsyncCallback): void;
readLatestImage(): Promise; | 新增 | -| ohos.multimedia.image | ImageReceiver | getReceivingSurfaceId(callback: AsyncCallback): void;
getReceivingSurfaceId(): Promise; | 新增 | +| ohos.multimedia.camera | camera | getCameraManager(context: Context, callback: AsyncCallback\): void;
getCameraManager(context: Context): Promise\; | 新增 | +| ohos.multimedia.image | ImageReceiver | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.image | ImageReceiver | on(type: 'imageArrival', callback: AsyncCallback\): void; | 新增 | +| ohos.multimedia.image | ImageReceiver | readNextImage(callback: AsyncCallback\): void;
readNextImage(): Promise\; | 新增 | +| ohos.multimedia.image | ImageReceiver | readLatestImage(callback: AsyncCallback\): void;
readLatestImage(): Promise\; | 新增 | +| ohos.multimedia.image | ImageReceiver | getReceivingSurfaceId(callback: AsyncCallback\): void;
getReceivingSurfaceId(): Promise\; | 新增 | | ohos.multimedia.image | ImageReceiver | readonly format: ImageFormat; | 新增 | | ohos.multimedia.image | ImageReceiver | readonly capacity: number; | 新增 | | ohos.multimedia.image | ImageReceiver | readonly size: Size; | 新增 | -| ohos.multimedia.image | Image | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.image | Image | getComponent(componentType: ComponentType, callback: AsyncCallback): void;
getComponent(componentType: ComponentType): Promise; | 新增 | +| ohos.multimedia.image | Image | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.image | Image | getComponent(componentType: ComponentType, callback: AsyncCallback\): void;
getComponent(componentType: ComponentType): Promise\; | 新增 | | ohos.multimedia.image | Image | readonly format: number; | 新增 | | ohos.multimedia.image | Image | readonly size: Size; | 新增 | | ohos.multimedia.image | Image | clipRect: Region; | 新增 | -| ohos.multimedia.image | image | function createImageReceiver(width: number, height: number, format: number, capacity: number): ImageReceiver; | 新增 | +| ohos.multimedia.image | image | createImageReceiver(width: number, height: number, format: number, capacity: number): ImageReceiver; | 新增 | | ohos.multimedia.image | Component | readonly byteBuffer: ArrayBuffer; | 新增 | | ohos.multimedia.image | Component | readonly pixelStride: number; | 新增 | | ohos.multimedia.image | Component | readonly rowStride: number; | 新增 | @@ -164,12 +164,12 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,媒体子 | ohos.multimedia.media | VideoRecorderProfile | readonly audioBitrate: number; | 新增 | | ohos.multimedia.media | VideoRecorder | readonly state: VideoRecordState; | 新增 | | ohos.multimedia.media | VideoRecorder | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.multimedia.media | VideoRecorder | reset(callback: AsyncCallback): void;
reset(): Promise; | 新增 | -| ohos.multimedia.media | VideoRecorder | release(callback: AsyncCallback): void;
release(): Promise; | 新增 | -| ohos.multimedia.media | VideoRecorder | stop(callback: AsyncCallback): void;
stop(): Promise; | 新增 | -| ohos.multimedia.media | VideoRecorder | resume(callback: AsyncCallback): void;
resume(): Promise; | 新增 | -| ohos.multimedia.media | VideoRecorder | pause(callback: AsyncCallback): void;
pause(): Promise; | 新增 | -| ohos.multimedia.media | VideoRecorder | start(callback: AsyncCallback): void;
start(): Promise; | 新增 | -| ohos.multimedia.media | VideoRecorder | getInputSurface(callback: AsyncCallback): void;
getInputSurface(): Promise; | 新增 | -| ohos.multimedia.media | VideoRecorder | prepare(config: VideoRecorderConfig, callback: AsyncCallback): void;
prepare(config: VideoRecorderConfig): Promise; | 新增 | -| ohos.multimedia.media | media | function createVideoRecorder(callback: AsyncCallback): void;
function createVideoRecorder(): Promise; | 新增 | +| ohos.multimedia.media | VideoRecorder | reset(callback: AsyncCallback\): void;
reset(): Promise\; | 新增 | +| ohos.multimedia.media | VideoRecorder | release(callback: AsyncCallback\): void;
release(): Promise\; | 新增 | +| ohos.multimedia.media | VideoRecorder | stop(callback: AsyncCallback\): void;
stop(): Promise\; | 新增 | +| ohos.multimedia.media | VideoRecorder | resume(callback: AsyncCallback\): void;
resume(): Promise\; | 新增 | +| ohos.multimedia.media | VideoRecorder | pause(callback: AsyncCallback\): void;
pause(): Promise\; | 新增 | +| ohos.multimedia.media | VideoRecorder | start(callback: AsyncCallback\): void;
start(): Promise\; | 新增 | +| ohos.multimedia.media | VideoRecorder | getInputSurface(callback: AsyncCallback\): void;
getInputSurface(): Promise\; | 新增 | +| ohos.multimedia.media | VideoRecorder | prepare(config: VideoRecorderConfig, callback: AsyncCallback\): void;
prepare(config: VideoRecorderConfig): Promise\; | 新增 | +| ohos.multimedia.media | media | createVideoRecorder(callback: AsyncCallback\): void;
createVideoRecorder(): Promise\; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-network.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-network.md index da00bb411de775d3fb9b8a9e9f45380d71e23ff1..939c88f18d70545b642f4e8a7006457d01459921 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-network.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-network.md @@ -8,34 +8,34 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,网络管理 |---|---|---|---| | ohos.net.webSocket | WebSocket | off(type: 'error', callback?: ErrorCallback): void; | 新增 | | ohos.net.webSocket | WebSocket | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.net.webSocket | WebSocket | off(type: 'close', callback?: AsyncCallback<{ code: number, reason: string }>): void; | 新增 | -| ohos.net.webSocket | WebSocket | on(type: 'close', callback: AsyncCallback<{ code: number, reason: string }>): void; | 新增 | -| ohos.net.webSocket | WebSocket | off(type: 'message', callback?: AsyncCallback): void; | 新增 | -| ohos.net.webSocket | WebSocket | on(type: 'message', callback: AsyncCallback): void; | 新增 | -| ohos.net.webSocket | WebSocket | off(type: 'open', callback?: AsyncCallback): void; | 新增 | -| ohos.net.webSocket | WebSocket | on(type: 'open', callback: AsyncCallback): void; | 新增 | -| ohos.net.webSocket | WebSocket | close(callback: AsyncCallback): void;
close(options: WebSocketCloseOptions, callback: AsyncCallback): void;
close(options?: WebSocketCloseOptions): Promise; | 新增 | -| ohos.net.webSocket | WebSocket | send(data: string \| ArrayBuffer, callback: AsyncCallback): void;
send(data: string \| ArrayBuffer): Promise; | 新增 | -| ohos.net.webSocket | WebSocket | connect(url: string, callback: AsyncCallback): void;
connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback): void;
connect(url: string, options?: WebSocketRequestOptions): Promise; | 新增 | +| ohos.net.webSocket | WebSocket | off(type: 'close', callback?: AsyncCallback\<{ code: number, reason: string }>): void; | 新增 | +| ohos.net.webSocket | WebSocket | on(type: 'close', callback: AsyncCallback\<{ code: number, reason: string }>): void; | 新增 | +| ohos.net.webSocket | WebSocket | off(type: 'message', callback?: AsyncCallback\): void; | 新增 | +| ohos.net.webSocket | WebSocket | on(type: 'message', callback: AsyncCallback\): void; | 新增 | +| ohos.net.webSocket | WebSocket | off(type: 'open', callback?: AsyncCallback\): void; | 新增 | +| ohos.net.webSocket | WebSocket | on(type: 'open', callback: AsyncCallback\): void; | 新增 | +| ohos.net.webSocket | WebSocket | close(callback: AsyncCallback\): void;
close(options: WebSocketCloseOptions, callback: AsyncCallback\): void;
close(options?: WebSocketCloseOptions): Promise\; | 新增 | +| ohos.net.webSocket | WebSocket | send(data: string \| ArrayBuffer, callback: AsyncCallback\): void;
send(data: string \| ArrayBuffer): Promise\; | 新增 | +| ohos.net.webSocket | WebSocket | connect(url: string, callback: AsyncCallback\): void;
connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback\): void;
connect(url: string, options?: WebSocketRequestOptions): Promise\; | 新增 | | ohos.net.webSocket | WebSocketCloseOptions | reason?: string; | 新增 | | ohos.net.webSocket | WebSocketCloseOptions | code?: number; | 新增 | | ohos.net.webSocket | WebSocketRequestOptions | header?: Object; | 新增 | -| ohos.net.webSocket | webSocket | function createWebSocket(): WebSocket; | 新增 | +| ohos.net.webSocket | webSocket | createWebSocket(): WebSocket; | 新增 | | ohos.net.socket | TCPSocket | off(type: 'error', callback?: ErrorCallback): void; | 新增 | | ohos.net.socket | TCPSocket | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.net.socket | TCPSocket | off(type: 'connect' \| 'close', callback?: Callback): void; | 新增 | -| ohos.net.socket | TCPSocket | off(type: 'connect' \| 'close', callback?: Callback): void; | 新增 | -| ohos.net.socket | TCPSocket | on(type: 'connect' \| 'close', callback: Callback): void; | 新增 | -| ohos.net.socket | TCPSocket | on(type: 'connect' \| 'close', callback: Callback): void; | 新增 | -| ohos.net.socket | TCPSocket | off(type: 'message', callback?: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | 新增 | -| ohos.net.socket | TCPSocket | on(type: 'message', callback: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | 新增 | -| ohos.net.socket | TCPSocket | setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback): void;
setExtraOptions(options: TCPExtraOptions): Promise; | 新增 | -| ohos.net.socket | TCPSocket | getState(callback: AsyncCallback): void;
getState(): Promise; | 新增 | -| ohos.net.socket | TCPSocket | getRemoteAddress(callback: AsyncCallback): void;
getRemoteAddress(): Promise; | 新增 | -| ohos.net.socket | TCPSocket | close(callback: AsyncCallback): void;
close(): Promise; | 新增 | -| ohos.net.socket | TCPSocket | send(options: TCPSendOptions, callback: AsyncCallback): void;
send(options: TCPSendOptions): Promise; | 新增 | -| ohos.net.socket | TCPSocket | connect(options: TCPConnectOptions, callback: AsyncCallback): void;
connect(options: TCPConnectOptions): Promise; | 新增 | -| ohos.net.socket | TCPSocket | bind(address: NetAddress, callback: AsyncCallback): void;
bind(address: NetAddress): Promise; | 新增 | +| ohos.net.socket | TCPSocket | off(type: 'connect' \| 'close', callback?: Callback\): void; | 新增 | +| ohos.net.socket | TCPSocket | off(type: 'connect' \| 'close', callback?: Callback\): void; | 新增 | +| ohos.net.socket | TCPSocket | on(type: 'connect' \| 'close', callback: Callback\): void; | 新增 | +| ohos.net.socket | TCPSocket | on(type: 'connect' \| 'close', callback: Callback\): void; | 新增 | +| ohos.net.socket | TCPSocket | off(type: 'message', callback?: Callback\<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | 新增 | +| ohos.net.socket | TCPSocket | on(type: 'message', callback: Callback\<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | 新增 | +| ohos.net.socket | TCPSocket | setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback\): void;
setExtraOptions(options: TCPExtraOptions): Promise\; | 新增 | +| ohos.net.socket | TCPSocket | getState(callback: AsyncCallback\): void;
getState(): Promise\; | 新增 | +| ohos.net.socket | TCPSocket | getRemoteAddress(callback: AsyncCallback\): void;
getRemoteAddress(): Promise\; | 新增 | +| ohos.net.socket | TCPSocket | close(callback: AsyncCallback\): void;
close(): Promise\; | 新增 | +| ohos.net.socket | TCPSocket | send(options: TCPSendOptions, callback: AsyncCallback\): void;
send(options: TCPSendOptions): Promise\; | 新增 | +| ohos.net.socket | TCPSocket | connect(options: TCPConnectOptions, callback: AsyncCallback\): void;
connect(options: TCPConnectOptions): Promise\; | 新增 | +| ohos.net.socket | TCPSocket | bind(address: NetAddress, callback: AsyncCallback\): void;
bind(address: NetAddress): Promise\; | 新增 | | ohos.net.socket | TCPExtraOptions | socketLinger: {on: boolean, linger: number}; | 新增 | | ohos.net.socket | TCPExtraOptions | TCPNoDelay?: boolean; | 新增 | | ohos.net.socket | TCPExtraOptions | OOBInline?: boolean; | 新增 | @@ -46,17 +46,17 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,网络管理 | ohos.net.socket | TCPConnectOptions | address: NetAddress; | 新增 | | ohos.net.socket | UDPSocket | off(type: 'error', callback?: ErrorCallback): void; | 新增 | | ohos.net.socket | UDPSocket | on(type: 'error', callback: ErrorCallback): void; | 新增 | -| ohos.net.socket | UDPSocket | off(type: 'listening' \| 'close', callback?: Callback): void; | 新增 | -| ohos.net.socket | UDPSocket | off(type: 'listening' \| 'close', callback?: Callback): void; | 新增 | -| ohos.net.socket | UDPSocket | on(type: 'listening' \| 'close', callback: Callback): void; | 新增 | -| ohos.net.socket | UDPSocket | on(type: 'listening' \| 'close', callback: Callback): void; | 新增 | -| ohos.net.socket | UDPSocket | off(type: 'message', callback?: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | 新增 | -| ohos.net.socket | UDPSocket | on(type: 'message', callback: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | 新增 | -| ohos.net.socket | UDPSocket | setExtraOptions(options: UDPExtraOptions, callback: AsyncCallback): void;
setExtraOptions(options: UDPExtraOptions): Promise; | 新增 | -| ohos.net.socket | UDPSocket | getState(callback: AsyncCallback): void;
getState(): Promise; | 新增 | -| ohos.net.socket | UDPSocket | close(callback: AsyncCallback): void;
close(): Promise; | 新增 | -| ohos.net.socket | UDPSocket | send(options: UDPSendOptions, callback: AsyncCallback): void;
send(options: UDPSendOptions): Promise; | 新增 | -| ohos.net.socket | UDPSocket | bind(address: NetAddress, callback: AsyncCallback): void;
bind(address: NetAddress): Promise; | 新增 | +| ohos.net.socket | UDPSocket | off(type: 'listening' \| 'close', callback?: Callback\): void; | 新增 | +| ohos.net.socket | UDPSocket | off(type: 'listening' \| 'close', callback?: Callback\): void; | 新增 | +| ohos.net.socket | UDPSocket | on(type: 'listening' \| 'close', callback: Callback\): void; | 新增 | +| ohos.net.socket | UDPSocket | on(type: 'listening' \| 'close', callback: Callback\): void; | 新增 | +| ohos.net.socket | UDPSocket | off(type: 'message', callback?: Callback\<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | 新增 | +| ohos.net.socket | UDPSocket | on(type: 'message', callback: Callback\<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | 新增 | +| ohos.net.socket | UDPSocket | setExtraOptions(options: UDPExtraOptions, callback: AsyncCallback\): void;
setExtraOptions(options: UDPExtraOptions): Promise\; | 新增 | +| ohos.net.socket | UDPSocket | getState(callback: AsyncCallback\): void;
getState(): Promise\; | 新增 | +| ohos.net.socket | UDPSocket | close(callback: AsyncCallback\): void;
close(): Promise\; | 新增 | +| ohos.net.socket | UDPSocket | send(options: UDPSendOptions, callback: AsyncCallback\): void;
send(options: UDPSendOptions): Promise\; | 新增 | +| ohos.net.socket | UDPSocket | bind(address: NetAddress, callback: AsyncCallback\): void;
bind(address: NetAddress): Promise\; | 新增 | | ohos.net.socket | SocketRemoteInfo | size: number; | 新增 | | ohos.net.socket | SocketRemoteInfo | port: number; | 新增 | | ohos.net.socket | SocketRemoteInfo | family: 'IPv4' \| 'IPv6'; | 新增 | @@ -71,8 +71,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,网络管理 | ohos.net.socket | ExtraOptionsBase | receiveBufferSize?: number; | 新增 | | ohos.net.socket | UDPSendOptions | address: NetAddress; | 新增 | | ohos.net.socket | UDPSendOptions | data: string \| ArrayBuffer; | 新增 | -| ohos.net.socket | socket | function constructTCPSocketInstance(): TCPSocket; | 新增 | -| ohos.net.socket | socket | function constructUDPSocketInstance(): UDPSocket; | 新增 | +| ohos.net.socket | socket | constructTCPSocketInstance(): TCPSocket; | 新增 | +| ohos.net.socket | socket | constructUDPSocketInstance(): UDPSocket; | 新增 | | ohos.net.socket | socket | import NetAddress = connection.NetAddress; | 新增 | | ohos.net.http | HttpResponse | cookies: string; | 新增 | | ohos.net.http | HttpResponse | header: Object; | 新增 | @@ -121,19 +121,19 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,网络管理 | ohos.net.http | RequestMethod | HEAD = "HEAD" | 新增 | | ohos.net.http | RequestMethod | GET = "GET" | 新增 | | ohos.net.http | RequestMethod | OPTIONS = "OPTIONS" | 新增 | -| ohos.net.http | HttpRequest | once(type: "headersReceive", callback: Callback): void; | 新增 | -| ohos.net.http | HttpRequest | off(type: "headersReceive", callback?: Callback): void; | 新增 | -| ohos.net.http | HttpRequest | on(type: "headersReceive", callback: Callback): void; | 新增 | -| ohos.net.http | HttpRequest | off(type: "headerReceive", callback?: AsyncCallback): void; | 新增 | -| ohos.net.http | HttpRequest | on(type: "headerReceive", callback: AsyncCallback): void; | 新增 | +| ohos.net.http | HttpRequest | once(type: "headersReceive", callback: Callback\): void; | 新增 | +| ohos.net.http | HttpRequest | off(type: "headersReceive", callback?: Callback\): void; | 新增 | +| ohos.net.http | HttpRequest | on(type: "headersReceive", callback: Callback\): void; | 新增 | +| ohos.net.http | HttpRequest | off(type: "headerReceive", callback?: AsyncCallback\): void; | 新增 | +| ohos.net.http | HttpRequest | on(type: "headerReceive", callback: AsyncCallback\): void; | 新增 | | ohos.net.http | HttpRequest | destroy(): void; | 新增 | -| ohos.net.http | HttpRequest | request(url: string, callback: AsyncCallback): void;
request(url: string, options: HttpRequestOptions, callback: AsyncCallback): void;
request(url: string, options?: HttpRequestOptions): Promise; | 新增 | +| ohos.net.http | HttpRequest | request(url: string, callback: AsyncCallback\): void;
request(url: string, options: HttpRequestOptions, callback: AsyncCallback\): void;
request(url: string, options?: HttpRequestOptions): Promise\; | 新增 | | ohos.net.http | HttpRequestOptions | connectTimeout?: number; | 新增 | | ohos.net.http | HttpRequestOptions | readTimeout?: number; | 新增 | | ohos.net.http | HttpRequestOptions | header?: Object; | 新增 | | ohos.net.http | HttpRequestOptions | extraData?: string \| Object \| ArrayBuffer; | 新增 | | ohos.net.http | HttpRequestOptions | method?: RequestMethod; | 新增 | -| ohos.net.http | http | function createHttp(): HttpRequest; | 新增 | +| ohos.net.http | http | createHttp(): HttpRequest; | 新增 | | ohos.net.connection | NetAddress | port?: number; | 新增 | | ohos.net.connection | NetAddress | family?: number; | 新增 | | ohos.net.connection | NetAddress | address: string; | 新增 | @@ -145,9 +145,9 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,网络管理 | ohos.net.connection | RouteInfo | destination: LinkAddress; | 新增 | | ohos.net.connection | RouteInfo | interface: string; | 新增 | | ohos.net.connection | ConnectionProperties | mtu: number; | 新增 | -| ohos.net.connection | ConnectionProperties | routes: Array; | 新增 | -| ohos.net.connection | ConnectionProperties | dnses: Array; | 新增 | -| ohos.net.connection | ConnectionProperties | linkAddresses: Array; | 新增 | +| ohos.net.connection | ConnectionProperties | routes: Array\; | 新增 | +| ohos.net.connection | ConnectionProperties | dnses: Array\; | 新增 | +| ohos.net.connection | ConnectionProperties | linkAddresses: Array\; | 新增 | | ohos.net.connection | ConnectionProperties | domains: string; | 新增 | | ohos.net.connection | ConnectionProperties | interfaceName: string; | 新增 | | ohos.net.connection | NetBearType | BEARER_ETHERNET = 3 | 新增 | @@ -158,29 +158,29 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,网络管理 | ohos.net.connection | NetCap | NET_CAPABILITY_INTERNET = 12 | 新增 | | ohos.net.connection | NetCap | NET_CAPABILITY_NOT_METERED = 11 | 新增 | | ohos.net.connection | NetCap | NET_CAPABILITY_MMS = 0 | 新增 | -| ohos.net.connection | NetCapabilities | bearerTypes: Array; | 新增 | -| ohos.net.connection | NetCapabilities | networkCap?: Array; | 新增 | +| ohos.net.connection | NetCapabilities | bearerTypes: Array\; | 新增 | +| ohos.net.connection | NetCapabilities | networkCap?: Array\; | 新增 | | ohos.net.connection | NetCapabilities | linkDownBandwidthKbps?: number; | 新增 | | ohos.net.connection | NetCapabilities | linkUpBandwidthKbps?: number; | 新增 | -| ohos.net.connection | NetHandle | getAddressByName(host: string, callback: AsyncCallback): void;
getAddressByName(host: string): Promise; | 新增 | -| ohos.net.connection | NetHandle | getAddressesByName(host: string, callback: AsyncCallback>): void;
getAddressesByName(host: string): Promise>; | 新增 | +| ohos.net.connection | NetHandle | getAddressByName(host: string, callback: AsyncCallback\): void;
getAddressByName(host: string): Promise\; | 新增 | +| ohos.net.connection | NetHandle | getAddressesByName(host: string, callback: AsyncCallback\>): void;
getAddressesByName(host: string): Promise\>; | 新增 | | ohos.net.connection | NetHandle | netId: number; | 新增 | | ohos.net.connection | NetSpecifier | bearerPrivateIdentifier?: string; | 新增 | | ohos.net.connection | NetSpecifier | netCapabilities: NetCapabilities; | 新增 | -| ohos.net.connection | NetConnection | unregister(callback: AsyncCallback): void; | 新增 | -| ohos.net.connection | NetConnection | register(callback: AsyncCallback): void; | 新增 | -| ohos.net.connection | NetConnection | on(type: 'netUnavailable', callback: Callback): void; | 新增 | -| ohos.net.connection | NetConnection | on(type: 'netLost', callback: Callback): void; | 新增 | -| ohos.net.connection | NetConnection | on(type: 'netConnectionPropertiesChange', callback: Callback<{ netHandle: NetHandle, connectionProperties: ConnectionProperties }>): void; | 新增 | -| ohos.net.connection | NetConnection | on(type: 'netCapabilitiesChange', callback: Callback<{ netHandle: NetHandle, netCap: NetCapabilities }>): void; | 新增 | -| ohos.net.connection | NetConnection | on(type: 'netBlockStatusChange', callback: Callback<{ netHandle: NetHandle, blocked: boolean }>): void; | 新增 | -| ohos.net.connection | NetConnection | on(type: 'netAvailable', callback: Callback): void; | 新增 | -| ohos.net.connection | connection | function getAddressesByName(host: string, callback: AsyncCallback>): void;
function getAddressesByName(host: string): Promise>; | 新增 | -| ohos.net.connection | connection | function reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback): void;
function reportNetDisconnected(netHandle: NetHandle): Promise; | 新增 | -| ohos.net.connection | connection | function reportNetConnected(netHandle: NetHandle, callback: AsyncCallback): void;
function reportNetConnected(netHandle: NetHandle): Promise; | 新增 | -| ohos.net.connection | connection | function hasDefaultNet(callback: AsyncCallback): void;
function hasDefaultNet(): Promise; | 新增 | -| ohos.net.connection | connection | function getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback): void;
function getNetCapabilities(netHandle: NetHandle): Promise; | 新增 | -| ohos.net.connection | connection | function getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback): void;
function getConnectionProperties(netHandle: NetHandle): Promise; | 新增 | -| ohos.net.connection | connection | function getAllNets(callback: AsyncCallback>): void;
function getAllNets(): Promise>; | 新增 | -| ohos.net.connection | connection | function getDefaultNet(callback: AsyncCallback): void;
function getDefaultNet(): Promise; | 新增 | -| ohos.net.connection | connection | function createNetConnection(netSpecifier?: NetSpecifier, timeout?: number): NetConnection; | 新增 | +| ohos.net.connection | NetConnection | unregister(callback: AsyncCallback\): void; | 新增 | +| ohos.net.connection | NetConnection | register(callback: AsyncCallback\): void; | 新增 | +| ohos.net.connection | NetConnection | on(type: 'netUnavailable', callback: Callback\): void; | 新增 | +| ohos.net.connection | NetConnection | on(type: 'netLost', callback: Callback\): void; | 新增 | +| ohos.net.connection | NetConnection | on(type: 'netConnectionPropertiesChange', callback: Callback\<{ netHandle: NetHandle, connectionProperties: ConnectionProperties }>): void; | 新增 | +| ohos.net.connection | NetConnection | on(type: 'netCapabilitiesChange', callback: Callback\<{ netHandle: NetHandle, netCap: NetCapabilities }>): void; | 新增 | +| ohos.net.connection | NetConnection | on(type: 'netBlockStatusChange', callback: Callback\<{ netHandle: NetHandle, blocked: boolean }>): void; | 新增 | +| ohos.net.connection | NetConnection | on(type: 'netAvailable', callback: Callback\): void; | 新增 | +| ohos.net.connection | connection | getAddressesByName(host: string, callback: AsyncCallback\>): void;
getAddressesByName(host: string): Promise\>; | 新增 | +| ohos.net.connection | connection | reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback\): void;
reportNetDisconnected(netHandle: NetHandle): Promise\; | 新增 | +| ohos.net.connection | connection | reportNetConnected(netHandle: NetHandle, callback: AsyncCallback\): void;
reportNetConnected(netHandle: NetHandle): Promise\; | 新增 | +| ohos.net.connection | connection | hasDefaultNet(callback: AsyncCallback\): void;
hasDefaultNet(): Promise\; | 新增 | +| ohos.net.connection | connection | getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback\): void;
getNetCapabilities(netHandle: NetHandle): Promise\; | 新增 | +| ohos.net.connection | connection | getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback\): void;
getConnectionProperties(netHandle: NetHandle): Promise\; | 新增 | +| ohos.net.connection | connection | getAllNets(callback: AsyncCallback\>): void;
getAllNets(): Promise\>; | 新增 | +| ohos.net.connection | connection | getDefaultNet(callback: AsyncCallback\): void;
getDefaultNet(): Promise\; | 新增 | +| ohos.net.connection | connection | createNetConnection(netSpecifier?: NetSpecifier, timeout?: number): NetConnection; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler.md index d79973a700db099cd4fcdc90d954b7d338911a30..d179dccc1eefbb077f760592b8f0f95a3e3240c2 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler.md @@ -13,11 +13,11 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,资源调度 | ohos.reminderAgent | LocalDateTime | month: number; | 新增 | | ohos.reminderAgent | LocalDateTime | year: number; | 新增 | | ohos.reminderAgent | ReminderRequestTimer | triggerTimeInSeconds: number; | 新增 | -| ohos.reminderAgent | ReminderRequestAlarm | daysOfWeek?: Array; | 新增 | +| ohos.reminderAgent | ReminderRequestAlarm | daysOfWeek?: Array\; | 新增 | | ohos.reminderAgent | ReminderRequestAlarm | minute: number; | 新增 | | ohos.reminderAgent | ReminderRequestAlarm | hour: number; | 新增 | -| ohos.reminderAgent | ReminderRequestCalendar | repeatDays?: Array; | 新增 | -| ohos.reminderAgent | ReminderRequestCalendar | repeatMonths?: Array; | 新增 | +| ohos.reminderAgent | ReminderRequestCalendar | repeatDays?: Array\; | 新增 | +| ohos.reminderAgent | ReminderRequestCalendar | repeatMonths?: Array\; | 新增 | | ohos.reminderAgent | ReminderRequestCalendar | dateTime: LocalDateTime; | 新增 | | ohos.reminderAgent | ReminderRequest | slotType?: notification.SlotType; | 新增 | | ohos.reminderAgent | ReminderRequest | notificationId?: number; | 新增 | @@ -43,21 +43,21 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,资源调度 | ohos.reminderAgent | ReminderType | REMINDER_TYPE_TIMER = 0 | 新增 | | ohos.reminderAgent | ActionButtonType | ACTION_BUTTON_TYPE_SNOOZE = 1 | 新增 | | ohos.reminderAgent | ActionButtonType | ACTION_BUTTON_TYPE_CLOSE = 0 | 新增 | -| ohos.reminderAgent | reminderAgent | function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void;
function removeNotificationSlot(slotType: notification.SlotType): Promise; | 新增 | -| ohos.reminderAgent | reminderAgent | function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void;
function addNotificationSlot(slot: NotificationSlot): Promise; | 新增 | -| ohos.reminderAgent | reminderAgent | function cancelAllReminders(callback: AsyncCallback): void;
function cancelAllReminders(): Promise; | 新增 | -| ohos.reminderAgent | reminderAgent | function getValidReminders(callback: AsyncCallback>): void;
function getValidReminders(): Promise>; | 新增 | -| ohos.reminderAgent | reminderAgent | function cancelReminder(reminderId: number, callback: AsyncCallback): void;
function cancelReminder(reminderId: number): Promise; | 新增 | -| ohos.reminderAgent | reminderAgent | function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void;
function publishReminder(reminderReq: ReminderRequest): Promise; | 新增 | -| ohos.bundleState | bundleState | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void;
function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; | 新增 | +| ohos.reminderAgent | reminderAgent | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback\): void;
removeNotificationSlot(slotType: notification.SlotType): Promise\; | 新增 | +| ohos.reminderAgent | reminderAgent | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback\): void;
addNotificationSlot(slot: NotificationSlot): Promise\; | 新增 | +| ohos.reminderAgent | reminderAgent | cancelAllReminders(callback: AsyncCallback\): void;
cancelAllReminders(): Promise\; | 新增 | +| ohos.reminderAgent | reminderAgent | getValidReminders(callback: AsyncCallback\>): void;
getValidReminders(): Promise\>; | 新增 | +| ohos.reminderAgent | reminderAgent | cancelReminder(reminderId: number, callback: AsyncCallback\): void;
cancelReminder(reminderId: number): Promise\; | 新增 | +| ohos.reminderAgent | reminderAgent | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\): void;
publishReminder(reminderReq: ReminderRequest): Promise\; | 新增 | +| ohos.bundleState | bundleState | queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback\>): void;
queryCurrentBundleActiveStates(begin: number, end: number): Promise\>; | 新增 | | ohos.bundleState | IntervalType | BY_ANNUALLY = 4 | 新增 | | ohos.bundleState | IntervalType | BY_MONTHLY = 3 | 新增 | | ohos.bundleState | IntervalType | BY_WEEKLY = 2 | 新增 | | ohos.bundleState | IntervalType | BY_DAILY = 1 | 新增 | | ohos.bundleState | IntervalType | BY_OPTIMIZED = 0 | 新增 | | ohos.bundleState | BundleActiveInfoResponse | [key: string]: BundleStateInfo; | 新增 | -| ohos.bundleState | bundleState | function queryAppUsagePriorityGroup(callback: AsyncCallback): void;
function queryAppUsagePriorityGroup(): Promise; | 新增 | -| ohos.bundleState | bundleState | function isIdleState(bundleName: string, callback: AsyncCallback): void;
function isIdleState(bundleName: string): Promise; | 新增 | +| ohos.bundleState | bundleState | queryAppUsagePriorityGroup(callback: AsyncCallback\): void;
queryAppUsagePriorityGroup(): Promise\; | 新增 | +| ohos.bundleState | bundleState | isIdleState(bundleName: string, callback: AsyncCallback\): void;
isIdleState(bundleName: string): Promise\; | 新增 | | ohos.bundleState | BundleActiveState | stateType?: number; | 新增 | | ohos.bundleState | BundleActiveState | stateOccurredTime?: number; | 新增 | | ohos.bundleState | BundleActiveState | nameOfClass?: string; | 新增 | @@ -82,10 +82,10 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,资源调度 | ohos.backgroundTaskManager | BackgroundMode | AUDIO_RECORDING = 3 | 新增 | | ohos.backgroundTaskManager | BackgroundMode | AUDIO_PLAYBACK = 2 | 新增 | | ohos.backgroundTaskManager | BackgroundMode | DATA_TRANSFER = 1 | 新增 | -| ohos.backgroundTaskManager | backgroundTaskManager | function stopBackgroundRunning(context: Context, callback: AsyncCallback): void;
function stopBackgroundRunning(context: Context): Promise; | 新增 | -| ohos.backgroundTaskManager | backgroundTaskManager | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void;
function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; | 新增 | -| ohos.backgroundTaskManager | backgroundTaskManager | function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; | 新增 | -| ohos.backgroundTaskManager | backgroundTaskManager | function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void;
function getRemainingDelayTime(requestId: number): Promise; | 新增 | -| ohos.backgroundTaskManager | backgroundTaskManager | function cancelSuspendDelay(requestId: number): void; | 新增 | +| ohos.backgroundTaskManager | backgroundTaskManager | stopBackgroundRunning(context: Context, callback: AsyncCallback\): void;
stopBackgroundRunning(context: Context): Promise\; | 新增 | +| ohos.backgroundTaskManager | backgroundTaskManager | startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback\): void;
startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise\; | 新增 | +| ohos.backgroundTaskManager | backgroundTaskManager | requestSuspendDelay(reason: string, callback: Callback\): DelaySuspendInfo; | 新增 | +| ohos.backgroundTaskManager | backgroundTaskManager | getRemainingDelayTime(requestId: number, callback: AsyncCallback\): void;
getRemainingDelayTime(requestId: number): Promise\; | 新增 | +| ohos.backgroundTaskManager | backgroundTaskManager | cancelSuspendDelay(requestId: number): void; | 新增 | | ohos.backgroundTaskManager | DelaySuspendInfo | actualDelayTime: number; | 新增 | | ohos.backgroundTaskManager | DelaySuspendInfo | requestId: number; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler_api-9-canary.md index 5e1c6296318de10290c024c48718454c37ec0cf7..d39199e75639672ed1d72207abb9d7eaa716d171 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler_api-9-canary.md @@ -22,12 +22,12 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,资源调 | ohos.workScheduler | NetworkType | NETWORK_TYPE_WIFI | 新增 | | ohos.workScheduler | NetworkType | NETWORK_TYPE_MOBILE | 新增 | | ohos.workScheduler | NetworkType | NETWORK_TYPE_ANY = 0 | 新增 | -| ohos.workScheduler | workScheduler | function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean;
function isLastWorkTimeOut(workId: number): Promise; | 新增 | -| ohos.workScheduler | workScheduler | function stopAndClearWorks(): boolean; | 新增 | -| ohos.workScheduler | workScheduler | function obtainAllWorks(callback: AsyncCallback): Array;
function obtainAllWorks(): Promise>; | 新增 | -| ohos.workScheduler | workScheduler | function getWorkStatus(workId: number, callback: AsyncCallback): void;
function getWorkStatus(workId: number): Promise; | 新增 | -| ohos.workScheduler | workScheduler | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | 新增 | -| ohos.workScheduler | workScheduler | function startWork(work: WorkInfo): boolean; | 新增 | +| ohos.workScheduler | workScheduler | isLastWorkTimeOut(workId: number, callback: AsyncCallback\): boolean;
isLastWorkTimeOut(workId: number): Promise\; | 新增 | +| ohos.workScheduler | workScheduler | stopAndClearWorks(): boolean; | 新增 | +| ohos.workScheduler | workScheduler | obtainAllWorks(callback: AsyncCallback\): Array\;
obtainAllWorks(): Promise\>; | 新增 | +| ohos.workScheduler | workScheduler | getWorkStatus(workId: number, callback: AsyncCallback\): void;
getWorkStatus(workId: number): Promise\; | 新增 | +| ohos.workScheduler | workScheduler | stopWork(work: WorkInfo, needCancel?: boolean): boolean; | 新增 | +| ohos.workScheduler | workScheduler | startWork(work: WorkInfo): boolean; | 新增 | | ohos.workScheduler | WorkInfo | idleWaitTime?: number; | 新增 | | ohos.workScheduler | WorkInfo | isDeepIdle?: boolean; | 新增 | | ohos.workScheduler | WorkInfo | repeatCount?: number; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-security.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-security.md index 6131699b92d239f0b92c5fe9d7b5a2a21486f503..9cd1e3a364bfcb813c21837eb3cf6933f8fb7ba8 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-security.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-security.md @@ -82,12 +82,12 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,安全子系 | ohos.security.huks | HuksTag | HUKS_TAG_PURPOSE = HuksTagType.HUKS_TAG_TYPE_UINT \| 2 | 新增 | | ohos.security.huks | HuksTag | HUKS_TAG_ALGORITHM = HuksTagType.HUKS_TAG_TYPE_UINT \| 1 | 新增 | | ohos.security.huks | HuksTag | HUKS_TAG_INVALID = HuksTagType.HUKS_TAG_TYPE_INVALID \| 0 | 新增 | -| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_BYTES = 5 << 28 | 新增 | -| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_BOOL = 4 << 28 | 新增 | -| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_ULONG = 3 << 28 | 新增 | -| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_UINT = 2 << 28 | 新增 | -| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_INT = 1 << 28 | 新增 | -| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_INVALID = 0 << 28 | 新增 | +| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_BYTES = 5 \<\< 28 | 新增 | +| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_BOOL = 4 \<\< 28 | 新增 | +| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_ULONG = 3 \<\< 28 | 新增 | +| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_UINT = 2 \<\< 28 | 新增 | +| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_INT = 1 \<\< 28 | 新增 | +| ohos.security.huks | HuksTagType | HUKS_TAG_TYPE_INVALID = 0 \<\< 28 | 新增 | | ohos.security.huks | HuksSendType | HUKS_SEND_TYPE_SYNC = 1 | 新增 | | ohos.security.huks | HuksSendType | HUKS_SEND_TYPE_ASYNC = 0 | 新增 | | ohos.security.huks | HuksKeyStorageType | HUKS_STORAGE_PERSISTENT = 1 | 新增 | @@ -223,25 +223,25 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,安全子系 | ohos.security.huks | HuksErrorCode | HUKS_ERROR_BAD_STATE = -2 | 新增 | | ohos.security.huks | HuksErrorCode | HUKS_FAILURE = -1 | 新增 | | ohos.security.huks | HuksErrorCode | HUKS_SUCCESS = 0 | 新增 | -| ohos.security.huks | HuksResult | certChains?: Array; | 新增 | -| ohos.security.huks | HuksResult | properties?: Array; | 新增 | +| ohos.security.huks | HuksResult | certChains?: Array\; | 新增 | +| ohos.security.huks | HuksResult | properties?: Array\; | 新增 | | ohos.security.huks | HuksResult | outData?: Uint8Array; | 新增 | | ohos.security.huks | HuksResult | errorCode: number; | 新增 | | ohos.security.huks | HuksOptions | inData?: Uint8Array; | 新增 | -| ohos.security.huks | HuksOptions | properties?: Array; | 新增 | +| ohos.security.huks | HuksOptions | properties?: Array\; | 新增 | | ohos.security.huks | HuksHandle | token?: Uint8Array; | 新增 | | ohos.security.huks | HuksHandle | handle: number; | 新增 | | ohos.security.huks | HuksHandle | errorCode: number; | 新增 | | ohos.security.huks | HuksParam | value: boolean \| number \| bigint \| Uint8Array; | 新增 | | ohos.security.huks | HuksParam | tag: HuksTag; | 新增 | -| ohos.security.huks | huks | function getSdkVersion(options: HuksOptions) : string; | 新增 | -| ohos.security.huks | huks | function abort(handle: number, options: HuksOptions, callback: AsyncCallback) : void;
function abort(handle: number, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function finish(handle: number, options: HuksOptions, callback: AsyncCallback) : void;
function finish(handle: number, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function update(handle: number, token?: Uint8Array, options: HuksOptions, callback: AsyncCallback) : void;
function update(handle: number, token?: Uint8Array, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function init(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void;
function init(keyAlias: string, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function isKeyExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void;
function isKeyExist(keyAlias: string, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function getKeyProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void;
function getKeyProperties(keyAlias: string, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function exportKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void;
function exportKey(keyAlias: string, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function importKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void;
function importKey(keyAlias: string, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function deleteKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void;
function deleteKey(keyAlias: string, options: HuksOptions) : Promise; | 新增 | -| ohos.security.huks | huks | function generateKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback) : void;
function generateKey(keyAlias: string, options: HuksOptions) : Promise; | 新增 | +| ohos.security.huks | huks | getSdkVersion(options: HuksOptions) : string; | 新增 | +| ohos.security.huks | huks | abort(handle: number, options: HuksOptions, callback: AsyncCallback\) : void;
abort(handle: number, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | finish(handle: number, options: HuksOptions, callback: AsyncCallback\) : void;
finish(handle: number, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | update(handle: number, token?: Uint8Array, options: HuksOptions, callback: AsyncCallback\) : void;
update(handle: number, token?: Uint8Array, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | init(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void;
init(keyAlias: string, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | isKeyExist(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void;
isKeyExist(keyAlias: string, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | getKeyProperties(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void;
getKeyProperties(keyAlias: string, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | exportKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void;
exportKey(keyAlias: string, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | importKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void;
importKey(keyAlias: string, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | deleteKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void;
deleteKey(keyAlias: string, options: HuksOptions) : Promise\; | 新增 | +| ohos.security.huks | huks | generateKey(keyAlias: string, options: HuksOptions, callback: AsyncCallback\) : void;
generateKey(keyAlias: string, options: HuksOptions) : Promise\; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-sensor.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-sensor.md index 5f954b20ef74c120f6575b251002029533a34609..f8b22e36c1a572754509d0ab8721b54696b1c1a0 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-sensor.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-sensor.md @@ -9,8 +9,8 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,泛Sensor子 | ohos.vibrator | VibratorStopMode | VIBRATOR_STOP_MODE_PRESET = "preset" | 新增 | | ohos.vibrator | VibratorStopMode | VIBRATOR_STOP_MODE_TIME = "time" | 新增 | | ohos.vibrator | EffectId | EFFECT_CLOCK_TIMER = "haptic.clock.timer" | 新增 | -| ohos.vibrator | vibrator | function stop(stopMode: VibratorStopMode): Promise;
function stop(stopMode: VibratorStopMode, callback?: AsyncCallback): void; | 新增 | -| ohos.vibrator | vibrator | function vibrate(duration: number, callback?: AsyncCallback): void;
function vibrate(duration: number): Promise;
function vibrate(effectId: EffectId): Promise;
function vibrate(effectId: EffectId, callback?: AsyncCallback): void; | 新增 | +| ohos.vibrator | vibrator | stop(stopMode: VibratorStopMode): Promise\;
stop(stopMode: VibratorStopMode, callback?: AsyncCallback\): void; | 新增 | +| ohos.vibrator | vibrator | vibrate(duration: number, callback?: AsyncCallback\): void;
vibrate(duration: number): Promise\;
vibrate(effectId: EffectId): Promise\;
vibrate(effectId: EffectId, callback?: AsyncCallback\): void; | 新增 | | ohos.sensor | WearDetectionResponse | value: number; | 新增 | | ohos.sensor | HeartRateResponse | heartRate: number; | 新增 | | ohos.sensor | BarometerResponse | pressure: number; | 新增 | @@ -85,18 +85,18 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,泛Sensor子 | ohos.sensor | SensorType | SENSOR_TYPE_ID_GYROSCOPE = 2 | 新增 | | ohos.sensor | SensorType | SENSOR_TYPE_ID_ACCELEROMETER = 1 | 新增 | | ohos.sensor | Options | interval?: number; | 新增 | -| ohos.sensor | RotationMatrixResponse | inclination: Array | 新增 | -| ohos.sensor | RotationMatrixResponse | rotation: Array; | 新增 | -| ohos.sensor | sensor | function getDirection(rotationMatrix: Array, callback: AsyncCallback>): void;
function getDirection(rotationMatrix: Array): Promise>; | 新增 | -| ohos.sensor | sensor | function createQuaternion(rotationVector: Array, callback: AsyncCallback>): void;
function createQuaternion(rotationVector: Array): Promise>; | 新增 | -| ohos.sensor | sensor | function transformCoordinateSystem(inRotationVector: Array, coordinates: CoordinatesOptions, callback: AsyncCallback>): void;
function transformCoordinateSystem(inRotationVector: Array, coordinates: CoordinatesOptions): Promise>; | 新增 | +| ohos.sensor | RotationMatrixResponse | inclination: Array\ | 新增 | +| ohos.sensor | RotationMatrixResponse | rotation: Array\; | 新增 | +| ohos.sensor | sensor | getDirection(rotationMatrix: Array\, callback: AsyncCallback\>): void;
getDirection(rotationMatrix: Array\): Promise\>; | 新增 | +| ohos.sensor | sensor | createQuaternion(rotationVector: Array\, callback: AsyncCallback\>): void;
createQuaternion(rotationVector: Array\): Promise\>; | 新增 | +| ohos.sensor | sensor | transformCoordinateSystem(inRotationVector: Array\, coordinates: CoordinatesOptions, callback: AsyncCallback\>): void;
transformCoordinateSystem(inRotationVector: Array\, coordinates: CoordinatesOptions): Promise\>; | 新增 | | ohos.sensor | CoordinatesOptions | y: number; | 新增 | | ohos.sensor | CoordinatesOptions | x: number; | 新增 | -| ohos.sensor | sensor | function createRotationMatrix(rotationVector: Array, callback: AsyncCallback>): void;
function createRotationMatrix(rotationVector: Array): Promise>;
function createRotationMatrix(gravity: Array, geomagnetic: Array, callback: AsyncCallback): void;
function createRotationMatrix(gravity: Array, geomagnetic: Array,): Promise; | 新增 | -| ohos.sensor | sensor | function getAngleModify(currentRotationMatrix: Array, preRotationMatrix: Array, callback: AsyncCallback>): void;
function getAngleModify(currentRotationMatrix: Array, preRotationMatrix: Array): Promise>;| 新增 | -| ohos.sensor | sensor | function getGeomagneticDip(inclinationMatrix: Array, callback: AsyncCallback): void;
function getGeomagneticDip(inclinationMatrix: Array): Promise; | 新增 | -| ohos.sensor | sensor | function getAltitude(seaPressure: number, currentPressure: number, callback: AsyncCallback): void;
function getAltitude(seaPressure: number, currentPressure: number): Promise; | 新增 | -| ohos.sensor | sensor | function getGeomagneticField(locationOptions: LocationOptions, timeMillis: number, callback: AsyncCallback): void;
function getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise; | 新增 | +| ohos.sensor | sensor | createRotationMatrix(rotationVector: Array\, callback: AsyncCallback\>): void;
createRotationMatrix(rotationVector: Array\): Promise\>;
createRotationMatrix(gravity: Array\, geomagnetic: Array\, callback: AsyncCallback\): void;
createRotationMatrix(gravity: Array\, geomagnetic: Array\,): Promise\; | 新增 | +| ohos.sensor | sensor | getAngleModify(currentRotationMatrix: Array\, preRotationMatrix: Array\, callback: AsyncCallback\>): void;
getAngleModify(currentRotationMatrix: Array\, preRotationMatrix: Array\): Promise\>; | 新增 | +| ohos.sensor | sensor | getGeomagneticDip(inclinationMatrix: Array\, callback: AsyncCallback\): void;
getGeomagneticDip(inclinationMatrix: Array\): Promise\; | 新增 | +| ohos.sensor | sensor | getAltitude(seaPressure: number, currentPressure: number, callback: AsyncCallback\): void;
getAltitude(seaPressure: number, currentPressure: number): Promise\; | 新增 | +| ohos.sensor | sensor | getGeomagneticField(locationOptions: LocationOptions, timeMillis: number, callback: AsyncCallback\): void;
getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise\; | 新增 | | ohos.sensor | GeomagneticResponse | totalIntensity: number; | 新增 | | ohos.sensor | GeomagneticResponse | levelIntensity: number; | 新增 | | ohos.sensor | GeomagneticResponse | deflectionAngle: number; | 新增 | @@ -107,6 +107,6 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,泛Sensor子 | ohos.sensor | LocationOptions | altitude: number; | 新增 | | ohos.sensor | LocationOptions | longitude: number; | 新增 | | ohos.sensor | LocationOptions | latitude: number; | 新增 | -| ohos.sensor | sensor | function off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_HALL, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback?: Callback): void;
function off(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback?: Callback): void;| 新增 | -| ohos.sensor | sensor | function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback): void;
function once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback): void; | 新增 | -| ohos.sensor | sensor | function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback, options?: Options): void;
function on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback, options?: Options): void; | 新增 | \ No newline at end of file +| ohos.sensor | sensor | off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_HALL, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback?: Callback\): void;
off(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback?: Callback\): void; | 新增 | +| ohos.sensor | sensor | once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback\): void;
once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback\): void; | 新增 | +| ohos.sensor | sensor | on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback\, options?: Options): void;
on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback\, options?: Options): void; | 新增 | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-settings.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-settings.md index a14266c90a2e4beb5b8108cf450b5f8cdb882d1e..a46ac582cf89ebab0061fcd0265bac857f2810a2 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-settings.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-settings.md @@ -6,13 +6,13 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,应用子系 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.settings | settings | function setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean; | 新增 | -| ohos.settings | settings | function getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string; | 新增 | -| ohos.settings | settings | function getUriSync(name: string): string; | 新增 | -| ohos.settings | settings | function canShowFloating(callback: AsyncCallback): void;
function canShowFloating(): Promise; | 新增 | -| ohos.settings | settings | function enableAirplaneMode(enable: boolean, callback: AsyncCallback): void;
function enableAirplaneMode(enable: boolean): Promise; | 新增 | -| ohos.settings | settings | function getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback): void;
function getValue(dataAbilityHelper: DataAbilityHelper, name: string): Promise; | 新增 | -| ohos.settings | settings | function getURI(name: string, callback: AsyncCallback): void;
function getURI(name: string): Promise; | 新增 | +| ohos.settings | settings | setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean; | 新增 | +| ohos.settings | settings | getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string; | 新增 | +| ohos.settings | settings | getUriSync(name: string): string; | 新增 | +| ohos.settings | settings | canShowFloating(callback: AsyncCallback\): void;
canShowFloating(): Promise\; | 新增 | +| ohos.settings | settings | enableAirplaneMode(enable: boolean, callback: AsyncCallback\): void;
enableAirplaneMode(enable: boolean): Promise\; | 新增 | +| ohos.settings | settings | getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback\): void;
getValue(dataAbilityHelper: DataAbilityHelper, name: string): Promise\; | 新增 | +| ohos.settings | settings | getURI(name: string, callback: AsyncCallback\): void;
getURI(name: string): Promise\; | 新增 | | ohos.settings | wireless | const WIFI_WATCHDOG_STATUS: string | 新增 | | ohos.settings | wireless | const WIFI_STATUS: string | 新增 | | ohos.settings | wireless | const WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT: string | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-telephony.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-telephony.md index 7e206375dc20eaef97801219064ac480e2aeb5db..6c0d704c3bf536386f887bfd82fb6f31a33dc5e8 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-telephony.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-telephony.md @@ -6,7 +6,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,电话服务 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.telephony.sms | sms | function hasSmsCapability(): boolean; | 新增 | +| ohos.telephony.sms | sms | hasSmsCapability(): boolean; | 新增 | | ohos.telephony.sim | CardType | SINGLE_MODE_ISIM_CARD = 60 | 新增 | | ohos.telephony.sim | CardType | DUAL_MODE_UG_CARD = 50 | 新增 | | ohos.telephony.sim | CardType | DUAL_MODE_TELECOM_LTE_CARD = 43 | 新增 | @@ -17,15 +17,15 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,电话服务 | ohos.telephony.sim | CardType | SINGLE_MODE_USIM_CARD = 20 | 新增 | | ohos.telephony.sim | CardType | SINGLE_MODE_SIM_CARD = 10 | 新增 | | ohos.telephony.sim | CardType | UNKNOWN_CARD = -1 | 新增 | -| ohos.telephony.sim | sim | function hasSimCard(slotId: number, callback: AsyncCallback): void;
function hasSimCard(slotId: number): Promise; | 新增 | -| ohos.telephony.sim | sim | function getMaxSimCount(): number; | 新增 | -| ohos.telephony.sim | sim | function getCardType(slotId: number, callback: AsyncCallback): void;
function getCardType(slotId: number): Promise; | 新增 | -| ohos.telephony.sim | sim | function hasOperatorPrivileges(slotId: number, callback: AsyncCallback): void;
function hasOperatorPrivileges(slotId: number): Promise; | 新增 | -| ohos.telephony.sim | sim | function isSimActive(slotId: number, callback: AsyncCallback): void;
function isSimActive(slotId: number): Promise; | 新增 | +| ohos.telephony.sim | sim | hasSimCard(slotId: number, callback: AsyncCallback\): void;
hasSimCard(slotId: number): Promise\; | 新增 | +| ohos.telephony.sim | sim | getMaxSimCount(): number; | 新增 | +| ohos.telephony.sim | sim | getCardType(slotId: number, callback: AsyncCallback\): void;
getCardType(slotId: number): Promise\; | 新增 | +| ohos.telephony.sim | sim | hasOperatorPrivileges(slotId: number, callback: AsyncCallback\): void;
hasOperatorPrivileges(slotId: number): Promise\; | 新增 | +| ohos.telephony.sim | sim | isSimActive(slotId: number, callback: AsyncCallback\): void;
isSimActive(slotId: number): Promise\; | 新增 | | ohos.telephony.radio | NetworkState | cfgTech: RadioTechnology; | 新增 | -| ohos.telephony.radio | radio | function getOperatorName(slotId: number, callback: AsyncCallback): void;
function getOperatorName(slotId: number): Promise; | 新增 | -| ohos.telephony.radio | radio | function isNrSupported(): boolean;
function isNrSupported(slotId: number): boolean; | 新增 | -| ohos.telephony.radio | radio | function getPrimarySlotId(callback: AsyncCallback): void;
function getPrimarySlotId(): Promise; | 新增 | +| ohos.telephony.radio | radio | getOperatorName(slotId: number, callback: AsyncCallback\): void;
getOperatorName(slotId: number): Promise\; | 新增 | +| ohos.telephony.radio | radio | isNrSupported(): boolean;
isNrSupported(slotId: number): boolean; | 新增 | +| ohos.telephony.radio | radio | getPrimarySlotId(callback: AsyncCallback\): void;
getPrimarySlotId(): Promise\; | 新增 | | ohos.telephony.observer | LockReason | SIM_SIM_PUK | 新增 | | ohos.telephony.observer | LockReason | SIM_SIM_PIN | 新增 | | ohos.telephony.observer | LockReason | SIM_PC_PUK | 新增 | @@ -42,12 +42,12 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,电话服务 | ohos.telephony.observer | SimStateData | reason: LockReason; | 新增 | | ohos.telephony.observer | SimStateData | state: SimState; | 新增 | | ohos.telephony.observer | SimStateData | type: CardType; | 新增 | -| ohos.telephony.observer | observer | function off(type: 'simStateChange', callback?: Callback): void; | 新增 | -| ohos.telephony.observer | observer | function on(type: 'simStateChange', callback: Callback): void;
function on(type: 'simStateChange', options: { slotId: number }, callback: Callback): void; | 新增 | -| ohos.telephony.observer | observer | function off(type: 'cellularDataFlowChange', callback?: Callback): void; | 新增 | -| ohos.telephony.observer | observer | function on(type: 'cellularDataFlowChange', callback: Callback): void;
function on(type: 'cellularDataFlowChange', options: { slotId: number },callback: Callback): void;| 新增 | -| ohos.telephony.observer | observer | function off(type: 'cellularDataConnectionStateChange',callback?: Callback<{ state: DataConnectState, network: RatType }>): void;| 新增 | -| ohos.telephony.observer | observer | function on(type: 'cellularDataConnectionStateChange', callback: Callback<{ state: DataConnectState, network: RatType }>): void;
function on(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback<{ state: DataConnectState, network: RatType }>): void; | 新增 | +| ohos.telephony.observer | observer | off(type: 'simStateChange', callback?: Callback\): void; | 新增 | +| ohos.telephony.observer | observer | on(type: 'simStateChange', callback: Callback\): void;
on(type: 'simStateChange', options: { slotId: number }, callback: Callback\): void; | 新增 | +| ohos.telephony.observer | observer | off(type: 'cellularDataFlowChange', callback?: Callback\): void; | 新增 | +| ohos.telephony.observer | observer | on(type: 'cellularDataFlowChange', callback: Callback\): void;
on(type: 'cellularDataFlowChange', options: { slotId: number },callback: Callback\): void; | 新增 | +| ohos.telephony.observer | observer | off(type: 'cellularDataConnectionStateChange',callback?: Callback\<{ state: DataConnectState, network: RatType }>): void; | 新增 | +| ohos.telephony.observer | observer | on(type: 'cellularDataConnectionStateChange', callback: Callback\<{ state: DataConnectState, network: RatType }>): void;
on(type: 'cellularDataConnectionStateChange', options: { slotId: number }, callback: Callback\<{ state: DataConnectState, network: RatType }>): void; | 新增 | | ohos.telephony.data | DataConnectState | DATA_STATE_SUSPENDED = 3 | 新增 | | ohos.telephony.data | DataConnectState | DATA_STATE_CONNECTED = 2 | 新增 | | ohos.telephony.data | DataConnectState | DATA_STATE_CONNECTING = 1 | 新增 | @@ -58,13 +58,13 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,电话服务 | ohos.telephony.data | DataFlowType | DATA_FLOW_TYPE_UP = 2 | 新增 | | ohos.telephony.data | DataFlowType | DATA_FLOW_TYPE_DOWN = 1 | 新增 | | ohos.telephony.data | DataFlowType | DATA_FLOW_TYPE_NONE = 0 | 新增 | -| ohos.telephony.data | data | function isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback): void;
function isCellularDataRoamingEnabled(slotId: number): Promise; | 新增 | -| ohos.telephony.data | data | function isCellularDataEnabled(callback: AsyncCallback): void;
function isCellularDataEnabled(): Promise; | 新增 | -| ohos.telephony.data | data | function getCellularDataState(callback: AsyncCallback): void;
function getCellularDataState(): Promise; | 新增 | -| ohos.telephony.data | data | function getCellularDataFlowType(callback: AsyncCallback): void;
function getCellularDataFlowType(): Promise; | 新增 | -| ohos.telephony.data | data | function getDefaultCellularDataSlotId(callback: AsyncCallback): void;
function getDefaultCellularDataSlotId(): Promise; | 新增 | -| ohos.telephony.call | call | function hasVoiceCapability(): boolean; | 新增 | -| ohos.telephony.call | call | function makeCall(phoneNumber: string, callback: AsyncCallback): void;
function makeCall(phoneNumber: string): Promise; | 新增 | +| ohos.telephony.data | data | isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\): void;
isCellularDataRoamingEnabled(slotId: number): Promise\; | 新增 | +| ohos.telephony.data | data | isCellularDataEnabled(callback: AsyncCallback\): void;
isCellularDataEnabled(): Promise\; | 新增 | +| ohos.telephony.data | data | getCellularDataState(callback: AsyncCallback\): void;
getCellularDataState(): Promise\; | 新增 | +| ohos.telephony.data | data | getCellularDataFlowType(callback: AsyncCallback\): void;
getCellularDataFlowType(): Promise\; | 新增 | +| ohos.telephony.data | data | getDefaultCellularDataSlotId(callback: AsyncCallback\): void;
getDefaultCellularDataSlotId(): Promise\; | 新增 | +| ohos.telephony.call | call | hasVoiceCapability(): boolean; | 新增 | +| ohos.telephony.call | call | makeCall(phoneNumber: string, callback: AsyncCallback\): void;
makeCall(phoneNumber: string): Promise\; | 新增 | | ohos.contact | Website | website: string | 新增 | | ohos.contact | SipAddress | labelId: number | 新增 | | ohos.contact | SipAddress | sipAddress: string | 新增 | @@ -214,17 +214,17 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,电话服务 | ohos.contact | Contact | readonly key: string | 新增 | | ohos.contact | Contact | readonly id: number | 新增 | | ohos.contact | Contact | static readonly INVALID_CONTACT_ID: -1 | 新增 | -| ohos.contact | contact | function isMyCard(id: number, callback: AsyncCallback): void;
function isMyCard(id: number): Promise; | 新增 | -| ohos.contact | contact | function isLocalContact(id: number, callback: AsyncCallback): void;
function isLocalContact(id: number): Promise; | 新增 | -| ohos.contact | contact | function updateContact(contact: Contact, callback: AsyncCallback): void;
function updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallback): void;
function updateContact(contact: Contact, attrs?: ContactAttributes): Promise; | 新增 | -| ohos.contact | contact | function queryMyCard(callback: AsyncCallback): void;
function queryMyCard(attrs: ContactAttributes, callback: AsyncCallback): void;
function queryMyCard(attrs?: ContactAttributes): Promise; | 新增 | -| ohos.contact | contact | function queryKey(id: number, callback: AsyncCallback): void;
function queryKey(id: number, holder: Holder, callback: AsyncCallback): void;
function queryKey(id: number, holder?: Holder): Promise; | 新增 | -| ohos.contact | contact | function queryHolders(callback: AsyncCallback>): void;
function queryHolders(): Promise>; | 新增 | -| ohos.contact | contact | function queryGroups(callback: AsyncCallback>): void;
function queryGroups(holder: Holder, callback: AsyncCallback>): void;
function queryGroups(holder?: Holder): Promise>; | 新增 | -| ohos.contact | contact | function queryContactsByPhoneNumber(phoneNumber: string, callback: AsyncCallback>): void;
function queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, callback: AsyncCallback>): void;
function queryContactsByPhoneNumber(phoneNumber: string, attrs: ContactAttributes, callback: AsyncCallback>): void;
function queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback>): void;
function queryContactsByPhoneNumber(phoneNumber: string, holder?: Holder, attrs?: ContactAttributes): Promise>; | 新增 | -| ohos.contact | contact | function queryContactsByEmail(email: string, callback: AsyncCallback>): void;
function queryContactsByEmail(email: string, holder: Holder, callback: AsyncCallback>): void;
function queryContactsByEmail(email: string, attrs: ContactAttributes, callback: AsyncCallback>): void;
function queryContactsByEmail(email: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback>): void;
function queryContactsByEmail(email: string, holder?: Holder, attrs?: ContactAttributes): Promise>; | 新增 | -| ohos.contact | contact | function queryContacts(callback: AsyncCallback>): void;
function queryContacts(holder: Holder, callback: AsyncCallback>): void;
function queryContacts(attrs: ContactAttributes, callback: AsyncCallback>): void;
function queryContacts(holder: Holder, attrs: ContactAttributes, callback: AsyncCallback>): void;
function queryContacts(holder?: Holder, attrs?: ContactAttributes): Promise>; | 新增 | -| ohos.contact | contact | function queryContact(key: string, callback: AsyncCallback): void;
function queryContact(key: string, holder: Holder, callback: AsyncCallback): void;
function queryContact(key: string, attrs: ContactAttributes, callback: AsyncCallback): void;
function queryContact(key: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback): void;
function queryContact(key: string, holder?: Holder, attrs?: ContactAttributes): Promise; | 新增 | -| ohos.contact | contact | function deleteContact(key: string, callback: AsyncCallback): void;
function deleteContact(key: string): Promise; | 新增 | -| ohos.contact | contact | function selectContact(callback: AsyncCallback>): void;
function selectContact(): Promise>; | 新增 | -| ohos.contact | contact | function addContact(contact: Contact, callback: AsyncCallback): void;
function addContact(contact: Contact): Promise; | 新增 | +| ohos.contact | contact | isMyCard(id: number, callback: AsyncCallback\): void;
isMyCard(id: number): Promise\; | 新增 | +| ohos.contact | contact | isLocalContact(id: number, callback: AsyncCallback\): void;
isLocalContact(id: number): Promise\; | 新增 | +| ohos.contact | contact | updateContact(contact: Contact, callback: AsyncCallback\): void;
updateContact(contact: Contact, attrs: ContactAttributes, callback: AsyncCallback\): void;
updateContact(contact: Contact, attrs?: ContactAttributes): Promise\; | 新增 | +| ohos.contact | contact | queryMyCard(callback: AsyncCallback\): void;
queryMyCard(attrs: ContactAttributes, callback: AsyncCallback\): void;
queryMyCard(attrs?: ContactAttributes): Promise\; | 新增 | +| ohos.contact | contact | queryKey(id: number, callback: AsyncCallback\): void;
queryKey(id: number, holder: Holder, callback: AsyncCallback\): void;
queryKey(id: number, holder?: Holder): Promise\; | 新增 | +| ohos.contact | contact | queryHolders(callback: AsyncCallback\>): void;
queryHolders(): Promise\>; | 新增 | +| ohos.contact | contact | queryGroups(callback: AsyncCallback\>): void;
queryGroups(holder: Holder, callback: AsyncCallback\>): void;
queryGroups(holder?: Holder): Promise\>; | 新增 | +| ohos.contact | contact | queryContactsByPhoneNumber(phoneNumber: string, callback: AsyncCallback\>): void;
queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, callback: AsyncCallback\>): void;
queryContactsByPhoneNumber(phoneNumber: string, attrs: ContactAttributes, callback: AsyncCallback\>): void;
queryContactsByPhoneNumber(phoneNumber: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback\>): void;
queryContactsByPhoneNumber(phoneNumber: string, holder?: Holder, attrs?: ContactAttributes): Promise\>; | 新增 | +| ohos.contact | contact | queryContactsByEmail(email: string, callback: AsyncCallback\>): void;
queryContactsByEmail(email: string, holder: Holder, callback: AsyncCallback\>): void;
queryContactsByEmail(email: string, attrs: ContactAttributes, callback: AsyncCallback\>): void;
queryContactsByEmail(email: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback\>): void;
queryContactsByEmail(email: string, holder?: Holder, attrs?: ContactAttributes): Promise\>; | 新增 | +| ohos.contact | contact | queryContacts(callback: AsyncCallback\>): void;
queryContacts(holder: Holder, callback: AsyncCallback\>): void;
queryContacts(attrs: ContactAttributes, callback: AsyncCallback\>): void;
queryContacts(holder: Holder, attrs: ContactAttributes, callback: AsyncCallback\>): void;
queryContacts(holder?: Holder, attrs?: ContactAttributes): Promise\>; | 新增 | +| ohos.contact | contact | queryContact(key: string, callback: AsyncCallback\): void;
queryContact(key: string, holder: Holder, callback: AsyncCallback\): void;
queryContact(key: string, attrs: ContactAttributes, callback: AsyncCallback\): void;
queryContact(key: string, holder: Holder, attrs: ContactAttributes, callback: AsyncCallback\): void;
queryContact(key: string, holder?: Holder, attrs?: ContactAttributes): Promise\; | 新增 | +| ohos.contact | contact | deleteContact(key: string, callback: AsyncCallback\): void;
deleteContact(key: string): Promise\; | 新增 | +| ohos.contact | contact | selectContact(callback: AsyncCallback\>): void;
selectContact(): Promise\>; | 新增 | +| ohos.contact | contact | addContact(contact: Contact, callback: AsyncCallback\): void;
addContact(contact: Contact): Promise\; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-unitest.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-unitest.md index 8f52e684d282cb6551b69566a3d09af57f2c3286..1e057c8cd9c6dfeda99561f11e5806ed19b9dc40 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-unitest.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-unitest.md @@ -6,32 +6,32 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,测试框架 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.uitest | UiDriver | screenCap(savePath:string):Promise; | 新增 | -| ohos.uitest | UiDriver | swipe(startx:number,starty:number,endx:number,endy:number):Promise; | 新增 | -| ohos.uitest | UiDriver | longClick(x:number,y:number):Promise; | 新增 | -| ohos.uitest | UiDriver | doubleClick(x:number,y:number):Promise; | 新增 | -| ohos.uitest | UiDriver | click(x:number,y:number):Promise; | 新增 | -| ohos.uitest | UiDriver | triggerKey(keyCode:number):Promise; | 新增 | -| ohos.uitest | UiDriver | pressBack():Promise; | 新增 | -| ohos.uitest | UiDriver | assertComponentExist(by:By):Promise; | 新增 | -| ohos.uitest | UiDriver | findComponents(by:By):Promise>; | 新增 | -| ohos.uitest | UiDriver | findComponent(by:By):Promise; | 新增 | -| ohos.uitest | UiDriver | delayMs(duration:number):Promise; | 新增 | +| ohos.uitest | UiDriver | screenCap(savePath:string):Promise\; | 新增 | +| ohos.uitest | UiDriver | swipe(startx:number,starty:number,endx:number,endy:number):Promise\; | 新增 | +| ohos.uitest | UiDriver | longClick(x:number,y:number):Promise\; | 新增 | +| ohos.uitest | UiDriver | doubleClick(x:number,y:number):Promise\; | 新增 | +| ohos.uitest | UiDriver | click(x:number,y:number):Promise\; | 新增 | +| ohos.uitest | UiDriver | triggerKey(keyCode:number):Promise\; | 新增 | +| ohos.uitest | UiDriver | pressBack():Promise\; | 新增 | +| ohos.uitest | UiDriver | assertComponentExist(by:By):Promise\; | 新增 | +| ohos.uitest | UiDriver | findComponents(by:By):Promise\>; | 新增 | +| ohos.uitest | UiDriver | findComponent(by:By):Promise\; | 新增 | +| ohos.uitest | UiDriver | delayMs(duration:number):Promise\; | 新增 | | ohos.uitest | UiDriver | static create():UiDriver; | 新增 | -| ohos.uitest | UiComponent | scrollSearch(by:By):Promise; | 新增 | -| ohos.uitest | UiComponent | inputText(text: string):Promise; | 新增 | -| ohos.uitest | UiComponent | isSelected():Promise; | 新增 | -| ohos.uitest | UiComponent | isFocused():Promise; | 新增 | -| ohos.uitest | UiComponent | isEnabled():Promise; | 新增 | -| ohos.uitest | UiComponent | isScrollable():Promise; | 新增 | -| ohos.uitest | UiComponent | isClickable():Promise; | 新增 | -| ohos.uitest | UiComponent | getType():Promise; | 新增 | -| ohos.uitest | UiComponent | getText():Promise; | 新增 | -| ohos.uitest | UiComponent | getKey():Promise; | 新增 | -| ohos.uitest | UiComponent | getId():Promise; | 新增 | -| ohos.uitest | UiComponent | longClick():Promise; | 新增 | -| ohos.uitest | UiComponent | doubleClick():Promise; | 新增 | -| ohos.uitest | UiComponent | click():Promise; | 新增 | +| ohos.uitest | UiComponent | scrollSearch(by:By):Promise\; | 新增 | +| ohos.uitest | UiComponent | inputText(text: string):Promise\; | 新增 | +| ohos.uitest | UiComponent | isSelected():Promise\; | 新增 | +| ohos.uitest | UiComponent | isFocused():Promise\; | 新增 | +| ohos.uitest | UiComponent | isEnabled():Promise\; | 新增 | +| ohos.uitest | UiComponent | isScrollable():Promise\; | 新增 | +| ohos.uitest | UiComponent | isClickable():Promise\; | 新增 | +| ohos.uitest | UiComponent | getType():Promise\; | 新增 | +| ohos.uitest | UiComponent | getText():Promise\; | 新增 | +| ohos.uitest | UiComponent | getKey():Promise\; | 新增 | +| ohos.uitest | UiComponent | getId():Promise\; | 新增 | +| ohos.uitest | UiComponent | longClick():Promise\; | 新增 | +| ohos.uitest | UiComponent | doubleClick():Promise\; | 新增 | +| ohos.uitest | UiComponent | click():Promise\; | 新增 | | ohos.uitest | By | isAfter(by:By):By; | 新增 | | ohos.uitest | By | isBefore(by:By):By; | 新增 | | ohos.uitest | By | selected(b?:bool):By; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-usb.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-usb.md index b10c55c50ac76ca3a3cd815c20562c945988ed12..48cf134e1577e67a5d87b0d0a9dd620d22d0a40f 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-usb.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-usb.md @@ -23,7 +23,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,USB服务子 | ohos.usb | USBControlParams | request: number; | 新增 | | ohos.usb | USBDevicePipe | devAddress: number; | 新增 | | ohos.usb | USBDevicePipe | busNum: number; | 新增 | -| ohos.usb | USBDevice | configs: Array; | 新增 | +| ohos.usb | USBDevice | configs: Array\; | 新增 | | ohos.usb | USBDevice | protocol: number; | 新增 | | ohos.usb | USBDevice | subClass: number; | 新增 | | ohos.usb | USBDevice | clazz: number; | 新增 | @@ -36,14 +36,14 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,USB服务子 | ohos.usb | USBDevice | serial: string; | 新增 | | ohos.usb | USBDevice | devAddress: number; | 新增 | | ohos.usb | USBDevice | busNum: number; | 新增 | -| ohos.usb | USBConfig | interfaces: Array; | 新增 | +| ohos.usb | USBConfig | interfaces: Array\; | 新增 | | ohos.usb | USBConfig | isSelfPowered: boolean; | 新增 | | ohos.usb | USBConfig | isRemoteWakeup: boolean; | 新增 | | ohos.usb | USBConfig | name: string; | 新增 | | ohos.usb | USBConfig | maxPower: number; | 新增 | | ohos.usb | USBConfig | attributes: number; | 新增 | | ohos.usb | USBConfig | id: number; | 新增 | -| ohos.usb | USBInterface | endpoints: Array; | 新增 | +| ohos.usb | USBInterface | endpoints: Array\; | 新增 | | ohos.usb | USBInterface | name: string; | 新增 | | ohos.usb | USBInterface | alternateSetting: number; | 新增 | | ohos.usb | USBInterface | subClass: number; | 新增 | @@ -58,16 +58,16 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,USB服务子 | ohos.usb | USBEndpoint | interval: number; | 新增 | | ohos.usb | USBEndpoint | attributes: number; | 新增 | | ohos.usb | USBEndpoint | address: number; | 新增 | -| ohos.usb | usb | function closePipe(pipe: USBDevicePipe): number; | 新增 | -| ohos.usb | usb | function bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array,timeout?: number): Promise; | 新增 | -| ohos.usb | usb | function controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise; | 新增 | -| ohos.usb | usb | function getFileDescriptor(pipe: USBDevicePipe): number; | 新增 | -| ohos.usb | usb | function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; | 新增 | -| ohos.usb | usb | function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; | 新增 | -| ohos.usb | usb | function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | 新增 | -| ohos.usb | usb | function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; | 新增 | -| ohos.usb | usb | function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; | 新增 | -| ohos.usb | usb | function requestRight(deviceName: string): Promise; | 新增 | -| ohos.usb | usb | function hasRight(deviceName: string): boolean; | 新增 | -| ohos.usb | usb | function connectDevice(device: USBDevice): Readonly; | 新增 | -| ohos.usb | usb | function getDevices(): Array>; | 新增 | +| ohos.usb | usb | closePipe(pipe: USBDevicePipe): number; | 新增 | +| ohos.usb | usb | bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array,timeout?: number): Promise\; | 新增 | +| ohos.usb | usb | controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise\; | 新增 | +| ohos.usb | usb | getFileDescriptor(pipe: USBDevicePipe): number; | 新增 | +| ohos.usb | usb | getRawDescriptor(pipe: USBDevicePipe): Uint8Array; | 新增 | +| ohos.usb | usb | setInterface(pipe: USBDevicePipe, iface: USBInterface): number; | 新增 | +| ohos.usb | usb | setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | 新增 | +| ohos.usb | usb | releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; | 新增 | +| ohos.usb | usb | claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; | 新增 | +| ohos.usb | usb | requestRight(deviceName: string): Promise\; | 新增 | +| ohos.usb | usb | hasRight(deviceName: string): boolean; | 新增 | +| ohos.usb | usb | connectDevice(device: USBDevice): Readonly\; | 新增 | +| ohos.usb | usb | getDevices(): Array\>; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md index 0d349c07d0ae6f4008c80643eff0cc9f5ad7445c..1394ba94bab01a28ddc725e76de92b5e6b02e72e 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md @@ -51,7 +51,7 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,用户身份 | ohos.userIAM.userAuth | UserAuth | getVersion() : number; | 新增 | | ohos.userIAM.userAuth | UserAuth | constructor(); | 新增 | | ohos.userIAM.userAuth | userAuth | function getAuthenticator(): Authenticator; | 新增 | -| ohos.userIAM.userAuth | Authenticator | execute(type: AuthType, level: SecureLevel, callback: AsyncCallback): void;
execute(type: AuthType, level: SecureLevel): Promise; | 新增 | +| ohos.userIAM.userAuth | Authenticator | execute(type: AuthType, level: SecureLevel, callback: AsyncCallback\): void;
execute(type: AuthType, level: SecureLevel): Promise\; | 新增 | | ohos.userIAM.userAuth | AuthenticationResult | GENERAL_ERROR = 100 | 新增 | | ohos.userIAM.userAuth | AuthenticationResult | NOT_ENROLLED = 8 | 新增 | | ohos.userIAM.userAuth | AuthenticationResult | LOCKED = 7 | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window.md index b1d4d42814a123566333b237e345648d50f06ce8..452b55571ef22e4a80b38b1447a2cc1883aa15fa 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window.md @@ -6,35 +6,35 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,窗口管理 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.window | Window | setTouchable(isTouchable: boolean): Promise;
setTouchable(isTouchable: boolean, callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | setPrivacyMode(isPrivacyMode: boolean): Promise;
setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | setOutsideTouchable(touchable: boolean): Promise;
setOutsideTouchable(touchable: boolean, callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | setKeepScreenOn(isKeepScreenOn: boolean): Promise;
setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | setFocusable(isFocusable: boolean): Promise;
setFocusable(isFocusable: boolean, callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | setDimBehind(dimBehindValue: number, callback: AsyncCallback): void;
setDimBehind(dimBehindValue: number): Promise; | 新增 | -| ohos.window | Window | setBrightness(brightness: number): Promise;
setBrightness(brightness: number, callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | setBackgroundColor(color: string): Promise;
setBackgroundColor(color: string, callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | getColorSpace(): Promise;
getColorSpace(callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | setColorSpace(colorSpace:ColorSpace): Promise;
setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | isSupportWideGamut(): Promise;
isSupportWideGamut(callback: AsyncCallback): void; | 新增 | -| ohos.window | Window | off(type: 'keyboardHeightChange', callback?: Callback): void; | 新增 | -| ohos.window | Window | on(type: 'keyboardHeightChange', callback: Callback): void; | 新增 | -| ohos.window | Window | off(type: 'systemAvoidAreaChange', callback?: Callback): void; | 新增 | -| ohos.window | Window | on(type: 'systemAvoidAreaChange', callback: Callback): void; | 新增 | -| ohos.window | Window | off(type: 'windowSizeChange', callback?: Callback): void; | 新增 | -| ohos.window | Window | on(type: 'windowSizeChange', callback: Callback): void; | 新增 | -| ohos.window | Window | isShowing(callback: AsyncCallback): void;
isShowing(): Promise; | 新增 | -| ohos.window | Window | loadContent(path: string, callback: AsyncCallback): void;
loadContent(path: string): Promise; | 新增 | -| ohos.window | Window | setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback): void;
setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise; | 新增 | -| ohos.window | Window | setSystemBarEnable(names: Array<'status'\|'navigation'>, callback: AsyncCallback): void;
setSystemBarEnable(names: Array<'status'\|'navigation'>): Promise; | 新增 | -| ohos.window | Window | setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback): void;
setLayoutFullScreen(isLayoutFullScreen: boolean): Promise; | 新增 | -| ohos.window | Window | setFullScreen(isFullScreen: boolean, callback: AsyncCallback): void;
setFullScreen(isFullScreen: boolean): Promise; | 新增 | -| ohos.window | Window | getAvoidArea(type: AvoidAreaType, callback: AsyncCallback): void;
getAvoidArea(type: AvoidAreaType): Promise; | 新增 | -| ohos.window | Window | getProperties(callback: AsyncCallback): void;
getProperties(): Promise; | 新增 | -| ohos.window | Window | destroy(callback: AsyncCallback): void;
destroy(): Promise; | 新增 | -| ohos.window | Window | show(callback: AsyncCallback): void;
show(): Promise; | 新增 | -| ohos.window | window | function find(id: string, callback: AsyncCallback): void;
function find(id: string): Promise; | 新增 | -| ohos.window | window | function create(id: string, type: WindowType, callback: AsyncCallback): void;
function create(id: string, type: WindowType): Promise;
function create(ctx: Context, id: string, type: WindowType): Promise;
function create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback): void; | 新增 | +| ohos.window | Window | setTouchable(isTouchable: boolean): Promise\;
setTouchable(isTouchable: boolean, callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | setPrivacyMode(isPrivacyMode: boolean): Promise\;
setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | setOutsideTouchable(touchable: boolean): Promise\;
setOutsideTouchable(touchable: boolean, callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | setKeepScreenOn(isKeepScreenOn: boolean): Promise\;
setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | setFocusable(isFocusable: boolean): Promise\;
setFocusable(isFocusable: boolean, callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | setDimBehind(dimBehindValue: number, callback: AsyncCallback\): void;
setDimBehind(dimBehindValue: number): Promise\; | 新增 | +| ohos.window | Window | setBrightness(brightness: number): Promise\;
setBrightness(brightness: number, callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | setBackgroundColor(color: string): Promise\;
setBackgroundColor(color: string, callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | getColorSpace(): Promise\;
getColorSpace(callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | setColorSpace(colorSpace:ColorSpace): Promise\;
setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | isSupportWideGamut(): Promise\;
isSupportWideGamut(callback: AsyncCallback\): void; | 新增 | +| ohos.window | Window | off(type: 'keyboardHeightChange', callback?: Callback\): void; | 新增 | +| ohos.window | Window | on(type: 'keyboardHeightChange', callback: Callback\): void; | 新增 | +| ohos.window | Window | off(type: 'systemAvoidAreaChange', callback?: Callback\): void; | 新增 | +| ohos.window | Window | on(type: 'systemAvoidAreaChange', callback: Callback\): void; | 新增 | +| ohos.window | Window | off(type: 'windowSizeChange', callback?: Callback\): void; | 新增 | +| ohos.window | Window | on(type: 'windowSizeChange', callback: Callback\): void; | 新增 | +| ohos.window | Window | isShowing(callback: AsyncCallback\): void;
isShowing(): Promise\; | 新增 | +| ohos.window | Window | loadContent(path: string, callback: AsyncCallback\): void;
loadContent(path: string): Promise\; | 新增 | +| ohos.window | Window | setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback\): void;
setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise\; | 新增 | +| ohos.window | Window | setSystemBarEnable(names: Array\<'status'\|'navigation'>, callback: AsyncCallback\): void;
setSystemBarEnable(names: Array\<'status'\|'navigation'>): Promise\; | 新增 | +| ohos.window | Window | setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback\): void;
setLayoutFullScreen(isLayoutFullScreen: boolean): Promise\; | 新增 | +| ohos.window | Window | setFullScreen(isFullScreen: boolean, callback: AsyncCallback\): void;
setFullScreen(isFullScreen: boolean): Promise\; | 新增 | +| ohos.window | Window | getAvoidArea(type: AvoidAreaType, callback: AsyncCallback\): void;
getAvoidArea(type: AvoidAreaType): Promise\; | 新增 | +| ohos.window | Window | getProperties(callback: AsyncCallback\): void;
getProperties(): Promise\; | 新增 | +| ohos.window | Window | destroy(callback: AsyncCallback\): void;
destroy(): Promise\; | 新增 | +| ohos.window | Window | show(callback: AsyncCallback\): void;
show(): Promise\; | 新增 | +| ohos.window | window | find(id: string, callback: AsyncCallback\): void;
find(id: string): Promise\; | 新增 | +| ohos.window | window | create(id: string, type: WindowType, callback: AsyncCallback\): void;
create(id: string, type: WindowType): Promise\;
create(ctx: Context, id: string, type: WindowType): Promise\;
create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback\): void; | 新增 | | ohos.window | ColorSpace | WIDE_GAMUT | 新增 | | ohos.window | ColorSpace | DEFAULT | 新增 | | ohos.window | WindowProperties | isTransparent: boolean | 新增 | @@ -87,11 +87,11 @@ OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,窗口管理 | ohos.display | DisplayState | STATE_ON | 新增 | | ohos.display | DisplayState | STATE_OFF | 新增 | | ohos.display | DisplayState | STATE_UNKNOWN = 0 | 新增 | -| ohos.display | display | function off(type: 'add' \| 'remove' \| 'change', callback?: Callback): void; | 新增 | -| ohos.display | display | function off(type: 'add' \| 'remove' \| 'change', callback?: Callback): void; | 新增 | -| ohos.display | display | function off(type: 'add' \| 'remove' \| 'change', callback?: Callback): void; | 新增 | -| ohos.display | display | function on(type: 'add' \| 'remove' \| 'change', callback: Callback): void; | 新增 | -| ohos.display | display | function on(type: 'add' \| 'remove' \| 'change', callback: Callback): void; | 新增 | -| ohos.display | display | function on(type: 'add' \| 'remove' \| 'change', callback: Callback): void; | 新增 | -| ohos.display | display | function getAllDisplay(callback: AsyncCallback>): void;
function getAllDisplay(): Promise>; | 新增 | -| ohos.display | display | function getDefaultDisplay(callback: AsyncCallback): void;
function getDefaultDisplay(): Promise; | 新增 | +| ohos.display | display | off(type: 'add' \| 'remove' \| 'change', callback?: Callback\): void; | 新增 | +| ohos.display | display | off(type: 'add' \| 'remove' \| 'change', callback?: Callback\): void; | 新增 | +| ohos.display | display | off(type: 'add' \| 'remove' \| 'change', callback?: Callback\): void; | 新增 | +| ohos.display | display | on(type: 'add' \| 'remove' \| 'change', callback: Callback\): void; | 新增 | +| ohos.display | display | on(type: 'add' \| 'remove' \| 'change', callback: Callback\): void; | 新增 | +| ohos.display | display | on(type: 'add' \| 'remove' \| 'change', callback: Callback\): void; | 新增 | +| ohos.display | display | getAllDisplay(callback: AsyncCallback\>): void;
getAllDisplay(): Promise\>; | 新增 | +| ohos.display | display | getDefaultDisplay(callback: AsyncCallback\): void;
getDefaultDisplay(): Promise\; | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window_api-9-canary.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window_api-9-canary.md index 1dd5b263435135a38a1255ae9be00d877bf9083b..c272b51e5f043050cd872e9887546b8a7c6d361d 100644 --- a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window_api-9-canary.md +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window_api-9-canary.md @@ -6,10 +6,10 @@ OpenHarmony 3.2 Canary1版本相较于OpenHarmony 3.1 Release版本,窗口管 | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | |---|---|---|---| -| ohos.window | WindowStage | loadContent(path: string, storage: ContentStorage, callback: AsyncCallback): void;
loadContent(path: string, storage?: ContentStorage): Promise;
loadContent(path: string, callback: AsyncCallback): void; | 新增 | -| ohos.window | WindowStage | getSubWindow(): Promise>;
getSubWindow(callback: AsyncCallback>): void; | 新增 | -| ohos.window | WindowStage | createSubWindow(name: string): Promise;
createSubWindow(name: string, callback: AsyncCallback): void; | 新增 | -| ohos.window | WindowStage | getMainWindow(): Promise;
getMainWindow(callback: AsyncCallback): void; | 新增 | +| ohos.window | WindowStage | loadContent(path: string, storage: ContentStorage, callback: AsyncCallback\): void;
loadContent(path: string, storage?: ContentStorage): Promise\;
loadContent(path: string, callback: AsyncCallback\): void; | 新增 | +| ohos.window | WindowStage | getSubWindow(): Promise\>;
getSubWindow(callback: AsyncCallback\>): void; | 新增 | +| ohos.window | WindowStage | createSubWindow(name: string): Promise\;
createSubWindow(name: string, callback: AsyncCallback\): void; | 新增 | +| ohos.window | WindowStage | getMainWindow(): Promise\;
getMainWindow(callback: AsyncCallback\): void; | 新增 | | ohos.window | WindowStageEventType | BACKGROUND | 新增 | | ohos.window | WindowStageEventType | INACTIVE | 新增 | | ohos.window | WindowStageEventType | ACTIVE | 新增 | diff --git a/zh-cn/release-notes/api-change/v3.1-beta/js-apidiff-v3.1-beta.md b/zh-cn/release-notes/api-change/v3.1-beta/js-apidiff-v3.1-beta.md index 83e1f3c794c21db9053fd78c6e060a705c83209d..0bc5c6259e90e55be5176bc0d789413ce1e61688 100644 --- a/zh-cn/release-notes/api-change/v3.1-beta/js-apidiff-v3.1-beta.md +++ b/zh-cn/release-notes/api-change/v3.1-beta/js-apidiff-v3.1-beta.md @@ -9,22 +9,22 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 系统应用-settings | getUri(name: string): string | 新增 | 新增获取设置数据URI | | 系统应用-settings | getValue(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string | 新增 | 新增获取设置数据库值 | | 系统应用-settings | setValue(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean | 新增 | 新增设置设置数据库值 | -| 杂散软件服务-systemTime | getCurrentTime(callback: AsyncCallback): void | 新增 | 获取自 Unix 纪元以来经过的毫秒数。 | -| 杂散软件服务-systemTime | getCurrentTime(): Promise | 新增 | 获取自 Unix 纪元以来经过的毫秒数。 | -| 杂散软件服务-systemTime | getCurrentTimeNs(callback: AsyncCallback): void | 新增 | 获取自 Unix 纪元以来经过的纳秒数。 | -| 杂散软件服务-systemTime | getCurrentTimeNs(): Promise | 新增 | 获取自 Unix 纪元以来经过的纳秒数。 | -| 杂散软件服务-systemTime | getRealActiveTime(callback: AsyncCallback): void | 新增 | 获取自系统启动以来经过的毫秒数,不包括深度睡眠时间。 | -| 杂散软件服务-systemTime | getRealActiveTime(): Promise | 新增 | 获取自系统启动以来经过的毫秒数,不包括深度睡眠时间。 | -| 杂散软件服务-systemTime | getRealActiveTimeNs(callback: AsyncCallback): void | 新增 | 获取自系统启动以来经过的纳秒数,不包括深度睡眠时间。 | -| 杂散软件服务-systemTime | getRealActiveTimeNs(): Promise | 新增 | 获取自系统启动以来经过的纳秒数,不包括深度睡眠时间。 | -| 杂散软件服务-systemTime | getRealTime(callback: AsyncCallback): void | 新增 | 获取自系统启动以来经过的毫秒数,包括深度睡眠时间。 | -| 杂散软件服务-systemTime | getRealTime(): Promise | 新增 | 获取自系统启动以来经过的毫秒数,包括深度睡眠时间。 | -| 杂散软件服务-systemTime | getRealTimeNs(callback: AsyncCallback): void | 新增 | 获取自系统启动以来经过的纳秒数,包括深度睡眠时间。 | -| 杂散软件服务-systemTime | getRealTimeNs(): Promise | 新增 | 获取自系统启动以来经过的纳秒数,包括深度睡眠时间。 | -| 杂散软件服务-systemTime | getDate(callback: AsyncCallback): void | 新增 | 获取当前时间。 | -| 杂散软件服务-systemTime | getDate(): Promise | 新增 | 获取当前时间。 | -| 杂散软件服务-systemTime | getTimeZone(callback: AsyncCallback): void | 新增 | 获取系统时区。 | -| 杂散软件服务-systemTime | getTimeZone(): Promise | 新增 | 获取系统时区。 | +| 杂散软件服务-systemTime | getCurrentTime(callback: AsyncCallback\): void | 新增 | 获取自 Unix 纪元以来经过的毫秒数。 | +| 杂散软件服务-systemTime | getCurrentTime(): Promise\ | 新增 | 获取自 Unix 纪元以来经过的毫秒数。 | +| 杂散软件服务-systemTime | getCurrentTimeNs(callback: AsyncCallback\): void | 新增 | 获取自 Unix 纪元以来经过的纳秒数。 | +| 杂散软件服务-systemTime | getCurrentTimeNs(): Promise\ | 新增 | 获取自 Unix 纪元以来经过的纳秒数。 | +| 杂散软件服务-systemTime | getRealActiveTime(callback: AsyncCallback\): void | 新增 | 获取自系统启动以来经过的毫秒数,不包括深度睡眠时间。 | +| 杂散软件服务-systemTime | getRealActiveTime(): Promise\ | 新增 | 获取自系统启动以来经过的毫秒数,不包括深度睡眠时间。 | +| 杂散软件服务-systemTime | getRealActiveTimeNs(callback: AsyncCallback\): void | 新增 | 获取自系统启动以来经过的纳秒数,不包括深度睡眠时间。 | +| 杂散软件服务-systemTime | getRealActiveTimeNs(): Promise\ | 新增 | 获取自系统启动以来经过的纳秒数,不包括深度睡眠时间。 | +| 杂散软件服务-systemTime | getRealTime(callback: AsyncCallback\): void | 新增 | 获取自系统启动以来经过的毫秒数,包括深度睡眠时间。 | +| 杂散软件服务-systemTime | getRealTime(): Promise\ | 新增 | 获取自系统启动以来经过的毫秒数,包括深度睡眠时间。 | +| 杂散软件服务-systemTime | getRealTimeNs(callback: AsyncCallback\): void | 新增 | 获取自系统启动以来经过的纳秒数,包括深度睡眠时间。 | +| 杂散软件服务-systemTime | getRealTimeNs(): Promise\ | 新增 | 获取自系统启动以来经过的纳秒数,包括深度睡眠时间。 | +| 杂散软件服务-systemTime | getDate(callback: AsyncCallback\): void | 新增 | 获取当前时间。 | +| 杂散软件服务-systemTime | getDate(): Promise\ | 新增 | 获取当前时间。 | +| 杂散软件服务-systemTime | getTimeZone(callback: AsyncCallback\): void | 新增 | 获取系统时区。 | +| 杂散软件服务-systemTime | getTimeZone(): Promise\ | 新增 | 获取系统时区。 | | Ark UI框架-通用事件 | 组件区域变化事件 onAreaChange | 新增 | 新增组件区域(包括大小和位置)变化事件。 | | Ark UI框架-通用属性 | 触摸热区设置 responseRegion | 新增 | 新增组件触摸热区设置。 | | Ark UI框架-通用属性 | 点击控制 touchable | 新增 | 新增设置组件是否可以被触摸。 | @@ -42,27 +42,27 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | Ark UI框架-画布组件 | Canvas | 新增 | 新增画布组件。 | | Ark UI框架-画布组件 | Lottie | 新增 | 新增Lottie库的支持。 | | Ark UI框架-全局UI方法 | ActionSheet | 新增 | 新增列表选择弹窗。 | -| USB服务-usb | getDevices(): Array> | 新增 | 新增获取USB设备列表的接口 | -| USB服务-usb | connectDevice(device: USBDevice): Readonly | 新增 | 新增根据**getDevices()**返回的设备信息打开USB设备的接口 | +| USB服务-usb | getDevices(): Array\> | 新增 | 新增获取USB设备列表的接口 | +| USB服务-usb | connectDevice(device: USBDevice): Readonly\ | 新增 | 新增根据getDevices()返回的设备信息打开USB设备的接口 | | USB服务-usb | hasRight(deviceName: string): boolean | 新增 | 新增判断是否有权访问设备的接口 | -| USB服务-usb | requestRight(deviceName: string): Promise | 新增 | 新增请求给定软件包的临时权限以访问设备的接口 | +| USB服务-usb | requestRight(deviceName: string): Promise\ | 新增 | 新增请求给定软件包的临时权限以访问设备的接口 | | USB服务-usb | claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number | 新增 | 新增获取接口的接口 | | USB服务-usb | releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number | 新增 | 新增释放接口的接口 | | USB服务-usb | setConfiguration(pipe: USBDevicePipe, config: USBConfig): number | 新增 | 新增设置设备配置的接口 | | USB服务-usb | setInterface(pipe: USBDevicePipe, iface: USBInterface): number | 新增 | 新增设置设备接口的接口 | | USB服务-usb | getRawDescriptor(pipe: USBDevicePipe): Uint8Array | 新增 | 新增获取原始的USB描述符的接口 | | USB服务-usb | getFileDescriptor(pipe: USBDevicePipe): number | 新增 | 新增获取文件描述符的接口 | -| USB服务-usb | controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise | 新增 | 新增控制传输的接口 | -| USB服务-usb | bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise | 新增 | 新增批量传输的接口 | +| USB服务-usb | controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise\ | 新增 | 新增控制传输的接口 | +| USB服务-usb | bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array, timeout?: number): Promise\ | 新增 | 新增批量传输的接口 | | USB服务-usb | closePipe(pipe: USBDevicePipe): number | 新增 | 新增关闭USBDevicePipe的接口 | -| 用户程序框架-bundle | function cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback): void;
function cleanBundleCacheFiles(bundleName: string): Promise; | 新增 | 新增清理应用缓存接口 | -| 用户程序框架-bundle | function setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback): void;
function setApplicationEnabled(bundleName: string, isEnable: boolean): Promise; | 新增 | 新增设置应用使能接口 | -| 用户程序框架-bundle | function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void;
function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; | 新增 | 新增设置ability使能接口 | -| 用户程序框架-bundle.innerBundleManager | function getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback>) : void;
function getLauncherAbilityInfos(bundleName: string, userId: number) : Promise>; | 新增 | 新增通过包名获取应用LauncherAbility接口 | -| 用户程序框架-bundle.innerBundleManager | function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback) : void;
function on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback): Proimise; | 新增 | 新增注册监听包状态变化接口 | -| 用户程序框架-bundle.innerBundleManager | function off(type:"BundleStatusChange", callback: AsyncCallback) : void;
function off(type:"BundleStatusChange"): Proimise; | 新增 | 新增注销监听包状态变化接口 | -| 用户程序框架-bundle.innerBundleManager | function getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback>) : void;
function getAllLauncherAbilityInfos(userId: number) : Promise>; | 新增 | 新增通过userId获取所有launcher上应用的ability接口 | -| 用户程序框架-bundle.innerBundleManager | function getShortcutInfos(bundleName :string, callback: AsyncCallback>) : void;
function getShortcutInfos(bundleName : string) : Promise>; | 新增 | 新增通过bundleName获取应用的shortcutInfo接口 | +| 用户程序框架-bundle | cleanBundleCacheFiles(bundleName: string, callback: AsyncCallback\): void;
cleanBundleCacheFiles(bundleName: string): Promise\; | 新增 | 新增清理应用缓存接口 | +| 用户程序框架-bundle | setApplicationEnabled(bundleName: string, isEnable: boolean, callback: AsyncCallback\): void;
setApplicationEnabled(bundleName: string, isEnable: boolean): Promise\; | 新增 | 新增设置应用使能接口 | +| 用户程序框架-bundle | setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback\): void;
setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise\; | 新增 | 新增设置ability使能接口 | +| 用户程序框架-bundle.innerBundleManager | getLauncherAbilityInfos(bundleName: string, userId: number, callback: AsyncCallback\>) : void;
getLauncherAbilityInfos(bundleName: string, userId: number) : Promise\>; | 新增 | 新增通过包名获取应用LauncherAbility接口 | +| 用户程序框架-bundle.innerBundleManager | on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback, callback: AsyncCallback\) : void;
on(type:"BundleStatusChange", bundleStatusCallback : BundleStatusCallback): Proimise\; | 新增 | 新增注册监听包状态变化接口 | +| 用户程序框架-bundle.innerBundleManager | off(type:"BundleStatusChange", callback: AsyncCallback\) : void;
off(type:"BundleStatusChange"): Proimise\; | 新增 | 新增注销监听包状态变化接口 | +| 用户程序框架-bundle.innerBundleManager | getAllLauncherAbilityInfos(userId: number, callback: AsyncCallback\>) : void;
getAllLauncherAbilityInfos(userId: number) : Promise\>; | 新增 | 新增通过userId获取所有launcher上应用的ability接口 | +| 用户程序框架-bundle.innerBundleManager | getShortcutInfos(bundleName :string, callback: AsyncCallback\>) : void;
getShortcutInfos(bundleName : string) : Promise\>; | 新增 | 新增通过bundleName获取应用的shortcutInfo接口 | | 分布式软总线-rpc.MessageParcel | writeNoException(): void | 新增 | - | | 分布式软总线-rpc.MessageParcel | readException(): void | 新增 | - | | 分布式软总线-rpc.MessageParcel | writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean | 新增 | - | @@ -79,7 +79,7 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 分布式软总线-rpc.MessageParcel | getRawDataCapacity(): number | 新增 | - | | 分布式软总线-rpc.MessageParcel | writeRawData(rawData: number[], size: number): boolean | 新增 | - | | 分布式软总线-rpc.MessageParcel | readRawData(size: number): number[] | 新增 | - | -| 分布式软总线-rpc | interface SendRequestResult {
errCode: number;

code: number;

data: MessageParcel;

reply: MessageParcel;
} | 新增 | - | +| 分布式软总线-rpc | interface SendRequestResult {
errCode: number;
code: number;
data: MessageParcel;
reply: MessageParcel;
} | 新增 | - | | 分布式软总线-rpc.Ashmem | PROT_EXEC = 4 | 新增 | - | | 分布式软总线-rpc.Ashmem | PROT_NONE = 0 | 新增 | - | | 分布式软总线-rpc.Ashmem | PROT_READ = 1 | 新增 | - | @@ -96,14 +96,14 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 分布式软总线-rpc.Ashmem | writeToAshmem(buf: number[], size: number, offset: number): boolean | 新增 | - | | 分布式软总线-rpc.Ashmem | readFromAshmem(size: number, offset: number): number[] | 新增 | - | | 分布式软总线-rpc.IRemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean | 废弃 | 替换为异步接口,使用返回Promise或者回调的接口 | -| 分布式软总线-rpc.IRemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise | 新增 | - | -| 分布式软总线-rpc.IRemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback): void | 新增 | - | +| 分布式软总线-rpc.IRemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise\ | 新增 | - | +| 分布式软总线-rpc.IRemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback\): void | 新增 | - | | 分布式软总线-rpc.RemoteProxy | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean | 废弃 | 替换为异步接口,使用返回Promise或者回调的接口 | -| 分布式软总线-rpc.RemoteProxy | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise | 新增 | - | -| 分布式软总线-rpc.RemoteProxy | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback): void | 新增 | - | +| 分布式软总线-rpc.RemoteProxy | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise\ | 新增 | - | +| 分布式软总线-rpc.RemoteProxy | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback\): void | 新增 | - | | 分布式软总线-rpc.RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): boolean | 废弃 | 替换为异步接口,使用返回Promise或者回调的接口 | -| 分布式软总线-rpc.RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise | 新增 | - | -| 分布式软总线-rpc.RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback): void | 新增 | - | +| 分布式软总线-rpc.RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise\ | 新增 | - | +| 分布式软总线-rpc.RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback\): void | 新增 | - | | 分布式软总线-rpc.IRemoteObject | PING_TRANSACTION | 删除 | API 7没有实现,不影响已有应用 | | 分布式软总线-rpc.IRemoteObject | DUMP_TRANSACTION | 删除 | API 7没有实现,不影响已有应用 | | 分布式软总线-rpc.IRemoteObject | INTERFACE_TRANSACTION | 删除 | API 7没有实现,不影响已有应用 | @@ -124,74 +124,74 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 分布式软总线-rpc.Proxy | MIN_TRANSACTION_ID = 0x1 | 新增 | - | | 分布式软总线-rpc.Proxy | MAX_TRANSACTION_ID = 0x00FFFFFF | 新增 | - | | 分布式软总线-rpc.Proxy | queryLocalInterface(interface: string): IRemoteBroker | 修改 | API 7有误,返回类型更正为IRemoteBroker,不影响已有应用 | -| 分布式软总线-wifi | function getLinkedInfo(): Promise;
function getLinkedInfo(callback: AsyncCallback): void;| 新增 | - | -| 分布式软总线-wifi | function isConnected(): boolean;| 新增 | - | -| 分布式软总线-wifi | function getSupportedFeatures(): number;| 新增 | - | -| 分布式软总线-wifi | function isFeatureSupported(featureId: number): boolean;| 新增 | - | -| 分布式软总线-wifi | function getDeviceMacAddress(): string[];| 新增 | - | -| 分布式软总线-wifi | function getIpInfo(): IpInfo;| 新增 | - | -| 分布式软总线-wifi | function getCountryCode(): string;| 新增 | - | -| 分布式软总线-wifi | function reassociate(): boolean;| 新增 | - | -| 分布式软总线-wifi | function reconnect(): boolean;| 新增 | - | -| 分布式软总线-wifi | function getDeviceConfigs(): Array;| 新增 | - | -| 分布式软总线-wifi | function updateNetwork(config: WifiDeviceConfig): number;| 新增 | - | -| 分布式软总线-wifi | function disableNetwork(netId: number): boolean;| 新增 | - | -| 分布式软总线-wifi | function removeAllNetwork(): boolean;| 新增 | - | -| 分布式软总线-wifi | function removeDevice(id: number): boolean;| 新增 | - | -| 分布式软总线-wifi | function enableHotspot(): boolean;| 新增 | - | -| 分布式软总线-wifi | function disableHotspot(): boolean;| 新增 | - | -| 分布式软总线-wifi | function isHotspotActive(): boolean;| 新增 | - | -| 分布式软总线-wifi | function setHotspotConfig(config: HotspotConfig): boolean;| 新增 | - | -| 分布式软总线-wifi | function getHotspotConfig(): HotspotConfig;| 新增 | - | -| 分布式软总线-wifi | function getStations(): Array;| 新增 | - | -| 分布式软总线-wifi | function on(type: "wifiStateChange", callback: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function off(type: "wifiStateChange", callback?: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function on(type: "wifiConnectionChange", callback: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function off(type: "wifiConnectionChange", callback?: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function on(type: "wifiScanStateChange", callback: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function off(type: "wifiScanStateChange", callback?: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function on(type: "wifiRssiChange", callback: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function off(type: "wifiRssiChange", callback?: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function on(type: "hotspotStateChange", callback: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function off(type: "hotspotStateChange", callback?: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function on(type: "hotspotStaJoin", callback: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function off(type: "hotspotStaJoin", callback?: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function on(type: "hotspotStaLeave", callback: Callback): void;| 新增 | - | -| 分布式软总线-wifi | function off(type: "hotspotStaLeave", callback?: Callback): void;| 新增 | - | -| 全球化-resourceManager | getRawFile(path: string, callback: AsyncCallback);
getRawFile(path: string): Promise;| 新增 | - | +| 分布式软总线-wifi | getLinkedInfo(): Promise\;
getLinkedInfo(callback: AsyncCallback\): void; | 新增 | - | +| 分布式软总线-wifi | isConnected(): boolean; | 新增 | - | +| 分布式软总线-wifi | getSupportedFeatures(): number; | 新增 | - | +| 分布式软总线-wifi | isFeatureSupported(featureId: number): boolean; | 新增 | - | +| 分布式软总线-wifi | getDeviceMacAddress(): string[]; | 新增 | - | +| 分布式软总线-wifi | getIpInfo(): IpInfo; | 新增 | - | +| 分布式软总线-wifi | getCountryCode(): string; | 新增 | - | +| 分布式软总线-wifi | reassociate(): boolean; | 新增 | - | +| 分布式软总线-wifi | reconnect(): boolean; | 新增 | - | +| 分布式软总线-wifi | getDeviceConfigs(): Array\; | 新增 | - | +| 分布式软总线-wifi | updateNetwork(config: WifiDeviceConfig): number; | 新增 | - | +| 分布式软总线-wifi | disableNetwork(netId: number): boolean; | 新增 | - | +| 分布式软总线-wifi | removeAllNetwork(): boolean; | 新增 | - | +| 分布式软总线-wifi | removeDevice(id: number): boolean; | 新增 | - | +| 分布式软总线-wifi | enableHotspot(): boolean; | 新增 | - | +| 分布式软总线-wifi | disableHotspot(): boolean; | 新增 | - | +| 分布式软总线-wifi | isHotspotActive(): boolean; | 新增 | - | +| 分布式软总线-wifi | setHotspotConfig(config: HotspotConfig): boolean; | 新增 | - | +| 分布式软总线-wifi | getHotspotConfig(): HotspotConfig; | 新增 | - | +| 分布式软总线-wifi | getStations(): Array\; | 新增 | - | +| 分布式软总线-wifi | on(type: "wifiStateChange", callback: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | off(type: "wifiStateChange", callback?: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | on(type: "wifiConnectionChange", callback: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | off(type: "wifiConnectionChange", callback?: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | on(type: "wifiScanStateChange", callback: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | off(type: "wifiScanStateChange", callback?: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | on(type: "wifiRssiChange", callback: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | off(type: "wifiRssiChange", callback?: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | on(type: "hotspotStateChange", callback: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | off(type: "hotspotStateChange", callback?: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | on(type: "hotspotStaJoin", callback: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | off(type: "hotspotStaJoin", callback?: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | on(type: "hotspotStaLeave", callback: Callback\): void; | 新增 | - | +| 分布式软总线-wifi | off(type: "hotspotStaLeave", callback?: Callback\): void; | 新增 | - | +| 全球化-resourceManager | getRawFile(path: string, callback: AsyncCallback\);
getRawFile(path: string): Promise\; | 新增 | - | | 全球化-Intl | RelativeTimeFormat.constructor(); | 新增 | 构造函数 | -| 全球化-Intl | RelativeTimeFormat.constructor(locale: string \| Array, options?: RelativeTimeFormatInputOptions); | 新增 | 构造函数 | +| 全球化-Intl | RelativeTimeFormat.constructor(locale: string \| Array\, options?: RelativeTimeFormatInputOptions); | 新增 | 构造函数 | | 全球化-Intl | RelativeTimeFormat.format(value: number, unit: string): string; | 新增 | 相对时间格式化 | -| 全球化-Intl | RelativeTimeFormat.formatToParts(value: number, unit: string): Array; | 新增 | 相对时间格式化,结果分为多部份分别存储 | -| 全球化-Intl | RelativeTimeFormat.formatToParts(value: number, unit: string): Array; | 新增 | 相对时间格式化,结果分为多部份分别存储 | +| 全球化-Intl | RelativeTimeFormat.formatToParts(value: number, unit: string): Array\; | 新增 | 相对时间格式化,结果分为多部份分别存储 | +| 全球化-Intl | RelativeTimeFormat.formatToParts(value: number, unit: string): Array\; | 新增 | 相对时间格式化,结果分为多部份分别存储 | | 全球化-Intl | PluralRules.constructor(); | 新增 | 构造函数 | -| 全球化-Intl | PluralRules.constructor(locale: string \| Array, options?: PluralRulesOptions); | 新增 | 构造函数 | +| 全球化-Intl | PluralRules.constructor(locale: string \| Array\, options?: PluralRulesOptions); | 新增 | 构造函数 | | 全球化-Intl | PluralRules.select(n: number): string; | 新增 | 计算一个数字的单复数类别 | | 全球化-Intl | Collator.constructor(); | 新增 | 构造函数 | -| 全球化-Intl | Collator.constructor(locale: string \| Array, options?: CollatorOptions); | 新增 | 构造函数 | +| 全球化-Intl | Collator.constructor(locale: string \| Array\, options?: CollatorOptions); | 新增 | 构造函数 | | 全球化-Intl | Collator.compare(first: string, second: string): number; | 新增 | 比较两个字符串 | | 全球化-Intl | Collator.resolvedOptions(): CollatorOptions; | 新增 | 获取排序对象相关属性 | -| 全球化-I18N | function unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: **number**, locale: **string**, style?: **string**): **string**; | 新增 | 新增转换单位接口 | -| 全球化-I18N | function **constructor**(country: **string**, options?: PhoneNumberFormatOptions);
function isValidNumber(**number**: **string**): boolean;
function format(**number**: **string**): **string**; | 新增 | 新增电话号码格式化接口 | -| 全球化-I18N | function setTime(date: Date);
function setTime(time: **number**);
function **set**(year: **number**, month: **number**, date:**number**, hour?: **number**, minute?: **number**, second?: **number**);
function setTimeZone(timezone: **string**);
function getTimeZone(): **string**;
function getFirstDayOfWeek(): **number**;
function setFirstDayOfWeek(value: **number**);
function getMinimalDaysInFirstWeek(): **number**;
function setMinimalDaysInFirstWeek(value: **number**);
function **get**(field: **string**): **number**;
function getDisplayName(locale: **string**): **string**;
function isWeekend(date?: Date): boolean;
function **export** **function** getCalendar(locale: **string**, **type**?: **string**): Calendar; | 新增 | 新增日历接口 | -| 全球化-I18N | **function** isRTL(locale: **string**): boolean; | 新增 | 判断区域语言是否是从右到左语言 | -| 全球化-I18N | **function** getLineInstance(locale: **string**): BreakIterator;
function current(): **number**;
function first(): **number**;
function last(): **number**;
function next(index?: **number**): **number**;
function previous(): **number**;
function setLineBreakText(text: **string**): **void**;
function following(offset: **number**): **number**;
function getLineBreakText(): **string**;
function isBoundary(offset: **number**): boolean; | 新增 | 新增断词换行接口 | -| 全球化-I18N | function getInstance(locale?:**string**): IndexUtil;
function getIndexList(): Array<**string**>; | 新增 | 新增获取字母表索引接口 | -| 全球化-I18N | function addLocale(locale: **string**);
function getIndex(text: **string**): **string**;
function isDigit(char: **string**): boolean;
function isSpaceChar(char: **string**): boolean;
function isWhitespace(char: **string**): boolean;
function isRTL(char: **string**): boolean;
function isIdeograph(char: **string**): boolean;
function isLetter(char: **string**): boolean;
function isLowerCase(char: **string**): boolean;
function isUpperCase(char: **string**): boolean;
function getType(char: **string**): **string**; | 新增 | 新增获取字符属性接口 | +| 全球化-I18N | unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string; | 新增 | 新增转换单位接口 | +| 全球化-I18N | constructor(country: string, options?: PhoneNumberFormatOptions);
isValidNumber(number: string): boolean;
format(number: string): string; | 新增 | 新增电话号码格式化接口 | +| 全球化-I18N | setTime(date: Date);
setTime(time: number);
set(year: number, month: number, date:number, hour?: number, minute?: number, second?: number);
setTimeZone(timezone: string);
getTimeZone(): string;
getFirstDayOfWeek(): number;
setFirstDayOfWeek(value: number);
getMinimalDaysInFirstWeek(): number;
setMinimalDaysInFirstWeek(value: number);
get(field: string): number;
getDisplayName(locale: string): string;
isWeekend(date?: Date): boolean;
export getCalendar(locale: string, type?: string): Calendar; | 新增 | 新增日历接口 | +| 全球化-I18N | isRTL(locale: string): boolean; | 新增 | 判断区域语言是否是从右到左语言 | +| 全球化-I18N | getLineInstance(locale: string): BreakIterator;
current(): number;
first(): number;
last(): number;
next(index?: number): number;
previous(): number;
setLineBreakText(text: string): void;
following(offset: number): number;
getLineBreakText(): string;
isBoundary(offset: number): boolean; | 新增 | 新增断词换行接口 | +| 全球化-I18N | getInstance(locale?:string): IndexUtil;
getIndexList(): Array\; | 新增 | 新增获取字母表索引接口 | +| 全球化-I18N | addLocale(locale: string);
getIndex(text: string): string;
isDigit(char: string): boolean;
isSpaceChar(char: string): boolean;
isWhitespace(char: string): boolean;
isRTL(char: string): boolean;
isIdeograph(char: string): boolean;
isLetter(char: string): boolean;
isLowerCase(char: string): boolean;
isUpperCase(char: string): boolean;
getType(char: string): string; | 新增 | 新增获取字符属性接口 | | 事件通知-DoNotDisturbDate | type: notification.DoNotDisturbType | 新增 | 免打扰设置的时间类型 | | 事件通知-DoNotDisturbDate | begin: Date | 新增 | 免打扰设置的起点时间 | | 事件通知-DoNotDisturbDate | end: Date | 新增 | 免打扰设置的终点时间 | | 事件通知-DoNotDisturbDate | export enum DoNotDisturbType {
TYPE_NONE = 0, // 非通知勿扰类型
TYPE_ONCE = 1, // 以设置时间段一次执行勿扰
TYPE_DAILY = 2, // 以设置时间段(只看小时和分钟)每天执行勿扰
TYPE_CLEARLY = 3, // 以设置时间段(明确年月日时分)执行勿扰
} | 新增 | 免打扰时间类型 | -| 事件通知-notification | function setDoNotDisturbDate(date DoNotDisturbDate, callback: AsyncCallback): void | 新增 | 设置免打扰时间接口 | -| 事件通知-notification | function setDoNotDisturbDate(date DoNotDisturbDate): Promise | 新增 | 设置免打扰时间接口 | -| 事件通知-notification | function getDoNotDisturbDate(callback: AsyncCallback): void | 新增 | 查询免打扰时间接口 | -| 事件通知-notification | function getDoNotDisturbDate(): Promise | 新增 | 查询免打扰时间接口 | -| 事件通知-notification | function supportDoNotDisturbMode(callback: AsyncCallback): void | 新增 | 是否支持勿扰模式功能 | -| 事件通知-notification | function supportDoNotDisturbMode(): Promise | 新增 | 是否支持勿扰模式功能 | -| 事件通知-notification | function cancelGroup(groupName: string, callback: AsyncCallback): void | 新增 | 取消本应用指定组通知 | -| 事件通知-notification | function cancelGroup(groupName: string): Promise | 新增 | 取消本应用指定组通知 | -| 事件通知-notification | function removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void | 新增 | 删除指定应用指定组通知 | -| 事件通知-notification | function removeGroupByBundle(bundle: BundleOption, groupName: string): Promise | 新增 | 删除指定应用指定组通知 | +| 事件通知-notification | setDoNotDisturbDate(date DoNotDisturbDate, callback: AsyncCallback\): void | 新增 | 设置免打扰时间接口 | +| 事件通知-notification | setDoNotDisturbDate(date DoNotDisturbDate): Promise\ | 新增 | 设置免打扰时间接口 | +| 事件通知-notification | getDoNotDisturbDate(callback: AsyncCallback\): void | 新增 | 查询免打扰时间接口 | +| 事件通知-notification | getDoNotDisturbDate(): Promise\ | 新增 | 查询免打扰时间接口 | +| 事件通知-notification | supportDoNotDisturbMode(callback: AsyncCallback\): void | 新增 | 是否支持勿扰模式功能 | +| 事件通知-notification | supportDoNotDisturbMode(): Promise\ | 新增 | 是否支持勿扰模式功能 | +| 事件通知-notification | cancelGroup(groupName: string, callback: AsyncCallback\): void | 新增 | 取消本应用指定组通知 | +| 事件通知-notification | cancelGroup(groupName: string): Promise\ | 新增 | 取消本应用指定组通知 | +| 事件通知-notification | removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback\): void | 新增 | 删除指定应用指定组通知 | +| 事件通知-notification | removeGroupByBundle(bundle: BundleOption, groupName: string): Promise\ | 新增 | 删除指定应用指定组通知 | | 事件通知-NotificationSubscriber | onDoNotDisturbDateChange?:(mode: notification.DoNotDisturbDate) => void | 新增 | 免打扰设置信息变更后的通知给订阅者 | | 事件通知-NotificationRequest | smallIcon?: image.PixelMap | 新增 | 小图标 | | 事件通知-NotificationRequest | largeIcon?: image.PixelMap; | 新增 | 大图标 | @@ -199,15 +199,15 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 事件通知-NotificationUserInput | | 新增 | 用户输入对象 | | 事件通知-NotificationUserInput | inputKey: string | 新增 | 用户输入时用于标识此输入的key | | 事件通知-NotificationActionButton | userInput?: NotificationUserInput | 新增 | 用户输入对象实例 | -| 事件通知-emitter | function on(event: InnerEvent, callback: Callback): void | 新增 | 持续订阅某个事件以及接收事件的回调处理 | -| 事件通知-emitter | function once(event: InnerEvent, callback: Callback): void | 新增 | 单次订阅某个事件以及接收事件的回调处理,接收到回调处理后自动取消订阅 | -| 事件通知-emitter | function off(eventId: number): void | 新增 | 取消订阅某个事件 | -| 事件通知-emitter | function emit(event: InnerEvent, data?: EventData): void | 新增 | 发送一个事件到事件队列 | -| 分布式文件-statfs | function getFreeBytes(path: string, callback: AsyncCallback): void | 新增 | 以callback形式异步获取设备剩余空间,单位为字节 | -| 分布式文件-statfs | function getFreeBytes(path: string): Promise | 新增 | 以promise形式异步获取设备剩余空间,单位为字节 | -| 分布式文件-statfs | function getTotalBytes(path: string, callback: AsyncCallback): void | 新增 | 以callback形式异步获取设备总空间,单位为字节 | -| 分布式文件-statfs | function getTotalBytes(path: string): Promise | 新增 | 以promise形式异步获取设备总空间,单位为字节 | -| 分布式任务调度-featureAbility | function continueAbility(options: ContinueAbilityOptions, callback: AsyncCallback): void;
function continueAbility(options: ContinueAbilityOptions): Promise; | 新增 | - | +| 事件通知-emitter | on(event: InnerEvent, callback: Callback\): void | 新增 | 持续订阅某个事件以及接收事件的回调处理 | +| 事件通知-emitter | once(event: InnerEvent, callback: Callback\): void | 新增 | 单次订阅某个事件以及接收事件的回调处理,接收到回调处理后自动取消订阅 | +| 事件通知-emitter | off(eventId: number): void | 新增 | 取消订阅某个事件 | +| 事件通知-emitter | emit(event: InnerEvent, data?: EventData): void | 新增 | 发送一个事件到事件队列 | +| 分布式文件-statfs | getFreeBytes(path: string, callback: AsyncCallback\): void | 新增 | 以callback形式异步获取设备剩余空间,单位为字节 | +| 分布式文件-statfs | getFreeBytes(path: string): Promise\ | 新增 | 以promise形式异步获取设备剩余空间,单位为字节 | +| 分布式文件-statfs | getTotalBytes(path: string, callback: AsyncCallback\): void | 新增 | 以callback形式异步获取设备总空间,单位为字节 | +| 分布式文件-statfs | getTotalBytes(path: string): Promise\ | 新增 | 以promise形式异步获取设备总空间,单位为字节 | +| 分布式任务调度-featureAbility | continueAbility(options: ContinueAbilityOptions, callback: AsyncCallback\): void;
continueAbility(options: ContinueAbilityOptions): Promise\; | 新增 | - | | 语言编译运行时-URI | constructor(uri: string); | 新增 | | | 语言编译运行时-URI | toString(): string | 新增 | | | 语言编译运行时-URI | equals(other: URI): boolean; | 新增 | | @@ -254,8 +254,8 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 语言编译运行时-LruBuffer | afterRemoval(isEvict: boolean, key: K, value: V, newValue: V): void; | 新增 | | | 语言编译运行时-LruBuffer | contains(key: K): boolean; | 新增 | | | 语言编译运行时-LruBuffer | createDefault(key: K): V; | 新增 | | -| 语言编译运行时-LruBuffer | entries(): IterableIterator<[K, V]>; | 新增 | | -| 语言编译运行时-LruBuffer | [Symbol.iterator](): IterableIterator<[K, V]>; | 新增 | | +| 语言编译运行时-LruBuffer | entries(): IterableIterator\<[K, V]>; | 新增 | | +| 语言编译运行时-LruBuffer | \[Symbol.iterator]\(): IterableIterator\<[K, V]>; | 新增 | | | 语言编译运行时-Scope | constructor(lowerObj: ScopeType, upperObj: ScopeType); | 新增 | | | 语言编译运行时-Scope | toString(): string; | 新增 | | | 语言编译运行时-Scope | intersect(range: Scope): Scope; | 新增 | | @@ -272,9 +272,9 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 语言编译运行时-Base64 | encodeSync(src: Uint8Array): Uint8Array; | 新增 | | | 语言编译运行时-Base64 | encodeToStringSync(src: Uint8Array): string; | 新增 | | | 语言编译运行时-Base64 | decodeSync(src: Uint8Array \| string): Uint8Array; | 新增 | | -| 语言编译运行时-Base64 | encode(src: Uint8Array): Promise; | 新增 | | -| 语言编译运行时-Base64 | encodeToString(src: Uint8Array): Promise; | 新增 | | -| 语言编译运行时-Base64 | decode(src: Uint8Array \| string): Promise; | 新增 | | +| 语言编译运行时-Base64 | encode(src: Uint8Array): Promise\; | 新增 | | +| 语言编译运行时-Base64 | encodeToString(src: Uint8Array): Promise\; | 新增 | | +| 语言编译运行时-Base64 | decode(src: Uint8Array \| string): Promise\; | 新增 | | | 语言编译运行时-types | constructor(); | 新增 | | | 语言编译运行时-types | isAnyArrayBuffer(value: Object): boolean; | 新增 | | | 语言编译运行时-types | isArrayBufferView(value: Object): boolean; | 新增 | | @@ -316,16 +316,16 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 语言编译运行时-types | isWeakMap(value: Object): boolean; | 新增 | | | 语言编译运行时-types | isWeakSet(value: Object): boolean; | 新增 | | | 语言编译运行时-process | const tid: number; | 新增 | | -| 语言编译运行时-process | function isIsolatedProcess(): boolean; | 新增 | | -| 语言编译运行时-process | function isAppUid(v: number): boolean; | 新增 | | -| 语言编译运行时-process | function is64Bit(): boolean; | 新增 | | -| 语言编译运行时-process | function getUidForName(v: string): number; | 新增 | | -| 语言编译运行时-process | function getThreadPriority(v: number): number; | 新增 | | -| 语言编译运行时-process | function getStartRealtime(): number; | 新增 | | -| 语言编译运行时-process | function getAvailableCores(): number[]; | 新增 | | -| 语言编译运行时-process | function getPastCpuTime(): number; | 新增 | | -| 语言编译运行时-process | function getSystemConfig(name: number): number; | 新增 | | -| 语言编译运行时-process | function getEnvironmentVar(name: string): string; | 新增 | | +| 语言编译运行时-process | isIsolatedProcess(): boolean; | 新增 | | +| 语言编译运行时-process | isAppUid(v: number): boolean; | 新增 | | +| 语言编译运行时-process | is64Bit(): boolean; | 新增 | | +| 语言编译运行时-process | getUidForName(v: string): number; | 新增 | | +| 语言编译运行时-process | getThreadPriority(v: number): number; | 新增 | | +| 语言编译运行时-process | getStartRealtime(): number; | 新增 | | +| 语言编译运行时-process | getAvailableCores(): number[]; | 新增 | | +| 语言编译运行时-process | getPastCpuTime(): number; | 新增 | | +| 语言编译运行时-process | getSystemConfig(name: number): number; | 新增 | | +| 语言编译运行时-process | getEnvironmentVar(name: string): string; | 新增 | | | 语言编译运行时-ConvertOptions | trim: boolean; | 新增 | | | 语言编译运行时-ConvertOptions | ignoreDeclaration?: boolean; | 新增 | | | 语言编译运行时-ConvertOptions | ignoreInstruction?: boolean; | 新增 | | @@ -363,65 +363,65 @@ OpenHarmony 3.1 Beta相较于OpenHarmony 3.0 LTS版本的API变更如下: | 语言编译运行时-ParseOptions | attributeValueCallbackFunction?: (name: string, value: string) => boolean; | 新增 | | | 语言编译运行时-ParseOptions | tokenValueCallbackFunction?: (eventType: EventType, value: ParseInfo) => boolean; | 新增 | | | 帐号-account.appAccount | createAppAccountManager | 新增 | 获取实例 | -| 帐号-account.appAccount | addAccount(name: string, callback: AsyncCallback): void;
addAccount(name: string, extraInfo: string, callback: AsyncCallback): void;
addAccount(name: string, extraInfo?: string): Promise; | 新增 | 添加应用帐户 | -| 帐号-account.appAccount | deleteAccount(name: string, callback: AsyncCallback): void;
deleteAccount(name: string): Promise; | 新增 | 删除应用帐户 | -| 帐号-account.appAccount | disableAppAccess(name: string, bundleName: string, callback: AsyncCallback): void;
disableAppAccess(name: string, bundleName: string): Promise; | 新增 | 使指定的package拒绝访问给定的应用帐号 | -| 帐号-account.appAccount | enableAppAccess(name: string, bundleName: string, callback: AsyncCallback): void;
enableAppAccess(name: string, bundleName: string): Promise; | 新增 | 使指定的package允许访问给定的应用帐号 | -| 帐号-account.appAccount | checkAppAccountSyncEnable(name: string, callback: AsyncCallback): void;
checkAppAccountSyncEnable(name: string): Promise; | 新增 | 检查指定的应用帐号是否允许应用程序同步数据 | -| 帐号-account.appAccount | setAccountCredential(name: string, credentialType: string, credential: string,
callback: AsyncCallback): void;
setAccountCredential(name: string, credentialType: string, credential: string): Promise; | 新增 | 设置指定应用程序帐号的认证凭据 | -| 帐号-account.appAccount | setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback): void;
setAccountExtraInfo(name: string, extraInfo: string): Promise; | 新增 | 设置指定应用帐号的附加信息 | -| 帐号-account.appAccount | setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback): void;
setAppAccountSyncEnable(name: string, isEnable: boolean): Promise; | 新增 | 设置指定的应用程序帐号是否允许应用程序同步数据 | -| 帐号-account.appAccount | setAssociatedData(name: string, key: string, value: string, callback: AsyncCallback): void;
setAssociatedData(name: string, key: string, value: string): Promise; | 新增 | 设置应用帐号关联信息 | -| 帐号-account.appAccount | getAllAccessibleAccounts(callback: AsyncCallback>): void;
getAllAccessibleAccounts(): Promise>; | 新增 | 获取本应用帐号信息和已授权给本应用的第三方应用帐号的信息 | -| 帐号-account.appAccount | getAllAccounts(owner: string, callback: AsyncCallback>): void;
getAllAccounts(owner: string): Promise>; | 新增 | 获取执行应用下全部帐号信息 | -| 帐号-account.appAccount | getAccountCredential(name: string, credentialType: string, callback: AsyncCallback): void;
getAccountCredential(name: string, credentialType: string): Promise; | 新增 | 获取指定应用程序帐号的认证凭据 | -| 帐号-account.appAccount | getAccountExtraInfo(name: string, callback: AsyncCallback): void;
getAccountExtraInfo(name: string): Promise; | 新增 | 获取应用帐号附加信息 | -| 帐号-account.appAccount | getAssociatedData(name: string, key: string, callback: AsyncCallback): void;
getAssociatedData(name: string, key: string): Promise; | 新增 | 获取应用帐号关联信息 | -| 帐号-account.appAccount| on(type: 'change', owners: Array, callback: Callback>): void; | 新增 | 订阅指定应用帐号的更改事件 | -| 帐号-account.appAccount | off(type: 'change', callback?: Callback): void; | 新增 | 取消订阅应用帐号的更改事件 | +| 帐号-account.appAccount | addAccount(name: string, callback: AsyncCallback\): void;
addAccount(name: string, extraInfo: string, callback: AsyncCallback\): void;
addAccount(name: string, extraInfo?: string): Promise\; | 新增 | 添加应用帐户 | +| 帐号-account.appAccount | deleteAccount(name: string, callback: AsyncCallback\): void;
deleteAccount(name: string): Promise\; | 新增 | 删除应用帐户 | +| 帐号-account.appAccount | disableAppAccess(name: string, bundleName: string, callback: AsyncCallback\): void;
disableAppAccess(name: string, bundleName: string): Promise\; | 新增 | 使指定的package拒绝访问给定的应用帐号 | +| 帐号-account.appAccount | enableAppAccess(name: string, bundleName: string, callback: AsyncCallback\): void;
enableAppAccess(name: string, bundleName: string): Promise\; | 新增 | 使指定的package允许访问给定的应用帐号 | +| 帐号-account.appAccount | checkAppAccountSyncEnable(name: string, callback: AsyncCallback\): void;
checkAppAccountSyncEnable(name: string): Promise\; | 新增 | 检查指定的应用帐号是否允许应用程序同步数据 | +| 帐号-account.appAccount | setAccountCredential(name: string, credentialType: string, credential: string,
callback: AsyncCallback\): void;
setAccountCredential(name: string, credentialType: string, credential: string): Promise\; | 新增 | 设置指定应用程序帐号的认证凭据 | +| 帐号-account.appAccount | setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback\): void;
setAccountExtraInfo(name: string, extraInfo: string): Promise\; | 新增 | 设置指定应用帐号的附加信息 | +| 帐号-account.appAccount | setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback\): void;
setAppAccountSyncEnable(name: string, isEnable: boolean): Promise\; | 新增 | 设置指定的应用程序帐号是否允许应用程序同步数据 | +| 帐号-account.appAccount | setAssociatedData(name: string, key: string, value: string, callback: AsyncCallback\): void;
setAssociatedData(name: string, key: string, value: string): Promise\; | 新增 | 设置应用帐号关联信息 | +| 帐号-account.appAccount | getAllAccessibleAccounts(callback: AsyncCallback\>): void;
getAllAccessibleAccounts(): Promise\>; | 新增 | 获取本应用帐号信息和已授权给本应用的第三方应用帐号的信息 | +| 帐号-account.appAccount | getAllAccounts(owner: string, callback: AsyncCallback\>): void;
getAllAccounts(owner: string): Promise\>; | 新增 | 获取执行应用下全部帐号信息 | +| 帐号-account.appAccount | getAccountCredential(name: string, credentialType: string, callback: AsyncCallback\): void;
getAccountCredential(name: string, credentialType: string): Promise\; | 新增 | 获取指定应用程序帐号的认证凭据 | +| 帐号-account.appAccount | getAccountExtraInfo(name: string, callback: AsyncCallback\): void;
getAccountExtraInfo(name: string): Promise\; | 新增 | 获取应用帐号附加信息 | +| 帐号-account.appAccount | getAssociatedData(name: string, key: string, callback: AsyncCallback\): void;
getAssociatedData(name: string, key: string): Promise\; | 新增 | 获取应用帐号关联信息 | +| 帐号-account.appAccount| on(type: 'change', owners: Array\, callback: Callback\>): void; | 新增 | 订阅指定应用帐号的更改事件 | +| 帐号-account.appAccount | off(type: 'change', callback?: Callback\): void; | 新增 | 取消订阅应用帐号的更改事件 | | 帐号-account.appAccount | interface AppAccountInfo | 新增 | 应用帐号信息 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallback,options?: Options): void | 新增 | 监听加速度传感器的数据变化 | -| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCallback, options?: Options): void | 新增 | 监听线性加速度传感器的数据变化 | -| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:AsyncCallback, options?: Options): void | 新增 | 监听未校准加速度计传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback,options?: Options): void | 新增 | 监听重力传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback, options?: Options): void | 新增 | 监听陀螺仪传感器的数据变化 | -| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:AsyncCallback, options?: Options): void | 新增 | 监听未校准陀螺仪传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCallback, options?: Options): void | 新增 | 监听大幅动作传感器数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCallback, options?: Options): void | 新增 | 监听计步检测传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback, options?: Options): void | 新增 | 监听计步传感器的数据变化 | -| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCallback, options?: Options): void | 新增 | 监听环境温度传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallback,options?: Options): void | 新增 | 监听磁场传感器的数据变化 | -| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:AsyncCallback, options: Options): void | 新增 | 监听未校准磁场传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback,options?: Options): void | 新增 | 监听接近光传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback,options?: Options): void | 新增 | 监听湿度传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback,options?: Options): void | 新增 | 监听气压计传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback, options?: Options): void | 新增 | 监听霍尔传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback, options?: Options): void | 新增 | 监听环境光传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback, options?: Options): void | 新增 | 监听方向传感器的数据变化 | -| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:AsyncCallback,options?: Options): void | 新增 | 监听旋转矢量传感器的数据变化 | -| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallback,options?: Options): void | 新增 | 监听佩戴检测传感器的数据变化 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallback): void | 新增 | 监听加速度传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCallback): void | 新增 | 监听线性加速度传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:AsyncCallback): void | 新增 | 监听未校准加速度计传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback): void | 新增 | 监听重力传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback): void | 新增 | 监听陀螺仪传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:AsyncCallback, options?: Options): void | 新增 | 监听未校准陀螺仪传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCallback): void | 新增 | 监听大幅动作传感器数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCallback): void | 新增 | 监听计步检测传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback): void | 新增 | 监听计步传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCallback): void | 新增 | 监听环境温度传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallback): void | 新增 | 监听磁场传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:AsyncCallback): void | 新增 | 监听未校准磁场传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback): void | 新增 | 监听接近光传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback): void | 新增 | 监听湿度传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback): void | 新增 | 监听气压计传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback): void | 新增 | 监听霍尔传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback): void | 新增 | 监听环境光传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback): void | 新增 | 监听方向传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:AsyncCallback): void | 新增 | 监听旋转矢量传感器的数据变化一次 | -| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallback): void | 新增 | 监听佩戴检测传感器的数据变化一次 | -| 泛Sensor服务-sensor | off(type: SensorType, callback?: AsyncCallback): void | 新增 | 取消订阅传感器数据 | -| 泛Sensor服务-sensor | getGeomagneticField(locationOptions: LocationOptions, timeMillis: number, callback: AsyncCallback): void
getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise | 新增 | 获取地球上特定位置的地磁场 | -| 泛Sensor服务-vibrator | vibrate(duration: number): Promise
vibrate(duration: number, callback?: AsyncCallback): void | 新增 | 按照指定持续时间触发马达振动 | -| 泛Sensor服务-vibrator | vibrate(effectId: EffectId): Promise
vibrate(effectId: EffectId, callback?: AsyncCallback): void | 新增 | 按照指定振动效果触发马达振动 | -| 泛Sensor服务-vibrator | stop(stopMode: VibratorStopMode): Promise
stop(stopMode: VibratorStopMode, callback?: AsyncCallback): void | 新增 | 停止马达振动 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallback\,options?: Options): void | 新增 | 监听加速度传感器的数据变化 | +| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCallback\, options?: Options): void | 新增 | 监听线性加速度传感器的数据变化 | +| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:AsyncCallback\, options?: Options): void | 新增 | 监听未校准加速度计传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback\,options?: Options): void | 新增 | 监听重力传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback\, options?: Options): void | 新增 | 监听陀螺仪传感器的数据变化 | +| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:AsyncCallback\, options?: Options): void | 新增 | 监听未校准陀螺仪传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCallback\, options?: Options): void | 新增 | 监听大幅动作传感器数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCallback\, options?: Options): void | 新增 | 监听计步检测传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback\, options?: Options): void | 新增 | 监听计步传感器的数据变化 | +| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCallback\, options?: Options): void | 新增 | 监听环境温度传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallback\,options?: Options): void | 新增 | 监听磁场传感器的数据变化 | +| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:AsyncCallback\, options: Options): void | 新增 | 监听未校准磁场传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback\,options?: Options): void | 新增 | 监听接近光传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback\,options?: Options): void | 新增 | 监听湿度传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback\,options?: Options): void | 新增 | 监听气压计传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback\, options?: Options): void | 新增 | 监听霍尔传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback\, options?: Options): void | 新增 | 监听环境光传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback\, options?: Options): void | 新增 | 监听方向传感器的数据变化 | +| 泛Sensor服务-sensor | on(type:SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:AsyncCallback\,options?: Options): void | 新增 | 监听旋转矢量传感器的数据变化 | +| 泛Sensor服务-sensor | on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallback\,options?: Options): void | 新增 | 监听佩戴检测传感器的数据变化 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: AsyncCallback\): void | 新增 | 监听加速度传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION,callback:AsyncCallback\): void | 新增 | 监听线性加速度传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED,callback:AsyncCallback\): void | 新增 | 监听未校准加速度计传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: AsyncCallback\): void | 新增 | 监听重力传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: AsyncCallback\): void | 新增 | 监听陀螺仪传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED,callback:AsyncCallback\, options?: Options): void | 新增 | 监听未校准陀螺仪传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: AsyncCallback\): void | 新增 | 监听大幅动作传感器数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: AsyncCallback\): void | 新增 | 监听计步检测传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: AsyncCallback\): void | 新增 | 监听计步传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE,callback:AsyncCallback\): void | 新增 | 监听环境温度传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: AsyncCallback\): void | 新增 | 监听磁场传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED,callback:AsyncCallback\): void | 新增 | 监听未校准磁场传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: AsyncCallback\): void | 新增 | 监听接近光传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: AsyncCallback\): void | 新增 | 监听湿度传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: AsyncCallback\): void | 新增 | 监听气压计传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: AsyncCallback\): void | 新增 | 监听霍尔传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: AsyncCallback\): void | 新增 | 监听环境光传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: AsyncCallback\): void | 新增 | 监听方向传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type:SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR,callback:AsyncCallback\): void | 新增 | 监听旋转矢量传感器的数据变化一次 | +| 泛Sensor服务-sensor | once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: AsyncCallback\): void | 新增 | 监听佩戴检测传感器的数据变化一次 | +| 泛Sensor服务-sensor | off(type: SensorType, callback?: AsyncCallback\): void | 新增 | 取消订阅传感器数据 | +| 泛Sensor服务-sensor | getGeomagneticField(locationOptions: LocationOptions, timeMillis: number, callback: AsyncCallback\): void
getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise\ | 新增 | 获取地球上特定位置的地磁场 | +| 泛Sensor服务-vibrator | vibrate(duration: number): Promise\
vibrate(duration: number, callback?: AsyncCallback\): void | 新增 | 按照指定持续时间触发马达振动 | +| 泛Sensor服务-vibrator | vibrate(effectId: EffectId): Promise\
vibrate(effectId: EffectId, callback?: AsyncCallback\): void | 新增 | 按照指定振动效果触发马达振动 | +| 泛Sensor服务-vibrator | stop(stopMode: VibratorStopMode): Promise\
stop(stopMode: VibratorStopMode, callback?: AsyncCallback\): void | 新增 | 停止马达振动 |