From e93c667a53b8fe56c85f51ba602e700a7dbbb2b1 Mon Sep 17 00:00:00 2001 From: du-zhihai Date: Fri, 16 Dec 2022 16:42:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85changelog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: du-zhihai Change-Id: I0d3daf3f269dd656d59fe801585ee63747620075 --- .../OpenHarmony_3.2.8.3/changelog-dmsfwk.md | 102 ++++++++++++++++++ .../OpenHarmony_3.2.9.1/changelog-dmsfwk.md | 21 ++++ 2 files changed, 123 insertions(+) create mode 100644 zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md create mode 100644 zh-cn/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md diff --git a/zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md b/zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md new file mode 100644 index 0000000000..88316500aa --- /dev/null +++ b/zh-cn/release-notes/changelogs/OpenHarmony_3.2.8.3/changelog-dmsfwk.md @@ -0,0 +1,102 @@ +# 分布式调度子系统ChangeLog + +## cl.DistributedManagerService.1 continuationManager事件监听接口on/off变更 + +- continuationManager事件监听接口on/off传入的参数事件类型名,命名不符合OpenHarmony的API接口规范。 +- continuationManager.on对于不同的事件接口返回值未进行统一,不符合OpenHarmony的API接口规范。 + +已做出以下变更: + +- continuationManager.on和continuationManager.off的设备选择事件名由原来的"deviceConnect"变更为"deviceSelected",设备取消选择事件名由原来的"deviceDisconnect"变更为"deviceUnselected"。 +- continuationManager.on对于不同事件统一callback返回值类型"Callback<Array<ContinuationResult>>"。 + +**变更影响** + +基于此前版本开发的应用,需适配变更接口,否则会影响原有业务逻辑。 + +**关键的接口/组件变更** + +- 涉及接口 + + continuationManager.on; + continuationManager.off; + +- 变更前: + +```js + function on(type: "deviceConnect", token: number, callback: Callback>): void; + function off(type: "deviceConnect", token: number): void; + function on(type: "deviceDisconnect", token: number, callback: Callback>): void; + function off(type: "deviceDisconnect", token: number): void; +``` + +- 变更后: + +```js + function on(type: "deviceSelected", token: number, callback: Callback>): void; + function off(type: "deviceSelected", token: number): void; + function on(type: "deviceUnselected", token: number, callback: Callback>): void; + function off(type: "deviceUnselected", token: number): void; +``` + +**适配指导** +修改事件名称,示例代码如下: + +continuationManager.on 设备选择事件 + +```ts + let token = 1; + try { + continuationManager.on("deviceSelected", token, (data) => { + console.info('onDeviceSelected len: ' + data.length); + for (let i = 0; i < data.length; i++) { + console.info('onDeviceSelected deviceId: ' + JSON.stringify(data[i].id)); + console.info('onDeviceSelected deviceType: ' + JSON.stringify(data[i].type)); + console.info('onDeviceSelected deviceName: ' + JSON.stringify(data[i].name)); + } + }); + } catch (err) { + console.error('on failed, cause: ' + JSON.stringify(err)); + } +``` + +continuationManager.off 设备选择事件 + +```ts + let token = 1; + try { + continuationManager.off("deviceSelected", token); + } catch (err) { + console.error('off failed, cause: ' + JSON.stringify(err)); + } +``` + +continuationManager.on 设备取消选择事件 + +```ts + let token = 1; + try { + continuationManager.on("deviceUnselected", token, (data) => { + console.info('onDeviceUnselected len: ' + data.length); + for (let i = 0; i < data.length; i++) { + console.info('onDeviceUnselected deviceId: ' + JSON.stringify(data[i].id)); + console.info('onDeviceUnselected deviceType: ' + JSON.stringify(data[i].type)); + console.info('onDeviceUnselected deviceName: ' + JSON.stringify(data[i].name)); + } + console.info('onDeviceUnselected finished.'); + }); + } catch (err) { + console.error('on failed, cause: ' + JSON.stringify(err)); + } +``` + +continuationManager.off 设备取消选择事件 + +```ts + let token = 1; + try { + continuationManager.off("deviceUnselected", token); + } catch (err) { + console.error('off failed, cause: ' + JSON.stringify(err)); + } +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md b/zh-cn/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md new file mode 100644 index 0000000000..a32202a9ea --- /dev/null +++ b/zh-cn/release-notes/changelogs/OpenHarmony_3.2.9.1/changelog-dmsfwk.md @@ -0,0 +1,21 @@ +# 分布式调度子系统ChangeLog + +## cl.DistributedManagerService.1 continuationManager接口新增DATASYNC权限校验 + +此前版本continuationManager接口未对调用方进行校验,不符合OpenHarmony的API接口规范。 +已做出以下变更:调用方使用continuationManager前需提前申请"ohos.permission.DISTRIBUTED_DATASYNC"权限。 + +**变更影响** + +基于此前版本开发的应用,需提前申请"ohos.permission.DISTRIBUTED_DATASYNC"权限,否则会影响原有业务逻辑。 + +**关键的接口/组件变更** + +涉及接口 + + - continuationManager.registerContinuation; + - continuationManager.on; + - continuationManager.off; + - continuationManager.unregisterContinuation; + - continuationManager.updateContinuationState; + - continuationManager.startContinuationDeviceManager; -- GitLab