diff --git a/en/application-dev/reference/apis/js-apis-notification.md b/en/application-dev/reference/apis/js-apis-notification.md index 1305ce8f886430d5797e4e3654d7791d710068fe..9ee2ae956f3cf344db1bd7b971e9601705a95945 100644 --- a/en/application-dev/reference/apis/js-apis-notification.md +++ b/en/application-dev/reference/apis/js-apis-notification.md @@ -528,7 +528,7 @@ Obtains all notification slots. This API uses an asynchronous callback to return | Name | Readable| Writable| Type | Mandatory| Description | | -------- | ---- | --- | --------------------------------- | ---- | -------------------- | -| callback | Yes | No | AsyncCallback\<[NotificationSlot](#notificationslot)\> | Yes | Callback used to return the result.| +| callback | Yes | No | AsyncCallback\\> | Yes | Callback used to return the result.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-workScheduler.md b/en/application-dev/reference/apis/js-apis-workScheduler.md index 964b63aa2ec47a0cceaaac8457f77f3a916051f7..28154fb549325dde8741ed35ed33a89d8986db1d 100644 --- a/en/application-dev/reference/apis/js-apis-workScheduler.md +++ b/en/application-dev/reference/apis/js-apis-workScheduler.md @@ -1,7 +1,12 @@ # Work Scheduler -> **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. +The **workScheduler** module provides the APIs for registering, canceling, and querying Work Scheduler tasks, which do not have real-time constraints. + +The system executes Work Scheduler tasks at an appropriate time, subject to the storage space, power consumption, temperature, and more. + +> **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. ## Modules to Import @@ -100,7 +105,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.code); + console.info('workschedulerLog getWorkStatus failed, because:' + err.data); } else { for (let item in res) { console.info('workschedulerLog getWorkStatus success,' + item + ' is:' + res[item]); @@ -136,7 +141,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.code); + console.info('workschedulerLog getWorkStatus failed, because:' + err.data); }) ``` @@ -164,7 +169,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.code); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); } else { console.info('workschedulerLog obtainAllWorks success, data is:' + JSON.stringify(res)); } @@ -190,7 +195,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.code); + console.info('workschedulerLog obtainAllWorks failed, because:' + err.data); }) ``` @@ -233,7 +238,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.code); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); } else { console.info('workschedulerLog isLastWorkTimeOut success, data is:' + res); } @@ -267,32 +272,30 @@ 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.code); + console.info('workschedulerLog isLastWorkTimeOut failed, because:' + err.data); }); ``` ## WorkInfo -Provides detailed information about the task. +Provides detailed information about the task. For details about the constraints on configuring **WorkInfo**, see [Work Scheduler Overview](../../task-management/work-scheduler-overview.md). **System capability**: SystemCapability.ResourceSchedule.WorkScheduler -| Name | Type | Mandatory| Description | -| --------------- | --------------------------------- | ---- | -------------------------------- | -| workId | number | Yes | Task ID. | -| bundleName | string | Yes | Name of the Work Scheduler task bundle. | -| abilityName | string | Yes | Name of the component to be notified by a Work Scheduler callback.| -| networkType | [NetworkType](#networktype) | No | Network type. | -| isCharging | boolean | No | Whether the device is charging. | -| chargerType | [ChargingType](#chargingtype) | No | Charging type. | -| batteryLevel | number | No | Battery level. | -| batteryStatus | [BatteryStatus](#batterystatus) | No | Battery status. | -| storageRequest | [StorageRequest](#storagerequest) | No | Storage status. | -| isRepeat | boolean | No | Whether the task is repeated. | -| 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. | +| Name | Type | Mandatory | Description | +| --------------- | --------------------------------- | ---- | ---------------- | +| workId | number | Yes | Task ID. | +| bundleName | string | Yes | Name of the Work Scheduler task bundle. | +| abilityName | string | Yes | Name of the component to be notified by a Work Scheduler callback.| +| networkType | [NetworkType](#networktype) | No | Network type. | +| isCharging | boolean | No | Whether the device is charging. | +| chargerType | [ChargingType](#chargingtype) | No | Charging type. | +| batteryLevel | number | No | Battery level. | +| batteryStatus | [BatteryStatus](#batterystatus) | No | Battery status. | +| storageRequest | [StorageRequest](#storagerequest) | No | Storage status. | +| isRepeat | boolean | No | Whether the task is repeated. | +| repeatCycleTime | number | No | Repeat interval. | +| repeatCount | number | No | Number of repeat times. | +| isPersisted | boolean | No | Whether to enable persistent storage for the task. | ## NetworkType Enumerates the network types that can trigger the task. @@ -336,8 +339,8 @@ Enumerates the storage states that can trigger the task. **System capability**: SystemCapability.ResourceSchedule.WorkScheduler - |Name |Default Value |Description| - | -------- | -------- | -------- | - |STORAGE_LEVEL_LOW |0 |The storage space is insufficient. - |STORAGE_LEVEL_OKAY |1 |The storage space is restored from insufficient to normal. - |STORAGE_LEVEL_LOW_OR_OKAY |2 |The storage space is restored from insufficient to normal, or the storage space is insufficient. +| Name | Default Value | Description | +| ------------------------- | ---- | ------------------------------ | +| STORAGE_LEVEL_LOW | 0 | The storage space is insufficient. | +| STORAGE_LEVEL_OKAY | 1 | The storage space is restored from insufficient to normal. | +| STORAGE_LEVEL_LOW_OR_OKAY | 2 | The storage space is restored from insufficient to normal, or the storage space is insufficient.| diff --git a/en/application-dev/reference/arkui-ts/figures/search.png b/en/application-dev/reference/arkui-ts/figures/search.png new file mode 100644 index 0000000000000000000000000000000000000000..fddf98d7104f3bd8a370b5be86da322834ff0180 Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/search.png differ 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 51598a90f72944e959ab2d9b836933c18356cc08..8330e5fafe2a3a13b11dd764418362b9eb9dfb72 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 @@ -20,32 +20,32 @@ Search(options?: { value?: string; placeholder?: string; icon?: string; controll **Parameters** -| Name | Type | Mandatory | Default Value | Description | -| ----------- | ---------------- | ---- | ---- | ---------------------------------------- | -| value | string | No | - | Text input in the search text box. | -| placeholder | string | No | - | Text displayed when there is no input. | -| icon | string | No | - | Path to the search icon. By default, the system search icon is used. The supported icon formats are .svg, .jpg, and .png.| -| controller | SearchController | No | - | Controller. | +| Name | Type | Mandatory | Description | +| ----------- | ---------------- | ---- | ---------------------------------------- | +| value | string | No | Text input in the search text box. | +| placeholder | string | No | Text displayed when there is no input. | +| icon | string | No | Path to the search icon. By default, the system search icon is used. The supported icon formats are .svg, .jpg, and .png.| +| controller | SearchController | No | Controller. | ## Attributes -| Name | Type | Default Value | Description | -| ----------------------- | ---------------------------------------- | ---- | --------------------- | -| searchButton | string | – | Text on the search button located next to the search text box. By default, there is no search button.| -| placeholderColor | [ResourceColor](ts-types.md#resourcecolor8) | - | Placeholder text color. | -| placeholderFont | [Font](ts-types.md#font) | - | Placeholder text style. | -| textFont | [Font](ts-types.md#font) | - | Text font for the search text box. | +| Name | Type | Description | +| ----------------------- | ---------------------------------------- | --------------------- | +| searchButton | string | Text on the search button located next to the search text box. By default, there is no search button.| +| placeholderColor | [ResourceColor](ts-types.md#resourcecolor8) | Placeholder text color. | +| placeholderFont | [Font](ts-types.md#font) | Placeholder text style. | +| textFont | [Font](ts-types.md#font) | Text font for the search text box. | ## Events -| Name | Description | -| ---------------------------------------- | ---------------------------------------- | -| onSubmit(callback: (value: string) => void) | Triggered when users click the search icon or the search button, or touch the search button on a soft keyboard.
-**value**: current text input.| -| onChange(callback: (value: string) => void) | Triggered when the input in the text box changes.
-**value**: current text input. | -| onCopy(callback: (value: string) => void) | Triggered when data is copied to the pasteboard.
-**value**: text copied. | -| onCut(callback: (value: string) => void) | Triggered when data is cut from the pasteboard.
-**value**: text cut. | -| onPaste(callback: (value: string) => void) | Triggered when data is pasted from the pasteboard.
-**value**: text pasted. | +| Name | Description | +| ------------------------------------------- | ------------------------------------------------------------ | +| onSubmit(callback: (value: string) => void) | Triggered when users click the search icon or the search button, or touch the search button on a soft keyboard.
- **value**: current text input. | +| onChange(callback: (value: string) => void) | Triggered when the input in the text box changes.
- **value**: current text input. | +| onCopy(callback: (value: string) => void) | Triggered when data is copied to the pasteboard.
- **value**: text copied. | +| onCut(callback: (value: string) => void) | Triggered when data is cut from the pasteboard.
- **value**: text cut. | +| onPaste(callback: (value: string) => void) | Triggered when data is pasted from the pasteboard.
- **value**: text pasted. | ## SearchController @@ -63,9 +63,9 @@ Sets the position of the caret. **Parameters** -| Name | Type | Mandatory | Default Value | Description | -| ----- | ------ | ---- | ---- | ----------------- | -| value | number | Yes | - | Length from the start of the character string to the position where the caret is located.| +| Name | Type | Mandatory | Description | +| ----- | ------ | ---- | ----------------- | +| value | number | Yes | Length from the start of the character string to the position where the caret is located.| diff --git a/en/application-dev/task-management/work-scheduler-dev-guide.md b/en/application-dev/task-management/work-scheduler-dev-guide.md index c5679dc1ea1c2aa8474d6423071a5b6eed7ff3d0..685486ada2fd56fe4467ad24df23ee7e2b9bb759 100644 --- a/en/application-dev/task-management/work-scheduler-dev-guide.md +++ b/en/application-dev/task-management/work-scheduler-dev-guide.md @@ -2,7 +2,7 @@ ## When to Use -If your application needs to execute a non-real-time task, for example, data learning, you can harness the Work Scheduler mechanism, which will schedule the task based on the storage space, power consumption, temperature, and more when the preset conditions are met. +If your application needs to execute a non-real-time task, for example, data learning, you can harness the Work Scheduler mechanism, which will schedule the task based on the storage space, power consumption, temperature, and more when the preset conditions are met. For details about the constraints on the Work Scheduler usage, see [Work Scheduler Overview](./work-scheduler-overview.md). ## Available APIs @@ -20,38 +20,42 @@ import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility'; **Table 1** Major workScheduler APIs -API | Description ----------------------------------------------------------|----------------------------------------- -startWork(work: WorkInfo): boolean | Starts a Work Scheduler task. -stopWork(work: WorkInfo, needCancel?: boolean): boolean | Stops a Work Scheduler task. -getWorkStatus(workId: number, callback: AsyncCallback\): void| Obtains the status of a Work Scheduler task. This method uses an asynchronous callback to return the result. -getWorkStatus(workId: number): Promise\ | Obtains the status of a Work Scheduler task. This method uses a promise to return the result. -obtainAllWorks(callback: AsyncCallback\): Array\| Obtains Work Scheduler tasks. This method uses an asynchronous callback to return the result. -obtainAllWorks(): Promise>| Obtains Work Scheduler tasks. This method uses a promise to return the result. -stopAndClearWorks(): boolean| Stops and clears Work Scheduler tasks. -isLastWorkTimeOut(workId: number, callback: AsyncCallback\): boolean| Checks whether the last execution of the specified task has timed out. This method uses an asynchronous callback to return the result. It is applicable to repeated tasks. -isLastWorkTimeOut(workId: number): Promise\| Checks whether the last execution of the specified task has timed out. This method uses a promise to return the result. It is applicable to repeated tasks. + API | Description + ------------------------------------------------------------ | ------------------------------------------------------------ + startWork(work: WorkInfo): boolean | Starts a Work Scheduler task. + stopWork(work: WorkInfo, needCancel?: boolean): boolean | Stops a Work Scheduler task. + getWorkStatus(workId: number, callback: AsyncCallback\): void | Obtains the status of a Work Scheduler task. This API uses an asynchronous callback to return the result. + getWorkStatus(workId: number): Promise\ | Obtains the status of a Work Scheduler task. This API uses a promise to return the result. + obtainAllWorks(callback: AsyncCallback\): Array\ | Obtains Work Scheduler tasks. This API uses an asynchronous callback to return the result. + obtainAllWorks(): Promise> | Obtains Work Scheduler tasks. This API uses a promise to return the result. + stopAndClearWorks(): boolean | Stops and clears Work Scheduler tasks. + isLastWorkTimeOut(workId: number, callback: AsyncCallback\): boolean | Checks whether the last execution of the specified task has timed out. This API uses an asynchronous callback to return the result. It is applicable to repeated tasks. + isLastWorkTimeOut(workId: number): Promise\ | Checks whether the last execution of the specified task has timed out. This API uses a promise to return the result. It is applicable to repeated tasks. **Table 2** WorkInfo parameters -API|Description|Type +> **NOTE** +> +> For details about the constraints on configuring **WorkInfo**, see [Work Scheduler Overview](./work-scheduler-overview.md). + +Name| Type|Description ---------------------------------------------------------|-----------------------------------------|--------------------------------------------------------- -workId | Work ID. Mandatory.|number -bundleName | Name of the Work Scheduler task bundle. Mandatory.|string -abilityName | Name of the component to be notified by a Work Scheduler callback.|string -networkType | Network type.| NetworkType -isCharging | Whether the device is charging.| boolean -chargerType | Charging type.| ChargingType -batteryLevel | Battery level.| number -batteryStatus| Battery status.| BatteryStatus -storageRequest|Storage status.| StorageRequest -isRepeat|Whether the task is repeated.| boolean -repeatCycleTime |Repeat interval.| number -repeatCount |Number of repeat times.| number +workId| number | Work ID. Mandatory. +bundleName| string | Name of the Work Scheduler task bundle. Mandatory. +abilityName| string | Name of the component to be notified by a Work Scheduler callback. Mandatory. +networkType | [NetworkType](../reference/apis/js-apis-workScheduler.md#networktype) | Network type. +isCharging| boolean | Whether the device is charging. +chargerType| [ChargingType](../reference/apis/js-apis-workScheduler.md#chargingtype) | Charging type. +batteryLevel| number | Battery level. +batteryStatus| [BatteryStatus](../reference/apis/js-apis-workScheduler.md#batterystatus) | Battery status. +storageRequest| [StorageRequest](../reference/apis/js-apis-workScheduler.md#storagerequest) |Storage status. +isRepeat| boolean |Whether the task is repeated. +repeatCycleTime| number |Repeat interval. +repeatCount | number|Number of repeat times. **Table 3** Work Scheduler callbacks -API | Description +Name | Description ---------------------------------------------------------|----------------------------------------- onWorkStart(work: WorkInfo): void | Triggered when the Work Scheduler task starts. onWorkStop(work: WorkInfo): void | Triggered when the Work Scheduler task stops. diff --git a/en/readme/misc-services.md b/en/readme/misc-services.md index 937e6cb511f72dfe0ba1e413e6151153c754aeb8..cbe1e1f2ef965cf24bbf0baab75904c81ddf728f 100755 --- a/en/readme/misc-services.md +++ b/en/readme/misc-services.md @@ -1,22 +1,21 @@ -# Misc Services +# Misc Services -## Introduction +## Introduction The Misc services subsystem provides APIs for setting the system time. -**Figure 1** Subsystem architecture +**Figure 1** Subsystem architecture ![](figures/subsystem-architecture.png "subsystem-architecture") -## Directory Structure +## Directory Structure ``` /base/miscservices └── time # Time service module ``` -## Repositories Involved +## Repositories Involved **Misc services subsystem** -miscservices\_time - +[time_time_service](https://gitee.com/openharmony/time_time_service)