From 6f6ebd197bb415ba7f79ca65c35cb7ace13c758e Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Fri, 12 May 2023 18:05:42 +0800 Subject: [PATCH] Update docs (17231) Signed-off-by: ester.zhou --- .../changelogs/v3.2-beta4/changelogs-arkui.md | 126 +++++++ .../v3.2-beta4/changelogs-device-manager.md | 106 ++++++ ...changelogs-enterprise_device_management.md | 157 +++++++++ .../changelogs-inputmethod-framworks.md | 242 ++++++++++++++ .../v3.2-beta4/changelogs-notification.md | 64 ++++ .../v3.2-beta4/changelogs-resourceschedule.md | 314 ++++++++++++++++++ .../changelogs/v3.2-beta4/changelogs-theme.md | 148 +++++++++ .../changelogs/v3.2-beta4/changelogs-web.md | 126 +++++++ 8 files changed, 1283 insertions(+) create mode 100644 en/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md create mode 100644 en/release-notes/changelogs/v3.2-beta4/changelogs-device-manager.md create mode 100644 en/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md create mode 100644 en/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md create mode 100644 en/release-notes/changelogs/v3.2-beta4/changelogs-notification.md create mode 100644 en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md create mode 100644 en/release-notes/changelogs/v3.2-beta4/changelogs-theme.md create mode 100644 en/release-notes/changelogs/v3.2-beta4/changelogs-web.md diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md new file mode 100644 index 0000000000..7acdb1c010 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md @@ -0,0 +1,126 @@ +# ArkUI Subsystem ChangeLog + +## cl.arkui.1 xcomponent API Change + +Changed the following APIs of the **xcomponent** component of the ArkUI subsystem: + + - **getXComponentSurfaceId** and **setXComponentSurfaceSize**: Removed the **@systemapi** tag. + - **getXComponentSurfaceId**, **getXComponentContext**, and **setXComponentSurfaceSize**: Specified the return value type. + +You need to adapt your application based on the following information. + + +**Change Impact** + +Released JS APIs are affected. The application needs to adapt these APIs so that it can be properly compiled in the SDK environment of the new version. + +**Key API/Component Changes** + + - **getXComponentSurfaceId**: is changed to a public API, with its return value type specified as string. + - **setXComponentSurfaceSize**: is changed to a public API, with its return value type specified as void. + - **getXComponentContext**: has its return value type specified as object. + +**Adaptation Guide** + +Startup rules for different scenarios are as follows: +Adaptions to be made: + + - **getXComponentSurfaceId** + - Rule in OpenHarmony 3.2 Beta3: + - System API + - No specified return value + - OpenHarmony 3.2 Beta4 rules: + - Public API + - Return value type specified as string + - You need to process the return value as a string. + - **setXComponentSurfaceSize** + - Rule in OpenHarmony 3.2 Beta3: + - System API + - No specified return value + - OpenHarmony 3.2 Beta4 rules: + - Public API + - Return value type specified as void + - You need to process the return value as a void. + - **getXComponentContext** + - Rule in OpenHarmony 3.2 Beta3: + - No specified return value + - OpenHarmony 3.2 Beta4 rules: + - Return value type specified as object + - You need to process the return value as an object. + +## cl.arkui.2 Change of Styles of Popup Component and APIs + +Changed the styles of the **alertDialog**, **actionSheet**, and **customDialog** components, as well as the **prompt** and **promptAction** APIs. Specifically speaking: + + - Added the popup background blur effect to **promptAction.showDialog**, **promptAction.showActionMenu**, **alertDialog**, **actionSheet**, and **customDialog**. + +**Change Impact** + +The popup background blur effect is set by default. + +**Key API/Component Changes** + +APIs: **promptAction.showDialog** and **promptAction.showActionMenu;** +Components: **alertDialog**, **actionSheet**, and **customDialog** + +**Adaptation Guide** + +No adaptation is required. + +## cl.arkui.3 Supplementation of the Initialization Mode and Restriction Verification Scenarios of Custom Components' Member Variables + +For details, see [Restrictions and Extensions](https://gitee.com/openharmony/docs/blob/master/en/application-dev/quick-start/arkts-restrictions-and-extensions.md). + + +**Change Impact** + +If custom components' member variables are initialized or assigned with values not according to the document specifications, an error will be reported during compilation. + +**Key API/Component Changes** + +N/A. + +**Adaptation Guide** + +Make modification according to specifications in the above document. + +## cl.arkui.4 Supplementation of Verification Scenarios of Value Assignment Restrictions on Member Variables of Custom Parent Components and Child Components + +For details, see [Restrictions and Extensions](../../../application-dev/quick-start/arkts-restrictions-and-extensions.md). + + +**Change Impact** + +If member variables of the parent component or child component are initialized not according to the document specifications, an error will be reported during compilation. + +**Key API/Component Changes** + +N/A. + +**Adaptation Guide** + +Make modification according to specifications in the above document, using other decorators or normal member variables for value assignment. + +## cl.arkui.5 Supplementation of Verification for a Single Subcomponent + +Added the check rule that allows only one child component to be enabled for the following components: **Button**, **FlowItem**, **GridItem**, **GridCol**, **ListItem**, **Navigator**, **Refresh**, **RichText**, **ScrollBar**, **StepperItem**, and **TabContent**. + + +**Change Impact** + +If one of the preceding components contains more than one child component, an error will be reported during compilation. + +**Key API/Component Changes** + +```js +RichText('RichText') { + Text('Text1') + Text('Text2') +} +/* ArkTS:ERROR File: /root/newOH/developtools/ace-ets2bundle/compiler/sample/pages/home.ets:25:7 + The component 'RichText' can only have a single child component. */ +``` + +**Adaptation Guide** + +Make modification based on the error message. Make sure that the specified component contains only one child component. diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-device-manager.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-device-manager.md new file mode 100644 index 0000000000..c9f8f116a9 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-device-manager.md @@ -0,0 +1,106 @@ +# Device Manager ChangeLog + +## cl.device_manager.1 Error Information Return Method Change of APIs + +The device manager API uses service logic return values to indicate the error information, which does not comply with the API error code specifications of OpenHarmony. The following changes are made in API version 9 and later: + +Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. + +Synchronous API: An error message is returned via an exception. + +**Change Impact** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Error code processing is added for the following APIs: + - createDeviceManager(bundleName: string, callback: AsyncCallback<DeviceManager>): void; + - release(): void; + - getTrustedDeviceListSync(): Array<DeviceInfo> + - getTrustedDeviceList(callback:AsyncCallback<Array<DeviceInfo>>): void; + - getTrustedDeviceList(): Promise<Array<DeviceInfo>> + - getLocalDeviceInfoSync(): DeviceInfo; + - getLocalDeviceInfo(callback:AsyncCallback<DeviceInfo>): void; + - getLocalDeviceInfo(): Promise<DeviceInfo> + - startDeviceDiscovery(subscribeInfo: SubscribeInfo): void; + - startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void; + - stopDeviceDiscovery(subscribeId: number): void; + - publishDeviceDiscovery(publishInfo: PublishInfo): void; + - unPublishDeviceDiscovery(publishId: number): void; + - authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinToken ?: number}>): void; + - unAuthenticateDevice(deviceInfo: DeviceInfo): void; + - verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback<{deviceId: string, level: number}>): void; + - setUserOperation(operateAction: number, params: string): void; + - on(type: 'uiStateChange', callback: Callback<{ param: string}>): void; + - off(type: 'uiStateChange', callback?: Callback<{ param: string}>): void; + - on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; + - off(type: 'deviceStateChange', callback?: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void; + - on(type: 'deviceFound', callback: Callback<{ subscribeId: number, device: DeviceInfo }>): void; + - off(type: 'deviceFound', callback?: Callback<{ subscribeId: number, device: DeviceInfo }>): void; + - on(type: 'discoverFail', callback: Callback<{ subscribeId: number, reason: number }>): void; + - off(type: 'discoverFail', callback?: Callback<{ subscribeId: number, reason: number }>): void; + - on(type: 'publishSuccess', callback: Callback<{ publishId: number }>): void; + - off(type: 'publishSuccess', callback?: Callback<{ publishId: number }>): void; + - on(type: 'publishFail', callback: Callback<{ publishId: number, reason: number }>): void; + - off(type: 'publishFail', callback?: Callback<{ publishId: number, reason: number }>): void; + - on(type: 'serviceDie', callback: () => void): void; + - off(type: 'serviceDie', callback?: () => void): void; + +**Adaptation Guide** + +The following uses **getTrustedDeviceList** as an example for asynchronous APIs: + +```ts +import account_osAccount from "@ohos.distributedHardware.deviceManager" +dmInstance.getTrustedDeviceList((err, data) => { + console.log("getTrustedDeviceList err: " + JSON.stringify(err)); + console.log('get trusted device info: ' + JSON.stringify(data)); +}); + +try { + dmInstance.getTrustedDeviceList((err, data) => { + if (err) { + console.error("getTrustedDeviceList errCode:" + err.code + ",errMessage:" + err.message); + return; + } + console.log('get trusted device info: ' + JSON.stringify(data)); + }); +} catch (err) { + console.error("getTrustedDeviceList errCode:" + err.code + ",errMessage:" + err.message); +} +``` + +The following uses **startDeviceDiscovery** as an example for synchronous APIs: + +```ts +// Automatically generate a unique subscription ID. +var subscribeId = Math.floor(Math.random() * 10000 + 1000); +var subscribeInfo = { + "subscribeId": subscribeId, + "mode": 0xAA, // Active discovery + "medium": 0, // Automatic. Multiple media can be used for device discovery. + "freq": 2, // High frequency + "isSameAccount": false, + "isWakeRemote": false, + "capability": 1 +}; +dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is called to notify the application when a device is discovered. + +// Automatically generate a unique subscription ID. +var subscribeId = Math.floor(Math.random() * 10000 + 1000); +var subscribeInfo = { + "subscribeId": subscribeId, + "mode": 0xAA, // Active discovery + "medium": 0, // Automatic. Multiple media can be used for device discovery. + "freq": 2, // High frequency + "isSameAccount": false, + "isWakeRemote": false, + "capability": 1 +}; +try { + dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is called to notify the application when a device is discovered. +} catch (err) { + console.error("startDeviceDiscovery errCode:" + err.code + ",errMessage:" + err.message); +} +``` diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md new file mode 100644 index 0000000000..dd8eb99aa4 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md @@ -0,0 +1,157 @@ +# Customization Subsystem ChangeLog + +## cl.Customization.1 Change of the Enterprise Device Management Module Name + +Changed **@ohos.enterpriseDeviceManager.d.ts** to **@ohos.enterprise.adminManager.d.ts**. + +**Change Impact** + +The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version. + +**Key API/Component Changes** + +| Original API | New API | +| --------------------------------- | ---------------------------------- | +| @ohos.enterpriseDeviceManager.d.ts | @ohos.enterprise.adminManager.d.ts | + +**Adaptation Guide** + +The original APIs are only moved to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. + +If the original API uses **@ohos.enterpriseDeviceManager**: + +```js +import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager'; +``` + +You can modify **import** to switch to the new namespace: + +```js +import enterpriseDeviceManager from '@ohos.enterprise.adminManager'; +``` + +## cl.Customization.2 enterpriseDeviceManager/DeviceSettingsManager.d.ts Module Change + +Changed **enterpriseDeviceManager/DeviceSettingsManager.d.ts** to **ohos.enterprise.dateTimeManager.d.ts**. + +**Change Impact** + +The application developed based on OpenHarmony earlier than 3.2.8.3 must be adapted so that it can be properly compiled in the SDK environment of the new version. + +**Key API/Component Changes** + +| Original API | Original API Type | New API | New API Type | +| --------------------------------- | --------- | ---------------------------------- | ----- | +| enterpriseDeviceManager/DeviceSettingsManager.d.ts | interface | @ohos.enterprise.dateTimeManager.d.ts | namespace | + +**Adaptation Guide** + +If the **setDateTime** API of **enterpriseDeviceManager/DeviceSettingsManager.d.ts** is used: + +```js +import enterpriseDeviceManager from '@ohos.enterpriseDeviceManager' + +let wantTemp = { + bundleName: "bundleName", + abilityName: "abilityName", +}; +enterpriseDeviceManager.getDeviceSettingsManager((error, mgr) => { + if (error) { + console.log("error code:" + error.code + " error message:" + error.message); + return; + } + mgr.setDateTime(wantTemp, 1526003846000, (error) => { + if (error) { + console.log("error code:" + error.code + " error message:" + error.message); + } + }); +}); +``` + +You need to import the new namespace for adaptation: + +```js +import dateTimeManager from '@ohos.enterprise.dateTimeManager' + +let wantTemp = { + bundleName: "bundleName", + abilityName: "abilityName", +}; +dateTimeManager.setDateTime(wantTemp, 1526003846000, (error) => { + if (error) { + console.log("error code:" + error.code + " error message:" + error.message); + } +}) +``` + +## cl.Customization.3 System API Change + +Changed all enterprise device management APIs to system APIs. + +**Change Impact** + +All APIs can be called only by system applications. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enum/Constant | Change Type| +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, callback: AsyncCallback<**boolean**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback<**boolean**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isAdminEnabled(admin: Want, userId?: number): Promise<**boolean**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want, callback: AsyncCallback<**EnterpriseInfo**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** getEnterpriseInfo(admin: Want): Promise<**EnterpriseInfo**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String, callback: AsyncCallback<**boolean**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** isSuperAdmin(bundleName: String): Promise<**boolean**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | systemapi | +| @ohos.enterprise.adminManager | adminManager | **interface** EnterpriseInfo | systemapi | +| @ohos.enterprise.adminManager | adminManager | **enum** AdminType | systemapi | +| @ohos.enterprise.adminManager | adminManager | **enum** ManagedEvent | systemapi | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | systemapi | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | systemapi | + +## cl.Customization.4 API Permission Change + +Added permission verification for some APIs. + +**Change Impact** + +The application developed based on OpenHarmony earlier than 3.2.8.3 must have the corresponding permission so that it can properly call these APIs. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enum/Constant | New Permission| +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId: number, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableAdmin(admin: Want, userId?: number): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String, callback: AsyncCallback<**void**>): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** disableSuperAdmin(bundleName: String): Promise<**void**>; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback<**void**>): void; | ohos.permission.SET_ENTERPRISE_INFO | +| @ohos.enterprise.adminManager | adminManager | **function** setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise<**void**>; | ohos.permission.SET_ENTERPRISE_INFO | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT | +| @ohos.enterprise.adminManager | adminManager | **function** subscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT | +| @ohos.enterprise.adminManager | adminManager | **function** unsubscribeManagedEvent(admin: Want, managedEvents: Array<**ManagedEvent**>): Promise<**void**>; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number, callback: AsyncCallback<**void**>): void; | ohos.permission.ENTERPRISE_SET_DATETIME | +| @ohos.enterprise.dataTimeManager | dateTimeManager | **function** setDateTime(admin: Want, time: number): Promise<**void**>; | ohos.permission.ENTERPRISE_SET_DATETIME | + +**Adaptation Guide** + +Apply for the corresponding permission to call these APIs properly. diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md new file mode 100644 index 0000000000..be4a459e40 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md @@ -0,0 +1,242 @@ +# Input Method Framework ChangeLog + +## cl.inputmethod_frameworks.1 API Error Information Return Method Change + +The internal APIs of the following modules used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later. + + - Input method framework module: system API, @ohos.inputmethod.d.ts + + - Input method service module: system API, @ohos.inputmethodengine.d.ts + + - Input method ExtentionAbility module: system API, @ohos.inputmethodextensionability.d.ts + + - Input method ExtentionContext module: system API, @ohos.inputmethodextensioncontext.d.ts + + - Input method subtype module: system API, @ohos.inputMethodSubtype.d.ts + +Asynchronous API: An error message is returned via **AsyncCallback** or the **error** object of **Promise**. + +Synchronous API: An error message is returned via an exception. + +**Change Impact** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Error code processing is added for the following APIs: + - getSetting(): InputMethodSetting; + + - getController(): InputMethodController; + + - switchInputMethod(target: InputMethodProperty, callback: AsyncCallback\): void; + + - switchInputMethod(target: InputMethodProperty): Promise\; + + - switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback\): void; + + - switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise\; + + - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback\): void; + + - switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype): Promise\; + + - listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback>): void; + + - listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise>; + + - listCurrentInputMethodSubtype(callback: AsyncCallback>): void; + + - listCurrentInputMethodSubtype(): Promise>; + + - getInputMethods(enable: boolean, callback: AsyncCallback>): void; + + - getInputMethods(enable: boolean): Promise>; + + - showOptionalInputMethods(callback: AsyncCallback\): void; + + - showOptionalInputMethods(): Promise\; + + - stopInputSession(callback: AsyncCallback\): void; + + - stopInputSession(): Promise\; + + - showSoftKeyboard(callback: AsyncCallback\): void; + + - showSoftKeyboard():Promise\; + + - hideSoftKeyboard(callback: AsyncCallback\): void; + + - hideSoftKeyboard():Promise\; + + - hide(callback: AsyncCallback\): void; + + - hide(): Promise\; + + - onCreate(want: Want): void; + + - onDestroy(): void; + + + - In **InputClient**: + + - sendKeyFunction(action: number, callback: AsyncCallback\): void; + + - sendKeyFunction(action: number): Promise\; + + - deleteForward(length: number, callback: AsyncCallback\): void; + + - deleteForward(length: number): Promise\; + + - deleteBackward(length: number, callback: AsyncCallback\): void; + + - deleteBackward(length: number): Promise\; + + - insertText(text: string, callback: AsyncCallback\): void; + + - insertText(text: string): Promise\; + + - getForward(length: number, callback: AsyncCallback\): void; + + - getForward(length: number): Promise\; + + - getBackward(length: number, callback: AsyncCallback\): void; + + - getBackward(length: number): Promise\; + + - getEditorAttribute(callback: AsyncCallback\): void; + + - getEditorAttribute(): Promise\EditorAttribute>; + + - moveCursor(direction: number, callback: AsyncCallback\): void; + + - moveCursor(direction: number): Promise\; + +- In **InputMethodExtensionAbility**: + + - onCreate(want: Want): void; + + - onDestroy(): void; + +**Adaptation Guide** + +The following uses **showOptionalInputMethods** as an example for asynchronous APIs: + +Callback mode: + +```js +import inputMethod from '@ohos.inputmethod'; +let inputMethodSetting = inputMethod.getSetting(); +try { + inputMethodSetting.showOptionalInputMethods((err, data) => { + if (err !== undefined) { + console.error('Failed to showOptionalInputMethods: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in showing optionalInputMethods.'); + }); +} catch (err) { + console.error('Failed to showOptionalInputMethods: ' + JSON.stringify(err)); +} +``` + +Promise mode: + +```js +import inputMethod from '@ohos.inputmethod'; +let inputMethodSetting = inputMethod.getSetting(); +inputMethodSetting.showOptionalInputMethods().then((data) => { + console.info('Succeeded in showing optionalInputMethods.'); +}).catch((err) => { + console.error('Failed to showOptionalInputMethods: ' + JSON.stringify(err)); +}) +``` + +## cl.inputmethod_frameworks.2 Deprecation of Some APIs + +Deprecated APIs: + - getInputMethodSetting(): InputMethodSetting; + - getInputMethodController(): InputMethodController; + - listInputMethod(callback: AsyncCallback>): void; + - listInputMethod(): Promise>; + - displayOptionalInputMethod(callback: AsyncCallback): void; + - displayOptionalInputMethod(): Promise; + - stopInput(callback: AsyncCallback): void; + - stopInput(): Promise; + interface InputMethodProperty: + - readonly packageName: string; + - readonly methodId: string; + - getInputMethodEngine(): InputMethodEngine; + - createKeyboardDelegate(): KeyboardDelegate; + - hideKeyboard(callback: AsyncCallback): void; + - hideKeyboard(): Promise; + +Substitute APIs: + - getSetting(): InputMethodSetting; + - getController(): InputMethodController; + - getInputMethods(enable: boolean, callback: AsyncCallback>): void; + - getInputMethods(enable: boolean): Promise>; + - showOptionalInputMethods(callback: AsyncCallback): void; + - showOptionalInputMethods(): Promise; + - stopInputSession(callback: AsyncCallback): void; + - stopInputSession(): Promise; + interface InputMethodProperty: + - readonly name: string; + - readonly id: string; + - getInputMethodAbility(): InputMethodAbility; + - getKeyboardDelegate(): KeyboardDelegate; + - hide(callback: AsyncCallback): void; + - hide(): Promise; + +**NOTE** + Use the **getInputMethodAbility()** API to obtain an **InputMethodAbility** object, and do not use **getInputMethodEngine()** to obtain an **InputMethodEngine** object. + Use methods in **InputMethodAbility**, and do not use methods in **InputMethodEngine**. + Use the **on('inputStart')** method in **InputMethodAbility** to obtain a **KeyboardController** instance and an **InputClient** instance, and do not use the **on('inputStart')** method in **InputMethodEngine** to obtain a **TextInputClient** instance. +Before: + +```js +inputMethodEngine.getInputMethodEngine().on('inputStart', (kbController, textClient) => { + let keyboardController = kbController; + let textInputClient = textClient; // Obtain a TextInputClient instance. +}); +``` + +After: +```js +inputMethodEngine.getInputMethodAbility().on('inputStart', (kbController, client) => { + let keyboardController = kbController; + let inputClient = client; // // Obtain an InputClient instance. +}); +``` + +## cl.inputmethod_frameworks.3 Change of Some APIs + +Before change: + - listInputMethod(enable: boolean, callback: AsyncCallback>): void; + - listInputMethod(enable: boolean): Promise>; + - terminateSelf(callback: AsyncCallback): void; + - terminateSelf(): Promise; + +After change: + - getInputMethods(enable: boolean, callback: AsyncCallback>): void; + - getInputMethods(enable: boolean): Promise>; + - destroy(callback: AsyncCallback): void; + - destroy(): Promise; + +Deleted APIs in API version 9: + - startAbility(want: Want, callback: AsyncCallback): void; + - startAbility(want: Want, options: StartOptions, callback: AsyncCallback): void; + - startAbility(want: Want, options?: StartOptions): Promise; + +Added APIs: + - on(type: 'imeChange', callback: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void): void; + - off(type: 'imeChange', callback?: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void): void; + - interface InputMethodProperty: + - readonly label?: string; + - readonly icon?: string; + - readonly iconId?: number; + - extra: object; + + - interface InputMethodAbility: + - on(type: 'setSubtype', callback: (inputMethodSubtype: InputMethodSubtype) => void): void; + - off(type: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void; diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-notification.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-notification.md new file mode 100644 index 0000000000..b7a670a8a4 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-notification.md @@ -0,0 +1,64 @@ +# Common Event and Notification Subsystem ChangeLog + +## cl.notification.1 API Exception Handling Method Changes + +Certain event notification APIs use service logic return values to indicate error information, which does not comply with the API error code specifications of OpenHarmony. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the new APIs and their method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +For adaptation to the unified API exception handling mode, certain event notification APIs are deprecated (original APIs in the following table) and corresponding new APIs in the following table are added. The newly added APIs support unified error code handling specifications and function the same as the original APIs. + +| Original API | New API | +| ----------------------- | -------------------------------- | +| @ohos.commonEvent.d.ts | @ohos.commonEventManager.d.ts | +| @ohos.notification.d.ts | @ohos.notificationManager.d.ts | +| @ohos.notification.d.ts | @ohos.notificationSubscribe.d.ts | + +**Adaptation Guide** + +The original APIs are only migrated to the new namespace. Therefore, you can modify **import** to solve the adaptation problem. + +If the original API uses **@ohos.commonEvent**: + +```js +import commonEvent from '@ohos.commonEvent'; +``` + +You can directly modify **import** to switch to the new namespace: + +```js +import commonEvent from '@ohos.commonEventManager'; +``` + +**@ohos.notification** is split into two namespaces. You need to select a new namespace for adaptation. + +In addition, exception handling is needed. For details, see the API reference for the new APIs. + +## cl.notification.2 API Changes + +The names of some event notification APIs are changed. + +**Key API/Component Changes** + +| Module | Class | Method/Attribute/Enumeration/Constant | Change Type| +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.notification | notification | **function** enableNotification(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notification | notification | **function** enableNotification(bundle: BundleOption, enable: boolean): Promise<**void**>; | Deprecated | +| @ohos.notificationManager | notificationManager | **function** setNotificationEnable(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.notificationManager | notificationManager | **function** setNotificationEnable(bundle: BundleOption, enable: boolean): Promise<**void**>; | Added | +| @ohos.notification | notification | **function** enableNotificationSlot(bundle: BundleOption, **type**: SlotType, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notification | notification | **function** enableNotificationSlot(bundle: BundleOption, **type**: SlotType, enable: boolean): Promise<**void**>; | Deprecated | +| @ohos.notificationManager | notificationManager | **function** setNotificationEnableSlot(bundle: BundleOption, **type**: SlotType, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.notificationManager | notificationManager | **function** setNotificationEnableSlot(bundle: BundleOption, **type**: SlotType, enable: boolean): Promise<**void**>; | Added | +| @ohos.notification | notification | **function** enableDistributed(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notification | notification | **function** enableDistributed(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notificationManager | notificationManager | **function** setDistributedEnable(enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.notificationManager | notificationManager | **function** setDistributedEnable(enable: boolean): Promise<**void**>; | Added | +| @ohos.notification | notification | **function** enableDistributedByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Deprecated | +| @ohos.notification | notification | **function** enableDistributedByBundle(bundle: BundleOption, enable: boolean): Promise<**void**>; | Deprecated | +| @ohos.notificationManager | notificationManager | **function** setDistributedEnableByBundle(bundle: BundleOption, enable: boolean, callback: AsyncCallback<**void**>): **void**; | Added | +| @ohos.notificationManager | notificationManager | **function** setDistributedEnableByBundle(bundle: BundleOption, enable: boolean): Promise<**void**>; | Added | diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md new file mode 100644 index 0000000000..73ffb069e2 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-resourceschedule.md @@ -0,0 +1,314 @@ +# Resource Scheduler Subsystem Changelog + +## cl.resourceschedule.backgroundTaskManager +Rectified original APIs of **backgroundTaskManager** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impact** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.backgroundTaskManager.d.ts** file is deprecated and related APIs are moved to the newly added **@ohos.resourceschedule.backgroundTaskManager.d.ts** file. + +| Class| API Type| Declaration| Description| +| -- | -- | -- | -- | +| backgroundTaskManager | namespace | declare namespace backgroundTaskManager | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | Changed in API version 9 to **function applyEfficiencyResources(request: EfficiencyResourcesRequest): void;** and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback): DelaySuspendInfo; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | field | requestId: number | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | Deprecated in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | export enum ResourceType | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | CPU = 1 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| +| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | Changed in API version 9 and moved to the **ohos.resourceschedule.backgroundTaskManager.d.ts** file.| + + +**Adaptation Guide** + +Import the **backgroundTaskManager** module. +``` +import bundle form '@ohos.resourceschedule.backgroundTaskManager' +``` +Exception handling also needs to be adapted. For details, see the [backgroundTaskManager API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md). + +## c2.resourceschedule.usageStatistics +Rectified original APIs of **deviceUsageStatistics** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impact** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.bundleState.d.ts** file is deprecated, the **@ohos.resourceschedule.usageStatistics.d.ts** file is added, and the class name is changed from **bundleState** to **usageStatistics**. + +| Class | API Type | Method/Attribute/Enum/Constant | Change Type | +| ----------------------------------------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| bundleState | method | function isIdleState(bundleName: string, callback: AsyncCallback): void; | Deprecated and moved to **usageStatistics.isIdleState**. | +| bundleState | method | function isIdleState(bundleName: string): Promise; | Deprecated and moved to **usageStatistics.isIdleState**. | +| bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(callback: AsyncCallback): void;**.| +| bundleState | method | function queryAppUsagePriorityGroup(): Promise; | Deprecated and changed to **function queryAppGroup(): Promise;**. | +| bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback): void;**.| +| bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise; | Deprecated and changed to **function queryBundleStatsInfos(begin: number, end: number): Promise;**.| +| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>;**.| +| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise>; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void; | Deprecated and changed to **function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise>; | Deprecated and changed to **function QueryModuleUsageRecords(maxNum: number): Promise>;** and **function QueryModuleUsageRecords(): Promise>;**.| +| bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback>): void; | Deprecated and changed to **function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void;** and **function QueryModuleUsageRecords(callback: AsyncCallback>): void;**.| +| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise; | Deprecated and changed to **function queryAppGroup(bundleName: string): Promise;**.| +| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback): void; | Deprecated and changed to **function queryAppGroup(bundleName: string, callback: AsyncCallback): void;**.| +| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback): void;**.| +| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise; | Deprecated and changed to **function setAppGroup(bundleName: string, newGroup: GroupType): Promise;**.| +| bundleState | method | function registerGroupCallBack(callback: Callback, callback: AsyncCallback): void; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback, callback: AsyncCallback): void;**.| +| bundleState | method | function registerGroupCallBack(callback: Callback): Promise; | Deprecated and changed to **function registerAppGroupCallBack(callback: Callback): Promise;**.| +| bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback): void; | Changed to **function unregisterAppGroupCallBack(): Promise;**.| +| bundleState | method | function unRegisterGroupCallBack(): Promise; | Changed to **function unregisterAppGroupCallBack(): Promise;**.| +| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback>): void; | Changed to **function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback>): void;**| +| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise>; | Changed in API version 9 to **function queryDeviceEventStats(begin: number, end: number): Promise>;**.| +| bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback>): void; | Changed in API version 9 to **function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback>): void;**.| +| bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise>; | Changed in API version 9 to **function queryNotificationEventStats(begin: number, end: number): Promise>;**.| +| bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | bundleName: string | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | changeReason: number | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | userId: number | Moved to **usageStatistics.AppGroupCallbackInfo**. | +| bundleState.BundleActiveGroupCallbackInfo | field | appUsageNewGroup: number | Deprecated and changed to **appNewGroup**. | +| bundleState.BundleActiveGroupCallbackInfo | field | appUsageOldGroup: number | Deprecated and changed to **appOldGroup**. | +| bundleState.BundleActiveEventState | interface | interface BundleActiveEventState | Deprecated and changed to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveEventState | field | count: number | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveEventState | field | eventId: number | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveEventState | field | name: string | Moved to **usageStatistics.DeviceEventStats**. | +| bundleState.BundleActiveModuleInfo | interface | interface BundleActiveModuleInfo | Changed in API version 9 to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | formRecords: Array | Changed to **formRecords: Array**. | +| bundleState.BundleActiveModuleInfo | field | lastModuleUsedTime: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | launchedCount: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityIconId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityDescriptionId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityLableId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | descriptionId?: number; | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | labelId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | appLabelId?: number | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | abilityName?: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | moduleName: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | bundleName: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.BundleActiveModuleInfo | field | deviceId?: string | Moved to **usageStatistics.HapModuleInfo**. | +| bundleState.GroupType | enum | enum GroupType | Moved to **usageStatistics.GroupType**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_ALIVE | Deprecated and changed to **ALIVE_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_DAILY | Deprecated and changed to **DAILY_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_FIXED | Deprecated and changed to **FIXED_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_RARE | Deprecated and changed to **RARE_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_LIMIT | Deprecated and changed to **LIMITED_GROUP**. | +| bundleState.GroupType | enum | ACTIVE_GROUP_NEVER | Deprecated and changed to **NEVER_GROUP**. | +| bundleState.IntervalType | enum | enum IntervalType | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_OPTIMIZED | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_DAILY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_WEEKLY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_MONTHLY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.IntervalType | enum | BY_ANNUALLY | Deprecated and moved to **usageStatistics.IntervalType**. | +| bundleState.BundleActiveInfoResponse | interface | interface BundleActiveInfoResponse | Deprecated and changed to **usageStatistics.BundleStatsMap**. | +| bundleState.BundleActiveState | interface | interface BundleActiveState | Deprecated and changed to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | stateType?: number | Deprecated and changed to **eventId**. | +| bundleState.BundleActiveState | field | stateOccurredTime?: number | Deprecated and changed to **eventOccurredTime**. | +| bundleState.BundleActiveState | field | nameOfClass?: string | Deprecated and moved to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | indexOfLink?: string | Deprecated and moved to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | bundleName?: string | Deprecated and moved to **usageStatistics.BundleEvents**. | +| bundleState.BundleActiveState | field | appUsagePriorityGroup?: number | Deprecated and changed to **appGroup**. | +| bundleState.BundleStateInfo | interface | interface BundleStateInfo | Deprecated and changed to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | method | merge(toMerge: BundleStateInfo): void | Deprecated. | +| bundleState.BundleStateInfo | field | infosEndTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | infosBeginTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | fgAbilityPrevAccessTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | fgAbilityAccessTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | bundleName?: string | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilitySeenTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityPrevSeenTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityPrevAccessTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | abilityInFgTotalTime?: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState.BundleStateInfo | field | id: number | Deprecated and moved to **usageStatistics.BundleStatsInfo**. | +| bundleState | namespace | declare namespace bundleState | Deprecated and changed to **usageStatistics**, and moved to **ohos.resourceschedule.usageStatistics.d.ts**.| + + +**Adaptation Guide** + +Import the **usageStatistics** module. +``` +import bundle form '@ohos.resourceschedule.usageStatistics' +``` +Exception handling also needs to be adapted. For details, see the [usageStatistics API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md). + + +## c3.resourceschedule.workScheduler +Rectified original APIs of **workScheduler** of the resource scheduler subsystem. The original APIs in API version 9 are changed to new APIs in API version 9. The new APIs in API version 9 comply with the error code specifications. + +**Change Impact** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.workScheduler.d.ts** file is deprecated and related APIs are moved to the newly added **@ohos.resourceschedule.workScheduler.d.ts** file. + +| Class| API Type| Declaration| Change Type| +| -- | -- | -- | -- | +| workScheduler | namespace | declare namespace workScheduler | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | interface | export interface WorkInfo | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | idleWaitTime?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isDeepIdle?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | repeatCount?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isRepeat?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | repeatCycleTime?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | batteryLevel?: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | chargerType?: ChargingType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isCharging?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | networkType?: NetworkType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | isPersisted?: boolean | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | abilityName: string | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | bundleName: string | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.WorkInfo | field | workId: number | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function stopAndClearWorks(): boolean; | Changed in API version 8 to **function stopAndClearWorks(): boolean;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function obtainAllWorks(): Promise>; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function obtainAllWorks(callback: AsyncCallback): Array; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function getWorkStatus(workId: number): Promise; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback): void; | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | Changed in API version 8 to **function stopWork(work: WorkInfo, needCancel?: boolean): void;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler | method | function startWork(work: WorkInfo): boolean; | Changed in API version 9 to **function startWork(work: WorkInfo): void;** and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | export enum NetworkType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | export enum ChargingType | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | export enum BatteryStatus | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.StorageRequest | enum | export enum StorageRequest | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | Changed in API version 9 and moved to the **ohos.resourceschedule.workScheduler.d.ts** file.| + + +**Adaptation Guide** + +Import the **workScheduler** module. +``` +import bundle form '@ohos.resourceschedule.workScheduler' +``` +Exception handling also needs to be adapted. For details, see the [workScheduler API reference](../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md). + + +## c4.resourceschedule.reminderAgent +Rectified original APIs of **reminderAgent** of the resource scheduler subsystem. All APIs in API version 8 and earlier versions are deprecated, and original APIs in API version 9 are deleted. New APIs in API version 9 need to be used. The new APIs in API version 9 comply with the error code specifications. + +**Change Impact** + +The application developed based on the SDK versions of OpenHarmony 3.2.8.2 and later needs to adapt the modules and APIs in API version 9 and their methods for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +The following methods, attributes, enums, and constants are changed in API version 9 and later versions. The **@ohos.reminderAgent.d.ts** file is deprecated, the **@ohos.reminderAgentManager.d.ts** file is added, and the class name is changed from **reminderAgent** to **reminderAgentManager**. + +| Class | API Type | Method/Attribute/Enum/Constant | Change Type | +| --------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelReminder(reminderId: number): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | getValidReminders(callback: AsyncCallback>): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | getValidReminders(): Promise>; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelAllReminders(callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | cancelAllReminders(): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback): void; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise; | Deprecated and moved to **reminderAgentManager**.| +| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | Deprecated and moved to **reminderAgentManager.ActionButtonType**.| +| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE | Deprecated and moved to **reminderAgentManager.ActionButtonType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | Deprecated and moved to **reminderAgentManager.ReminderType**.| +| reminderAgent.ActionButton | field | title:string | Deprecated and moved to **reminderAgentManager.ActionButton**.| +| reminderAgent.ActionButton | field | type:ActionButtonType | Deprecated and moved to **reminderAgentManager.ActionButton**.| +| reminderAgent.WantAgent | field | pkgName:string | Deprecated and moved to **reminderAgentManager.WantAgent**.| +| reminderAgent.WantAgent | field | abilityName:string | Deprecated and moved to **reminderAgentManager.WantAgent**.| +| reminderAgent.MaxScreenWantAgent | field | pkgName:string | Deprecated and moved to **reminderAgentManager.MaxScreenWantAgent**.| +| reminderAgent.MaxScreenWantAgent | field | abilityName:string | Deprecated and moved to **reminderAgentManager.MaxScreenWantAgent**.| +| reminderAgent.ReminderRequest | field | reminderType:ReminderType | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | actionButton?:ActionButton | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | ringDuration?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | snoozeTimes?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | timeInterval?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | title?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | content?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | expiredContent?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | snoozeContent?:string | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | notificationId?:number | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequest | field | slotType?: notification.SlotType | Deprecated and moved to **reminderAgentManager.ReminderRequest**.| +| reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestCalendar**.| +| reminderAgent.ReminderRequestAlarm | field | hour:number | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestAlarm | field | minute:number | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array | Deprecated and moved to **reminderAgentManager.ReminderRequestAlarm**.| +| reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | Deprecated and moved to **reminderAgentManager.ReminderRequestTimer**.| +| reminderAgent.LocalDateTime | field | year:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | month:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | day:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | hour:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | minute:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| +| reminderAgent.LocalDateTime | field | second?:number | Deprecated and moved to **reminderAgentManager.LocalDateTime**.| + + +**Adaptation Guide** + +Import the **reminderAgentManager** module. +``` +import bundle form '@ohos.reminderAgentManager' +``` +Exception handling also needs to be adapted. For details, see the [reminderAgentManager API reference](../../../application-dev/reference/apis/js-apis-reminderAgentManager.md). diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-theme.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-theme.md new file mode 100644 index 0000000000..17621fd618 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-theme.md @@ -0,0 +1,148 @@ +# Theme Framework ChangeLog + +## cl.theme.1 Support of Exception Handling for APIs in API Version 9 + +The internal APIs of the following modules used service logic return values to indicate error information, which did not comply with the error code specifications of OpenHarmony. Therefore, they are modified in API version 9 and later. + - Wallpaper management service: **@ohos.wallpaper.d.ts** + + - Lock screen management service: **@ohos.screenLock.d.ts** + +APIs in the preceding modules are changed as follows: +Synchronous API: An error message is returned via an exception. +Asynchronous API: A parameter check error is returned synchronously. A service logic error is returned via **AsyncCallback** or the **error** object of **Promise**. + +**Change Impacts** + +The application developed based on earlier versions needs to adapt the method for returning API error information. Otherwise, the original service logic will be affected. + +**Key API/Component Changes** + +Deprecated APIs of the wallpaper management service: + - getColors(wallpaperType: WallpaperType, callback: AsyncCallback>): void; + - getColors(wallpaperType: WallpaperType): Promise>; + - getId(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - getId(wallpaperType: WallpaperType): Promise; + - getMinHeight(callback: AsyncCallback): void; + - getMinHeight(): Promise; + - getMinWidth(callback: AsyncCallback): void; + - getMinWidth(): Promise; + - isChangePermitted(callback: AsyncCallback): void; + - isChangePermitted(): Promise; + - isOperationAllowed(callback: AsyncCallback): void; + - isOperationAllowed(): Promise; + - reset(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - reset(wallpaperType: WallpaperType): Promise; + - setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + - setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; + - getFile(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - getFile(wallpaperType: WallpaperType): Promise; + - getPixelMap(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - getPixelMap(wallpaperType: WallpaperType): Promise; + +Substitute APIs of the wallpaper management service: + - getColorsSync(wallpaperType: WallpaperType): Array; + - getIdSync(wallpaperType: WallpaperType): number; + - getMinHeightSync(): number; + - getMinWidthSync(): number; + - isChangeAllowed(): boolean; + - isUserChangeAllowed(): boolean; + - restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - restore(wallpaperType: WallpaperType): Promise; + - setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + - setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; + - getFileSync(wallpaperType: WallpaperType): number; + - getImage(wallpaperType: WallpaperType, callback: AsyncCallback): void; + - getImage(wallpaperType: WallpaperType): Promise; + +Changed APIs of the wallpaper management service: + - on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void + - off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void + +Deprecated APIs of the lock screen management service: + - isScreenLocked(callback: AsyncCallback): void; + - isScreenLocked(): Promise; + - isSecureMode(callback: AsyncCallback): void; + - isSecureMode(): Promise; + - unlockScreen(callback: AsyncCallback): void; + - unlockScreen(): Promise; + +Substitute APIs of the lock screen management service: + - isLocked(): boolean; + - isSecure(): boolean; + - unlock(callback: AsyncCallback): void; + - unlock():Promise; + +Deleted APIs of the lock screen management service: + - lockScreen(callback: AsyncCallback): void; + - lockScreen(): Promise; + +The following APIs are added for the lock screen management service: + - lock(callback: AsyncCallback): void; + - lock():Promise; + +Changed APIs of the lock screen management service: + - onSystemEvent(callback: Callback): boolean; + - sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback): void; + - sendScreenLockEvent(event: String, parameter: number): Promise; + +**Adaption Guide for the Wallpaper Management Service** + +The following uses **getImage** as an example for asynchronous APIs: + +```ts +import pointer from '@ohos.wallpaper'; +try { + wallpaper.getImage(wallpaper.WallpaperType.WALLPAPER_SYSTEM).then((data) => { + console.log(`success to getImage: ${JSON.stringify(data)}`); + }).catch((error) => { + console.error(`failed to getImage because: ${JSON.stringify(error)}`); + }); +} catch (err) { + console.error(`failed to getImage because: ${JSON.stringify(err)}`); +} + +``` + +The following uses **getFileSync** as an example for synchronous APIs: + +```ts +import pointer from '@ohos.wallpaper'; +try { + let file = wallpaper.getFileSync(wallpaper.WallpaperType.WALLPAPER_SYSTEM); +} catch (err) { + console.error(`failed to getFileSync because: ${err.message}`); +} +``` + +**Adaption Guide for the Lock Screen Management Service** + +The following uses **lock** as an example for asynchronous APIs: + +```ts +import screenLock from '@ohos.screenlock'; +try { + screenLock.lock((err, data) => { + if (err) { + console.error(`Failed to lock the screen, because: ${err.message}`); + return; + } + console.info(`lock the screen successfully. result: ${data}`); + }); +} catch (err) { + console.error(`Failed to lock the screen, because: ${err.message}`); +} + +``` + +The following uses **onSystemEvent** as an example for synchronous APIs: + +```ts +import screenLock from '@ohos.screenlock'; +try { + let isSuccess = screenLock.onSystemEvent((event) => { + console.log(`Register the system event which related to screenlock successfully. eventType: ${event.eventType}`) + }); +} catch (err) { + console.error(`Failed to register the system event which related to screenlock, because: ${err.message}`) +} +``` diff --git a/en/release-notes/changelogs/v3.2-beta4/changelogs-web.md b/en/release-notes/changelogs/v3.2-beta4/changelogs-web.md new file mode 100644 index 0000000000..a754808f32 --- /dev/null +++ b/en/release-notes/changelogs/v3.2-beta4/changelogs-web.md @@ -0,0 +1,126 @@ +# Web Subsystem ChangeLog + +## cl.web.1 Deletion of Unnecessary Error Codes + +APIs in the webviewController component of the web subsystem are changed: + + - Deleted **@throws { BusinessError } 17100007 - Invalid back or forward operation** from the **forward**, **backward**, and **backOrForward** APIs. + - Deleted **@throws { BusinessError } 17100009 - Cannot zoom in or zoom out** from the **zoom**, **zoomIn**, and **zoomOut** APIs. + +You need to adapt your application based on the following information. + +**Change Impacts** + +Released JS APIs are affected. The application can be properly compiled in the SDK environment of the new version, without any adaptation. + +**Key API/Component Changes** + +Involved APIs: **forward**, **backward**, **backOrForward**, **zoom**, **zoomIn**, and **zoomOut** +Involved component: web + +**Adaptation Guide** + +No adaptation is required. +## cl.web.2 setWebController Input Parameter Changes + +Some released web controllers are migrated to the webviewController, and the original webController is deprecated. The following changes are made in API version 9 and later: +The input parameter of **setWebController** is replaced by the new **webviewController**. + +**Change Impacts** + +Input parameters of JS APIs need to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. + +**Key API/Component Changes** + +- Involved API: + + setWebController(controller: WebviewController): void; + +- Before change: + +```js +setWebController(controller: WebController): void; +``` + +- After change: + +```js +setWebController(controller: WebviewController): void; +``` + +**Adaptation Guide** + +The sample code is as follows: + +Before change: + +```js +// xxx.ets +@Entry +@Component +struct WebComponent { + controller:WebController = new WebController() + build() { + Column() { + Web({ src:'www.example.com', controller: this.controller }) + .multiWindowAccess(true) + .onWindowNew((event) => { + console.log("onWindowNew...") + var popController: WebController = new WebController() + event.handler.setWebController(popController) + }) + } + } +} +``` + +After change: +```js +// xxx.ets +@Entry +@Component +struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController() + build() { + Column() { + Web({ src:'www.example.com', controller: this.controller }) + .multiWindowAccess(true) + .onWindowNew((event) => { + console.log("onWindowNew...") + var popController: web_webview.WebviewController = new web_webview.WebviewController() + event.handler.setWebController(popController) + }) + } + } +} +``` + +## cl.web.3 getUnfilterendLinkUrl API Name Change + +The **getUnfilterendLinkUrl** API is misspelled and should be changed to **getUnfilteredLinkUrl**. + +**Change Impacts** + +The JS API name needs to be adapted for applications developed based on earlier versions. Otherwise, relevant functions will be affected. + +**Key API/Component Changes** + +- Involved API: + + getUnfilteredLinkUrl(): string; + +- Before change: + +```js +getUnfilterendLinkUrl(): string; +``` + +- After change: + +```js +getUnfilteredLinkUrl(): string; +``` + +**Adaptation Guide** + +The JS API name needs to be adapted for applications developed based on earlier versions. The new API name is used to replace the original one. Otherwise, relevant functions will be affected. -- GitLab