diff --git a/zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md b/zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md index c5f817c83f7f8940ceca599bffde8e812c356d3c..51000aff51856c265eff8d7c1c3d1e99d3a8b873 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-distributedMissionManager.md @@ -368,8 +368,8 @@ continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback, callba | 参数名 | 类型 | 必填 | 说明 | | --------- | --------------------------------------- | ---- | ----- | -| parameter | [ContinueDeviceInfo](#js-apis-inner-application-continueDeviceInfo.md) | 是 | 迁移信息。 | -| options | [ContinueCallback](#js-apis-inner-application-continueCallback.md) | 是 | 迁移任务完成回调函数。 | +| parameter | [ContinueDeviceInfo](js-apis-inner-application-continueDeviceInfo.md) | 是 | 迁移信息。 | +| options | [ContinueCallback](js-apis-inner-application-continueCallback.md) | 是 | 迁移任务完成回调函数。 | | callback | AsyncCallback<void> | 是 | 执行结果回调函数。 | **错误码:** @@ -426,8 +426,8 @@ continueMission(parameter: ContinueDeviceInfo, options: ContinueCallback): Promi | 参数名 | 类型 | 必填 | 说明 | | --------- | --------------------------------------- | ---- | ----- | -| parameter | [ContinueDeviceInfo](#js-apis-inner-application-continueDeviceInfo.md) | 是 | 迁移信息。 | -| options | [ContinueCallback](#js-apis-inner-application-continueCallback.md) | 是 | 迁移任务完成回调函数。 | +| parameter | [ContinueDeviceInfo](js-apis-inner-application-continueDeviceInfo.md) | 是 | 迁移信息。 | +| options | [ContinueCallback](js-apis-inner-application-continueCallback.md) | 是 | 迁移任务完成回调函数。 | **返回值:** diff --git a/zh-cn/release-notes/OpenHarmony-v3.2-beta5.md b/zh-cn/release-notes/OpenHarmony-v3.2-beta5.md index e156dad5e3cdca1dd967da9fbed7127f27d05e71..0c4832685fe31658f93280f73729b2ea59bcbca1 100644 --- a/zh-cn/release-notes/OpenHarmony-v3.2-beta5.md +++ b/zh-cn/release-notes/OpenHarmony-v3.2-beta5.md @@ -139,7 +139,7 @@ ArkUI适配了根据资源名称获取资源的能力。 从本版本起,仅发布Public SDK,开发者可从镜像站点获取或通过DevEco Studio下载Public SDK用于应用开发。 -包含系统接口的全量SDK(Full SDK)需下载全量代码后编译构建出SDK文件,并在DevEco Studio中替换。通过源码编译Full SDK的指导请参见[Full-SDK编译指南](../application-dev/quick-start/full-sdk-compile-guide.md)。 +包含系统接口的全量SDK(Full SDK)需下载全量代码后编译构建出SDK文件,并在DevEco Studio中替换。通过源码编译Full SDK的指导请参见[Full-SDK编译指南](../application-dev/faqs/full-sdk-compile-guide.md)。 ### 特性变更 @@ -162,7 +162,7 @@ ArkUI适配了根据资源名称获取资源的能力。 | 文件存储 | - 新增应用文件统一URI处理能力。
- 新增支持公共数据的临时授权和统一的打开入口。
主要涉及以下需求:
I687C8【新增能力】支持应用文件统一URI处理能力
I64U8W【基础能力】支持公共数据的临时授权和统一open入口 | NA | | 元能力 | - 新增常驻进程重启优化。
- 支持卡片数据库切换。
- 支持异步onConnected等能力。
主要涉及以下需求:
I65M3F 【基础能力】执行ShellCommand命令管控
I65V83 【基础能力】ServiceExtensionAbility支持异步onConnected生命周期
I61H21 【基础能力】卡片本地数据库切换
I63UJ5 【元能力】【ability_runtime】API8及以前API 支持异常处理
I6BDCW 【基础能力】应用加载禁止加载data目录下的代码
I6BDDU 【基础能力】FA模型默认启动方式为Standard
I6BDE2 【基础能力】常驻应用异常频繁重启保护 | NA | -API变更清单请参考:[API差异报告](api-change/v3.2-beta5/Readme.md) +API变更清单请参考:[API差异报告](api-diff/v3.2-beta5/Readme-CN.md) 各子系统API详细变更说明请参考:[变更说明](changelogs/v3.2-beta5/Readme.md) @@ -212,5 +212,3 @@ API变更清单请参考:[API差异报告](api-change/v3.2-beta5/Readme.md) | I641A2
I64726 | 蓝牙模块存在静默配对问题,其他设备可以静默配对后通过蓝牙键盘、鼠标完全控制设备 | 蓝牙模块存在静默配对问题。在后续版本以需求跟踪解决。 | 2023年3月30日 | | I6BRTS | 调用rdb::executeSql接口会引起内存泄漏风险 | 反复初始化调用rdb::executeSql接口出现少量内存泄露,此接口为应用初始化时调用,但不会多次调用,内存泄露影响可控。 | 2023年2月10日 | | I6AZ4T | 带textinput输入框组件的应用存在内存泄漏风险 | 高频反复调用textinput框出现少量内存泄露,根因为调用三方库flutter库,内存未回收。需排查是否为开源flutter组件问题。 | 2023年2月10日 | - - \ No newline at end of file diff --git a/zh-cn/release-notes/Readme.md b/zh-cn/release-notes/Readme.md index 2f06c2b0a9db5d2816df9bc6340aa0ce9219a363..66be6c562d6b8ce7d5ff7e1efc9dfc6f95845d39 100644 --- a/zh-cn/release-notes/Readme.md +++ b/zh-cn/release-notes/Readme.md @@ -2,7 +2,7 @@ ## OpenHarmony 4.x Releases -- [OpenHarmony v4.0 Release (2023-06-03)](OpenHarmony-v4.0-beta1.md) +- [OpenHarmony v4.0 Beta1 (2023-06-03)](OpenHarmony-v4.0-beta1.md) ## OpenHarmony 3.x Releases diff --git a/zh-cn/release-notes/api-diff/v3.2-beta5/Readme-CN.md b/zh-cn/release-notes/api-diff/v3.2-beta5/Readme-CN.md new file mode 100644 index 0000000000000000000000000000000000000000..4a68dabd551299179fe0de8aebf5bdb7f02233f2 --- /dev/null +++ b/zh-cn/release-notes/api-diff/v3.2-beta5/Readme-CN.md @@ -0,0 +1,25 @@ +# JS API差异报告 + +- [元能力](js-apidiff-ability.md) +- [帐号](js-apidiff-account.md) +- [应用](js-apidiff-application.md) +- [ArkUI](js-apidiff-arkui.md) +- [电源管理](js-apidiff-battery.md) +- [包管理](js-apidiff-bundle.md) +- [基础通信](js-apidiff-communication.md) +- [语言编译与运行时](js-apidiff-compiler-and-runtime.md) +- [分布式数据管理](js-apidiff-distributed-data.md) +- [文件管理](js-apidiff-file-management.md) +- [位置服务](js-apidiff-geolocation.md) +- [全球化](js-apidiff-global.md) +- [Misc软件](js-apidiff-misc.md) +- [多媒体](js-apidiff-multimedia.md) +- [事件通知](js-apidiff-notification.md) +- [资源调度](js-apidiff-resource-scheduler.md) +- [安全](js-apidiff-security.md) +- [启动](js-apidiff-start-up.md) +- [电话服务](js-apidiff-telephony.md) +- [测试](js-apidiff-unitest.md) +- [用户IAM](js-apidiff-user-iam.md) +- [Web](js-apidiff-web.md) +- [窗口](js-apidiff-window.md) diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/Readme.md b/zh-cn/release-notes/changelogs/v3.2-Release/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..90bbd7a5fbf68123d02056315d5de25b313202e7 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/Readme.md @@ -0,0 +1,12 @@ +# Readme + +- [元能力](changelogs-ability.md) +- [ArkUI](changelogs-arkui.md) +- [包管理](changelogs-bundlemanager.md) +- [输入法框架](changelogs-imf.md) +- [全局资源调度](changelogs-resourceschedule.md) +- [主题框架-锁屏](changelogs-screenlock.md) +- [电话服务](changelogs-telephony.md) +- [util](changelogs-util.md) +- [主题框架-壁纸](changelogs-wallpaper.md) +- [web组件](changelogs-web.md) diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-ability.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..b5289610acebcfd24695f527efc2ae51f2198da1 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-ability.md @@ -0,0 +1,291 @@ +# 元能力子系统JS API变更Changelog + +## cl.ability.1 AreaMode接口变更 +AreaMode接口有多个重复,删除掉重复的AreaMode。 + +**变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.app.ability.common.d.ts | common.AreaMode | | 删除 | +| application/Context.d.ts | AreaMode | | 删除 | + + +**适配指导** + +使用@ohos.app.ability.contextConstant.d.ts中的AreaMode + +```ts +import contextConstant from '@ohos.app.ability.contextConstant'; +let area: contextConstant.AreaMode = contextConstant.AreaMode.EL1; +``` + + + +## cl.ability.2 killProcessesBySelf接口变更 + +killProcessesBySelf接口命名不合理,修改为killAllProcesses。 + +**变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------------ | ------------------ | ----------------------------------------------------- | -------- | +| application/ApplicationContext | ApplicationContext | killProcessesBySelf(): Promise\; | 删除 | +| application/ApplicationContext | ApplicationContext | killProcessesBySelf(callback: AsyncCallback\); | 删除 | +| application/ApplicationContext | ApplicationContext | killAllProcesses(): Promise\; | 新增 | +| application/ApplicationContext | ApplicationContext | killAllProcesses(callback: AsyncCallback\); | 新增 | + + +**适配指导** + +应用中调用killProcessesBySelf可参考下列代码 + +变更前代码: + +```ts +let context: common.UIAbilityContext = globalThis.abilityContext; +let appContext = context.getApplicationContext(); +appContext.killProcessesBySelf() +``` + +变更后代码: + +```ts +let context: common.UIAbilityContext = globalThis.abilityContext; +let appContext = context.getApplicationContext(); +appContext.killAllProcesses() +``` + + + +## cl.ability.3 getProcessRunningInformation接口变更 + +getProcessRunningInformation接口命名不合理,修改为getRunningProcessInformation。 + +**变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ----------------------------------- | ------------------ | ------------------------------------------------------------ | -------- | +| @ohos.app.ability.appManager.d.ts | appManager | function getProcessRunningInformation(): Promise\\>; | 删除 | +| @ohos.app.ability.appManager.d.ts | appManager | function getProcessRunningInformation(callback: AsyncCallback\\>): void; | 删除 | +| @ohos.app.ability.appManager.d.ts | appManager | function getRunningProcessInformation(): Promise\\>; | 新增 | +| @ohos.app.ability.appManager.d.ts | appManager | function getRunningProcessInformation(callback: AsyncCallback\\>): void; | 新增 | +| application/ApplicationContext.d.ts | ApplicationContext | getProcessRunningInformation(): Promise\\>; | 删除 | +| application/ApplicationContext.d.ts | ApplicationContext | getProcessRunningInformation(callback: AsyncCallback\\>): void; | 删除 | +| application/ApplicationContext.d.ts | ApplicationContext | getRunningProcessInformation(): Promise\\>; | 新增 | +| application/ApplicationContext.d.ts | ApplicationContext | getRunningProcessInformation(callback: AsyncCallback\\>): void; | 新增 | + +**适配指导** + +应用中调用getProcessRunningInformation可参考下列代码 + +变更前代码: + +```ts +let context: common.UIAbilityContext = globalThis.abilityContext; +let appContext = context.getApplicationContext(); +appContext.getProcessRunningInformation() +``` + +变更后代码: + +```ts +let context: common.UIAbilityContext = globalThis.abilityContext; +let appContext = context.getApplicationContext(); +appContext.getRunningProcessInformation() +``` + + + +## cl.ability.4 WantConstant.Flags接口变更 +WantConstant.Flags接口有多个无效Flag定义,删除掉无效的Flag。 + +**变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_FORWARD_RESULT | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_CONTINUATION | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_NOT_OHOS_COMPONENT | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_FORM_ENABLED | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_AUTH_PREFIX_URI_PERMISSION | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITYSLICE_MULTI_DEVICE | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_START_FOREGROUND_ABILITY | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_CONTINUATION_REVERSIBLE | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_INSTALL_WITH_BACKGROUND_MODE | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_CLEAR_MISSION | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_NEW_MISSION | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Flags | FLAG_ABILITY_MISSION_TOP | 删除 | + + + +## cl.ability.5 WantConstant.Action接口变更 +WantConstant.Action接口有多个无效Action定义,删除掉无效的Action。 + +**变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | ACTION_APP_ACCOUNT_AUTH | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | ACTION_MARKET_DOWNLOAD | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | ACTION_MARKET_CROWDTEST | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | DLP_PARAMS_SANDBOX | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | DLP_PARAMS_BUNDLE_NAME | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | DLP_PARAMS_MODULE_NAME | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Action | DLP_PARAMS_ABILITY_NAME | 删除 | + + + +## cl.ability.6 Caller相关接口变更 +Caller相关接口使用RPC废弃的Sequenceable和MessageParcel对象,使用RPC在API9提供的Parcelable和MessageSequence对象替代。 + +**变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| api/@ohos.app.ability.UIAbility.d.ts | CalleeCallback | (indata: rpc.MessageParcel): rpc.Sequenceable; | 变更,修改为 (indata: rpc.MessageSequence): rpc.Parcelable; | +| api/@ohos.app.ability.UIAbility.d.ts | Caller | call(method: string, data: rpc.Sequenceable): Promise; | 变更,修改为 call(method: string, data: rpc.Parcelable): Promise; | +| api/@ohos.app.ability.UIAbility.d.ts | Caller | callWithResult(method: string, data: rpc.Sequenceable): Promise; | 变更,修改为 callWithResult(method: string, data: rpc.Parcelable): Promise; | + +**适配指导** + +应用中调用Caller相关接口可参考下列代码 + +变更前代码: + +```ts + class MyMessageAble{ + name:"" + str:"" + num: 1 + constructor(name, str) { + this.name = name; + this.str = str; + } + marshalling(messageParcel) { + messageParcel.writeInt(this.num); + messageParcel.writeString(this.str); + console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']'); + return true; + } + unmarshalling(messageParcel) { + this.num = messageParcel.readInt(); + this.str = messageParcel.readString(); + console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']'); + return true; + } + }; + let method = 'call_Function'; + function funcCallBack(pdata) { + console.log('Callee funcCallBack is called ' + pdata); + let msg = new MyMessageAble("test", ""); + pdata.readSequenceable(msg); + return new MyMessageAble("test1", "Callee test"); + } + export default class MainUIAbility extends UIAbility { + onCreate(want, launchParam) { + console.log('Callee onCreate is called'); + try { + this.callee.on(method, funcCallBack); + } catch (error) { + console.log('Callee.on catch error, error.code: ' + error.code + + ' error.message: ' + error.message); + } + } + } +``` + +变更后代码: + +```ts + class MyMessageAble{ + name:"" + str:"" + num: 1 + constructor(name, str) { + this.name = name; + this.str = str; + } + marshalling(messageSequence) { + messageSequence.writeInt(this.num); + messageSequence.writeString(this.str); + console.log('MyMessageAble marshalling num[' + this.num + '] str[' + this.str + ']'); + return true; + } + unmarshalling(messageSequence) { + this.num = messageSequence.readInt(); + this.str = messageSequence.readString(); + console.log('MyMessageAble unmarshalling num[' + this.num + '] str[' + this.str + ']'); + return true; + } + }; + let method = 'call_Function'; + function funcCallBack(pdata) { + console.log('Callee funcCallBack is called ' + pdata); + let msg = new MyMessageAble("test", ""); + pdata.readParcelable(msg); + return new MyMessageAble("test1", "Callee test"); + } + export default class MainUIAbility extends UIAbility { + onCreate(want, launchParam) { + console.log('Callee onCreate is called'); + try { + this.callee.on(method, funcCallBack); + } catch (error) { + console.log('Callee.on catch error, error.code: ' + error.code + + ' error.message: ' + error.message); + } + } + } +``` + + + +## cl.ability.7 WantConstant.Flags接口变更 + +wantConstant接口有两个类似的枚举,合并成一个。 + +**变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ----------------------------------- | ---------------------- | ----------------------------------- | -------- | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Parameter | ABILITY_BACK_TO_OTHER_MISSION_STACK | 删除 | +| @ohos.app.ability.wantConstant.d.ts | wantConstant.Params | ABILITY_BACK_TO_OTHER_MISSION_STACK | 新增 | + +**适配指导** + +使用@ohos.app.ability.wantConstant.d.ts中的ABILITY_BACK_TO_OTHER_MISSION_STACK + +```ts +import wantConstant from '@ohos.app.ability.wantConstant'; +let backToOtherMissionStack: wantConstant.Params = wantParam.Params.ABILITY_BACK_TO_OTHER_MISSION_STACK; +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-arkui.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-arkui.md new file mode 100644 index 0000000000000000000000000000000000000000..23d453b41ef6811d484f1c62796676f6a2f1013b --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-arkui.md @@ -0,0 +1,306 @@ +# arkui子系统ChangeLog + +## cl.arkui.1 getInspectorTree接口返回值从string修改为Object。 + +**变更影响** + +3.2.10.7之前使用getInspectorTree接口的代码需要适配 + +**关键的接口/组件变更** + +getInspectorTree接口返回值从string修改为Object + +**适配指导** + +将getInspectorTree返回值作为string使用的代码需要修改,比如以下示例代码: + +```typescript +console.info(getInspectorTree()) +``` + +需要修改成 + +```typescript +console.info(JSON.stringify(getInspectorTree())) +``` + +## cl.arkui.2 废弃GridItem的forceRebuild属性 + +**变更影响** + +无,该属性无作用 + +**关键的接口/组件变更** + +GridItem的forceRebuild属性废弃 + +**适配指导** + +如有使用可以直接删除,不影响GridItem功能 + +## cl.arkui.3 Plugin模块接口变更 + + +### 1. arkui子系统Plugin模块 `PluginComponentTemplate` 接口存在变更: + +ability命名无法准确表达对应参数的语义,修改为bundleName。 + +开发者需要根据以下说明对应用进行适配。 + + + +**变更影响** + +基于此前版本开发的应用,需适配变更接口,变更前的接口已经不能正常使用,会在编译过程中报错。 + + + +**关键的接口/组件变更** + +- 涉及接口 + + interface PluginComponentTemplate { + source: string; + bundleName: string; + } + + interface PluginComponentInterface { + (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; +} + +- 变更前: + +```js + interface PluginComponentTemplate { source: string; ability: string; } + interface PluginComponentInterface { + (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; + } +``` + +- 变更后: + +```js + interface PluginComponentTemplate { source: string; bundleName: string; } + interface PluginComponentInterface { + (value: { template: PluginComponentTemplate; data: any }): PluginComponentAttribute; + } +``` + +**适配指导** + +使用变更后的接口,示例代码如下: + +- 变更前: +```js +PluginComponent({ + template: { source: 'plugincomponent1', ability: 'com.example.plugin' }, + data: { 'countDownStartValue': 'new countDownStartValue' } +}).size({ width: 500, height: 100 }) +``` + +- 变更后: +```js +PluginComponent({ + template: { source: 'plugincomponent1', bundleName: 'com.example.plugin' }, + data: { 'countDownStartValue': 'new countDownStartValue' } +}).size({ width: 500, height: 100 }) +``` + +### 2. arkui子系统Plugin模块 `pluginComponentManager` 接口存在变更: + +want命名无法准确表达对应参数的语义,修改为target。 + +开发者需要根据以下说明对应用进行适配。 + + + +**变更影响** + +基于此前版本开发的应用,需适配变更接口。变更前的接口会出现告警,虽然可以通过编译,但是已经不能正常使用其功能。 + + + +**关键的接口/组件变更** + +- 涉及接口 + + interface PushParameterForStage { + owner: Want; + target: Want; + name: string; + data: KVObject; + extraData: KVObject; + jsonPath?: string; + } + + function push(param: PushParameterForStage, callback: AsyncCallback): void; + + interface RequestParameterForStage { + owner: Want; + target: Want; + name: string; + data: KVObject; + jsonPath?: string; + } + + function request(param: RequestParameterForStage, callback: AsyncCallback): void; + +- 变更前: + +```js + interface PushParameterForStage { + owner: Want; + want: Want; + name: string; + data: KVObject; + extraData: KVObject; + jsonPath?: string; + } + + function push(param: PushParameterForStage, callback: AsyncCallback): void; + + interface RequestParameterForStage { + owner: Want; + want: Want; + name: string; + data: KVObject; + jsonPath?: string; + } + + function request(param: RequestParameterForStage, callback: AsyncCallback): void; +``` + +- 变更后: + +```js + interface PushParameterForStage { + owner: Want; + target: Want; + name: string; + data: KVObject; + extraData: KVObject; + jsonPath?: string; + } + + function push(param: PushParameterForStage, callback: AsyncCallback): void; + + interface RequestParameterForStage { + owner: Want; + target: Want; + name: string; + data: KVObject; + jsonPath?: string; + } + + function request(param: RequestParameterForStage, callback: AsyncCallback): void; +``` + +**适配指导** + +使用变更后的接口,示例代码如下: + +- 变更前: +```js +import pluginComponentManager from '@ohos.pluginComponent' + +pluginComponentManager.push({ + owner:{ + bundleName:"com.example.provider", + abilityName:"com.example.provider.MainAbility" + }, + want: { + bundleName: "com.example.provider", + abilityName: "com.example.provider.MainAbility", + }, + name: "ets/pages/plugin2.js", + data: { + "js": "ets/pages/plugin.js", + "key_1": 1111, + }, + extraData: { + "extra_str": "this is push event" + }, + jsonPath: "", + }, + (err, data) => { + console.log("push_callback:err: " ,JSON.stringify(err)); + console.log("push_callback:data: " , JSON.stringify(data)); + console.log("push_callback: push ok!"); + } +) + +pluginComponentManager.request({ + owner:{ + bundleName:"com.example.provider", + abilityName:"com.example.provider.MainAbility" + }, + want: { + bundleName: "com.example.provider", + abilityName: "ets/pages/plugin2.js", + }, + name: "plugintemplate", + data: { + "key_1": " myapplication plugin component test", + "key_2": 123456 + }, + jsonPath: "", +}, + (err, data) => { + console.log("request_callback: componentTemplate.ability=" + data.componentTemplate.ability) + console.log("request_callback: componentTemplate.source=" + data.componentTemplate.source) + } +) +``` + +- 变更后: +```js +import pluginComponentManager from '@ohos.pluginComponent' + +pluginComponentManager.push({ + owner:{ + bundleName:"com.example.provider", + abilityName:"com.example.provider.MainAbility" + }, + target: { + bundleName: "com.example.provider", + abilityName: "com.example.provider.MainAbility", + }, + name: "ets/pages/plugin2.js", + data: { + "js": "ets/pages/plugin.js", + "key_1": 1111, + }, + extraData: { + "extra_str": "this is push event" + }, + jsonPath: "", + }, + (err, data) => { + console.log("push_callback:err: " ,JSON.stringify(err)); + console.log("push_callback:data: " , JSON.stringify(data)); + console.log("push_callback: push ok!"); + } +) + +pluginComponentManager.request({ + owner:{ + bundleName:"com.example.provider", + abilityName:"com.example.provider.MainAbility" + }, + target: { + bundleName: "com.example.provider", + abilityName: "ets/pages/plugin2.js", + }, + name: "plugintemplate", + data: { + "key_1": " myapplication plugin component test", + "key_2": 123456 + }, + jsonPath: "", +}, + (err, data) => { + console.log("request_callback: componentTemplate.ability=" + data.componentTemplate.ability) + console.log("request_callback: componentTemplate.source=" + data.componentTemplate.source) + } +) +``` diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-bundlemanager.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-bundlemanager.md new file mode 100644 index 0000000000000000000000000000000000000000..f175165703f3b7929833790238251b5d0b6fa901 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-bundlemanager.md @@ -0,0 +1,298 @@ +# 包管理子系统ChangeLog + +## cl.bundlemanager.1 包管理删除@ohos.bundle.bundleManager.d.ts中的getAbilityIcon接口,可以使用@ohos.resourceManager.d.ts中的getMediaContent替换。 + +包管理删除[@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts)中的getAbilityIcon接口,可以使用[@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts)中的getMediaContent替换。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了getAbilityIcon接口的,需要改为使用getMediaContent接口。 + +**关键的接口/组件变更**
+删除@ohos.bundle.bundleManager.d.ts中的getAbilityIcon接口。 + +**适配指导**
+使用@ohos.bundle.bundleManager.d.ts下面的getAbilityIcon,需要修改为@ohos.resourceManager.d.ts中的getMediaContent。需要提前获取到图标的资源ID值,可参考该接口的[使用指导](../../../application-dev/reference/apis/js-apis-resource-manager.md#getmediacontent9)。 + +## cl.bundlemanager.2 包管理底层能力变更,仅支持系统资源HAP自定义权限,其它HAP均不支持自定义权限。 + +仅支持系统资源HAP自定义权限,其它HAP均不支持自定义权限。包管理在解析HAP时,仅支持解析资源HAP(包名为:ohos.global.systemres)的配置文件中的definePermissions字段,该字段用来定义权限。其它HAP中配置的definePermissions字段将不会解析。 +如果有应用需要自定义权限,可以在资源HAP的[配置文件](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json)中definePermissions字段下面新增定义权限。格式可参考[定义权限](../../../application-dev/quick-start/module-structure.md#definepermissions对象内部结构)。 + + +**变更影响**
+升级新版本镜像后,应用自定义的权限将不会生效,使用方在申请该权限时,会授权失败。 + +**关键的接口/组件变更**
+包管理底层能力变更,仅支持系统资源HAP自定义权限,其它HAP均不支持自定义权限。 + +**适配指导**
+如果有应用需要自定义权限,可以在资源HAP的[配置文件](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json)中definePermissions字段下面新增定义权限。格式可参考[定义权限](../../../application-dev/quick-start/module-structure.md#definepermissions对象内部结构)。 + +## cl.bundlemanager.3 包管理二级模块文件名称变更,修改为文件内对应的接口名称 + +包管理二级模块文件名称变更,修改为文件内对应的接口名称,变更文件如下: + +| 原文件名称 |变更后文件名称 | +|----|----| +| bundleManager/abilityInfo.d.ts | bundleManager/AbilityInfo.d.ts | +| bundleManager/applicationInfo.d.ts | bundleManager/ApplicationInfo.d.ts | +| bundleManager/bundleInfo.d.ts | bundleManager/BundleInfo.d.ts | +| bundleManager/dispatchInfo.d.ts | bundleManager/DispatchInfo.d.ts | +| bundleManager/elementName.d.ts | bundleManager/ElementName.d.ts | +| bundleManager/extensionAbilityInfo.d.ts | bundleManager/ExtensionAbilityInfo.d.ts | +| bundleManager/hapModuleInfo.d.ts | bundleManager/HapModuleInfo.d.ts | +| bundleManager/launcherAbilityInfo.d.ts | bundleManager/LauncherAbilityInfo.d.ts | +| bundleManager/metadata.d.ts | bundleManager/Metadata.d.ts | +| bundleManager/packInfo.d.ts | bundleManager/BundlePackInfo.d.ts | +| bundleManager/permissionDef.d.ts | bundleManager/PermissionDef.d.ts | +| bundleManager/remoteAbilityInfo.d.ts | bundleManager/RemoteAbilityInfo.d.ts | +| bundleManager/shortcutInfo.d.ts | bundleManager/ShortcutInfo.d.ts | + +除了免安装相关的BundlePackInfo文件名称增加了Bundle,其余文件名称均是修改为大写开头。 + +**变更影响**
+仅修改二级模块文件名称,不会影响一级模块的使用。在使用之前已发布的API 9各beta版本时,如果在ts文件中直接导入了bundleManager下面二级模块接口的,IDE中编译报错的话,需要修改导入的文件名称。 + +**关键的接口/组件变更**
+变更bundleManager文件夹下面的d.ts名称,修改为文件中的接口名称。 + +**适配指导**
+使用新的sdk后,正常情况下应用无需适配该变更。如果在应用中直接导入了bundleManager文件夹下面的文件,则需要修改导入的文件名称。可以按照如下的修改方式: + +**修改前:** +```ts +import {AbilityInfo} from 'bundleManger/abilityInfo'; +import {ExtensionAbilityInfo} from 'bundleManger/extensionAbilityInfo'; +import {BundlePackInfo} from 'bundleManger/packInfo'; +``` +**修改后:** +```ts +import {AbilityInfo} from 'bundleManger/AbilityInfo'; +import {ExtensionAbilityInfo} from 'bundleManger/ExtensionAbilityInfo'; +import {BundlePackInfo} from 'bundleManger/BundlePackInfo'; +``` + +## cl.bundlemanager.4 包管理LaunchType枚举类型名称变更,由STANDARD修改为MULTITON,枚举值不变。 + +包管理[LaunchType](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts)枚举类型变更,由STANDARD修改为MULTITON,枚举值不变,表示多实例类型。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了LaunchType.STANDARD的,需要改为使用LaunchType.MULTITON接口。 + +**关键的接口/组件变更**
+LaunchType枚举类型名称变更,由LaunchType.STANDARD修改为LaunchType.MULTITON。 + +**适配指导**
+由LaunchType.STANDARD修改为LaunchType.MULTITON。 + +## cl.bundlemanager.5 包管理AbilityInfo结构体中isVisible字段修改为exported,类型不变。 + +包管理[AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts)结构体中isVisible字段修改为exported,类型不变,表示当前ability是否支持导出,被其他的ability使用。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了isVisible的,需要改为使用exported。 + +**关键的接口/组件变更**
+包管理[AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts)结构体中isVisible字段修改为exported,类型不变。 + +**适配指导**
+由isVisible修改为exported。 + +## cl.bundlemanager.6 包管理ExtensionAbilityInfo结构体中isVisible字段修改为exported,类型不变。 + +包管理[ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts)结构体中isVisible字段修改为exported,类型不变,表示当前ability是否支持导出,被其他的ability使用。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了isVisible的,需要改为使用exported。 + +**关键的接口/组件变更**
+包管理[ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts)结构体中isVisible字段修改为exported,类型不变。 + +**适配指导**
+由isVisible修改为exported。 + +## cl.bundlemanager.7 包管理ModuleAbilityInfo结构体中visible字段修改为exported,类型不变。 + +包管理[ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts)结构体中visible字段修改为exported,类型不变,表示当前ability是否支持导出,被其他的ability使用。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了visible的,需要改为使用exported。 + +**关键的接口/组件变更**
+包管理[ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts)结构体中visible字段修改为exported,类型不变。 + +**适配指导**
+由visible修改为exported。 + +## cl.bundlemanager.8 app.json配置文件删除distributedNotificationEnabled标签 +删除配置文件app.json中[distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md)标签 + +**变更影响**
+删除配置文件app.json中[distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除[distributedNotificationEnabled](../../../application-dev/quick-start/app-configuration-file.md)标签 + +## cl.bundlemanager.9 app.json配置文件删除entityType标签 +删除配置文件app.json中[entityType](../../../application-dev/quick-start/app-configuration-file.md)标签 + +**变更影响**
+删除配置文件app.json中[entityType](../../../application-dev/quick-start/app-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除[entityType](../../../application-dev/quick-start/app-configuration-file.md)标签 + +## cl.bundlemanager.10 app.json配置文件删除keepAlive标签 +删除配置文件app.json中[keepAlive](../../../application-dev/quick-start/app-configuration-file.md)标签 + +**变更影响**
+删除配置文件app.json中[keepAlive](../../../application-dev/quick-start/app-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除[keepAlive](../../../application-dev/quick-start/app-configuration-file.md)标签 + +## cl.bundlemanager.11 app.json配置文件删除removable标签 +删除配置文件app.json中[removable](../../../application-dev/quick-start/app-configuration-file.md)标签 + +**变更影响**
+删除配置文件app.json中[removable](../../../application-dev/quick-start/app-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除[removable](../../../application-dev/quick-start/app-configuration-file.md)标签 + +## cl.bundlemanager.12 app.json配置文件删除singleton标签 +删除配置文件app.json中[singleton](../../../application-dev/quick-start/app-configuration-file.md)标签 + +**变更影响**
+删除配置文件app.json中[singleton](../../../application-dev/quick-start/app-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除[singleton](../../../application-dev/quick-start/app-configuration-file.md)标签 + +## cl.bundlemanager.13 app.json配置文件删除userDataClearable标签 +删除配置文件app.json中[userDataClearable](../../../application-dev/quick-start/app-configuration-file.md)标签 + +**变更影响**
+删除配置文件app.json中[userDataClearable](../../../application-dev/quick-start/app-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除[userDataClearable](../../../application-dev/quick-start/app-configuration-file.md)标签 + +## cl.bundlemanager.14 module.json配置文件中module的name标签不再支持配置中文 +module.json配置文件中的module的[name](../../../application-dev/quick-start/module-configuration-file.md)不再支持配置中文 + +**变更影响**
+删除配置文件module.json中module的[name](../../../application-dev/quick-start/module-configuration-file.md)标签不再支持配置中文,IDE中配置该标签为中文,会导致IDE编译报错 + +**适配指导**
+使用英文语言配置module.json中module的[name](../../../application-dev/quick-start/module-configuration-file.md)标签 + +## cl.bundlemanager.15 module.json配置文件中ability的name标签不再支持配置中文 +module.json配置文件中的ability的[name](../../../application-dev/quick-start/module-configuration-file.md)不再支持配置中文 + +**变更影响**
+删除配置文件module.json中ability的[name](../../../application-dev/quick-start/module-configuration-file.md)标签不再支持配置中文,IDE中配置该标签为中文,会导致IDE编译报错 + +**适配指导**
+使用英文语言配置module.json中ability的[name](../../../application-dev/quick-start/module-configuration-file.md)标签 + +## cl.bundlemanager.16 module.json配置文件删除uiSyntax标签 +删除配置文件module.json中[uiSyntax](../../../application-dev/quick-start/module-configuration-file.md)标签 + +**变更影响**
+删除配置文件module.json中[uiSyntax](../../../application-dev/quick-start/module-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除module.json中[uiSyntax](../../../application-dev/quick-start/module-configuration-file.md)标签 + +## cl.bundlemanager.17 module.json配置文件中module及ability中的srcEntrance标签修改为srcEntry +配置文件module.json中[srcEntrance](../../../application-dev/quick-start/module-configuration-file.md)标签修改为srcEntry + +**变更影响**
+删除配置文件module.json中[srcEntrance](../../../application-dev/quick-start/module-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除module.json中[srcEntrance](../../../application-dev/quick-start/module-configuration-file.md)标签,使用srcEntry替代 + +## cl.bundlemanager.18 删除module.json配置文件中distroFilter的apiVersion标签 +删除配置文件module.json中[distroFilter](../../../application-dev/quick-start/module-configuration-file.md)的apiVersion标签 + +**变更影响**
+删除配置文件module.json[distroFilter](../../../application-dev/quick-start/module-configuration-file.md)的apiVersion标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除module.json中[distroFilter](../../../application-dev/quick-start/module-configuration-file.md)的apiVersion标签 + +## cl.bundlemanager.19 module.json配置文件中distroFilter修改为distributionFilter +配置文件module.json中[distroFilter](../../../application-dev/quick-start/module-configuration-file.md)标签修改为distributionFilter + +**变更影响**
+删除配置文件module.json[distroFilter](../../../application-dev/quick-start/module-configuration-file.md)标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除module.json中[distroFilter](../../../application-dev/quick-start/module-configuration-file.md)标签,使用distributionFilter替代 + +## cl.bundlemanager.20 module.json配置文件中launchTypede标签standard模式修改为multiton +删除module.json中[launchType](../../../application-dev/quick-start/module-configuration-file.md)标签的standard模式修改为multiton + +**适配指导**
+删除module.json中[launchType](../../../application-dev/quick-start/module-configuration-file.md)标签的standard模式,使用multiton替代 + +## cl.bundlemanager.21 app.json配置文件删除atomicService标签 +删除配置文件app.json中atomicService标签 + +**变更影响**
+删除配置文件app.json中atomicService标签,IDE中不再支持配置该标签,使用该标签会导致IDE编译报错 + +**适配指导**
+删除atomicService标签 + +## cl.bundlemanager.22 app.json配置文件新增bundleType标签 +配置文件app.json中新增bundleType标签 + +**变更影响**
+现存的元服务([installationFree](../../../application-dev/quick-start/module-configuration-file.md)为true),必须在app.json中指定bundleType为atomicService,否则打包失败。 + +**适配指导**
+新增[bundleType](../../../application-dev/quick-start/app-configuration-file.md)标签。该标签为可缺省(缺省值为app)。该标签需要和module.json中[installationFree](../../../application-dev/quick-start/module-configuration-file.md)字段保持一一对应,其相应规则为: +- 当bundleType为app时,installationFree必须为false。 +- 当bundleType为atomicService时,installationFree必须为true。 + +## cl.bundlemanager.23 包管理ApplicationInfo结构体中删除split字段。 + +包管理[ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts)结构体中删除split字段。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了split的,会编译失败。 + +**关键的接口/组件变更**
+包管理[ApplicationInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ApplicationInfo.d.ts)结构体中删除split字段。 + +**适配指导**
+删除ApplicationInfo结构体中的split字段。目前元服务中stage模型强制分包,不支持不分包。 + +## cl.bundlemanager.24 包管理HapModuleInfo结构体中删除atomicServiceModuleType字段。 + +包管理[HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts)结构体中删除atomicServiceModuleType字段。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了atomicServiceModuleType的,会编译失败。 + +**关键的接口/组件变更**
+包管理[HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts)结构体中删除atomicServiceModuleType字段。 + +**适配指导**
+删除[HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts)结构体中的atomicServiceModuleType字段。判断atomicServiceModuleType字段的部分,用[HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts)结构体中的moduleType代替。 + +## cl.bundlemanager.25 包管理删除AtomicServiceModuleType枚举值。 + +包管理[HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts)结构体中删除atomicServiceModuleType字段。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了atomicServiceModuleType的,会编译失败。 + +**关键的接口/组件变更**
+包管理[HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts)结构体中删除atomicServiceModuleType字段。 + +**适配指导**
+删除[HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts)结构体中的atomicServiceModuleType字段。判断atomicServiceModuleType字段的部分,用[HapModuleInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/HapModuleInfo.d.ts)结构体中的moduleType代替。 \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-imf.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-imf.md new file mode 100644 index 0000000000000000000000000000000000000000..a6cdab6b8d7e7fc6a97698ce9b2e2a84ba32076a --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-imf.md @@ -0,0 +1,21 @@ +# 输入法框架子系统-输入法框架服务ChangeLog + + +## @ohos.InputMethodSubtype 中输入法子类型中name、label、id属性值变更 +从API9开始,变更如上三个属性值 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +此三个属性的取值发生变化,需要开发者进行适配更新 + +| 名称 | 变更前 | 变更后 | +| -------- | -------- | -------- | +| label | (1)取值:输入法子类型的id。| (1)取值:输入法子类型的标签。| +| name | (1)说明:输入法子类型的名字;(2)取值:输入法子类型的标签。| (1)说明:输入法应用的包名;(2)取值:输入法应用的包名。| +| id | (1)取值:输入法应用的包名。| (1)取值:输入法子类型的id。| + +**适配指导** + +请按上述取值变更结果适配更新。 diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-resourceschedule.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-resourceschedule.md new file mode 100644 index 0000000000000000000000000000000000000000..8042bb2241aa42c2c43aedc691c8b1113e93bf8a --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-resourceschedule.md @@ -0,0 +1,21 @@ +# 资源调度子系统ChangeLog + +## cl.resourceschedule.workScheduler +修改parameters属性值的数据类型,不允许使用any类型,支持number、string、boolean三种类型。 + +**变更影响** + +基于OpenHarmony3.2.10.7及之后的SDK版本开发的应用,parameters属性值的数据类型不允许使用any类型,仅支持number、string、boolean三种类型,否则将编译报错。 + +**关键接口/组件变更** + +@ohos.resourceschedule.workScheduler.d.ts中的parameters属性变更。 + +| 类名 | 接口类型 | 变更前声明 | 变更后声明 | +| -- | -- | -- | -- | +| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | parameters?: {[key: string]: number | string | boolean} | + + +**适配指导**
+ +parameters属性使用{[key: string]: number | string | boolean}数据类型。 \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-screenlock.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-screenlock.md new file mode 100644 index 0000000000000000000000000000000000000000..8e5a2fab3671eb32db8accb72d764a1194f26ff1 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-screenlock.md @@ -0,0 +1,155 @@ +# 主题框架子系统-锁屏管理服务ChangeLog + + +## cl.screenlock.1 isLocked、unlock接口使用权限变更 +从API9开始,变更为systemapi,停止对三方应用开放。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。 + +- 涉及接口 + +```js + function isLocked(): boolean; + function unlock(callback: AsyncCallback): void; + function unlock():Promise; +``` + +- 变更前: + +```js + * Checks whether the screen is currently locked. + * + * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 9 + */ + function isLocked(): boolean; + + /** + * Unlock the screen. + * + * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 9 + */ + function unlock(callback: AsyncCallback): void; + + /** + * Unlock the screen. + * + * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 9 + */ + function unlock():Promise; +``` + +- 变更后: + +```js + * Checks whether the screen is currently locked. + * + * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 9 + */ + function isLocked(): boolean; + + /** + * Unlock the screen. + * + * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 9 + */ + function unlock(callback: AsyncCallback): void; + + /** + * Unlock the screen. + * + * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. + * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 9 + */ + function unlock():Promise; +``` + + +**适配指导** + +该接口变更为系统应用后,三方应用已无法使用。 +系统应用可正常使用。 +示例代码如下: + +```js + try { + let ret = screenLock.isLocked(); + console.error(`Obtain whether the screen is locked successfully , ret is: ${ret}`); + } catch (error) { + console.error(`Failed to obtain whether the screen is locked, error is : ${error.code}, ${error.message}`); + } +``` + +```js + screenlock.unlock((err, data) => { + if (err) { + console.error(`Failed to unlock the screen, because: ${err.message}`); + return; + } + console.info(`unlock the screen successfully. result: ${data}`); + }); +``` + +```js + screenlock.unlock().then((data) => { + console.info(`unlock the screen successfully. result: ${data}`); + }).catch((err) => { + console.error(`Failed to unlock the screen, because: ${err.message}`); + }); +``` + + +## cl.screenlock.2 isSecure接口废弃变更 +从API9开始,废弃此接口。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +该接口删除无法再使用,请使用进行更新使用,否则会影响原有功能。 + +- 涉及接口 + +```js + function isSecure(): boolean; +``` + +- 变更前: + +```js + function isSecure(): boolean; +``` + +- 变更后:删除接口,停止对外开放。 + + +**适配指导** + +该接口删除后无法再使用,请适配更新。 diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-telephony.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-telephony.md new file mode 100644 index 0000000000000000000000000000000000000000..cd74291d37afa9e4aee941a0e813824ede5af546 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-telephony.md @@ -0,0 +1,223 @@ +# 电话子系统ChangeLog + + + +## cl.telephony.1 call模块reject接口变更 +从API9开始,废弃此接口,改为使用rejectCall接口。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +该接口删除无法再使用,请使用新增的接口rejectCall替换,否则会影响原有功能。 + +- 涉及接口 + +```js + function reject(callId: number, callback: AsyncCallback): void; + function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void; + function reject(callId?: number, options?: RejectMessageOptions): Promise; + function reject(callback: AsyncCallback): void; + function reject(options: RejectMessageOptions, callback: AsyncCallback): void; +``` + +- 变更前: + +```js + function reject(callId: number, callback: AsyncCallback): void; + function reject(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void; + function reject(callId?: number, options?: RejectMessageOptions): Promise; + function reject(callback: AsyncCallback): void; + function reject(options: RejectMessageOptions, callback: AsyncCallback): void; +``` + +- 变更后: + +```js + function rejectCall(callId: number, callback: AsyncCallback): void; + function rejectCall(callId: number, options: RejectMessageOptions, callback: AsyncCallback): void; + function rejectCall(callId?: number, options?: RejectMessageOptions): Promise; + function rejectCall(callback: AsyncCallback): void; + function rejectCall(options: RejectMessageOptions, callback: AsyncCallback): void; +``` + + +**适配指导** + +该接口删除无法再使用,请使用新增的接口rejectCall替换。 +使用变更后的接口,示例代码如下: + +```js +call.rejectCall("138xxxxxxxx", (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +```js +let rejectMessageOptions={ + messageContent: "拦截陌生号码" +} +let promise = call.rejectCall(1, rejectMessageOptions); +promise.then(data => { + console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`); +}).catch(err => { + console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`); +}); +``` + + +```js +let rejectMessageOptions={ + messageContent: "拦截陌生号码" +} +let promise = call.rejectCall(1, rejectMessageOptions); +promise.then(data => { + console.log(`rejectCall success, promise: data->${JSON.stringify(data)}`); +}).catch(err => { + console.error(`rejectCall fail, promise: err->${JSON.stringify(err)}`); +}); +``` + + +```js +call.rejectCall((err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +```js +let rejectMessageOptions={ + messageContent: "拦截陌生号码" +} +call.rejectCall(rejectMessageOptions, (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +## cl.telephony.2 call模块answer接口变更 +从API9开始,废弃此接口,改为使answerCall接口。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +该接口删除无法再使用,请使用新增的接口answerCall替换,否则会影响原有功能。 + +- 涉及接口 + +```js + function answer(callId: number, callback: AsyncCallback): void; + function answer(callId?: number): Promise; + function answer(callback: AsyncCallback): void; +``` + +- 变更前: + +```js + function answer(callId: number, callback: AsyncCallback): void; + function answer(callId?: number): Promise; + function answer(callback: AsyncCallback): void; +``` + +- 变更后: + +```js + function answerCall(callId: number, callback: AsyncCallback): void; + function answerCall(callId?: number): Promise; + function answerCall(callback: AsyncCallback): void; +``` + + +**适配指导** + +该接口删除无法再使用,请使用新增的接口answerCall替换。 +使用变更后的接口,示例代码如下: + +```js +call.answerCall(1, (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +```js +let promise = call.answerCall(1); +promise.then(data => { + console.log(`answerCall success, promise: data->${JSON.stringify(data)}`); +}).catch(err => { + console.error(`answerCall fail, promise: err->${JSON.stringify(err)}`); +}); +``` + + +```js +call.answerCall((err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +## cl.telephony.1 call模块hangup接口变更 +从API9开始,废弃此接口,改为使用hangUpCall接口。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +该接口删除无法再使用,请使用新增的接口hangUpCall替换,否则会影响原有功能。 + +- 涉及接口 + +```js + function hangup(callId: number, callback: AsyncCallback): void; + function hangup(callId?: number): Promise; + function hangup(callback: AsyncCallback): void; +``` + +- 变更前: + +```js + function hangup(callId: number, callback: AsyncCallback): void; + function hangup(callId?: number): Promise; + function hangup(callback: AsyncCallback): void; +``` + +- 变更后: + +```js + function hangUpCall(callId: number, callback: AsyncCallback): void; + function hangUpCall(callId?: number): Promise; + function hangUpCall(callback: AsyncCallback): void; +``` + + +**适配指导** + +该接口删除无法再使用,请使用新增的接口hangUpCall替换。 +使用变更后的接口,示例代码如下: + +```js +call.hangUpCall(1, (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +```js +let promise = call.hangUpCall(1); +promise.then(data => { + console.log(`hangUpCall success, promise: data->${JSON.stringify(data)}`); +}).catch(err => { + console.error(`hangUpCall fail, promise: err->${JSON.stringify(err)}`); +}); +``` + + +```js +call.hangUpCall((err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-util.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-util.md new file mode 100644 index 0000000000000000000000000000000000000000..3455ff99e6f1a2e885acd1865b59f166d99a8c3e --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-util.md @@ -0,0 +1,99 @@ +# util系统JS API变更Changelog + +OpenHarmony 3.2.10.7(Mr)版本相较于OpenHarmony 3.2.beta4版本,util子系统的API变更如下 + +## cl.util.1.randomUUID接口名变更 +util子系统randomUUID函数名存在变更: + +function randomUUID(entropyCache?: boolean): string 改为 function generateRandomUUID(entropyCache?: boolean): string 函数名由原来的randomUUID改为generateRandomUUID。 + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 方法/属性/枚举/常量 | 变更类型 | +| :---------- | ------------------- | ------- | +| @ohos.util | function randomUUID(entropyCache?: boolean): string | 删除 | +| @ohos.util | function generateRandomUUID(entropyCache?: boolean): string| 变更 | + +**适配指导** + +应用中使用generateRandomUUID可参考下列代码 + +示例: + +```ts +import util from '@ohos.util' +let uuid = util.generateRandomUUID(true); +console.log("RFC 4122 Version 4 UUID:" + uuid); +// 输出: +// RFC 4122 Version 4 UUID:88368f2a-d5db-47d8-a05f-534fab0a0045 +``` + +## cl.util.2.randomBinaryUUID接口名变更 +util子系统randomBinaryUUID函数名存在变更: + +function randomBinaryUUID(entropyCache?: boolean): Uint8Array 改为 function generateRandomBinaryUUID(entropyCache?: boolean): Uint8Array 函数名由原来的randomBinaryUUID改为generateRandomBinaryUUID。 + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 方法/属性/枚举/常量 | 变更类型 | +| :---------- | ------------------- | ------- | +| @ohos.util | function randomBinaryUUID(entropyCache?: boolean): Uint8Array; | 删除 | +| @ohos.util | function generateRandomBinaryUUID(entropyCache?: boolean): Uint8Array| 变更 | + +**适配指导** + +应用中使用generateRandomBinaryUUID可参考下列代码 + +示例: + +```ts +import util from '@ohos.util' +let uuid = util.generateRandomBinaryUUID(true); +console.log(JSON.stringify(uuid)); +// 输出: +// 138,188,43,243,62,254,70,119,130,20,235,222,199,164,140,150 +``` + +## cl.util.3.LRUCache类contains接口参数类型变更 +util子系统LRUCache类contains接口参数类型变更: + +contains(key: object): boolean 改为 contains(key: K): boolean 参数类型由原来的object改为K。 + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| :-------- | ---------| -------------------------------- | -------- | +| @ohos.util | LRUCache | contains(key: object): boolean | 删除 | +| @ohos.util | LRUCache | contains(key: K): boolean | 变更 | + +**适配指导** + +应用中使用contains函数可参考下列代码 + +示例: + +```ts +import util from '@ohos.util' +let pro = new util.LRUCache(); +pro.put(2,10); +let obj = {1:"key"}; +let result = pro.contains(obj); +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-wallpaper.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-wallpaper.md new file mode 100644 index 0000000000000000000000000000000000000000..13baab45851959398ccf4689543f91c5e1aa1d68 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-wallpaper.md @@ -0,0 +1,304 @@ +# 主题框架子系统-壁纸管理服务ChangeLog + + +## cl.wallpaper.1 getColorsSync、getMinHeightSync、getMinWidthSync、restore、setImage接口使用权限变更 +从API9开始,变更为systemapi,停止对三方应用开放。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。 + +- 涉及接口 + +```js + function getColorsSync(wallpaperType: WallpaperType): Array; + function getMinHeightSync(): number; + function getMinWidthSync(): number; + function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + function restore(wallpaperType: WallpaperType): Promise; + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; +``` + +- 变更前: + +```js + /** + * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. + * @param wallpaperType Indicates the wallpaper type. + * @returns { Array } the Array returned by the function. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getColorsSync(wallpaperType: WallpaperType): Array; + + /** + * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * @returns { number } the number returned by the function. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getMinHeightSync(): number; + + /** + * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * @returns { number } the number returned by the function. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getMinWidthSync(): number; + + /** + * Removes a wallpaper of the specified type and restores the default one. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Removes a wallpaper of the specified type and restores the default one. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function restore(wallpaperType: WallpaperType): Promise; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; +``` + +- 变更后: + +```js + /** + * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. + * @param wallpaperType Indicates the wallpaper type. + * @returns { Array } the Array returned by the function. + * @throws {BusinessError} 401 - parameter error. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function getColorsSync(wallpaperType: WallpaperType): Array; + + /** + * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * @returns { number } the number returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function getMinHeightSync(): number; + + /** + * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * @returns { number } the number returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function getMinWidthSync(): number; + + /** + * Removes a wallpaper of the specified type and restores the default one. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Removes a wallpaper of the specified type and restores the default one. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function restore(wallpaperType: WallpaperType): Promise; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; +``` + + +**适配指导** + +该接口变更为系统应用后,三方应用已无法使用。 +系统应用可正常使用。 +示例代码如下: + +```js + try { + let colors = wallpaper.getColorsSync(wallpaper.WallpaperType.WALLPAPER_SYSTEM); + console.log(`success to getColorsSync: ${JSON.stringify(colors)}`); + } catch (error) { + console.error(`failed to getColorsSync because: ${JSON.stringify(error)}`); + } +``` + +```js + let minHeight = wallpaper.getMinHeightSync(); +``` + +```js + let minWidth = wallpaper.getMinWidthSync(); +``` + +```js + wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => { + if (error) { + console.error(`failed to restore because: ${JSON.stringify(error)}`); + return; + } + console.log(`success to restore.`); + }); +``` + +```js + wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => { + console.log(`success to restore.`); + }).catch((error) => { + console.error(`failed to restore because: ${JSON.stringify(error)}`); + }); +``` + +```js + // source类型为string + let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg"; + wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => { + if (error) { + console.error(`failed to setImage because: ${JSON.stringify(error)}`); + return; + } + console.log(`success to setImage.`); + }); +``` + +```js + // source类型为string + let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg"; + wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => { + console.log(`success to setImage.`); + }).catch((error) => { + console.error(`failed to setImage because: ${JSON.stringify(error)}`); + }); +``` + + +## cl.wallpaper.2 getIdSync、getFileSync、isChangeAllowed、isUserChangeAllowed、on、off、RgbaColor接口废弃变更 +从API9开始,废弃此接口。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +该接口删除无法再使用,请使用进行更新使用,否则会影响原有功能。 + +- 涉及接口 + +```js + function getIdSync(wallpaperType: WallpaperType): number; + function getFileSync(wallpaperType: WallpaperType): number; + function isChangeAllowed(): boolean; + function isUserChangeAllowed(): boolean; + function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void; + function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void; + interface RgbaColor { + red: number; + green: number; + blue: number; + alpha: number; + } +``` + +- 变更前: + +```js + function getIdSync(wallpaperType: WallpaperType): number; + function getFileSync(wallpaperType: WallpaperType): number; + function isChangeAllowed(): boolean; + function isUserChangeAllowed(): boolean; + function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void; + function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void; + interface RgbaColor { + red: number; + green: number; + blue: number; + alpha: number; + } +``` + +- 变更后:删除接口,停止对外开放。 + + +**适配指导** + +该接口删除后无法再使用,请适配更新。 diff --git a/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-web.md b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-web.md new file mode 100644 index 0000000000000000000000000000000000000000..1fd92a86421021c0ac26639f04c56c4e5c0f01f6 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-Release/changelogs-web.md @@ -0,0 +1,467 @@ +# web子系统ChangeLog + +OpenHarmony 3.2.10.7 版本相较于OpenHarmony 之前的版本,web的API变更如下。 + +## cl.web.1 HitTestTypeV9命名变更 + +枚举类HitTestTypeV9由于命名规范问题,名称变更为WebHitTestType。 + +**变更影响** + +枚举类HitTestTypeV9,以及使用HitTestTypeV9作为参数或返回值的接口,在3.2.10.7版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + enum HitTestTypeV9 + +- 变更前: + + ```ts + enum HitTestTypeV9 + ``` + +- 变更后: + + ```ts + enum WebHitTestType + ``` + +**适配指导** + +请使用WebHitTestType替换HitTestTypeV9。 + +## cl.web.2 HeaderV9命名变更 + +结构体HeaderV9由于命名规范问题,名称变更为WebHeader。 + +**变更影响** + +结构体HeaderV9,以及使用HeaderV9作为参数或返回值的接口,在3.2.10.7版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + interface HeaderV9 + +- 变更前: + + ```ts + interface HeaderV9 + ``` + +- 变更后: + + ```ts + interface WebHeader + ``` + +**适配指导** + +请使用WebHeader替换HeaderV9。 + +## cl.web.3 HitTestValue结构体成员类型变更 + +结构体HitTestValue中的成员变量HitTestTypeV9由于命名规范问题,名称变更为WebHitTestType。 + +**变更影响** + +结构体HitTestValue,以及使用HitTestValue作为参数或返回值的接口,在3.2.10.7版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + interface HitTestValue + +- 变更前: + + ```ts + interface HitTestValue { + + /** + * Get the hit test type. + * + * @since 9 + */ + type: HitTestTypeV9; + + /** + * Get the hit test extra data. + * + * @since 9 + */ + extra: string; + } + ``` + +- 变更后: + + ```ts + interface HitTestValue { + + /** + * Get the hit test type. + * + * @since 9 + */ + type: WebHitTestType; + + /** + * Get the hit test extra data. + * + * @since 9 + */ + extra: string; + } + ``` + +**适配指导** + +请使用WebHitTestType替换HitTestTypeV9。 + +## cl.web.4 loadUrl参数类型变更 + +loadUrl接口中的参数headers,由于其类型的命名规范问题,类型变更为WebHeader。 + +**变更影响** + +loadUrl接口若使用了headers参数,则在3.2.10.7版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + loadUrl(url: string | Resource, headers?: Array): void + +- 变更前: + + ```ts + loadUrl(url: string | Resource, headers?: Array): void + ``` + +- 变更后: + + ```ts + loadUrl(url: string | Resource, headers?: Array): void + ``` + +**适配指导** + +在loadUrl中设置headers参数时,请使用WebHeader类型替换HeaderV9类型。 + +## cl.web.5 getHitTest返回值类型变更 + +getHitTest接口中的返回值,由于其类型的命名规范问题,变更为WebHitTest。 + +**变更影响** + +getHitTest接口,在3.2.10.7版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + getHitTest(): HitTestTypeV9 + +- 变更前: + + ```ts + getHitTest(): HitTestTypeV9 + ``` + +- 变更后: + + ```ts + getHitTest(): WebHitTestType + ``` + +**适配指导** + +在使用getHitTest接口的返回值时,请使用WebHitTestType类型替换HitTestTypeV9类型。 + +## cl.web.6 WebMessagePort类迁移 + +WebMessagePort类迁移至@ohos.web.webview.d.ts,并新增错误码抛出。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现该类下接口支持错误码处理,需注意错误码处理的使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + postMessageEvent(message: WebMessageEvent): void; + onMessageEvent(callback: (result: string) => void): void; + +- 变更前: + + ```ts + postMessageEvent(message: WebMessageEvent): void; + onMessageEvent(callback: (result: string) => void): void; + ``` + +- 变更后: + + ```ts + postMessageEvent(message: WebMessage): void; + onMessageEvent(callback: (result: WebMessage) => void): void; + ``` + +**适配指导** + +原WebMessagePort类不需要import,现WebMessagePort类使用的是@ohos.web.webview,以下方式import: + + ```ts + import web_webview from '@ohos.web.webview'; + ``` + +## cl.web.7 HitTestValue类迁移 + +HitTestValue类迁移至@ohos.web.webview.d.ts,HitTestValue类变更为接口,getType,getExtra变更为属性。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。 + +**关键的接口/组件变更** + +- 涉及接口 + + getType(): HitTestType; + getExtra(): string; + +- 变更前: + + ```ts + getType(): HitTestType; + getExtra(): string; + ``` + +- 变更后: + + ```ts + type: WebHitTestType; + extra: string; + ``` + +**适配指导** + +原HitTestValue类不需要import,现HitTestValue类使用的是@ohos.web.webview,以下方式import: + + ```ts + import web_webview from '@ohos.web.webview'; + ``` + +## cl.web.8 WebCookie类下api9接口迁移 + +WebCookie类下api9接口迁移,WebCookie类下api9接口迁移到web.webview.webview.WebCookieManager。 +并新增接口错误码抛出。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现该类下接口支持错误码处理,需注意错误码处理的使用。 +该类方法变为静态方法。 + +**关键的接口/组件变更** + +- 涉及接口 + + isCookieAllowed(): boolean; + isThirdPartyCookieAllowed(): boolean; + putAcceptCookieEnabled(accept: boolean): void; + putAcceptThirdPartyCookieEnabled(accept: boolean): void; + setCookie(url: string, value: string): boolean; + saveCookieSync(): boolean; + getCookie(url: string): string; + existCookie(): boolean; + deleteEntireCookie(): void; + deleteSessionCookie(): void; + +- 变更前: + + ```ts + isCookieAllowed(): boolean; + isThirdPartyCookieAllowed(): boolean; + putAcceptCookieEnabled(accept: boolean): void; + putAcceptThirdPartyCookieEnabled(accept: boolean): void; + setCookie(url: string, value: string): boolean; + saveCookieSync(): boolean; + getCookie(url: string): string; + existCookie(): boolean; + deleteEntireCookie(): void; + deleteSessionCookie(): void; + ``` + +- 变更后: + + ```ts + static isCookieAllowed(): boolean; + static isThirdPartyCookieAllowed(): boolean; + static putAcceptCookieEnabled(accept: boolean): void; + static putAcceptThirdPartyCookieEnabled(accept: boolean): void; + static setCookie(url: string, value: string): void; + static saveCookieAsync(): Promise; + static saveCookieAsync(callback: AsyncCallback): void; + static getCookie(url: string): string; + static existCookie(): boolean; + static deleteEntireCookie(): void; + static deleteSessionCookie(): void; + ``` + +**适配指导** + +原WebCookie类不需要import,现WebCookieManager使用的是@ohos.web.webview,以下方式import: + + ```ts + import web_webview from '@ohos.web.webview'; + ``` + +## cl.web.9 WebController类下api9接口迁移 + +WebController类下api9接口迁移至web.webview.webview.WebviewController,并新增接口错误码抛出。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现该类下接口支持错误码处理,需注意错误码处理的使用。 +getDefaultUserAgent接口更名为getUserAgent。 + +**关键的接口/组件变更** + +- 涉及接口 + + zoomIn(): boolean; + zoomOut(): boolean; + createWebMessagePorts(): Array; + postMessage(options: { message: WebMessageEvent, uri: string}): void; + getHitTestValue(): HitTestValue; + getWebId(): number; + getDefaultUserAgent(): string; + getTitle(): string; + getPageHeight(): number; + backOrForward(step: number): void; + searchAllAsync(searchString: string): void; + clearMatches(): void; + searchNext(forward: boolean): void; + clearSslCache(): void; + clearClientAuthenticationCache(): void; + getUrl(): string; + +- 变更前: + + ```ts + zoomIn(): boolean; + zoomOut(): boolean; + createWebMessagePorts(): Array; + postMessage(options: { message: WebMessageEvent, uri: string}): void; + getHitTestValue(): HitTestValue; + getWebId(): number; + getDefaultUserAgent(): string; + getTitle(): string; + getPageHeight(): number; + backOrForward(step: number): void; + searchAllAsync(searchString: string): void; + clearMatches(): void; + searchNext(forward: boolean): void; + clearSslCache(): void; + clearClientAuthenticationCache(): void; + getUrl(): string; + ``` + +- 变更后: + + ```ts + zoomIn(): void; + zoomOut(): void; + createWebMessagePorts(): Array; + postMessage(name: string, ports: Array, uri: string): void; + getHitTestValue(): HitTestValue; + getWebId(): number; + getUserAgent(): string; + getTitle(): string; + getPageHeight(): number; + backOrForward(step: number): void; + searchAllAsync(searchString: string): void; + clearMatches(): void; + searchNext(forward: boolean): void; + clearSslCache(): void; + clearClientAuthenticationCache(): void; + getUrl(): string; + ``` + +**适配指导** + +原WebController类不需要import,现WebviewController类使用的是@ohos.web.webview,以下方式import: + + ```ts + import web_webview from '@ohos.web.webview'; + ``` + +## cl.web.10 WebAsyncController类迁移 + +WebAsyncController类下接口迁移至web.webview.webview.WebviewController,并新增接口错误码抛出。 + +**变更影响** + +基于此前版本开发的应用,需注意错误码处理的使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + storeWebArchive(baseName: string, autoName: boolean): Promise; + storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback): void; + +- 变更前: + + ```ts + storeWebArchive(baseName: string, autoName: boolean): Promise; + storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback): void; + ``` + +- 变更后: + + ```ts + storeWebArchive(baseName: string, autoName: boolean): Promise; + storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback): void; + ``` + +**适配指导** + +使用示例: + + ```ts + // xxx.ets + import web_webview from '@ohos.web.webview' + + @Entry + @Component + struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController(); + + build() { + Column() { + Button('saveWebArchive') + .onClick(() => { + try { + this.controller.storeWebArchive("/data/storage/el2/base/", true, (error, filename) => { + if (error) { + console.info(`save web archive error: ` + JSON.stringify(error)) + return; + } + if (filename != null) { + console.info(`save web archive success: ${filename}`) + } + }); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + }) + Web({ src: 'www.example.com', controller: this.controller }) + } + } + } + ``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/Readme.md b/zh-cn/release-notes/changelogs/v3.2-beta5/Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..d8a99235b333491bbc60f91c31083b23e7a084ec --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/Readme.md @@ -0,0 +1,26 @@ +# Readme + +- [元能力](changelogs-ability.md) +- [帐号](changelogs-account_os_account.md) +- [ArkUI](changelogs-arkui.md) +- [多媒体-相机](changelogs-camera-sync.md) +- [公共基础类库-容器](changelogs-container.md) +- [分布式数据管理](changelogs-distributeddatamgr.md) +- [文件管理](changelogs-filemanagement.md) +- [输入法框架](changelogs-inputmethod-framworks.md) +- [文件管理-媒体库](changelogs-mediaLibrary.md) +- [多媒体](changelogs-multimedia.md) +- [基础通信-NFC](changelogs-nfc.md) +- [事件通知](changelogs-notification.md) +- 位置服务 + - [ohos.geoLocationManager](changelogs-ohos-geoLocationManager.md) + - [ohos.geoLocation](changelogs-ohos-geolocation.md) + - [system.geolocation](changelogs-system-geolocation.md) +- [上传下载](changelogs-request.md) +- [资源调度](changelogs-resourceschedule.md) +- [安全](changelogs-security.md) +- [电话服务](changelogs-telephony.md) +- [时间服务](changelogs-time.md) +- [公共基础类库-URL](changelogs-url.md) +- [用户IAM](changelogs-useriam.md) +- [窗口](changelogs-window.md) diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelog-x-x.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelog-x-x.md new file mode 100644 index 0000000000000000000000000000000000000000..b20dbfc1fc13ba0dc94a8044119ac0ae2473cfb7 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelog-x-x.md @@ -0,0 +1,31 @@ +# xxx子系统ChangeLog + +相比最近一个发布版本(包括不限于LTS、Release、Beta、monthly版本)发生了影响契约兼容性(契约兼容:也称语义兼容,指版本演进后,开发者原有程序行为不发生变化)的变更(包括不限于接口名、参数、返回值、所需要的权限、调用顺序、枚举值、配置参数、路径等),则需要在ChangeLog中对变更进行阐述。 + +## cl.subsystemname.x xxx功能变更, 例:DeviceType属性变更、相机权限变更(尽量概括,不要超过15个字) + +每个变更标题前需要附加编号:cl.subsystemname.x。cl为ChangeLog首字母缩写,subsystemname请填写子系统英文标准名称,x表示变更序号(从低到高逐位增加,起始为1)。 +以功能维度对变更点进行概括描述。例如:xxx功能的xxx、xxx等发生了xxx变化,开发者需要根据以下说明对应用进行适配。 +如果有此变更有对应的需求或设计文档,可以在描述中附上对应的设计文档编号。 + +**变更影响** + +是否影响已发布的接口或者接口行为发生变更,影响的是JS接口还是Native接口。 +是否影响在此前版本已开发的应用,即应用是否需要进行适配动才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** + +列举此功能变更涉及的接口/组件变更。 + +**适配指导(可选,不涉及则可以删除)** + +提供指导,帮助开发者针对相关变更进行适配,使应用可以与新版本兼容。 +例: +在xxx文件中将xxx参数修改为xxx。 + +``` +sample code +``` + + + diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ability.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..27f0f6ead460e4c49ab60f1c4af64f84a2727cb9 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ability.md @@ -0,0 +1,175 @@ +# 元能力子系统JS API变更Changelog + +## cl.ability.1 接口迁移 +ability子系统UIAbilityContext的接口requestPermissionsFromUser迁移到security子系统: + +之前权限弹窗应用是基于UIAbility实现的,需要借助于UIAbilityContext的startAbilityForResult接口把授权结果带回给调用方,故把requestPermissionsFromUser接口暂时放在UIAbilityContext中。现在权限弹窗应用切换为基于ServiceExtensionAbility实现,不再需要借助UIAbilityContext的startAbilityForResult接口,因此把requestPermissionsFromUser接口迁移到security子系统。 + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array, requestCallback: AsyncCallback): void; | 删除 | +| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array): Promise; | 删除 | +| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array, requestCallback: AsyncCallback) : void; | 新增 | +| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array) : Promise; | 新增 | + + +**适配指导** + +应用中调用requestPermissionsFromUser拉起权限弹窗应用可参考下列代码 + +Stage模型下的示例: + +```ts +import abilityAccessCtrl from '@ohos.abilityAccessCtrl.d.ts'; +//UIAbility的onWindowStageCreate生命周期 +onWindowStageCreate() { + let AtManager = abilityAccessCtrl.createAtManager(); + //requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗 + AtManager.requestPermissionsFromUser(this.context, ["ohos.permission.MANAGE_DISPOSED_APP_STATUS"]).then((data) => { + console.log("data type:" + typeof(data)); + console.log("data:" + data); + console.log("data permissions:" + data.permissions); + console.log("data result:" + data.authResults); + }).catch((err) => { + console.error('Failed to start ability', err.code); + }) +} +``` + + + +## cl.ability.2 删除标记为废弃的API9接口 + +元能力异常处理整改将部分API9接口标记为了废弃,根据OpenHarmony接口规范,需要删除标记为废弃的API9接口。 + +**变更影响** + +基于此前版本开发的应用,需要将被删除的接口替换为新接口,否则会影响应用编译。 + +**关键接口/组件变更** + +接口文件被删除: + +| 被删除接口 | 新接口 | +| ----------------------------------------------- | ----------------------------------------------- | +| @ohos.application.Ability.d.ts | @ohos.app.ability.UIAbility.d.ts | +| @ohos.application.AbilityConstant.d.ts | @ohos.app.ability.AbilityConstant.d.ts | +| @ohos.application.AbilityLifecycleCallback.d.ts | @ohos.app.ability.AbilityLifecycleCallback.d.ts | +| @ohos.application.AbilityStage.d.ts | @ohos.app.ability.AbilityStage.d.ts | +| @ohos.application.EnvironmentCallback.d.ts | @ohos.app.ability.EnvironmentCallback.d.ts | +| @ohos.application.ExtensionAbility.d.ts | @ohos.app.ability.ExtensionAbility.d.ts | +| @ohos.application.FormExtension.d.ts | @ohos.app.form.FormExtensionAbility.d.ts | +| @ohos.application.ServiceExtensionAbility.d.ts | @ohos.app.ability.ServiceExtensionAbility.d.ts | +| @ohos.application.StartOptions.d.ts | @ohos.app.ability.StartOptions.d.ts | +| @ohos.application.context.d.ts | @ohos.app.ability.common.d.ts | +| @ohos.application.errorManager.d.ts | @ohos.app.ability.errorManager.d.ts | + +接口、属性被删除: + +- @ohos.application.Configuration.d.ts + - Configuration 的 direction、screenDensity、displayId、hasPointerDevice 被删除。可以使用 @ohos.app.ability.Configuration.d.ts 的 Configuration替换。 +- @ohos.application.ConfigurationConstant.d.ts + - 枚举 Direction 和 ScreenDensity 被删除。可以使用 @ohos.app.ability.ConfigurationConstant.d.ts 的枚举 Direction 和 ScreenDensity 替换。 +- @ohos.application.abilityManager.d.ts + - 方法 getExtensionRunningInfos 和 getTopAbility 被删除。可以使用 @ohos.app.ability.abilityManager.d.ts 的同名方法替换。 +- @ohos.application.appManager.d.ts + - 枚举 ApplicationState 和 ProcessState 被删除。可以使用 @ohos.app.ability.appManager.d.ts 的枚举 ApplicationState 和 ProcessState 替换。 + - 方法 registerApplicationStateObserver 和 getProcessRunningInformation被删除。可以使用 @ohos.app.ability.appManager.d.ts 的同名方法替换。 +- @ohos.application.formHost.d.ts + - 方法 shareForm 和 notifyFormsPrivacyProtected 被删除。可以使用 @ohos.app.form.formHost.d.ts 的同名方法替换。 +- @ohos.application.formInfo.d.ts + - 枚举 FormType 的 eTS 被删除,可以使用 @ohos.app.form.formInfo.d.ts 的 FormType 中的 eTS 替换。 + - 枚举 FormParam 的 IDENTITY_KEY、BUNDLE_NAME_KEY、ABILITY_NAME_KEY、DEVICE_ID_KEY 被删除,可以使用 @ohos.app.form.formInfo.d.ts 的 FormParam 中的同名枚举替换。 + - 接口 FormInfoFilter 被删除。可以使用 @ohos.app.form.formInfo.d.ts 的 FormInfoFilter 替换。 + - 枚举 FormDimension 被删除。可以使用 @ohos.app.form.formInfo.d.ts 的 FormDimension 替换。 + - 枚举 VisibilityType 被删除。可以使用 @ohos.app.form.formInfo.d.ts 的 VisibilityType 替换。 +- @ohos.wantAgent.d.ts + - 方法 trigger 和 getOperationType 被删除。可以使用 @ohos.app.ability.wantAgent.d.ts 的同名方法替换。 +- application/ApplicationContext.d.ts + - 方法 registerAbilityLifecycleCallback、unregisterAbilityLifecycleCallback、registerEnvironmentCallback、unregisterEnvironmentCallback 被删除。可以使用 on、off 替换。 +- application/ServiceExtensionContext.d.ts + - 方法 connectAbility、connectAbilityWithAccount、disconnectAbility 被删除。可以使用 connectServiceExtensionAbility、connectServiceExtensionAbilityWithAccount、disconnectServiceExtensionAbility 替换。 +- @ohos.application.FormExtension.d.ts + - 生命周期onCreate、onCastToNormal、onUpdate、onVisibilityChange、onEvent、onDestroy、onAcquireFormState、onShare 被删除。可以使用@ohos.app.form.FormExtensionAbility.d.ts的onAddForm、onCastToNormalForm、onUpdateForm、onChangeFormVisibility、onFormEvent、onRemoveForm、onAcquireFormState、onShareForm +- @ohos.application.abilityDelegatorRegistry.d.ts + - 导出类 AbilityDelegator、AbilityDelegatorArgs、AbilityMonitor、ShellCmdResult 被删除。可以使用@ohos.app.ability.abilityDelegatorRegistry.d.ts中的同名导出类替换。 +- @ohos.application.abilityManager.d.ts + - 导出类 AbilityRunningInfo、ExtensionRunningInfo 被删除。可以使用@ohos.app.ability.abilityManager.d.ts中的同名导出类替换。 +- @ohos.application.appManager.d.ts + - 导出类 AbilityStateData、AppStateData、ApplicationStateObserver、ProcessRunningInfo、ProcessRunningInformation 被删除。可以使用@ohos.app.ability.appManager.d.ts中的同名导出类替换。 +- @ohos.application.missionManager.d.ts + - 导出类 MissionInfo、MissionListener、MissionSnapshot 被删除。可以使用@ohos.app.ability.missionManager.d.ts中的同名导出类替换。 +- @ohos.wantAgent.d.ts + - 导出类 TriggerInfo、WantAgentInfo 被删除。可以使用@ohos.app.ability.wantAgent.d.ts中的同名导出类替换。 + + + + + +**适配指导** + +如上所述,仅少数接口修改了接口名的如注册回调函数(registerAbilityLifecycleCallback、unregisterAbilityLifecycleCallback、registerEnvironmentCallback、unregisterEnvironmentCallback)和连接断开 ServiceExtensionAbility(connectAbility、connectAbilityWithAccount、disconnectAbility),卡片生命周期等需要替换成新的接口名。 + +绝大多数接口平移到了新的namespace中,所以可以通过修改import来解决适配问题: + +如原先接口使用了@ohos.application.Ability + +```js +import Ability from '@ohos.application.Ability'; +``` + +可以通过直接修改import,来切换到新的namespace上: + +```js +import Ability from '@ohos.app.ability.UIAbility'; +``` + +此外还需要适配异常处理,具体参考新接口的接口文档。 + +## cl.ability.3 appRecovery接口中RestartFlag属性名称变更,删除了未支持的属性 + +appRecovery接口中RestartFlag枚举命名从特定故障发生后**不重启**改成了特定故障发生后**重启**。 +删除了CPP_CRASH_NO_RESTART。 + +**变更影响** + +3.2.10.6版本之前使用CPP_CRASH_NO_RESTART/JS_CRASH_NO_RESTART/APP_FREEZE_NO_RESTART类型开发的应用,在3.2.10.6版本之后行为会发生变化。 + +**关键接口/组件变更** + +**RestartFlag** 9+ + +变更前: + +| 名称 | 值 | 说明 | +| --------------------- | ------ | -------------------------------- | +| ALWAYS_RESTART | 0 | 总是重启应用。 | +| CPP_CRASH_NO_RESTART | 0x0001 | 发生CPP_CRASH时**不重启**应用。 | +| JS_CRASH_NO_RESTART | 0x0002 | 发生JS_CRASH时**不重启**应用。 | +| APP_FREEZE_NO_RESTART | 0x0004 | 发生APP_FREEZE时**不重启**应用。 | +| NO_RESTART | 0xFFFF | 总是不重启应用。 | + +变更后: + +| 名称 | 值 | 说明 | +| ----------------------- | ------ | ------------------------------ | +| ALWAYS_RESTART | 0 | 总是重启应用。 | +| CPP_CRASH_NO_RESTART | NA | **删除**,不支持该场景的重启。 | +| RESTART_WHEN_JS_CRASH | 0x0001 | 发生JS_CRASH时**重启**应用。 | +| RESTART_WHEN_APP_FREEZE | 0x0002 | 发生APP_FREEZE时**重启**应用。 | +| NO_RESTART | 0xFFFF | 总是不重启应用。 | + +**适配指导** + +按新的语义进行适配。 + + + diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-account_os_account.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-account_os_account.md new file mode 100644 index 0000000000000000000000000000000000000000..8b8cad7dbf026cb17c1599e61ebdbae510073a30 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-account_os_account.md @@ -0,0 +1,96 @@ +# 帐号子系统changeLog + +## cl.account_os_account.1 createOsAccountForDomain错误码变更 + +使用createOsAccountForDomain重复创建域帐号时,变更前返回的错误码为12300001,变更后返回的错误码为12300004。 +错误信息由通用系统报错细化为帐号已存在报错。 + +**变更影响** + +基于此前版本开发的应用,需适配变更后的错误码,否则会影响原有业务逻辑。 + +**关键接口/组件变更** +- AccountManager + - createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback<OsAccountInfo>); + - createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Promise<OsAccountInfo>; + +**适配指导** + +重复创建域帐号的示例代码如下: + +```ts +import account_osAccount from "@ohos.account.osAccount" + +let accountMgr = account_osAccount.getAccountManager(); +let domainInfo = { + accountName: "zhangsan", + domain: "china.example.com" +}; +try { + await accountMgr.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo); + await accountMgr.createOsAccountForDomain(account_osAccount.OsAccountType.NORMAL, domainInfo); +} catch (err) { + console.log("activateOsAccount err: " + JSON.stringify(err)); // error.code = 12300004; +} +``` + +## cl.account_os_account.2 应用帐号getAllAccounts接口权限场景变更 + +应用使用getAllAccounts接口查询自己可访问的帐号列表时,不需要申请权限ohos.permission.GET_ALL_APP_ACCOUNTS。 + +**变更影响** + +基于此后版本开发的应用,查询自己可访问的帐号列表时,无需申请权限。 + +**关键接口/组件变更** +- AccountManager + - getAllAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void; + - getAllAccounts(): Promise<Array<AppAccountInfo>>; + +**适配指导** + +应用未申请ohos.permission.GET_ALL_APP_ACCOUNTS,查询自己可访问的帐号列表示例代码如下: + +```ts +import account_appAccount from "@ohos.account.appAccount" + +let accountMgr = account_appAccount.createAppAccountManager(); +try { + await accountMgr.addAccount("accessibleAccount_promise_nopermission"); + var data = await accountMgr.getAllAccounts(); + if (data[0].name == "accessibleAccount_promise_nopermission") { + console.log("getAllAccounts successfully"); + } +} catch (err) { + console.log("getAllAccounts err: " + JSON.stringify(err)); +} +``` + +## cl.account_os_account.3 应用帐号getAccountsByOwner接口权限场景变更 + +应用使用getAccountsByOwner接口查询可访问的指定应用的帐号列表时,不需要申请权限ohos.permission.GET_ALL_APP_ACCOUNTS。 + +**变更影响** + +基于此后版本开发的应用,查询指定应用可访问的帐号列表时,无需申请权限。 + +**关键接口/组件变更** +- AccountManager + - getAccountsByOwner(owner: string, callback: AsyncCallback<Array<AppAccountInfo>>): void; + - getAccountsByOwner(owner: string): Promise<Array<AppAccountInfo>>; + +**适配指导** + +应用未申请ohos.permission.GET_ALL_APP_ACCOUNTS,查询指定应用可访问的帐号列表示例代码如下: + +```ts +import account_appAccount from "@ohos.account.appAccount" + +let accountMgr = account_appAccount.createAppAccountManager(); +try { + var ownerName = "com.example.owner"; + var data = await accountMgr.getAllAccounts(ownerName); +} catch (err) { + console.log("getAllAccounts err: " + JSON.stringify(err)); +} +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-arkui.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-arkui.md new file mode 100644 index 0000000000000000000000000000000000000000..d661cf1d84f2b2c6b06bb8102d30455fb07a7e43 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-arkui.md @@ -0,0 +1,332 @@ +# arkui子系统ChangeLog + +## cl.arkui.1 状态变量数据类型声明使用限制 + +1. 所有的状态装饰器变量需要显式声明变量类型,不允许声明any,不支持Date数据类型。 + + 示例: + + ```ts + // xxx.ets + @Entry + @Component + struct DatePickerExample { + // 错误写法: @State isLunar: any = false + @State isLunar: boolean = false + // 错误写法: @State selectedDate: Date = new Date('2021-08-08') + private selectedDate: Date = new Date('2021-08-08') + + build() { + Column() { + Button('切换公历农历') + .margin({ top: 30 }) + .onClick(() => { + this.isLunar = !this.isLunar + }) + DatePicker({ + start: new Date('1970-1-1'), + end: new Date('2100-1-1'), + selected: this.selectedDate + }) + .lunar(this.isLunar) + .onChange((value: DatePickerResult) => { + this.selectedDate.setFullYear(value.year, value.month, value.day) + console.info('select current date is: ' + JSON.stringify(value)) + }) + + }.width('100%') + } + } + ``` + + ![datePicker](../../../application-dev/reference/arkui-ts/figures/datePicker.gif) + +2. @State、@Provide、 @Link和@Consume四种状态变量的数据类型声明只能由简单数据类型或引用数据类型的其中一种构成。 + + 类型定义中的Length、ResourceStr、ResourceColor三个类型是简单数据类型或引用数据类型的组合,所以不能被以上四种状态装饰器变量使用。 + Length、ResourceStr、ResourceColor的定义请看文档[arkui-ts类型定义](../../../application-dev/reference/arkui-ts/ts-types.md)。 + + 示例: + + ```ts + // xxx.ets + @Entry + @Component + struct IndexPage { + // 错误写法: @State message: string | Resource = 'Hello World' + @State message: string = 'Hello World' + // 错误写法: @State message: ResourceStr = $r('app.string.hello') + @State resourceStr: Resource = $r('app.string.hello') + + build() { + Row() { + Column() { + Text(`${this.message}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } + } + ``` + + ![hello](../../../application-dev/quick-start/figures/hello.PNG) + +**变更影响** + +1. 如果状态装饰器变量没有显式声明变量类型,声明any,编译拦截报错; + ```ts + // ArkTS:ERROR Please define an explicit type, not any. + @State isLunar: any = false + ``` +2. 状态装饰器变量声明变量类型为Date,编译拦截报错; + ```ts + // ArkTS:ERROR The @State property 'selectedDate' cannot be a 'Date' object. + @State selectedDate: Date = new Date('2021-08-08') + ``` +3. @State、@Provide、 @Link和@Consume四种状态变量使用框架提供的Length、ResourceStr、ResourceColor, + 编译拦截报错。 + ```ts + /* ArkTS:ERROR The state variable type here is 'ResourceStr', it contains both a simple type and an object type, + which are not allowed to be defined for state variable of a struct.*/ + @State message: ResourceStr = $r('app.string.hello') + ``` + +**关键的接口/组件变更** + +不涉及。 + +**适配指导** + +1. 状态装饰器变量声明具体的变量类型替代any; +2. 使用Date对象的状态装饰器变量,修改为不加状态装饰器修饰的常规变量; +3. 因为Length(string|number|Resource), ResourceStr(string|Resource), ResourceColor(string|number|Color|Resource) + 的三个类型是简单数据类型或引用数据类型的组合,使用@State、@Provide、 @Link和@Consume四种状态变量场景参考以下修改: + ```ts + // 错误写法: + @State message: ResourceStr = $r('app.string.hello') + // 修正后的写法: + @State resourceStr: Resource = $r('app.string.hello') + ``` + + +## cl.arkui.2 自定义组件成员变量初始化的规则与约束 + +通过构造函数方法初始化成员变量,需要遵循如下规则: + +| **从父组件中的变量(右)到子组件中的变量(下)** | **regular** | **@State** | **@Link** | **@Prop** | **@Provide** | **@Consume** | **@ObjectLink** | +|---------------------------------|----------------------------|------------|-----------|-----------|--------------|--------------|------------------| +| **regular** | 支持 | 支持 | 支持 | 支持 | 不支持 | 不支持 | 支持 | +| **@State** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | +| **@Link** | 不支持 | 支持(1) | 支持(1) | 支持(1) | 支持(1) | 支持(1) | 支持(1) | +| **@Prop** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | +| **@Provide** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | +| **@Consume** | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | +| **@ObjectLink** | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | + +| **从父组件中的变量(右)到子组件中的变量(下)** | **@StorageLink** | **@StorageProp** | **@LocalStorageLink** | **@LocalStorageProp** | +|------------------|------------------|------------------|-----------------------|------------------------| +| **regular** | 支持 | 不支持 | 不支持 | 不支持 | +| **@State** | 支持 | 支持 | 支持 | 支持 | +| **@Link** | 支持(1) | 支持(1) | 支持(1) | 支持(1) | +| **@Prop** | 支持 | 支持 | 支持 | 支持 | +| **@Provide** | 支持 | 支持 | 支持 | 支持 | +| **@Consume** | 不支持 | 不支持 | 不支持 | 不支持 | +| **@ObjectLink** | 不支持 | 不支持 | 不支持 | 不支持 | + +> **说明** +> +> **支持(1)**:必须使用`$`, 例如 `this.$varA`。 +> **regular**:未加修饰的常规变量。 + +不允许从父组件初始化`@StorageLink`, `@StorageProp`, `@LocalStorageLink`, `@LocalStorageProp`修饰的变量。 + +**变更影响** + +1. 不允许从父组件初始化`@LocalStorageLink`, `@LocalStorageProp`修饰的变量。 + ```ts + @Entry + @Component + struct LocalStorageComponent { + build() { + Column() { + Child({ + /* ArkTS:ERROR Property 'simpleVarName' in the custom component 'Child' cannot + initialize here (forbidden to specify). */ + simpleVarName: 1, + /* ArkTS:ERROR Property 'objectName' in the custom component 'Child' cannot + initialize here (forbidden to specify). */ + objectName: new ClassA("x") + }) + } + } + } + @Component + struct Child { + @LocalStorageLink("storageSimpleProp") simpleVarName: number = 0; + @LocalStorageProp("storageObjectProp") objectName: ClassA = new ClassA("x"); + build() {} + } + ``` +2. 子组件的@ObjectLink变量不支持父组件装饰器变量的直接赋值,其父组件的源必须是数组的项或对象的属性,该数组或对象必现用`@State`、`@Link`、`@Provide`、`@Consume`或`@ObjectLink`装饰器修饰。 + ```ts + let NextID : number = 0; + + @Observed class ClassA { + public id : number; + public c: number; + constructor(c: number) { + this.id = NextID++; + this.c = c; + } + } + + @Component + struct Child { + @ObjectLink varA : ClassA; + build() { + Row() { + Text('ViewA-' + this.varA.id) + } + } + } + + @Component + struct Parent { + @Link linkValue: ClassA + build() { + Column() { + /* ArkTS:ERROR The @Link property 'linkValue' cannot be assigned to + the @ObjectLink property 'varA'.*/ + Child({ varA: this.linkValue }) + } + } + } + ``` + +**关键的接口/组件变更** + +不涉及。 + +**适配指导** +1. 构造子组件时,不对子组件的`@LocalStorageLink`, `@LocalStorageProp`修饰的变量进行。 +如果需要在父组件中修改子组件的`@LocalStorageLink`, `@LocalStorageProp`修饰的变量,则使用LocalStorage提供的API接口方法(比如set方法)赋值。 +2. @ObjectLink的使用指导请参考文档@ObjectLink使用指导。 + + +## cl.arkui.LocalStorage.1 get接口返回类型变更 + +**变更影响** + +返回类型从get(propName: string): T变更为get(propName: string): T | undefined +应用不需要进行适配。 + +## cl.arkui.LocalStorage.2 setOrCreate参数newValue变成必选 +**变更影响** + +原接口声明: +```js +setOrCreate(propName: string, newValue?: T): boolean +``` +现接口声明: +```js +setOrCreate(propName: string, newValue: T): boolean +``` +第二个参数newValue变为必选。 +如果应用调用这个接口没有指定newValue参数,在替换新的sdk后会编译不过,需要手动指定newValue。 + +**适配指导** + +```js +let storage = new LocalStorage(); +storage.setOrCreate('propA', 'hello'); +``` +## cl.arkui.LocalStorage.3 link参数和返回类型变更 +**变更影响** + +原接口声明: +```js +link(propName: string, linkUser?: T, subscribersName?: string): T +``` +现接口声明: +```js +link(propName: string): SubscribedAbstractProperty +``` +1. link第二三个参数为框架内部调用,不应对外开发,所以将接口变更为一个参数; +2. 返回类型T变更为SubscribedAbstractProperty; + +**适配指导** + +```js +let storage = new LocalStorage({"PropA": "47"}); +let linA = storage.link("PropA"); +linA.set(50); +``` + +## cl.arkui.LocalStorage.4 setAndLink参数和返回类型变更 +**变更影响** + +原接口声明: +```js +setAndLink(propName: string, defaultValue: T, linkUser?: T, subscribersName?: string): T +``` +现接口声明: +```js +setAndLink(propName: string, defaultValue: T): SubscribedAbstractProperty +``` +1. setAndLink第三四个参数为框架内部调用,不应对外开发,所以将接口变更为2个参数; +2. 返回类型T变更为SubscribedAbstractProperty; + +**适配指导** + +```js +let storage = new LocalStorage({"PropA": "47"}); +let linA = storage.setAndLink("PropA", "48") +linA.set(50); +``` + +## cl.arkui.LocalStorage.5 prop参数和返回类型变更 +**变更影响** + +原接口声明: +```js +prop(propName: string, propUser?: T, subscribersName?: string): T +``` +现接口声明: +```js +prop(propName: string): SubscribedAbstractProperty +``` +1. prop第二三个参数为框架内部调用,不应对外开发,所以将接口变更为1个参数; +2. 返回类型T变更为SubscribedAbstractProperty; + +**适配指导** + +```js +let storage = new LocalStorage({"PropA": "47"}); +let propA = storage.prop("PropA"); +propA.set(51); // one-way sync +``` + +## cl.arkui.LocalStorage.6 setAndProp参数和返回类型变更 +**变更影响** + +原接口声明: +```js +setAndProp(propName: string, defaultValue: T, propUser?: T, subscribersName?: string): T +``` +现接口声明: +```js +setAndProp(propName: string, defaultValue: S): SubscribedAbstractProperty +``` +1. setAndProp第三四个参数为框架内部调用,不应对外开发,所以将接口变更为2个参数; +2. 返回类型T变更为SubscribedAbstractProperty; + +**适配指导** + +```js +let storage = new LocalStorage({"PropA": "47"}); +let propA = storage.setAndProp("PropA", "48"); +propA.set(51); // one-way sync +``` diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md new file mode 100644 index 0000000000000000000000000000000000000000..3f5cd56d576151dc37ab56f50301a4d4443a271a --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-camera-sync.md @@ -0,0 +1,520 @@ +# 媒体子系统 JS API 变更 Changelog + +## cl.subsystemname.1 camera 接口变更 +1. camera 部件在 API9 版本全量改为 SystemAPI +2. 基于以下原因新增部分功能接口以及废弃部分接口: + +提升开发者使用相机接口的便利。 +帮助开发者快速掌握相机开发接口,快速投入到开发当中。 +易于后续版本中框架功能的扩展,降低框架模块之间的耦合度。 + +具体参考下方变更内容,开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +影响 API9 版本的 JS 接口,应用需要进行适配才可以在新版本 SDK 环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 是否为 SystemApi | 变更类型 | +| ---------------------- | ----------------------- | ------------------------------------------------------------ | --------------- | -------- | +| ohos.multimedia.camera | camera | function getCameraManager(context: Context): CameraManager; | 是 | 新增 | +| ohos.multimedia.camera | camera | function getCameraManager(context: Context, callback: AsyncCallback): void;
function getCameraManager(context: Context): Promise; | 是 | 废弃 | +| ohos.multimedia.camera | CameraErrorCode | INVALID_ARGUMENT = 7400101,
OPERATION_NOT_ALLOWED = 7400102,
SESSION_NOT_CONFIG = 7400103,
SESSION_NOT_RUNNING = 7400104,
SESSION_CONFIG_LOCKED = 7400105,
DEVICE_SETTING_LOCKED = 7400106,
CONFILICT_CAMERA = 7400107,
DEVICE_DISABLED = 7400108,
SERVICE_FATAL_ERROR = 7400201 | 是 | 新增 | +| ohos.multimedia.camera | CameraManager | getSupportedCameras(): Array;
getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability;
createCameraInput(camera: CameraDevice): CameraInput;
createCameraInput(position: CameraPosition, type: CameraType): CameraInput;
createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput;
createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput;
createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput;
createMetadataOutput(metadataObjectTypes: Array): MetadataOutput;
createCaptureSession(): CaptureSession; | 是 | 新增 | +| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback>): void;
getSupportedCameras(): Promise>;
getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void;
getSupportedOutputCapability(camera: CameraDevice): Promise;
createCameraInput(camera: CameraDevice, callback: AsyncCallback): void;
createCameraInput(camera: CameraDevice): Promise;
createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void;
createCameraInput(position: CameraPosition, type: CameraType): Promise;
createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;
createPreviewOutput(profile: Profile, surfaceId: string): Promise;
createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void;
createPhotoOutput(profile: Profile, surfaceId: string): Promise;
createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void;
createVideoOutput(profile: VideoProfile, surfaceId: string): Promise;
createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void;
createMetadataOutput(metadataObjectTypes: Array): Promise;
createCaptureSession(callback: AsyncCallback): void;
createCaptureSession(): Promise; | 是 | 废弃 | +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_DEFAULT = 0 | 是 | 新增 | +| ohos.multimedia.camera | CameraType | CAMERA_TYPE_UNSPECIFIED = 0 | 是 | 废弃 | +| ohos.multimedia.camera | CameraInput | on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; | 是 | 新增 | +| ohos.multimedia.camera | CameraInput | release(callback: AsyncCallback): void;
release(): Promise;
on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; | 是 | 废弃 | +| ohos.multimedia.camera | CameraInputErrorCode | ERROR_UNKNOWN = -1
ERROR_NO_PERMISSION = 0
ERROR_DEVICE_PREEMPTED = 1
ERROR_DEVICE_DISCONNECTED = 2
ERROR_DEVICE_IN_USE = 3
ERROR_DRIVER_ERROR = 4 | 是 | 废弃 | +| ohos.multimedia.camera | CameraInputError | code: CameraInputErrorCode | 是 | 废弃 | +| ohos.multimedia.camera | CaptureSession | beginConfig(): void;
addInput(cameraInput: CameraInput): void;
removeInput(cameraInput: CameraInput): void;
addOutput(cameraOutput: CameraOutput): void;
removeOutput(cameraOutput: CameraOutput): void;
hasFlash(): boolean;
isFlashModeSupported(flashMode: FlashMode): boolean;
getFlashMode(): FlashMode;
setFlashMode(flashMode: FlashMode): void;
isExposureModeSupported(aeMode: ExposureMode): boolean;
getExposureMode(): ExposureMode;
setExposureMode(aeMode: ExposureMode): void;
getMeteringPoint(): Point;
setMeteringPoint(point: Point): void;
getExposureBiasRange(): Array;
setExposureBias(exposureBias: number): void;
getExposureValue(): number;
isFocusModeSupported(afMode: FocusMode): boolean;
getFocusMode(): FocusMode;
setFocusMode(afMode: FocusMode): void;
setFocusPoint(point: Point): void;
getFocusPoint(): Point;
getFocalLength(): number;
getZoomRatioRange(): Array;
getZoomRatio(): number;
setZoomRatio(zoomRatio: number): void;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean;
getActiveVideoStabilizationMode(): VideoStabilizationMode;
setVideoStabilizationMode(mode: VideoStabilizationMode): void;
on(type: 'error', callback: ErrorCallback): void; | 是 | 新增 | +| ohos.multimedia.camera | CaptureSession | beginConfig(callback: AsyncCallback): void;
beginConfig(): Promise;
addInput(cameraInput: CameraInput, callback: AsyncCallback): void;
addInput(cameraInput: CameraInput): Promise;
removeInput(cameraInput: CameraInput, callback: AsyncCallback): void;
removeInput(cameraInput: CameraInput): Promise;
addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
addOutput(cameraOutput: CameraOutput): Promise;
removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void;
removeOutput(cameraOutput: CameraOutput): Promise;
hasFlash(callback: AsyncCallback): void;
hasFlash(): Promise;
isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void;
isFlashModeSupported(flashMode: FlashMode): Promise;
getFlashMode(callback: AsyncCallback): void;
getFlashMode(): Promise;
setFlashMode(flashMode: FlashMode, callback: AsyncCallback): void;
setFlashMode(flashMode: FlashMode): Promise;
isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void;
isExposureModeSupported(aeMode: ExposureMode): Promise;
getExposureMode(callback: AsyncCallback): void;
getExposureMode(): Promise;
setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void;
setExposureMode(aeMode: ExposureMode): Promise;
getMeteringPoint(callback: AsyncCallback): void;
getMeteringPoint(): Promise;
setMeteringPoint(point: Point, callback: AsyncCallback): void;
setMeteringPoint(point: Point): Promise;
getExposureBiasRange(callback: AsyncCallback>): void;
getExposureBiasRange(): Promise>;
setExposureBias(exposureBias: number, callback: AsyncCallback): void;
setExposureBias(exposureBias: number): Promise;
getExposureValue(callback: AsyncCallback): void;
getExposureValue(): Promise;
isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void;
isFocusModeSupported(afMode: FocusMode): Promise;
getFocusMode(callback: AsyncCallback): void;
getFocusMode(): Promise;
setFocusMode(afMode: FocusMode, callback: AsyncCallback): void;
setFocusMode(afMode: FocusMode): Promise;
setFocusPoint(point: Point, callback: AsyncCallback): void;
setFocusPoint(point: Point): Promise;
getFocusPoint(callback: AsyncCallback): void;
getFocusPoint(): Promise;
getFocalLength(callback: AsyncCallback): void;
getFocalLength(): Promise;
getZoomRatioRange(callback: AsyncCallback>): void;
getZoomRatioRange(): Promise>;
getZoomRatio(callback: AsyncCallback): void;
getZoomRatio(): Promise;
setZoomRatio(zoomRatio: number, callback: AsyncCallback): void;
setZoomRatio(zoomRatio: number): Promise;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void;
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise;
getActiveVideoStabilizationMode(callback: AsyncCallback): void;
getActiveVideoStabilizationMode(): Promise;
setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void;
setVideoStabilizationMode(mode: VideoStabilizationMode): Promise;
on(type: 'error', callback: ErrorCallback): void; | 是 | 废弃 | +| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_UNKNOWN = -1
ERROR_INSUFFICIENT_RESOURCES = 0
ERROR_TIMEOUT = 1 | 是 | 废弃 | +| ohos.multimedia.camera | CaptureSessionError | code: CaptureSessionErrorCode | 是 | 废弃 | +| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback): void; | 是 | 新增 | +| ohos.multimedia.camera | PreviewOutput | on(type: 'error', callback: ErrorCallback): void; | 是 | 废弃 | +| ohos.multimedia.camera | PreviewOutputErrorCode | ERROR_UNKNOWN = -1 | 是 | 废弃 | +| ohos.multimedia.camera | PreviewOutputError | code: PreviewOutputErrorCode | 是 | 废弃 | +| ohos.multimedia.camera | PhotoOutput | capture(): Promise;
isMirrorSupported(): boolean;
on(type: 'error', callback: ErrorCallback): void; | 是 | 新增 | +| ohos.multimedia.camera | PhotoOutput | isMirrorSupported(callback: AsyncCallback): void;
isMirrorSupported(): Promise;
on(type: 'error', callback: ErrorCallback): void; | 是 | 废弃 | +| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_DRIVER_ERROR = 0
ERROR_INSUFFICIENT_RESOURCES = 1
ERROR_TIMEOUT = 2 | 是 | 废弃 | +| ohos.multimedia.camera | PhotoOutputError | code: PhotoOutputErrorCode | 是 | 废弃 | +| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback): void; | 是 | 新增 | +| ohos.multimedia.camera | VideoOutput | on(type: 'error', callback: ErrorCallback): void; | 是 | 废弃 | +| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_DRIVER_ERROR = 0 | 是 | 废弃 | +| ohos.multimedia.camera | VideoOutputError | code: VideoOutputErrorCode | 是 | 废弃 | +| ohos.multimedia.camera | MetadataObject | readonly type: MetadataObjectType;
readonly timestamp: number; | 是 | 新增 | +| ohos.multimedia.camera | MetadataObject | getType(callback: AsyncCallback): void;
getType(): Promise;
getTimestamp(callback: AsyncCallback): void;
getTimestamp(): Promise;
getBoundingBox(callback: AsyncCallback): void;
getBoundingBox(): Promise; | 是 | 废弃 | +| ohos.multimedia.camera | MetadataFaceObject | readonly boundingBox: Rect | 是 | 新增 | +| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback): void; | 是 | 新增 | +| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback): void; | 是 | 废弃 | +| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1
ERROR_INSUFFICIENT_RESOURCES = 0 | 是 | 废弃 | +| ohos.multimedia.camera | MetadataOutputError | code: MetadataOutputErrorCode | 是 | 废弃 | + +**适配指导** + +除新增接口,和废弃接口之外,开发者需要关注变更的接口的适配: + +从 Beta4 版本开始,对以下接口进行调整: + +**新增接口** + +1. CameraErrorCode 枚举 + + 枚举值名称:INVALID_ARGUMENT, 值:7400101; + + 枚举值名称:OPERATION_NOT_ALLOWED, 值:7400102; + + 枚举值名称:SESSION_NOT_CONFIG, 值:7400103; + + 枚举值名称:SESSION_NOT_RUNNING, 值:7400104; + + 枚举值名称:SESSION_CONFIG_LOCKED, 值:7400105; + + 枚举值名称:DEVICE_SETTING_LOCKED, 值:7400106; + + 枚举值名称:CONFILICT_CAMERA, 值:7400107; + + 枚举值名称:DEVICE_DISABLED, 值:7400108; + + 枚举值名称:SERVICE_FATAL_ERROR, 值:7400201; + +2. PhotoOutput 接口新增 capture(): Promise; + +3. MetadataObject 接口中新增 readonly type: MetadataObjectType; + +4. MetadataObject 接口中新增 readonly timestamp: number; + +5. MetadataObject 接口中新增 readonly boundingBox: Rect; + +**废弃接口** + +1. CameraInput 中废弃接口 release(callback: AsyncCallback): void; 以及 release(): Promise; + +2. 废弃枚举 CameraInputErrorCode 以及所有它里边的枚举值(ERROR_UNKNOWN = -1,ERROR_NO_PERMISSION = 0,ERROR_DEVICE_PREEMPTED = 1,ERROR_DEVICE_DISCONNECTED = 2,ERROR_DEVICE_IN_USE = 3,ERROR_DRIVER_ERROR = 4); + +3. 废弃接口 CameraInputError 以及接口属性 code:CameraInputErrorCode; + +4. 废弃枚举 CaptureSessionErrorCode 以及所有它里边的枚举值(ERROR_UNKNOWN = -1,ERROR_INSUFFICIENT_RESOURCES = 0,ERROR_TIMEOUT = 1); + +5. 废弃接口 CaptureSessionError 以及接口属性 code: CaptureSessionErrorCode; + +6. 废弃枚举 PreviewOutputErrorCode 以及所有它里边的枚举值(ERROR_UNKNOWN = -1); + +7. 废弃接口 PreviewOutputError 以及接口属性 code: PreviewOutputErrorCode; + +8. 废弃枚举 PhotoOutputErrorCode 以及所有它里边的枚举值(ERROR_UNKNOWN = -1,ERROR_DRIVER_ERROR = 0,ERROR_INSUFFICIENT_RESOURCES = 1,ERROR_TIMEOUT = 2); + +9. 废弃接口 PhotoOutputError 以及接口属性 code:PhotoOutputErrorCode; + +10. 废弃枚举 VideoOutputErrorCode 以及所有它里边的枚举值(ERROR_UNKNOWN = -1,ERROR_DRIVER_ERROR = 0); + +11. 废弃接口 VideoOutputError 以及接口属性 code:VideoOutputErrorCode; + +12. 废弃接口 MetadataObject 中 getType(callback: AsyncCallback): void; + +13. 废弃接口 MetadataObject 中 getType(): Promise; + +14. 废弃接口 MetadataObject 中 getTimestamp(callback: AsyncCallback): void; + +15. 废弃接口 MetadataObject 中 getTimestamp(): Promise; + +16. 废弃接口 MetadataObject 中 getBoundingBox(callback: AsyncCallback): void; + +17. 废弃接口 MetadataObject 中 getBoundingBox(): Promise; + +18. 废弃枚举 MetadataOutputErrorCode 以及所有它里边的枚举值(ERROR_UNKNOWN = -1,ERROR_INSUFFICIENT_RESOURCES = 0); + +19. 废弃接口 MetadataOutputError 以及接口属性 code:MetadataOutputErrorCode; + +**接口变更** + +1. camera 模块中接口 getCameraManager 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getCameraManager(context: Context, callback: AsyncCallback): void; 以及 getCameraManager(context: Context): Promise; 变更为 getCameraManager(context: Context): CameraManager; + + 参考代码如下: + + ``` + let cameraManager = camera.getCameraManager(context); + ``` + +2. CameraManager 中接口 getSupportedCameras 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getSupportedCameras(callback: AsyncCallback>): void; 以及 getSupportedCameras(): Promise>; 变更为 getSupportedCameras(): Array; + + 参考代码如下: + + ``` + let cameras = cameraManager.getSupportedCameras(); + ``` + +3. CameraManager 中接口 getSupportedOutputCapability 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback): void; 以及 getSupportedOutputCapability(camera: CameraDevice): Promise; 变更为 getSupportedOutputCapability(camera: CameraDevice): CameraOutputCapability; + + 参考代码如下: + + ``` + let cameraDevice = cameras[0]; + let CameraOutputCapability = cameraManager.getSupportedOutputCapability(cameraDevice); + ``` + +4. CameraManager 中接口 createCameraInput(camera: CameraDevice) 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 createCameraInput(camera: CameraDevice, callback: AsyncCallback): void; 以及 createCameraInput(camera: CameraDevice): Promise; 变更为 createCameraInput(camera: CameraDevice): CameraInput; + + 参考代码如下: + + ``` + let cameraDevice = cameras[0]; + let cameraInput = cameraManager.createCameraInput(cameraDevice); + ``` + +5. CameraManager 中接口 createCameraInput(position: CameraPosition, type: CameraType) 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 createCameraInput(position: CameraPosition, type: CameraType, callback: AsyncCallback): void; 以及 createCameraInput(position: CameraPosition, type: CameraType): Promise; 变更为 createCameraInput(position: CameraPosition, type: CameraType): CameraInput; + + 参考代码如下: + + ``` + let cameraDevice = cameras[0]; + let position = cameraDevice.cameraPosition; + let type = cameraDevice.cameraType; + let cameraInput = cameraManager.createCameraInput(position, type); + ``` + +6. CameraManager 中接口 createPreviewOutput 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void; 以及 createPreviewOutput(profile: Profile, surfaceId: string): Promise; 变更为 createPreviewOutput(profile: Profile, surfaceId: string): PreviewOutput; + + 参考代码如下: + + ``` + let profile = cameraoutputcapability.previewProfiles[0]; + let previewOutput = cameraManager.createPreviewOutput(profile, surfaceId); + ``` + +7. CameraManager 中接口 createPhotoOutput 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback): void; 以及 createPhotoOutput(profile: Profile, surfaceId: string): Promise; 变更为 createPhotoOutput(profile: Profile, surfaceId: string): PhotoOutput; + + 参考代码如下: + + ``` + let profile = cameraoutputcapability.photoProfiles[0]; + let photoOutput = cameraManager.createPhotoOutput(profile, surfaceId); + ``` + +8. CameraManager 中接口 createVideoOutput 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback): void; 以及 createVideoOutput(profile: VideoProfile, surfaceId: string): Promise; 变更为 createVideoOutput(profile: VideoProfile, surfaceId: string): VideoOutput; + + 参考代码如下: + + ``` + let profile = cameraoutputcapability.videoProfiles[0]; + let videoOutput = cameraManager.createVideoOutput(profile, surfaceId); + ``` + +9. CameraManager 中接口 createMetadataOutput 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 createMetadataOutput(metadataObjectTypes: Array, callback: AsyncCallback): void; 以及 createMetadataOutput(metadataObjectTypes: Array): Promise; 变更为 createMetadataOutput(metadataObjectTypes: Array): MetadataOutput; + + 参考代码如下: + + ``` + let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes; + let metadataOutput = cameraManager.createMetadataOutput(metadataObjectTypes); + ``` + +10. CameraManager 中接口 createCaptureSession 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 createCaptureSession(callback: AsyncCallback): void; 以及 createCaptureSession(): Promise; 变更为 createCaptureSession(): CaptureSession; + + 参考代码如下: + + ``` + let captureSession = cameraManager.createCaptureSession(); + ``` + +11. 枚举 CameraType 中,枚举值名称 CAMERA_TYPE_UNSPECIFIED 变更为 CAMERA_TYPE_DEFAULT。 + +12. CameraInput 中,on 接口返回值类型由 CameraInputError 变更为 BusinessError,因此旧接口 on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; 变更为 on(type: 'error', camera: CameraDevice, callback: ErrorCallback): void; + + 参考代码如下: + + ``` + let cameraDevice = cameras[0]; + cameraInput.on('error', cameraDevice, (BusinessError) => { + + }) + ``` + +13. CaptureSession 中接口 beginConfig 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 beginConfig(callback: AsyncCallback): void; 以及 beginConfig(): Promise; 变更为 beginConfig(): void; + + 参考代码如下: + + ``` + captureSession.beginConfig(); + ``` + +14. CaptureSession 中接口 addInput 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 addInput(cameraInput: CameraInput, callback: AsyncCallback): void; 以及 addInput(cameraInput: CameraInput): Promise; 变更为 addInput(cameraInput: CameraInput): void; + + 参考代码如下: + + ``` + captureSession.addInput(cameraInput); + ``` + +15. CaptureSession 中接口 removeInput 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 removeInput(cameraInput: CameraInput, callback: AsyncCallback): void; 以及 removeInput(cameraInput: CameraInput): Promise; 变更为 removeInput(cameraInput: CameraInput): void; + + 参考代码如下: + + ``` + captureSession.removeInput(cameraInput); + ``` + +16. CaptureSession 中接口 addOutput 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 addOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; 以及 addOutput(cameraOutput: CameraOutput): Promise; 变更为 addOutput(cameraOutput: CameraOutput): void; + + 参考代码如下: + + ``` + captureSession.addOutput(previewOutput); + ``` + +17. CaptureSession 中接口 removeOutput 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback): void; 以及 removeOutput(cameraOutput: CameraOutput): Promise; 变更为 removeOutput(cameraOutput: CameraOutput): void; + + 参考代码如下: + + ``` + captureSession.removeOutput(previewOutput); + ``` + +18. CaptureSession 中接口 hasFlash 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 hasFlash(callback: AsyncCallback): void; 以及 hasFlash(): Promise; 变更为 hasFlash(): boolean; + + 参考代码如下: + + ``` + let status = captureSession.hasFlash(); + ``` + +19. CaptureSession 中接口 isFlashModeSupported 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback): void; 以及 isFlashModeSupported(flashMode: FlashMode): Promise; 变更为 isFlashModeSupported(flashMode: FlashMode): boolean; + + 参考代码如下: + + ``` + let status = captureSession.isFlashModeSupported(camera.FlashMode.FLASH_MODE_AUTO); + ``` + +20. CaptureSession 中接口 getFlashMode 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getFlashMode(callback: AsyncCallback): void; 以及 getFlashMode(): Promise; 变更为 getFlashMode(): FlashMode; + + 参考代码如下: + + ``` + let flashMode = captureSession.getFlashMode(); + ``` + +21. CaptureSession 中接口 isExposureModeSupported 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback): void; 以及 isExposureModeSupported(aeMode: ExposureMode): Promise; 变更为 isExposureModeSupported(aeMode: ExposureMode): boolean; + + 参考代码如下: + + ``` + let isSupported = captureSession.isExposureModeSupported(camera.ExposureMode.EXPOSURE_MODE_LOCKED); + ``` + +22. CaptureSession 中接口 getExposureMode 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getExposureMode(callback: AsyncCallback): void; 以及 getExposureMode(): Promise; 变更为 getExposureMode(): ExposureMode; + + 参考代码如下: + + ``` + let exposureMode = captureSession.getExposureMode(); + ``` + +23. CaptureSession 中接口 setExposureMode 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 setExposureMode(aeMode: ExposureMode, callback: AsyncCallback): void; 以及 setExposureMode(aeMode: ExposureMode): Promise; 变更为 setExposureMode(aeMode: ExposureMode): void; + + 参考代码如下: + + ``` + captureSession.setExposureMode(camera.ExposureMode.EXPOSURE_MODE_LOCKED); + ``` + +24. CaptureSession 中接口 getMeteringPoint 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getMeteringPoint(callback: AsyncCallback): void; 以及 getMeteringPoint(): Promise; 变更为 getMeteringPoint(): Point; + + 参考代码如下: + + ``` + let exposurePoint = captureSession.getMeteringPoint(); + ``` + +25. CaptureSession 中接口 setMeteringPoint 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 setMeteringPoint(point: Point, callback: AsyncCallback): void; 以及 setMeteringPoint(point: Point): Promise; 变更为 setMeteringPoint(point: Point): void; + + 参考代码如下: + + ``` + let Point2 = {x: 2, y: 2}; + captureSession.setMeteringPoint(Point2); + ``` + +26. CaptureSession 中接口 getExposureBiasRange 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getExposureBiasRange(callback: AsyncCallback>): void; 以及 getExposureBiasRange(): Promise>; 变更为 getExposureBiasRange(): Array; + + 参考代码如下: + + ``` + let biasRangeArray = captureSession.getExposureBiasRange(); + ``` + +27. CaptureSession 中接口 setExposureBias 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 setExposureBias(exposureBias: number, callback: AsyncCallback): void; 以及 setExposureBias(exposureBias: number): Promise; 变更为 setExposureBias(exposureBias: number): void; + + 参考代码如下: + + ``` + let exposureBias = biasRangeArray[0]; + captureSession.setExposureBias(exposureBias); + ``` + +28. CaptureSession 中接口 getExposureValue 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getExposureValue(callback: AsyncCallback): void; 以及 getExposureValue(): Promise; 变更为 getExposureValue(): number; + + 参考代码如下: + + ``` + let exposureValue = captureSession.getExposureValue(); + ``` + +29. CaptureSession 中接口 isFocusModeSupported 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback): void; 以及 isFocusModeSupported(afMode: FocusMode): Promise; 变更为 isFocusModeSupported(afMode: FocusMode): boolean; + + 参考代码如下: + + ``` + let status = captureSession.isFocusModeSupported(camera.FocusMode.FOCUS_MODE_AUTO); + ``` + +30. CaptureSession 中接口 getFocusMode 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getFocusMode(callback: AsyncCallback): void; 以及 getFocusMode(): Promise; 变更为 getFocusMode(): FocusMode; + + 参考代码如下: + + ``` + let afMode = captureSession.getFocusMode(); + ``` + +31. CaptureSession 中接口 setFocusMode 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 setFocusMode(afMode: FocusMode, callback: AsyncCallback): void; 以及 setFocusMode(afMode: FocusMode): Promise; 变更为 setFocusMode(afMode: FocusMode): void; + + 参考代码如下: + + ``` + captureSession.setFocusMode(camera.FocusMode.FOCUS_MODE_AUTO); + ``` + +32. CaptureSession 中接口 setFocusPoint 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 setFocusPoint(point: Point, callback: AsyncCallback): void; 以及 setFocusPoint(point: Point): Promise; 变更为 setFocusPoint(point: Point): void; + + 参考代码如下: + + ``` + let Point2 = {x: 2, y: 2}; + captureSession.setFocusPoint(Point2); + ``` + +33. CaptureSession 中接口 getFocusPoint 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getFocusPoint(callback: AsyncCallback): void; 以及 getFocusPoint(): Promise; 变更为 getFocusPoint(): Point; + + 参考代码如下: + + ``` + let point = captureSession.getFocusPoint(); + ``` + +34. CaptureSession 中接口 getFocalLength 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getFocalLength(callback: AsyncCallback): void; 以及 getFocalLength(): Promise; 变更为 getFocalLength(): number; + + 参考代码如下: + + ``` + let focalLength = captureSession.getFocalLength(); + ``` + +35. CaptureSession 中接口 getZoomRatioRange 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getZoomRatioRange(callback: AsyncCallback>): void; 以及 getZoomRatioRange(): Promise>; 变更为 getZoomRatioRange(): Array; + + 参考代码如下: + + ``` + let zoomRatioRange = captureSession.getZoomRatioRange(); + ``` + +36. CaptureSession 中接口 getZoomRatio 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getZoomRatio(callback: AsyncCallback): void; 以及 getZoomRatio(): Promise; 变更为 getZoomRatio(): number; + + 参考代码如下: + + ``` + let zoomRatio = captureSession.getZoomRatio(); + ``` + +37. CaptureSession 中接口 setZoomRatio 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 setZoomRatio(zoomRatio: number, callback: AsyncCallback): void; 以及 setZoomRatio(zoomRatio: number): Promise; 变更为 setZoomRatio(zoomRatio: number): void; + + 参考代码如下: + + ``` + let zoomRatio = zoomRatioRange[0]; + captureSession.setZoomRatio(zoomRatio); + ``` + +38. CaptureSession 中接口 isVideoStabilizationModeSupported 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback): void; 以及 isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise; 变更为 isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): boolean; + + 参考代码如下: + + ``` + let isSupported = captureSession.isVideoStabilizationModeSupported(camera.VideoStabilizationMode.OFF); + ``` + +39. CaptureSession 中接口 getActiveVideoStabilizationMode 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 getActiveVideoStabilizationMode(callback: AsyncCallback): void; 以及 getActiveVideoStabilizationMode(): Promise; 变更为 getActiveVideoStabilizationMode(): VideoStabilizationMode; + + 参考代码如下: + + ``` + let vsMode = captureSession.getActiveVideoStabilizationMode(); + ``` + +40. CaptureSession 中接口 setVideoStabilizationMode 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback): void; 以及 setVideoStabilizationMode(mode: VideoStabilizationMode): Promise; 变更为 setVideoStabilizationMode(mode: VideoStabilizationMode): void; + + 参考代码如下: + + ``` + captureSession.setVideoStabilizationMode(camera.VideoStabilizationMode.OFF); + ``` + +41. CaptureSession 中,on(type: 'error') callback 类型由 ErrorCallback 变更为 ErrorCallback,因此旧接口 on(type: 'error', callback: ErrorCallback): void; 变更为 on(type: 'error', callback: ErrorCallback): void; + + 参考代码如下: + + ``` + captureSession.on('error', (BusinessError) => { + + }) + ``` + +42. PreviewOutput 中,on(type: 'error') callback 类型由 ErrorCallback 变更为 ErrorCallback,因此旧接口 on(type: 'error', callback: ErrorCallback): void; 变更为 on(type: 'error', callback: ErrorCallback): void; + + 参考代码如下: + + ``` + previewOutput.on('error', (BusinessError) => { + + }) + ``` + +43. PhotoOutput 中接口 isMirrorSupported 返回方式由异步 callback 跟异步 promise 变更为同步返回,因此旧接口 isMirrorSupported(callback: AsyncCallback): void; 以及 isMirrorSupported(): Promise; 变更为 isMirrorSupported(): boolean; + + 参考代码如下: + + ``` + let isSupported = photoOutput.isMirrorSupported(); + ``` + +44. PhotoOutput 中,on(type: 'error') callback 类型由 ErrorCallback 变更为 ErrorCallback,因此旧接口 on(type: 'error', callback: ErrorCallback): void; 变更为 on(type: 'error', callback: ErrorCallback): void; + + 参考代码如下: + + ``` + PhotoOutput.on('error', (BusinessError) => { + + }) + ``` + +45. VideoOutput 中,on(type: 'error') callback 类型由 ErrorCallback 变更为 ErrorCallback,因此旧接口 on(type: 'error', callback: ErrorCallback): void; 变更为 on(type: 'error', callback: ErrorCallback): void; + + 参考代码如下: + + ``` + VideoOutput.on('error', (BusinessError) => { + + }) + ``` + +46. MetadataOutput 中,on(type: 'error') callback 类型由 ErrorCallback 变更为 ErrorCallback,因此旧接口 on(type: 'error', callback: ErrorCallback): void; 变更为 on(type: 'error', callback: ErrorCallback): void; + + 参考代码如下: + + ``` + MetadataOutput.on('error', (BusinessError) => { + + }) + ``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-container.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-container.md new file mode 100644 index 0000000000000000000000000000000000000000..8ba5a4809bb3b6fee51165a615a1bded4be9421e --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-container.md @@ -0,0 +1,21 @@ +# 公共基础类库子系统JS API变更Changelog + +## cl.公共基础类库子系统.1 错误码及信息变更 +公共基础类库子系统子系统中ArrayList、List、LinkedList、Stack、Queue、Deque、PlainArray、LightWeightMap、LightWeightSet、HashMap、HashSet、TreeMap、TreeSet类的接口抛出的错误码及信息变更: + +变更后的错误码详细介绍请参见[语言基础类库错误码](../../../application-dev/reference/errorcodes/errorcode-utils.md)。 + +已使用相关接口开发的应用无需重新适配。 + +**关键的接口/组件变更** +各个类中的接口重新定义了错误码抛出的信息,并在对应模块的`*.d.ts`声明文件中通过'@throws'标签进行标示。 +示例如下: +ArrayList类变更前: +constructor(); +ArrayList类变更后: +@throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked. +constructor(); + +**变更影响** + +暂无影响。 diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md new file mode 100644 index 0000000000000000000000000000000000000000..1bf0d3ff6bd3161271a8a79a0302f981aa670947 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md @@ -0,0 +1,158 @@ +# 分布式数据管理子系统JS API变更Changelog + +## cl.distributeddatamgr.1 接口变更 +distributeddatamgr子系统kv_store组件接口存在变更: + +由于执行时间固定且耗时短,不需要异步等待执行结果,createKVManager方法需要改为同步接口。因此旧的接口function createKVManager(config: KVManagerConfig): Promise\; 与 function createKVManager(config: KVManagerConfig, callback: AsyncCallback): void; 改为 function createKVManager(config: KVManagerConfig): KVManager; + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): Promise\; | 删除 | +| @ohos.distributedKVStore | distributedKVStore | function createKVManager(config: KVManagerConfig): KVManager; | 变更 | + + +**适配指导** + +应用中调用createKVManager创建KVManager对象实例可参考下列代码 + +Stage模型下的示例: + +```ts +import AbilityStage from '@ohos.application.Ability' +let kvManager; +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("MyAbilityStage onCreate") + let context = this.context + const kvManagerConfig = { + context: context, + bundleName: 'com.example.datamanagertest', + } + try { + kvManager = distributedKVStore.createKVManager(kvManagerConfig); + } catch (e) { + console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`); + } + } +} +``` + +FA模型下的示例: + +```ts +import featureAbility from '@ohos.ability.featureAbility' +let kvManager; +let context = featureAbility.getContext() +const kvManagerConfig = { + context: context, + bundleName: 'com.example.datamanagertest', +} +try { + kvManager = distributedKVStore.createKVManager(kvManagerConfig); +} catch (e) { + console.error(`Failed to create KVManager.code is ${e.code},message is ${e.message}`); +} +``` + +## cl.distributeddatamgr.2 function getRdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts +**变更影响** +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +如下接口: +```ts +function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number, callback: AsyncCallback): void; +function getRdbStoreV9(context: Context, config: StoreConfigV9, version: number): Promise; +``` +从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts: +``` +function getRdbStore(context: Context, config: StoreConfig, callback: AsyncCallback): void; +function getRdbStore(context: Context, config: StoreConfig): Promise; +``` + +**适配指导** + * `import rdb from "@ohos.data.rdb"` 改为 `import rdb from "@ohos.data.relationalStore"`; + * 按上述接口变更对齐修改所调用的方法名称即可。 + +## cl.distributeddatamgr.3 function deleteRdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts +**变更影响** +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +如下接口: +```ts +function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; +function deleteRdbStoreV9(context: Context, name: string): Promise; +``` +从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts: +``` +function deleteRdbStoreV9(context: Context, name: string, callback: AsyncCallback): void; +function deleteRdbStoreV9(context: Context, name: string): Promise; +``` + +**适配指导** + * `import rdb from "@ohos.data.rdb"` 改为 `import rdb from "@ohos.data.relationalStore"`; + * 按上述接口变更对齐修改所调用的方法名称即可。 + +## cl.distributeddatamgr.4 interface StoreConfigV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts +**变更影响** +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface StoreConfigV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts 改名为interface StoreConfig。 + +**适配指导** + * `import rdb from "@ohos.data.rdb"` 改为 `import rdb from "@ohos.data.relationalStore"`; + * 按上述接口变更对齐修改所调用的接口名称即可。 + +## cl.distributeddatamgr.5 enum SecurityLevel 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts +**变更影响** +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +enum SecurityLevel 从ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts。 + +**适配指导** + * `import rdb from "@ohos.data.rdb"` 改为 `import rdb from "@ohos.data.relationalStore"`; + * 按上述接口变更对齐修改所调用的接口名称即可。 + +## cl.distributeddatamgr.6 interface RdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts +**变更影响** +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface RdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts 改名为interface RdbStore。 + +**适配指导** + * `import rdb from "@ohos.data.rdb"` 改为 `import rdb from "@ohos.data.relationalStore"`; + * 按上述接口变更对齐修改所调用的接口名称即可。 + +## cl.distributeddatamgr.7 class RdbPredicatesV9 从ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts +**变更影响** +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +class RdbPredicatesV9 从ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts 改名为interface RdbPredicates。 + +**适配指导** + * `import rdb from "@ohos.data.rdb"` 改为 `import rdb from "@ohos.data.relationalStore"`; + * 按上述接口变更对齐修改所调用的接口名称即可。 + +## cl.distributeddatamgr.8 interface ResultSetV9 从api/@ohos.data.relationalStore.d.ts 迁移至@ohos.data.relationalStore.d.ts +**变更影响** +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface ResultSetV9 从api/data/rdb/resultSet.d.ts 迁移至@ohos.data.relationalStore.d.ts 改名为interface ResultSet。 + +**适配指导** + * `import rdb from "@ohos.data.rdb"` 改为 `import rdb from "@ohos.data.relationalStore"`; + * ResultSetV9实例仅通过getRdbStoreV9方法获取,参考cl.distributeddatamgr.2变更后,代码可自动适配ResultSet。 diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md new file mode 100644 index 0000000000000000000000000000000000000000..c8cd90d415700977a4ae914099b92cf84fafff56 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md @@ -0,0 +1,189 @@ +# 文件管理子系统ChangeLog + +## cl.filemanagement.1 environment模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。environment模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现environment模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原environment使用的是@ohos.environment,以以下方式import: + +```js +import environment from '@ohos.environment'; +``` + +现environment使用的是@ohos.file.environment,以以下方式import: + +```js +import environment from '@ohos.file.environment'; +``` + +## cl.filemanagement.2 securityLabel模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。securityLabel模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现securityLabel模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原securityLabel使用的是@ohos.securityLabel,以以下方式import: + +```js +import securityLabel from '@ohos.securityLabel'; +``` + +现securityLabel使用的是@ohos.file.securityLabel,以以下方式import: + +```js +import securityLabel from '@ohos.file.securityLabel'; +``` + +## cl.filemanagement.3 fs模块变更 + +fs模块下Stat接口ino属性类型变更。 + +**变更影响** + +fs模块下Stat接口ino属性类型变更,由number变更为bigint,以适配文件系统下所有类型文件的inode范围。 + +**关键接口/组件变更** + +原Stat接口ino属性类型为number,现变更为bigint。 + +## cl.filemanagement.4 fileAccess模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。fileAccess模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现fileAccess模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原fileAccess使用的是@ohos.data.fileAccess,以以下方式import: + +```js +import fileAccess from '@ohos.data.fileAccess'; +``` + +现fileAccess使用的是@ohos.file.fileAccess,以以下方式import: + +```js +import fileAccess from '@ohos.file.fileAccess'; +``` + +## cl.filemanagement.5 fileExtensionInfo模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。fileExtensionInfo模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现fileExtensionInfo模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原fileExtensionInfo使用的是@ohos.fileExtensionInfo,以以下方式import: + +```js +import fileExtensionInfo from '@ohos.fileExtensionInfo'; +``` + +现fileExtensionInfo使用的是@ohos.file.fileExtensionInfo,以以下方式import: + +```js +import fileExtensionInfo from '@ohos.file.fileExtensionInfo'; +``` + +## cl.filemanagement.6 storageStatistics模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。fileExtensionInfo模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现storageStatistics模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原storageStatistics使用的是@ohos.storageStatistics,以以下方式import: + +```js +import storageStatistics from '@ohos.storageStatistics'; +``` + +现storageStatistics使用的是@ohos.file.storageStatistics,以以下方式import: + +```js +import storageStatistics from '@ohos.file.storageStatistics'; +``` + +## cl.filemanagement.7 volumeManager模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。fileExtensionInfo模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现volumeManager模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原volumeManager使用的是@ohos.volumeManager,以以下方式import: + +```js +import volumeManager from '@ohos.volumeManager'; +``` + +现volumeManager使用的是@ohos.file.volumeManager,以以下方式import: + +```js +import volumeManager from '@ohos.file.volumeManager'; +``` + +## cl.filemanagement.8 fileio相关接口异常处理方式变更 + +file_api部件fileio接口返回值不包含错误码error.code,现进行错误码整改,废弃原有相关接口,新增相关接口。 + +**变更影响** + +基于此前版本开发的应用,需注意废弃接口的迭代更新。新接口在接口规格上进行了微调,需注意新接口使用方法。 + +**关键接口/组件变更** + +为适配统一的API异常处理方式,对fileio相关接口进行废弃,并新增对应接口,原接口位于@ohos.fileio,新接口位于@ohos.file.fs。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致,参数上有微调,以下为规格调整的接口列表。 +废弃与新增方法同名,请在列表中对应查看。 + +| 模块名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------------------------------------------------ | -------- | +| @ohos.fileio | **function** access(path: string, mode?: number, callback?: AsyncCallback\): void \| Promise\ | 废弃 | +| @ohos.fileio | **function** accessSync(path: string, mode?: number): void | 废弃 | +| @ohos.file.fs | **function** access(path: string, callback?: AsyncCallback\): void \| Promise\ | 新增 | +| @ohos.file.fs | **function** accessSync(path: string): boolean | 新增 | +| @ohos.fileio | **function** close(fd: number, callback?: AsyncCallback\): void \| Promise\ | 废弃 | +| @ohos.fileio | **function** closeSync(fd: number): void | 废弃 | +| @ohos.file.fs | **function** close(file: File \| number, callback?: AsyncCallback\): void \| Promise\ | 新增 | +| @ohos.file.fs | **function** closeSync(file: File \| number): void | 新增 | +| @ohos.fileio | **function** mkdir(path: string, mode?: number, callback?: AsyncCallback\): void \| Promise\ | 废弃 | +| @ohos.fileio | **function** mkdirSync(path: string, mode?: number): void | 废弃 | +| @ohos.file.fs | **function** mkdir(path: string, callback?: AsyncCallback\): void \| Promise\ | 新增 | +| @ohos.file.fs | **function** mkdirSync(path: string): void | 新增 | +| @ohos.fileio | **function** readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\): void \| Promise\ | 废弃 | +| @ohos.fileio | **function** readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string | 废弃 | +| @ohos.file.fs | **function** readText(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\): void \| Promise\ | 新增 | +| @ohos.file.fs | **function** readTextSync(filePath: string, options?: { offset?: number; length?: number; encoding?: string; }): string | 新增 | +| @ohos.fileio | **function** Stream.read(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback\): void \| Promise\ | 废弃 | +| @ohos.fileio | **function** Stream.readSync(buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number | 废弃 | +| @ohos.file.fs | **function** Stream.read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback\): void \| Promise\ | 新增 | +| @ohos.file.fs | **function** Stream.readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number | 新增 | +| @ohos.fileio | **function** Stream.write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback\): void \| Promise\ | 废弃 | +| @ohos.fileio | **function** Stream.writeSync(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number | 废弃 | +| @ohos.file.fs | **function** Stream.write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback\): void \| Promise\ | 新增 | +| @ohos.file.fs | **function** Stream.writeSync(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; encoding?: string; }): number | 新增 | + +**适配指导** + +@ohos.file.fs新增统一的API异常处理方式,具体示例代码请参考[接口文档](../../../application-dev/reference/apis/js-apis-file-fs.md)。 diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md new file mode 100644 index 0000000000000000000000000000000000000000..ba3fbf1df4e369ec72a031df204a0cb6cbb7ff47 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md @@ -0,0 +1,30 @@ +# 输入法框架changeLog + +## cl.inputmethod_frameworks.1 API文件名变更 + +下列模块不符合OpenHarmony接口文件名命名规范。在API9进行变更。 + + **变更影响** + + 修改后的SDK与先前已发布版本不兼容,影响在此前版本已开发的应用,应用需要进行适配改动才可以在新版本SDK环境正常编译通过。 + + **关键的接口/组件变更** + +| 模块 | 变更前文件名 | 变更后文件名 | +|------|--------------|--------------| +| 输入法框架模块 | @ohos.inputmethod.d.ts |@ohos.inputMethod.d.ts | +| 输入法服务模块 |@ohos.inputmethodengine.d.ts | @ohos.inputMethodEngine.d.ts | +| 输入法ExtentionAbility模块 | @ohos.inputmethodextensionability.d.ts | @ohos.InputMethodExtensionAbility.d.ts | +| 输入法ExtentionContext模块 |@ohos.inputmethodextensioncontext.d.ts | @ohos.InputMethodExtensionContext.d.ts | +| 输入法子类型模块 | @ohos.inputMethodSubtype.d.ts | @ohos.InputMethodSubtype.d.ts | + + **适配指导** + + 应用中对输入法框架d.ts文件的import后的文件名要写为变更后文件名,即小驼峰/大驼峰命名格式。 + 如: + +```js +import inputMethodEngine from '@ohos.inputMethodEngine'; +``` + + \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md new file mode 100644 index 0000000000000000000000000000000000000000..73ef9158bc274f11f4de68f19cfc9561ca85ddad --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md @@ -0,0 +1,272 @@ +# 文件子系统ChangeLog + +## cl.file.1 mediaLibrary相关接口变更 + +multimedia 部件 mediaLibrary所有接口废弃。 + +**变更影响** + +[mediaLibrary](../../../application-dev/reference/apis/js-apis-medialibrary.md)所有接口废弃。系统只对三方应用开放公共目录下文件资源选择和保存功能,由[FilePicker](../../../application-dev/reference/apis/js-apis-file-picker.md)提供能力。 +基于此前版本开发的应用,需注意废弃接口的迭代更新。 + +**关键接口/组件变更** + +以下为可以使用FilePicker替代的接口。 + +| 模块名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------------------------------------------------ | -------- | +| medialibrary | **function** getMediaLibrary(context: Context): MediaLibrary; | 废弃 | +| medialibrary | **function** getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** getFileAssets(options: MediaFetchOptions): Promise\ | 废弃 | +| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise\ | 废弃 | +| medialibrary | **function** getPublicDirectory(type: DirectoryType, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** getPublicDirectory(type: DirectoryType): Promise\ | 废弃 | +| medialibrary | **function** release(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** release(): Promise\ | 废弃 | +| medialibrary | **function** FileAsset.open(mode: string, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.open(mode: string): Promise\ | 废弃 | +| medialibrary | **function** FileAsset.close(fd: number, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.close(fd: number): Promise\ | 废弃 | +| medialibrary | **function** FetchFileResult.getCount(): number | 废弃 | +| medialibrary | **function** FetchFileResult.isAfterLast(): boolean | 废弃 | +| medialibrary | **function** FetchFileResult.close(): void | 废弃 | +| medialibrary | **function** FetchFileResult.getFirstObject(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FetchFileResult.getFirstObject(): Promise\ | 废弃 | +| medialibrary | **function** FetchFileResult.getNextObject(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FetchFileResult.getNextObject(): Promise\ | 废弃 | +| medialibrary | **function** FetchFileResult.getLastObject(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FetchFileResult.getLastObject(): Promise\ | 废弃 | +| medialibrary | **function** FetchFileResult.getPositionObject(index: number, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FetchFileResult.getPositionObject(index: number): Promise\ | 废弃 | +| medialibrary | **function** FetchFileResult.getAllObject(callback: AsyncCallback\\>): void | 废弃 | +| medialibrary | **function** FetchFileResult.getAllObject(): Promise\\> | 废弃 | +| medialibrary | **function** Album.getFileAssets(options: MediaFetchOptions, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** Album.getFileAssets(options?: MediaFetchOptions): Promise\ | 废弃 | +| medialibrary | **enum** FileKey | 废弃 | +| medialibrary | **enum** DirectoryType | 废弃 | +| medialibrary | **enum** MediaType | 废弃 | +| medialibrary | **interface** MediaFetchOptions | 废弃 | +| medialibrary | **interface** FileAsset | 废弃 | + +**适配指导** + +**使用mediaLibrary接口编辑公共目录下的文件示例:** + +1. 使用getMediaLibrary接口获取媒体库实例。 +2. 创建MediaFetchOptions检索条件使用mediaLibrary实例调用getFileAssets接口获取公共目录下的文件。 +3. 使用FetchFileResult相应接口获取目的文件的fileAsset。 +4. 使用fileAsset.open接口打开这个文件得到fd。 +5. 通过fd使用[fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync)接口对这个文件进行编辑修改。 +6. 修改完成后使用fileAsset.close接口关闭这个文件的fd。 +7. 使用fetchFileResult.close接口释放getFileAssets时占用的资源。 +8. 使用release接口释放媒体库实例。 + +**示例:** + +```js +import mediaLibrary from '@ohos.multimedia.mediaLibrary'; +import fs from '@ohos.file.fs'; + +async function example() { + try { + let context = getContext(this); + let media = mediaLibrary.getMediaLibrary(context); + let fileKeyObj = mediaLibrary.FileKey; + let imageType = mediaLibrary.MediaType.IMAGE; + let getImageOp = { + selections: fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: [imageType.toString()], + order: fileKeyObj.DATE_ADDED + ' DESC', + }; + const fetchFileResult = await media.getFileAssets(getImageOp); + const fileAsset = await fetchFileResult.getFirstObject(); + console.info('mediaLibrary fileAsset displayName: ' + fileAsset.displayName); + let fd = await fileAsset.open('rw'); + console.info('mediaLibrary fileAsset open fd: ' + fd); + let writeLen = fs.writeSync(fd, 'hello, world'); + console.info('write data to file succeed and size is: ' + writeLen); + fileAsset.close(fd); + fetchFileResult.close(); + media.release(); + } catch (err) { + console.error('mediaLibrary fail, err: ' + err); + } +} +``` + +**使用FilePicker编辑公共目录下的文件示例:** + +1. 获取DocumentViewPicker文件选择器对象。 +2. 拉起DocumentViewPicker.select接口选择目的文件。 +3. 用户选择完后返回目的文件的uri。 +4. 待界面从DocumentViewPicker返回后在其他函数中使用[fs.openSync](../../../application-dev/reference/apis/js-apis-file-fs.md#fsopensync)接口通过uri打开这个文件得到fd。 +5. 通过fd使用[fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync)接口对这个文件进行编辑修改。 +6. 编辑修改完毕后使用[fs.closeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#closesync)接口关闭这个fd。 + +**示例:** + +```js +import mediaLibrary from '@ohos.multimedia.mediaLibrary'; +import picker from '@ohos.file.picker'; +import fs from '@ohos.file.fs'; + +let uri; + +async function example() { + try { + let DocumentSelectOptions = new picker.DocumentSelectOptions(); + let documentPicker = new picker.DocumentViewPicker(); + documentPicker.select(DocumentSelectOptions).then((DocumentSelectResult) => { + console.info('DocumentViewPicker.select successfully, DocumentSelectResult uri: ' + JSON.stringify(DocumentSelectResult)); + uri = DocumentSelectResult[0]; + }).catch((err) => { + console.error('DocumentViewPicker.select failed with err: ' + err); + }); + } catch (err) { + console.error('DocumentViewPicker failed with err: ' + err); + } +} + +async function writeFile() { + try { + let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); + console.info('DocumentViewPicker file fd: ' + file.fd); + let writeLen = fs.writeSync(file.fd, 'hello, world'); + console.info('write data to file succeed and size is: ' + writeLen); + fs.closeSync(file); + } catch (err) { + console.error('DocumentViewPicker fail, err: ' + err); + } +} +``` + +**使用mediaLibrary接口在公共目录下创建文件示例:** + +1. 使用getMediaLibrary接口获取媒体库实例。 +2. 使用getPublicDirectory接口获取公共目录路径。 +3. 使用createAsset接口创建文件得到这个文件的fileAsset。 +4. 使用fileAsset.open接口打开这个文件得到fd。 +5. 通过fd使用fs.write接口对这个文件进行编辑修改。 +6. 修改完成后使用fileAsset.close接口关闭这个文件的fd。 +7. 使用release接口释放媒体库实例。 + +**示例:** + +```js +import mediaLibrary from '@ohos.multimedia.mediaLibrary'; +import fs from '@ohos.file.fs'; + +async function example() { + try { + let context = getContext(this); + let media = mediaLibrary.getMediaLibrary(context); + let mediaType = mediaLibrary.MediaType.FILE; + let DIR_DOWNLOAD = mediaLibrary.DirectoryType.DIR_DOWNLOAD; + const path = await media.getPublicDirectory(DIR_DOWNLOAD); + const fileAsset = await media.createAsset(mediaType, 'test.txt', path); + console.info('mediaLibrary fileAsset displayName: ' + fileAsset.displayName); + let fd = await fileAsset.open('rw'); + console.info('mediaLibrary fileAsset open fd: ' + fd); + let writeLen = fs.writeSync(fd, 'hello, world'); + console.info('write data to file succeed and size is: ' + writeLen); + fileAsset.close(fd); + media.release(); + } catch (err) { + console.error('mediaLibrary fail, err: ' + err); + } +} +``` + +**使用FilePicker在公共目录下创建文件示例:** + +1. 获取DocumentViewPicker文件选择器对象。 +2. 拉起DocumentViewPicker.save接口创建保存一个空的文件。 +3. 用户保存完后返回目的文件的uri。 +4. 待界面从DocumentViewPicker返回后在其他函数中使用[fs.openSync](../../../application-dev/reference/apis/js-apis-file-fs.md#fsopensync)接口通过uri打开这个文件得到fd。 +5. 通过fd使用[fs.writeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#writesync)接口对这个文件进行编辑修改。 +6. 编辑修改完毕后使用[fs.closeSync](../../../application-dev/reference/apis/js-apis-file-fs.md#closesync)接口关闭这个fd。 + +**示例:** + +```js +import mediaLibrary from '@ohos.multimedia.mediaLibrary'; +import picker from '@ohos.file.picker'; +import fs from '@ohos.file.fs'; + +let uri; + +async function example() { + try { + let DocumentSaveOptions = new picker.DocumentSaveOptions(); + DocumentSaveOptions.newFileNames = ['DocumentViewPicker01.txt']; + let documentPicker = new picker.DocumentViewPicker(); + documentPicker.save(DocumentSaveOptions).then((DocumentSaveResult) => { + console.info('DocumentViewPicker.save successfully, DocumentSaveResult uri: ' + JSON.stringify(DocumentSaveResult)); + uri = DocumentSaveResult[0]; + }).catch((err) => { + console.error('DocumentViewPicker.save failed with err: ' + err); + }); + } catch (err) { + console.error('DocumentViewPicker failed with err: ' + err); + } +} + +async function writeFile() { + try { + let file = fs.openSync(uri, fs.OpenMode.READ_WRITE); + console.info('DocumentViewPicker file fd: ' + file.fd); + let writeLen = fs.writeSync(file.fd, 'hello, world'); + console.info('write data to file succeed and size is: ' + writeLen); + fs.closeSync(file); + } catch (err) { + console.error('DocumentViewPicker fail, err: ' + err); + } +} +``` + +**关键接口/组件变更** + +medialibrary以下废弃接口由于功能管控,不对三方应用开放,无替代接口。 + +| 模块名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------------------------------------------------ | -------- | +| medialibrary | **function** getMediaLibrary(): MediaLibrary; | 废弃 | +| medialibrary | **function** on(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback: Callback\): void | 废弃 | +| medialibrary | **function** off(type: 'deviceChange'\|'albumChange'\|'imageChange'\|'audioChange'\|'videoChange'\|'fileChange'\|'remoteFileChange', callback?: Callback\): void | 废弃 | +| medialibrary | **function** deleteAsset(uri: string): Promise\ | 废弃 | +| medialibrary | **function** deleteAsset(uri: string, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** storeMediaAsset(option: MediaAssetOption): Promise\ | 废弃 | +| medialibrary | **function** startImagePreview(images: Array\, index: number, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** startImagePreview(images: Array\, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** startImagePreview(images: Array\, index?: number): Promise\ | 废弃 | +| medialibrary | **function** startMediaSelect(option: MediaSelectOption, callback: AsyncCallback\\>): void | 废弃 | +| medialibrary | **function** startMediaSelect(option: MediaSelectOption): Promise\\> | 废弃 | +| medialibrary | **function** getActivePeers(): Promise\\>; | 废弃 | +| medialibrary | **function** getActivePeers(callback: AsyncCallback\\>): void; | 废弃 | +| medialibrary | **function** getAllPeers(): Promise\\>; | 废弃 | +| medialibrary | **function** FileAsset.isDirectory(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.isDirectory():Promise\ | 废弃 | +| medialibrary | **function** FileAsset.commitModify(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.commitModify(): Promise\ | 废弃 | +| medialibrary | **function** FileAsset.getThumbnail(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.getThumbnail(size: Size, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.getThumbnail(size?: Size): Promise\ | 废弃 | +| medialibrary | **function** FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.favorite(isFavorite: boolean): Promise\ | 废弃 | +| medialibrary | **function** FileAsset.isFavorite(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.isFavorite():Promise\ | 废弃 | +| medialibrary | **function** FileAsset.trash(isTrash: boolean, callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.trash(isTrash: boolean): Promise\ | 废弃 | +| medialibrary | **function** FileAsset.isTrash(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** FileAsset.isTrash():Promise\ | 废弃 | +| medialibrary | **function** getAlbums(options: MediaFetchOptions, callback: AsyncCallback\\>): void | 废弃 | +| medialibrary | **function** getAlbums(options: MediaFetchOptions): Promise\\> | 废弃 | +| medialibrary | **function** Album.commitModify(callback: AsyncCallback\): void | 废弃 | +| medialibrary | **function** Album.commitModify(): Promise\ | 废弃 | +| medialibrary | **enum** DeviceType | 废弃 | +| medialibrary | **interface** PeerInfo | 废弃 | +| medialibrary | **interface** Size | 废弃 | +| medialibrary | **interface** MediaAssetOption | 废弃 | +| medialibrary | **interface** MediaSelectOption | 废弃 | \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md new file mode 100644 index 0000000000000000000000000000000000000000..45249cf9851984f3119e534f732d694eacf1e31f --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-multimedia.md @@ -0,0 +1,53 @@ +## cl.multimedia.av_session.001 av_session所有接口更换为系统接口 + +所有av_session的接口变更为SystemApi。 + +**变更影响** + +非系统应用无法调用系统接口,如调用方为非系统应用或未申请SystemApi相关权限,将无法调用接口。 + +**关键的接口/组件变更** + +所有接口均变更为SystemApi,接口明细如下: + +| 接口、枚举或变量名 | 类型 | 是否为SystemApi | +| -------- | -------- | ------- | +| SessionToken | interface | 是 | +| AVMetadata | interface | 是 | +| AVPlaybackState | interface | 是 | +| PlaybackPosition | interface | 是 | +| OutputDeviceInfo | interface | 是 | +| AVSessionDescriptor | interface | 是 | +| AVSessionController | interface | 是 | +| AVControlCommand | interface | 是 | +| createAVSession | function | 是 | +| getAllSessionDescriptors | function | 是 | +| createController | function | 是 | +| castAudio | function | 是 | +| on | function | 是 | +| off | function | 是 | +| sendSystemAVKeyEvent | function | 是 | +| sendSystemControlCommand | function | 是 | +| sessionId | variable | 是 | +| setAVMetadata | function | 是 | +| setAVPlaybackState | function | 是 | +| setLaunchAbility | function | 是 | +| getController | function | 是 | +| getOutputDevice | function | 是 | +| activate | function | 是 | +| deactivate | function | 是 | +| destroy | function | 是 | +| getAVPlaybackState | function | 是 | +| getAVMetadata | function | 是 | +| getOutputDevice | function | 是 | +| sendAVKeyEvent | function | 是 | +| getLaunchAbility | function | 是 | +| getRealPlaybackPositionSync | function | 是 | +| isActive | function | 是 | +| getValidCommands | function | 是 | +| sendControlCommand | function | 是 | +| AVSessionType | type | 是 | +| AVControlCommandType | type | 是 | +| LoopMode | enum | 是 | +| PlaybackState | enum | 是 | +| AVSessionErrorCode | enum | 是 | diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md new file mode 100644 index 0000000000000000000000000000000000000000..21caa2f21e1b8f4d93cadb1e1d6dc4947ab5e4a4 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md @@ -0,0 +1,59 @@ +# 公共通信子系统NFC JS API变更Changelog + +## cl.nfc.1 接口变更 +NFC部分API6到API8部分JS接口不支持抛出错误码,需要删除废弃,然后使用新的API9替换。 + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响部分API6到API8部分JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- | +| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | FeatureType | 废弃 | +| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | isSupported | 废弃 | +| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | hasHceCapability | 新增 | +| api/@ohos.nfc.controller.d.ts | nfcController | isNfcAvailable | 废弃 | +| api/@ohos.nfc.controller.d.ts | nfcController | openNfc | 废弃 | +| api/@ohos.nfc.controller.d.ts | nfcController | closeNfc | 废弃 | +| api/@ohos.nfc.controller.d.ts | nfcController | enableNfc | 新增 | +| api/@ohos.nfc.controller.d.ts | nfcController | disableNfc | 新增 | +| api/@ohos.nfc.tag.d.ts | tag | getNfcATag | 废弃 | +| api/@ohos.nfc.tag.d.ts | tag | getNfcBTag | 废弃 | +| api/@ohos.nfc.tag.d.ts | tag | getNfcFTag | 废弃 | +| api/@ohos.nfc.tag.d.ts | tag | getNfcVTag | 废弃 | +| api/@ohos.nfc.tag.d.ts | tag | getNfcA | 新增 | +| api/@ohos.nfc.tag.d.ts | tag | getNfcB | 新增 | +| api/@ohos.nfc.tag.d.ts | tag | getNfcF | 新增 | +| api/@ohos.nfc.tag.d.ts | tag | getNfcV | 新增 | +| api/tag/tagSession.d.ts | TagSession | getTagInfo | 废弃 | +| api/tag/tagSession.d.ts | TagSession | connectTag | 废弃 | +| api/tag/tagSession.d.ts | TagSession | reset | 废弃 | +| api/tag/tagSession.d.ts | TagSession | isTagConnected | 废弃 | +| api/tag/tagSession.d.ts | TagSession | setSendDataTimeout | 废弃 | +| api/tag/tagSession.d.ts | TagSession | getSendDataTimeout | 废弃 | +| api/tag/tagSession.d.ts | TagSession | sendData | 废弃 | +| api/tag/tagSession.d.ts | TagSession | getMaxSendLength | 废弃 | +| api/tag/tagSession.d.ts | TagSession | connect | 新增 | +| api/tag/tagSession.d.ts | TagSession | resetConnection | 新增 | +| api/tag/tagSession.d.ts | TagSession | isConnected | 新增 | +| api/tag/tagSession.d.ts | TagSession | setTimeout | 新增 | +| api/tag/tagSession.d.ts | TagSession | getTimeout | 新增 | +| api/tag/tagSession.d.ts | TagSession | transmit | 新增 | +| api/tag/tagSession.d.ts | TagSession | getMaxTransmitSize | 新增 | + +**适配指导** + +查看API开发指南: +[cardEmulation-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md) + +[nfcController-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-nfcController.md) + +[tag-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-nfcTag.md) + +[TagSession-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-tagSession.md) +``` + diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-notification.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-notification.md new file mode 100644 index 0000000000000000000000000000000000000000..c1f91a124b4023c7522d5075e6c96f7f669874d5 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-notification.md @@ -0,0 +1,48 @@ +# 事件通知子系统ChangeLog + +## cl.notification.1 删除标记为废弃的API9接口 + +事件通知异常处理整改将部分API9接口标记为了废弃,根据OpenHarmony接口规范,需要删除标记为废弃的API9接口。 + +**变更影响** + +基于此前版本开发的应用,需要将被删除的接口替换为新接口,否则会影响应用编译。 + +**关键接口/组件变更** + +原接口中标记为废弃的API9接口将被删除,可以使用新接口中的同名接口替换。 + +| 原接口 | 新接口 | +| ----------------------- | -------------------------------- | +| @ohos.commonEvent.d.ts | @ohos.commonEventManager.d.ts | +| @ohos.notification.d.ts | @ohos.notificationManager.d.ts | +| @ohos.notification.d.ts | @ohos.notificationSubscribe.d.ts | + +接口、属性被删除: + +- @ohos.notification.d.ts + - 接口 publishAsBundle、cancelAsBundle、isNotificationSlotEnabled、setSyncNotificationEnabledWithoutApp、getSyncNotificationEnabledWithoutApp 被删除。可以使用 api/@ohos.notificationManager.d.ts 的同名接口替换。 + - 接口 enableNotificationSlot 被删除。可以使用 api/@ohos.notificationManager.d.ts 的接口 setNotificationEnableSlot 替换。 + - 导出类 NotificationActionButton、NotificationBasicContent、NotificationContent、NotificationLongTextContent、NotificationMultiLineContent、NotificationPictureContent、NotificationFlags、NotificationFlagStatus、NotificationRequest、DistributedOptions、NotificationSlot、NotificationSorting、NotificationTemplate、NotificationUserInput 被删除。可以使用 api/@ohos.notificationManager.d.ts 的同名导出类替换。 + - 导出类 NotificationSubscribeInfo、NotificationSubscriber、SubscribeCallbackData、EnabledNotificationCallbackData 被删除。可以使用 api/@ohos.notificationSubscribe.d.ts 的同名导出类替换。 + +**适配指导** + +如上所述,仅将老接口平移到了新的namespace中,所以可以通过修改import来解决适配问题: + +如原先接口使用了@ohos.commonEvent + +```js +import commonEvent from '@ohos.commonEvent'; +``` + +可以通过直接修改import,来切换到新的namespace上: + +```js +import commonEvent from '@ohos.commonEventManager'; +``` + +@ohos.notification拆分成了两个namespace,需要根据接口情况选择需要的新namespace进行适配。 + +此外还需要适配异常处理,具体参考新接口的接口文档。 + diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md new file mode 100644 index 0000000000000000000000000000000000000000..a509d856204ff61c962b99fef71642eafaab930b --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md @@ -0,0 +1,107 @@ +# 位置服务子系统ChangeLog + +## cl.location.1 @ohos.geolocation.d.ts接口迁移到新增的@ohos.geoLocationManager.d.ts + +@ohos.geolocation.d.ts接口不支持抛出错误码,为了支持错误码功能,把@ohos.geolocation.d.ts中所有接口,迁移到新增的@ohos.geoLocationManager.d.ts中,并增加错误码描述。 + +后续需要import @ohos.geoLocationManager才能使用位置服务的接口: + +import geoLocationManager from '@ohos.geoLocationManager'; + + +**变更影响** + +对位置服务所有接口的使用有影响,需要import @ohos.geoLocationManager才能使用位置服务接口: + +import geoLocationManager from '@ohos.geoLocationManager'; + +**关键的接口/组件变更** + +| 类名 | 接口类型 | 接口声明 | 变更类型 | +| -- | -- | -- | -- | +|geolocation| method | function on(type: 'locationChange', request: LocationRequest, callback: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function off(type: 'locationChange', callback?: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function on(type: 'locationServiceState', callback: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'locationServiceState'更改为type: 'locationEnabledChange' | +|geolocation| method | function off(type: 'locationServiceState', callback?: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'locationServiceState'更改为type: 'locationEnabledChange' | +|geolocation| method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback>): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'cachedGnssLocationsReporting'更改为type: 'cachedGnssLocationsChange' | +|geolocation| method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback>): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'cachedGnssLocationsReporting'更改为type: 'cachedGnssLocationsChange' | +|geolocation| method | function on(type: 'gnssStatusChange', callback: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'gnssStatusChange'更改为type: 'satelliteStatusChange' | +|geolocation| method | function off(type: 'gnssStatusChange', callback?: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'gnssStatusChange'更改为type: 'satelliteStatusChange' | +|geolocation| method | function on(type: 'nmeaMessageChange', callback: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'nmeaMessageChange'更改为type: 'nmeaMessage' | +|geolocation| method | function off(type: 'nmeaMessageChange', callback?: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'nmeaMessageChange'更改为type: 'nmeaMessage' | +|geolocation| method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'fenceStatusChange'更改为type: 'gnssFenceStatusChange' | +|geolocation| method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'fenceStatusChange'更改为type: 'gnssFenceStatusChange' | +|geolocation| method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getCurrentLocation(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getCurrentLocation(request?: CurrentLocationRequest): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getLastLocation(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function getLastLocation(): Location; | +|geolocation| method | function getLastLocation(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function getLastLocation(): Location; | +|geolocation| method | function isLocationEnabled(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isLocationEnabled(): boolean; | +|geolocation| method | function isLocationEnabled(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isLocationEnabled(): boolean; | +|geolocation| method | function requestEnableLocation(callback: AsyncCallback): void; | 接口删除 | +|geolocation| method | function requestEnableLocation(): Promise; | 接口删除 | +|geolocation| method | function enableLocation(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function enableLocation(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function disableLocation(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableLocation(): void; | +|geolocation| method | function disableLocation(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableLocation(): void; | +|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback>): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise>; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback>): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise>; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function isGeoServiceAvailable(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isGeocoderAvailable(): boolean; | +|geolocation| method | function isGeoServiceAvailable(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isGeocoderAvailable(): boolean; | +|geolocation| method | function getCachedGnssLocationsSize(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getCachedGnssLocationsSize(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function flushCachedGnssLocations(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function flushCachedGnssLocations(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function sendCommand(command: LocationCommand, callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function sendCommand(command: LocationCommand): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function enableLocationMock(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function enableLocationMock(): void; | +|geolocation| method | function enableLocationMock(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function enableLocationMock(): void; | +|geolocation| method | function disableLocationMock(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableLocationMock(): void; | +|geolocation| method | function disableLocationMock(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableLocationMock(): void; | +|geolocation| method | function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setMockedLocations(config: LocationMockConfig): void; | +|geolocation| method | function setMockedLocations(config: LocationMockConfig): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setMockedLocations(config: LocationMockConfig): void; | +|geolocation| method | function enableReverseGeocodingMock(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function enableReverseGeocodingMock(): void; | +|geolocation| method | function enableReverseGeocodingMock(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function enableReverseGeocodingMock(): void; | +|geolocation| method | function disableReverseGeocodingMock(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableReverseGeocodingMock(): void; | +|geolocation| method | function disableReverseGeocodingMock(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableReverseGeocodingMock(): void; | +|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array, callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setReverseGeocodingMockInfo(mockInfos: Array): void; | +|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setReverseGeocodingMockInfo(mockInfos: Array): void; | +|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean; | +|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType,): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean; | +|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void; | +|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void; | +|geolocation| interface | SatelliteStatusInfo | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | CachedGnssLocationsRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | GeofenceRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | Geofence | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | ReverseGeoCodeRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | GeoCodeRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | GeoAddress | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | LocationRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | CurrentLocationRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | Location | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| enum | LocationRequestPriority | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| enum | LocationRequestScenario | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| enum | GeoLocationErrorCode | 接口废弃 | +|geolocation| enum | LocationPrivacyType | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| enum | LocationCommand | 接口迁移到@ohos.geoLocationManager.d.ts | + + +**适配指导(可选,不涉及则可以删除)** + +以enableLocation为例,在新版本上需要使用如下方式进行调用: + + ```ts + import geoLocationManager from '@ohos.geoLocationManager'; + try { + geoLocationManager.enableLocation((err, data) => { + if (err) { + console.log('enableLocation: err=' + JSON.stringify(err)); + } + }); + } catch (err) { + console.error("errCode:" + err.code + ",errMessage:" + err.message); + } + ``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geolocation.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geolocation.md new file mode 100644 index 0000000000000000000000000000000000000000..5d127ca0d13961d29741afdbd713275a3f6c8033 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geolocation.md @@ -0,0 +1,92 @@ +# 位置服务子系统ChangeLog + +## cl.location.1 @ohos.geolocation.d.ts接口迁移到新增的@ohos.geoLocationManager.d.ts + +@ohos.geolocation.d.ts接口不支持抛出错误码,为了支持错误码功能,把@ohos.geolocation.d.ts中所有接口,迁移到新增的@ohos.geoLocationManager.d.ts中,并增加错误码描述。 + +后续需要import @ohos.geoLocationManager才能使用位置服务的接口: + +import geoLocationManager from '@ohos.geoLocationManager'; + + +**变更影响** + +对位置服务所有接口的使用有影响,需要import @ohos.geoLocationManager才能使用位置服务接口: + +import geoLocationManager from '@ohos.geoLocationManager'; + +**关键的接口/组件变更** + +| 类名 | 接口类型 | 接口声明 | 变更类型 | +| -- | -- | -- | -- | +|geolocation| namespace | declare namespace geolocation| 迁移到@ohos.geoLocationManager.d.ts,使用namespace geoLocationManager代替 | +|geolocation| method | function on(type: 'locationChange', request: LocationRequest, callback: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function off(type: 'locationChange', callback?: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function on(type: 'locationServiceState', callback: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function off(type: 'locationServiceState', callback?: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback>): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback>): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function on(type: 'gnssStatusChange', callback: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function off(type: 'gnssStatusChange', callback?: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function on(type: 'nmeaMessageChange', callback: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function off(type: 'nmeaMessageChange', callback?: Callback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getCurrentLocation(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getCurrentLocation(request?: CurrentLocationRequest): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getLastLocation(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getLastLocation(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function isLocationEnabled(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function isLocationEnabled(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function requestEnableLocation(callback: AsyncCallback): void; | 接口删除 | +|geolocation| method | function requestEnableLocation(): Promise; | 接口删除 | +|geolocation| method | function enableLocation(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function enableLocation(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function disableLocation(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function disableLocation(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback>): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise>; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback>): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise>; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function isGeoServiceAvailable(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function isGeoServiceAvailable(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getCachedGnssLocationsSize(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function getCachedGnssLocationsSize(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function flushCachedGnssLocations(callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function flushCachedGnssLocations(): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function sendCommand(command: LocationCommand, callback: AsyncCallback): void; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| method | function sendCommand(command: LocationCommand): Promise; | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | SatelliteStatusInfo | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | CachedGnssLocationsRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | GeofenceRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | Geofence | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | ReverseGeoCodeRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | GeoCodeRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | GeoAddress | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | LocationRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | CurrentLocationRequest | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| interface | Location | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| enum | LocationRequestPriority | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| enum | LocationRequestScenario | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| enum | GeoLocationErrorCode | 接口废弃 | +|geolocation| enum | LocationPrivacyType | 接口迁移到@ohos.geoLocationManager.d.ts | +|geolocation| enum | LocationCommand | 接口迁移到@ohos.geoLocationManager.d.ts | + + +**适配指导(可选,不涉及则可以删除)** + +以enableLocation为例,在新版本上需要使用如下方式进行调用: + + ```ts + import geoLocationManager from '@ohos.geoLocationManager'; + try { + geoLocationManager.enableLocation((err, data) => { + if (err) { + console.log('enableLocation: err=' + JSON.stringify(err)); + } + }); + } catch (err) { + console.error("errCode:" + err.code + ",errMessage:" + err.message); + } + ``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-request.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-request.md new file mode 100644 index 0000000000000000000000000000000000000000..6d7bc0e05cd183ff46328bbbbbe8722287961c70 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-request.md @@ -0,0 +1,42 @@ +# 上传下载子系统ChangeLog + + +## cl.request.2 request上传下载接口变更 + +- 删除API9-beta接口: +1. function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; +2. function download(context: BaseContext, config: DownloadConfig): Promise; +3. function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; +4. function upload(context: BaseContext, config: UploadConfig): Promise; + +**变更影响** + +基于此前版本使用Stage模式开发的应用,需适配变更后的接口,否则会影响原有业务逻辑。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +|--------------|--------------|-------------------------------------------------------------------------------------------------------------------|------| +| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback): void; | 删除 | +| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise; | 删除 | +| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback): void; | 删除 | +| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise; | 删除 | + + +**适配指导** + +以download为例,在新版本上需要使用downloadFile, 如下方式进行调用: + +```ts +try { + request.downloadFile(globalThis.abilityContext, { url: 'https://xxxx/xxxxx.hap', + filePath: 'xxx/xxxxx.hap'}, (err, data) => { + if (err) { + console.error('Failed to request the download. Cause: ' + JSON.stringify(err)); + return; + } + }); +} catch (err) { + console.log("downloadFile callback fail." + "errCode:" + err.code + ",errMessage:" + err.message); +} +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md new file mode 100644 index 0000000000000000000000000000000000000000..a7c431a2365444a6275d3fc3be61f785dcaa4b4f --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-resourceschedule.md @@ -0,0 +1,111 @@ +# 资源调度子系统ChangeLog + +## cl.resourceschedule.backgroundTaskManager +对资源调度子系统backgroundTaskManager仓原有接口进行整改,原有@ohos.backgroundTaskManager.d.ts中的API9接口删除,需要使用@ohos.resourceschedule.backgroundTaskManager.d.ts中的API9新接口。新的API9接口符合错误码规范。 + +**变更影响** + +基于OpenHarmony3.2.10.5及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。 + +**关键接口/组件变更** + +以下方法、属性、枚举和常量均从API9变更。@ohos.backgroundTaskManager.d.ts文件中的接口移植到@ohos.resourceschedule.backgroundTaskManager.d.ts文件。 + +| 类名 | 接口类型 | 接口声明 | 说明 | +| -- | -- | -- | -- | +| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts,修改为function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; | +| backgroundTaskManager.ResourceType | enum | export enum ResourceType | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.ResourceType | enum | CPU = 1 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | +| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts | + + +**适配指导**
+ +导入backgroundTaskManager模块。 +``` +import bundle form '@ohos.resourceschedule.backgroundTaskManager' +``` +此外还需要适配异常处理,具体参考[backgroundTaskManager接口文档](../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md)。 + +## c2.resourceschedule.workScheduler +对资源调度子系统workScheduler仓原有接口进行整改,原有@ohos.workScheduler.d.ts中的API9接口删除,需要使用@ohos.resourceschedule.workScheduler.d.ts中的API9新接口。新的API9接口符合错误码规范。 + +**变更影响** + +基于OpenHarmony3.2.10.5及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。 + +**关键接口/组件变更** + +以下方法、属性、枚举和常量均从API9变更。删除@ohos.workScheduler.d.ts文件,相关接口变更至@ohos.resourceschedule.workScheduler.d.ts文件中。 + +| 类名 | 接口类型 | 接口声明 | 变更类型 | +| -- | -- | -- | -- | +| workScheduler | namespace | declare namespace workScheduler | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | interface | export interface WorkInfo | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | idleWaitTime?: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | isDeepIdle?: boolean | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | repeatCount?: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | isRepeat?: boolean | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | repeatCycleTime?: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | batteryLevel?: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | chargerType?: ChargingType | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | isCharging?: boolean | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | networkType?: NetworkType | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | isPersisted?: boolean | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | abilityName: string | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | bundleName: string | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.WorkInfo | field | workId: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback): boolean; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler | method | function stopAndClearWorks(): boolean; | 接口API8变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function stopAndClearWorks(): boolean; | +| workScheduler | method | function obtainAllWorks(): Promise>; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler | method | function obtainAllWorks(callback: AsyncCallback): Array; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler | method | function getWorkStatus(workId: number): Promise; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback): void; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | 接口API8变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function stopWork(work: WorkInfo, needCancel?: boolean): void; | +| workScheduler | method | function startWork(work: WorkInfo): boolean; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function startWork(work: WorkInfo): void; | +| workScheduler.NetworkType | enum | export enum NetworkType | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.ChargingType | enum | export enum ChargingType | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.BatteryStatus | enum | export enum BatteryStatus | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.StorageRequest | enum | export enum StorageRequest | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | +| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts | + + +**适配指导**
+ +导入workScheduler模块。 +``` +import bundle form '@ohos.resourceschedule.workScheduler' +``` +此外还需要适配异常处理,具体参考[workScheduler接口文档](../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md)。 diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-security.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-security.md new file mode 100644 index 0000000000000000000000000000000000000000..3f3a7acf0bbdee1aa1b640f511c91e3f65d2333e --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-security.md @@ -0,0 +1,475 @@ +# security子系统ChangeLog + +## cl.security.1 Random的setSeed功能变更,由异步接口改为同步接口 + +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +setSeed(seed : DataBlob, callback : AsyncCallback\) : void; +setSeed(seed : DataBlob) : Promise\; +修改后的接口原型: +setSeed(seed : DataBlob) : void; + +**适配指导** +查看API参考中setSeed对应的接口适配指南: +[加解密算法库框架-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cryptoFramework.md) + + +## cl.security.2 interface DataArray 从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface DataArray从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.3 interface EncodingFormat从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface EncodingFormat从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.4 interface EncodingBlob 从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface EncodingBlob 从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.5 interface CertChainData从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface CertChainData从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.6 interface X509Cert从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface X509Cert从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.7 function createX509Cert从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +function createX509Cert从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.8 interface X509CrlEntry从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface X509CrlEntry从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.9 interface X509Crl从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface X509Crl从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.10 function createX509Crl从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +function createX509Crl从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.11 interface CertChainValidator从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +interface CertChainValidator从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.12 function createCertChainValidator从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +function createCertChainValidator从@ohos.security.cryptoFramework.d.ts 迁移至@ohos.security.cert.d.ts + +**适配指导** +重新import并使用对应的.d.ts文件: +import cryptoCert from '@ohos.security.cert'; +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.13 X509Cert 的getPublicKey功能变更,由异步接口改为同步接口 +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +getPublicKey(callback : AsyncCallback\) : void; +getPublicKey() : Promise\; +修改后的接口原型: +getPublicKey() : cryptoFramework.PubKey; + +**适配指导** +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.14 X509Cert 的checkValidityWithDate功能变更,由异步接口改为同步接口 +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +checkValidityWithDate(date: string, callback : AsyncCallback\) : void; +checkValidityWithDate(date: string) : Promise\; +修改后的接口原型: +checkValidityWithDate(date: string) : void; + +**适配指导** +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.15 X509CrlEntry 的getCertIssuer功能变更,由异步接口改为同步接口 +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +getCertIssuer(callback : AsyncCallback\) : void; +getCertIssuer() : Promise\; + +修改后的接口原型: +getCertIssuer() : DataBlob; + +**适配指导** +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.16 X509CrlEntry 的getRevocationDate功能变更,由异步接口改为同步接口 +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +getRevocationDate(callback : AsyncCallback\) : void; +getRevocationDate() : Promise\; + +修改后的接口原型: +getRevocationDate() : string; + +**适配指导** +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.17 X509Crl 的isRevoked功能变更,由异步接口改为同步接口 +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +isRevoked(cert : X509Cert, callback : AsyncCallback\) : void; +isRevoked(cert : X509Cert) : Promise\; + +修改后的接口原型: +isRevoked(cert : X509Cert) : boolean; + +**适配指导** +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.18 X509Crl 的getRevokedCert功能变更,由异步接口改为同步接口 +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +getRevokedCert(serialNumber : number, callback : AsyncCallback\) : void; +getRevokedCert(serialNumber : number) : Promise\; + +修改后的接口原型: +getRevokedCert(serialNumber : number) : X509CrlEntry; + +**适配指导** +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.19 X509Crl 的getRevokedCertWithCert功能变更,由异步接口改为同步接口 +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\) : void; +getRevokedCertWithCert(cert : X509Cert) : Promise\; + +修改后的接口原型: +getRevokedCertWithCert(cert : X509Cert) : X509CrlEntry; + +**适配指导** +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + + +## cl.security.20 X509Crl 的getTbsInfo功能变更,由异步接口改为同步接口 +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** +修改前的接口原型: +getTbsInfo(callback : AsyncCallback\) : void; +getTbsInfo() : Promise\; + +修改后的接口原型: +getTbsInfo() : DataBlob; + +**适配指导** +查看API参考中对应的接口适配指南: +[证书-API参考](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md) + +## cl.security.21 HUKS支持No-Hash的签名模式 + +变更之前,应用传递huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE,HUKS默认使用huks.HuksKeyDigest.HUKS_DIGEST_SHA256进行处理;变更之后,应用传递huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE时,HUKS默认不进行摘要处理,需要业务先对原始数据进行hash操作,再将hash后的摘要传入huks进行签名/验签处理。 + +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以使得变更前后的签名/验签结果通过。 + +**关键的接口/组件变更** + +发布的JS接口不变, 传入接口的参数集合发生变更。 + +业务使用No-Hash的签名模式,需要先对原始数据进行hash处理,再将hash后的摘要传入huks签名/验签接口。同时huks.HuksTag.HUKS_TAG_DIGEST参数设置为huks.HuksKeyDigest.HUKS_DIGEST_NONE。 + +**适配指导** + +以签名为例,示例代码如下: + +```js +import huks from '@ohos.security.huks'; + +let keyAlias = 'rsa_Key'; +/* sha256之后的摘要值 */ +let inDataAfterSha256 = new Uint8Array( + 0x4B, 0x1E, 0x22, 0x64, 0xA9, 0x89, 0x60, 0x1D, 0xEC, 0x78, 0xC0, 0x5D, 0xBE, 0x46, 0xAD, 0xCF, + 0x1C, 0x35, 0x16, 0x11, 0x34, 0x01, 0x4E, 0x9B, 0x7C, 0x00, 0x66, 0x0E, 0xCA, 0x09, 0xC0, 0xF3, +); +/* 签名参数 */ +let signProperties = new Array(); +signProperties[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_RSA, +} +signProperties[1] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: + huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN +} +signProperties[2] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_RSA_KEY_SIZE_2048, +} +signProperties[3] = { + tag: huks.HuksTag.HUKS_TAG_DIGEST, + value: huks.HuksKeyDigest.HUKS_DIGEST_NONE, // 设置 digest-none +} +let signOptions = { + properties: signProperties, + inData: inDataAfterSha256 // 设置HASH后的值 +} + +huks.initSession(keyAlias, signOptions); +``` + +更多接口的示例代码可参考[HUKS-guidelines](../../../application-dev/security/huks-guidelines.md)和[HUKS API](../../../application-dev/reference/apis/js-apis-huks.md)。 + +## cl.security.22 HUKS支持在密钥使用时指定密钥运算参数 + +变更之前,业务在生成密钥的时候,必须指定密钥运算的全部参数;变更之后,在生成密钥时,只需要包含必选参数即可,在密钥使用阶段再传入其他参数。业务使用会更加灵活。 + +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 + +允许应用在生成密钥阶段传入的参数中包含必选参数即可,在密钥使用阶段再传入其他可选参数。 + +**关键的接口/组件变更** + +发布的JS接口不变, 传入接口的参数集合发生变更,将参数分为必选参数和可选参数,具体可参考[HUKS-guidelines](../../../application-dev/security/huks-guidelines.md),涉及的接口有: + +huks.generateKeyItem + +huks.importKeyItem + +huks.importWrappedKeyItem + +huks.initSession + +huks.updateSession + +huks.finishSession + +**适配指导** + +以生成密钥为例,示例代码如下: + +```js +let keyAlias = 'keyAlias'; +let properties = new Array(); +//必选参数 +properties[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_RSA +}; +//必选参数 +properties[1] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_RSA_KEY_SIZE_2048 +}; +//必选参数 +properties[2] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: + huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN | + huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_VERIFY +}; +//可选参数,如果在生成密钥阶段没有传入,则在使用密钥阶段必须传入。 +properties[3] = { + tag: huks.HuksTag.HUKS_TAG_DIGEST, + value: huks.HuksKeyDigest.HUKS_DIGEST_SHA256 +}; +let options = { + properties: properties +}; +try { + huks.generateKeyItem(keyAlias, options, function (error, data) { + if (error) { + console.error(`callback: generateKeyItem failed, code: ${error.code}, msg: ${error.message}`); + } else { + console.info(`callback: generateKeyItem key success`); + } + }); +} catch (error) { + console.error(`callback: generateKeyItem input arg invalid, code: ${error.code}, msg: ${error.message}`); +} +``` + +更多接口的示例代码可参考[HUKS-guidelines](../../../application-dev/security/huks-guidelines.md)和[HUKS API](../../../application-dev/reference/apis/js-apis-huks.md)。 diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-system-geolocation.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-system-geolocation.md new file mode 100644 index 0000000000000000000000000000000000000000..4494940d23cfa519f2c7b0e3ac7f3c1a3b1cfa8c --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-system-geolocation.md @@ -0,0 +1,50 @@ +# 位置服务子系统ChangeLog + +## cl.location.1 @system.geolocation.d.ts接口迁移到新增的@ohos.geoLocationManager.d.ts + +@system.geolocation.d.ts接口不支持抛出错误码,为了支持错误码功能,把@system.geolocation.d.ts中所有接口,迁移到新增的@ohos.geoLocationManager.d.ts中,并增加错误码描述。 + +后续需要import @ohos.geoLocationManager才能使用位置服务的接口: + +import geoLocationManager from '@ohos.geoLocationManager'; + + +**变更影响** + +对位置服务所有接口的使用有影响,需要import @ohos.geoLocationManager才能使用位置服务接口: + +import geoLocationManager from '@ohos.geoLocationManager'; + +**关键的接口/组件变更** + +| 类名 | 接口类型 | 接口声明 | 变更类型 | +| -- | -- | -- | -- | +|Geolocation| class | Geolocation | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager代替 | +|Geolocation| interface | static getLocation(options?: GetLocationOption): void; | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.getCurrentLocation代替 | +|Geolocation| interface | static getLocationType(options?: GetLocationTypeOption): void; | 接口废弃 | +|Geolocation| interface | static subscribe(options: SubscribeLocationOption): void; | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.on#event:locationChange代替 | +|Geolocation| interface | static unsubscribe(): void; | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.off#event:locationChange代替 | +|Geolocation| interface | static getSupportedCoordTypes(): Array; | 接口废弃 | +|| interface | GeolocationResponse| 迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.Location代替 | +|| interface | GetLocationOption | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.CurrentLocationRequest代替 | +|| interface | GetLocationTypeResponse | 接口废弃 | +|| interface | GetLocationTypeOption | 接口废弃 | +|| interface | SubscribeLocationOption | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.LocationRequest代替 | + + +**适配指导(可选,不涉及则可以删除)** + +以enableLocation为例,在新版本上需要使用如下方式进行调用: + + ```ts + import geoLocationManager from '@ohos.geoLocationManager'; + try { + geoLocationManager.enableLocation((err, data) => { + if (err) { + console.log('enableLocation: err=' + JSON.stringify(err)); + } + }); + } catch (err) { + console.error("errCode:" + err.code + ",errMessage:" + err.message); + } + ``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-telephony.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-telephony.md new file mode 100644 index 0000000000000000000000000000000000000000..9096ff88cbc71e971fa3bd2d631684a161c175e2 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-telephony.md @@ -0,0 +1,59 @@ +# 电话子系统ChangeLog + + + +## cl.telephony.1 radio模块接口变更 + + +### 电话子系统radio模块 `isNrSupported` 接口存在变更: + +NR是专有名词,需要全部大写。 + +开发者需要根据以下说明对应用进行适配。 + + + +**变更影响** + +基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。 + + + +**关键的接口/组件变更** + +- 涉及接口 + + isNrSupported(): boolean; + isNrSupported(slotId: number): boolean; + +- 变更前: + +```js +function isNrSupported(): boolean; +function isNrSupported(slotId: number): boolean; +``` + +- 变更后: + +```js +function isNRSupported(): boolean; +function isNRSupported(slotId: number): boolean; +``` + + + +**适配指导** + +使用变更后的接口,示例代码如下: + +```js +let result = radio.isNrSupported(); +console.log("Result: "+ result); +``` + + +```js +let slotId = 0; +let result = radio.isNRSupported(slotId); +console.log("Result: "+ result); +``` diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-time.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-time.md new file mode 100644 index 0000000000000000000000000000000000000000..1f6aa755b94e4acbcec7900011f563478e1793fc --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-time.md @@ -0,0 +1,336 @@ +# 时间时区子系统ChangeLog + +## cl.time.1 接口异常抛出变更 + +时间时区子系统定时器接口异常抛出:202非系统应用异常和401参数无效异常。 + +**变更影响** + +该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,增加相应的异常处理,原有功能不受影响。 + +**关键接口/组件变更** + +变更前: + - 接口异常抛出message,无错误码。 + +变更后: + - 接口异常抛出message和code,包括202非系统应用异常和401参数无效异常。 + + | 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | + | ----------------- | ----------- | ------------------------------------------------------------ | -------- | + | @ohos.systemTimer | systemTimer | function createTimer(options: TimerOptions, callback: AsyncCallback): void | 变更 | + | @ohos.systemTimer | systemTimer | function createTimer(options: TimerOptions): Promise | 变更 | + | @ohos.systemTimer | systemTimer | function startTimer(timer: number, triggerTime: number, callback: AsyncCallback): void | 变更 | + | @ohos.systemTimer | systemTimer | function startTimer(timer: number, triggerTime: number): Promise | 变更 | + | @ohos.systemTimer | systemTimer | function stopTimer(timer: number, callback: AsyncCallback): void | 变更 | + | @ohos.systemTimer | systemTimer | function stopTimer(timer: number): Promise | 变更 | + | @ohos.systemTimer | systemTimer | function destroyTimer(timer: number, callback: AsyncCallback): void | 变更 | + | @ohos.systemTimer | systemTimer | function destroyTimer(timer: number): Promise | 变更 | + + +**适配指导** + +应用中调用systemTimer所有接口可参考下列代码进行异常捕获 + +createTimer callback形式调用: + +**示例:** + +```js +export default { + systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat: false + }; + try { + systemTimer.createTimer(options, (error, timerId) => { + if (error) { + //捕获权限否定异常 + console.info(`Failed to create timer. message: ${error.message}, code: ${error.code}`); + } + console.info(`Succeeded in creating timer. timerId: ${timerId}`); + }); + } catch(e) { + //捕获参数校验失败异常 + console.info(`Failed to create timer. message: ${e.message}, code: ${e.code}`); + } + } +} +``` + +createTimer promise形式调用: + +**示例:** + +```js +export default { + systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat: false + }; + try { + systemTimer.createTimer(options).then((timerId) => { + console.info(`Succeeded in creating timer. timerId: ${timerId}`); + }).catch((error) => { + //捕获权限否定异常 + console.info(`Failed to create timer. message: ${error.message}, code: ${error.code}`); + }); + } catch(e) { + //捕获参数校验失败异常 + console.info(`Failed to create timer. message: ${e.message}, code: ${e.code}`); + } + } +} +``` + +startTimer callback形式调用: + +**示例:** + +```js +export default { + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + try { + systemTimer.startTimer(timerId, triggerTime, (error) => { + if (error) { + //捕获权限否定异常 + console.error(`Failed to start timer. message: ${error.message}, code: ${error.code}`); + } + }); + } catch (e) { + //捕获参数校验失败异常 + console.info(`Failed to start timer. message: ${e.message}, code: ${e.code}`); + } + } +} +``` + +startTimer promise形式调用: + +**示例:** + +```js +export default { + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + try { + systemTimer.startTimer(timerId, triggerTime).then((data) => { + console.log(`Succeeded in startting timer. Data:` + data); + }).catch((error) => { + //捕获权限否定异常 + console.info(`Failed to start timer. message: ${error.message}, code: ${error.code}`); + }); + } catch (e) { + //捕获参数校验失败异常 + console.info(`Failed to start timer. message: ${e.message}, code: ${e.code}`); + } + } +} +``` + +stopTimer callback形式调用: + +**示例:** + +```js +export default { + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + try { + systemTimer.stopTimer(timerId, triggerTime, (error) => { + if (error) { + //捕获权限否定异常 + console.error(`Failed to stop timer. message: ${error.message}, code: ${error.code}`); + } + }); + } catch (e) { + //捕获参数校验失败异常 + console.info(`Failed to stop timer. message: ${e.message}, code: ${e.code}`); + } + } +}git +``` + +stopTimer promise形式调用: + +**示例:** + +```js +export default { + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + try { + systemTimer.stopTimer(timerId, triggerTime).then((data) => { + console.log(`Succeeded in stop timer. Data:` + data); + }).catch((error) => { + //捕获权限否定异常 + console.info(`Failed to stop timer. message: ${error.message}, code: ${error.code}`); + }); + } catch (e) { + //捕获参数校验失败异常 + console.info(`Failed to stop timer. message: ${e.message}, code: ${e.code}`); + } + } +} +``` + +destroyTimer callback形式调用: + +**示例:** + +```js +export default { + async systemTimer () { + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + systemTimer.stopTimer(timerId); + try { + systemTimer.destroyTimer(timerId, triggerTime, (error) => { + if (error) { + //捕获权限否定异常 + console.error(`Failed to destroy timer. message: ${error.message}, code: ${error.code}`); + } + }); + } catch (e) { + //捕获参数校验失败异常 + console.info(`Failed to destroy timer. message: ${e.message}, code: ${e.code}`); + } + } +} +``` + +destroyTimer promise形式调用: + +**示例:** + +```js +export default { + async systemTimer (){ + let options = { + type: systemTimer.TIMER_TYPE_REALTIME, + repeat:false + } + let timerId = await systemTimer.createTimer(options); + let triggerTime = new Date().getTime(); + triggerTime += 3000; + systemTimer.startTimer(timerId, triggerTime); + systemTimer.stopTimer(timerId); + try { + systemTimer.destroyTimer(timerId, triggerTime).then((data) => { + console.log(`Succeeded in destroy timer. Data:` + data); + }).catch((error) => { + //捕获权限否定异常 + console.info(`Failed to destroy timer. message: ${error.message}, code: ${error.code}`); + }); + } catch (e) { + //捕获参数校验失败异常 + console.info(`Failed to destroy timer. message: ${e.message}, code: ${e.code}`); + } + } +} +``` + +## cl.time.2 接口异常抛出变更 + +时间时区子系统时间相关接口异常抛出:201权限否定异常、202非系统应用异常和401参数无效异常。 + +**变更影响** + +基于此前版本开发的应用,继续使用无影响,使用新接口需要捕获并处理抛出的新异常。 + +**关键接口/组件变更** + +变更前: + - 接口异常抛出message,错误码-1。 + +变更后: + - 接口异常抛出message和code,包括201权限否定异常、202非系统应用异常和401参数无效异常。 + +原接口中标记为废弃的接口,可以使用新接口中的同名接口替换 + +| 原接口 | 新接口 | +| ---------------- | -------------------- | +| @ohos.systemTime | @ohos.systemDateTime | + +**适配指导** + +应用中调用systemTime所有接口可参考下列代码进行异常捕获,以setTime接口为例,其他接口适配方法相同。 + +callback形式调用: + +**示例:** + +```js +import systemDateTime from @ohos.systemDateTime +// time对应的时间为2021-01-20 02:36:25 +let time = 1611081385000; +try { + systemDateTime.setTime(time, (error) => { + //捕获权限否定异常和非系统应用异常 + if (error) { + console.info(`Failed to setting time. message: ${error.message}, code: ${error.code}`); + return; + } + console.info(`Succeeded in setting time.`); + }) +} catch(e) { + //捕获参数校验失败异常 + console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`); +} +``` + +promise形式调用: + +**示例:** + +```js +import systemDateTime from @ohos.systemDateTime +// time对应的时间为2021-01-20 02:36:25 +let time = 1611081385000; +try { + systemDateTime.setTime(time).then(() => { + console.info(`Succeeded in setting time.`); + }).catch((error) => { + //捕获权限否定异常和非系统应用异常 + console.info(`Failed to setting time. message: ${error.message}, code: ${error.code}`); + }); +} catch(e) { + //捕获参数校验失败异常 + console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`); +} +``` diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-url.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-url.md new file mode 100644 index 0000000000000000000000000000000000000000..34da098e0a10b2e03811bbc534e8599c759bac6f --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-url.md @@ -0,0 +1,68 @@ +# 公共基础类库子系统JS API变更Changelog + +## cl.commonlibrary.1.URLParams类接口变更 +公共基础类库子系统url模块URLParams类构造函数存在变更: + +constructor(init?: string[][] | Record | string | URLSearchParams) 改为 constructor(init?: string[][] | Record | string | URLParams);参数类型为原来的URLSearchParams类改为URLParams类。 + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLSearchParams) | 删除 | +| @ohos.url | URLParams | constructor(string[][] \| Record<string, string> \| string \| URLParams)| 变更 + +**适配指导** + +应用中创建URLParams对象实例可参考下列代码 + +示例: + +```ts +import url from '@ohos.url' +try { + let params1 = new Url.URLParams('?user=abc&query=xyz') + let params2 = new Url.URLParams(params1) + var result= params2.toString() + console.log(result) //"user=abc&query=xyz" +} catch (err) { + console.error(`Fail to ceate URLParams.codeis${err.code},message is ${err.message}`); +} +``` +## cl.commonlibrary.2.URL类属性变更url子系统URLParams类构造函数存在变更: +公共基础类库子系统url模块URL类属性存在变更: + +废弃searchParams: URLSearchParams属性,新增params: URLParams属性 + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- | +| @ohos.url | URL | searchParams: URLSearchParams; |废弃版本:9
| +| @ohos.url | URL | params: URLParams; | 新增 | + +**适配指导** + +应用中创建URLParams对象实例可参考下列代码 + +示例: + +```ts +import url from '@ohos.url' +let that = new Url.URL('http://username:password@host:8080/directory/file?你好=china#qwer=da') +let params = that.URLParams +var result = params.toString() +console.log(result) //%E4%BD%A0%E5%A5%BD=china +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-useriam.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-useriam.md new file mode 100644 index 0000000000000000000000000000000000000000..0444bab5234087b1f865eda378e680c95fc1abb4 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-useriam.md @@ -0,0 +1,17 @@ +# 用户IAM子系统Changelog + +## cl.useriam.1 API9返回值命名变更 + +用户IAM API9的返回值枚举类类名发生变更,从 ResultCodeV9 更名为 UserAuthResultCode + +**变更影响** + +基于此版本以前开发的应用不受影响,以后的需适配错误码的类名,否则会影响业务逻辑。 + +**关键接口/组件变更** + +无接口/组件变更 + +**适配指导** + +需要修改返回值调用类名从 ResultCodeV9 改为 UserAuthResultCode \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-window.md b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-window.md new file mode 100644 index 0000000000000000000000000000000000000000..697060fe9cf6a50e0958bc566bd495e9220fa1c4 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-window.md @@ -0,0 +1,63 @@ +# 窗口子系统ChangeLog + +## cl.window.1 WindowStage生命周期监听类型名称变更 + +WindowStage生命周期的监听类型枚举定义自3.2.10.5版本起进行了变更。 + +**变更影响** + +3.2.10.5版本之前使用FOREGROUND/BACKGROUND类型开发的应用生命周期监听,在3.2.10.5版本之后失效。 + +**关键接口/组件变更** + +## WindowStageEventType9+ + +变更前: + +| 名称 | 值 | 说明 | +| ---------- | ---- | ---------- | +| FOREGROUND | 1 | 切到前台。 | +| BACKGROUND | 4 | 切到后台。 | + +变更后: +| 名称 | 值 | 说明 | +| ------ | ---- | ---------- | +| SHOWN | 1 | 切到前台。 | +| HIDDEN | 4 | 切到后台。 | + +**适配指导** + +在注册生命周期监听回调时,将前后台事件类型改为SHOWN/HIDDEN: + +``` +import Ability from '@ohos.application.Ability'; + +class myAbility extends Ability { + onWindowStageCreate(windowStage) { + console.log('onWindowStageCreate'); + try { + windowStage.on('windowStageEvent', (stageEventType) => { + switch (stageEventType) { + case window.WindowStageEventType.SHOWN: + console.log("windowStage shown"); + break; + case window.WindowStageEventType.ACTIVE: + console.log("windowStage active"); + break; + case window.WindowStageEventType.INACTIVE: + console.log("windowStage inActive"); + break; + case window.WindowStageEventType.HIDDEN: + console.log("windowStage hidden"); + break; + default: + break; + } + } ) + } catch (exception) { + console.error('Failed to enable the listener for window stage event changes. Cause:' + + JSON.stringify(exception)); + }; + } +}; +``` diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/Readme-CN.md b/zh-cn/release-notes/changelogs/v4.0-beta1/Readme-CN.md new file mode 100644 index 0000000000000000000000000000000000000000..ddabc17980b28b7bc618f18a33299839c0ae0478 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/Readme-CN.md @@ -0,0 +1,33 @@ +# Readme + +- [元能力](changelogs-ability.md) +- [程序访问控制](changelogs-accesstoken.md) +- [帐号](changelogs-account_os_account.md) +- [通知](changelogs-ans.md) +- [语言编译运行时](changelogs-arkcompiler.md) +- [ArkUI](changelogs-arkui.md) +- [蓝牙](changelogs-bluetooth.md) +- [包管理](changelogs-bundlemanager.md) +- [事件](changelogs-ces.md) +- [分布式数据管理](changelogs-distributeddatamgr.md) +- [文件管理](changelogs-filemanagement.md) +- [位置](changelogs-geoLocationManager.md) +- [全球化](changelogs-global.md) +- [安全-huks](changelogs-huks.md) +- [输入法框架](changelogs-imf.md) +- [媒体](changelogs-media.md) +- [Misc软件](changelogs-miscdevice.md) +- [剪贴板](changelogs-pasteboard.md) +- [电源](changelogs-power.md) +- [资源调度](changelogs-resourceschedule.md) +- [主题框架-锁屏](changelogs-screenlock.md) +- [安全基础能力](changelogs-security.md) +- [泛Sensor](changelogs-sensor.md) +- [分布式软总线](changelogs-softbus.md) +- [启动服务](changelogs-startup.md) +- [电话服务](changelogs-telephony.md) +- [测试框架](changelogs-testfwk_arkxtest.md) +- [USB](changelogs-usb.md) +- [主题框架-壁纸](changelogs-wallpaper.md) +- [Web](changelogs-web.md) +- [WIFI](changelogs-wifiManager.md) \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ability.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..e637842e79f52518d6d83087b5d8942ba90a4374 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ability.md @@ -0,0 +1,240 @@ +# 元能力子系统ChangeLog + +## cl.ability.1 SystemAPI使用规则变更 + +目前元能力提供的system-api在调用时未做系统应用校验,三方应用使用Full版本的SDK就可以使用这些system-api,存在安全隐患,因此在OpenHarmony 4.0.2.1版本开始增加应用身份校验。 + +**变更影响** + +只有系统应用允许使用system-api,三方应用使用system-api将返回202错误,返回202错误的方式有两种:1.抛异常;2.异步回调 + +**关键接口/组件变更** + +system-api列表如下所示。 + +| 模块名 | 方法 | 返回错误码方式 | +| ------------------------------------------ | --------------------------------------------------------------------------------- | -------------- | +| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.abilityManager.d.ts | updateConfiguration(config: Configuration): Promise | 异步回调 | +| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(): Promise> | 异步回调 | +| @ohos.app.ability.abilityManager.d.ts | getAbilityRunningInfos(callback: AsyncCallback>): void | 异步回调 | +| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number): Promise> | 异步回调 | +| @ohos.app.ability.abilityManager.d.ts | getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void | 异步回调 | +| @ohos.app.ability.abilityManager.d.ts | getTopAbility(): Promise | 抛异常 | +| @ohos.app.ability.abilityManager.d.ts | getTopAbility(callback: AsyncCallback): void | 抛异常 | +| @ohos.app.ability.appManager.d.ts | on(type: "applicationState", observer: ApplicationStateObserver): number | 异步回调 | +| @ohos.app.ability.appManager.d.ts | on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array): number | 异步回调 | +| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.appManager.d.ts | off(type: "applicationState", observerId: number): Promise | 异步回调 | +| @ohos.app.ability.appManager.d.ts | getForegroundApplications(callback: AsyncCallback>): void | 异步回调 | +| @ohos.app.ability.appManager.d.ts | getForegroundApplications(): Promise> | 异步回调 | +| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number): Promise | 异步回调 | +| @ohos.app.ability.appManager.d.ts | killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string): Promise | 异步回调 | +| @ohos.app.ability.appManager.d.ts | killProcessesByBundleName(bundleName: string, callback: AsyncCallback) | 异步回调 | +| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string): Promise | 异步回调 | +| @ohos.app.ability.appManager.d.ts | clearUpApplicationData(bundleName: string, callback: AsyncCallback) | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | on(type: "mission", listener: MissionListener): number | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | off(type: "mission", listenerId: number): Promise | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | getMissionInfo(deviceId: string, missionId: number): Promise | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | getMissionInfos(deviceId: string, numMax: number): Promise> | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | getMissionSnapShot(deviceId: string, missionId: number): Promise | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | lockMission(missionId: number): Promise | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | unlockMission(missionId: number): Promise | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | clearMission(missionId: number): Promise | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | clearAllMissions(callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | clearAllMissions(): Promise | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options: StartOptions, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.missionManager.d.ts | moveMissionToFront(missionId: number, options?: StartOptions): Promise | 异步回调 | +| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.quickFixManager.d.ts | applyQuickFix(hapModuleQuickFixFiles: Array): Promise | 异步回调 | +| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.quickFixManager.d.ts | getApplicationQuickFixInfo(bundleName: string): Promise | 异步回调 | +| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.ability.wantAgent.d.ts | getWant(agent: WantAgent): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | deleteForm(formId: string, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | deleteForm(formId: string): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | releaseForm(formId: string, isReleaseCache?: boolean): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | requestForm(formId: string, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | requestForm(formId: string): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | castToNormalForm(formId: string): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyVisibleForms(formIds: Array): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyInvisibleForms(formIds: Array): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | enableFormsUpdate(formIds: Array): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | disableFormsUpdate(formIds: Array): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | isSystemReady(callback: AsyncCallback): void | 抛异常 | +| @ohos.app.form.formHost.d.ts | isSystemReady(): Promise | 抛异常 | +| @ohos.app.form.formHost.d.ts | getAllFormsInfo(callback: AsyncCallback>): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | getAllFormsInfo(): Promise> | 异步回调 | +| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, callback: AsyncCallback>): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | getFormsInfo(bundleName: string, moduleName?: string): Promise> | 异步回调 | +| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | deleteInvalidForms(formIds: Array): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | acquireFormState(want: Want): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | on(type: "formUninstall", callback: Callback): void | 抛异常 | +| @ohos.app.form.formHost.d.ts | off(type: "formUninstall", callback?: Callback): void | 抛异常 | +| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array, isVisible: boolean, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyFormsVisible(formIds: Array, isVisible: boolean): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | shareForm(formId: string, deviceId: string): Promise | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formHost.d.ts | notifyFormsPrivacyProtected(formIds: Array, isProtected: boolean): Promise | 异步回调 | +| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, callback: AsyncCallback): void | 异步回调 | +| @ohos.app.form.formProvider.d.ts | requestPublishForm(want: Want, formBindingData?: formBindingData.FormBindingData): Promise | 异步回调 | +| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(callback: AsyncCallback): void | 抛异常 | +| @ohos.app.form.formProvider.d.ts | isRequestPublishFormSupported(): Promise | 抛异常 | +| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | 异步回调 | +| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | 异步回调 | +| UIAbilityContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | 异步回调 | +| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | 抛异常 | +| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | 抛异常 | +| UIAbilityContext.d.ts | startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | 抛异常 | +| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback): void | 异步回调 | +| UIAbilityContext.d.ts | startServiceExtensionAbility(want: Want): Promise | 异步回调 | +| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | 异步回调 | +| UIAbilityContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | 异步回调 | +| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void | 异步回调 | +| UIAbilityContext.d.ts | stopServiceExtensionAbility(want: Want): Promise | 异步回调 | +| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | 异步回调 | +| UIAbilityContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | 异步回调 | +| UIAbilityContext.d.ts | connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number | 异步回调 | +| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap, callback: AsyncCallback): void | 异步回调 | +| UIAbilityContext.d.ts | setMissionIcon(icon: image.PixelMap): Promise | 异步回调 | +| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | 异步回调 | +| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options: StartOptions, callback: AsyncCallback): void | 异步回调 | +| ServiceExtensionContext.d.ts | startAbilityWithAccount(want: Want, accountId: number, options?: StartOptions): Promise | 异步回调 | +| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want, callback: AsyncCallback): void | 异步回调 | +| ServiceExtensionContext.d.ts | startServiceExtensionAbility(want: Want): Promise | 异步回调 | +| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | 异步回调 | +| ServiceExtensionContext.d.ts | startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | 异步回调 | +| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want, callback: AsyncCallback): void | 异步回调 | +| ServiceExtensionContext.d.ts | stopServiceExtensionAbility(want: Want): Promise | 异步回调 | +| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback: AsyncCallback): void | 异步回调 | +| ServiceExtensionContext.d.ts | stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise | 异步回调 | +| ServiceExtensionContext.d.ts | connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options: ConnectOptions): number | 异步回调 | +| Context.d.ts | createBundleContext(bundleName: string): Context | 抛异常 | +| Context.d.ts | createModuleContext(bundleName: string, moduleName: string): Context | 抛异常 | +| FormExtensionContext.d.ts | startAbility(want: Want, callback: AsyncCallback): void | 异步回调 | +| FormExtensionContext.d.ts | startAbility(want: Want): Promise | 异步回调 | + + +## cl.ability.2 appRecovery接口中RestartFlag属性名称变更,删除了未支持的属性 + +appRecovery接口中RestartFlag枚举命名从特定故障发生后**不重启**改成了特定故障发生后**重启**。 +删除了CPP_CRASH_NO_RESTART。 + +**变更影响** + +4.0.2.3版本之前使用CPP_CRASH_NO_RESTART/JS_CRASH_NO_RESTART/APP_FREEZE_NO_RESTART类型开发的应用,在4.0.2.3版本之后行为会发生变化。 + +**关键接口/组件变更** + +**RestartFlag** 9+ + +变更前: +| 名称 | 值 | 说明 | +| ----------------------------- | ---- | ------------------------------------------------------------ | +| ALWAYS_RESTART | 0 | 总是重启应用。 | +| CPP_CRASH_NO_RESTART | 0x0001 | 发生CPP_CRASH时**不重启**应用。 | +| JS_CRASH_NO_RESTART | 0x0002 | 发生JS_CRASH时**不重启**应用。 | +| APP_FREEZE_NO_RESTART | 0x0004 | 发生APP_FREEZE时**不重启**应用。 | +| NO_RESTART | 0xFFFF | 总是不重启应用。 | + +变更后: +| 名称 | 值 | 说明 | +| ---------- | ---- | ---------- | +| ALWAYS_RESTART | 0 | 总是重启应用。 | +| CPP_CRASH_NO_RESTART | NA | **删除**,不支持该场景的重启。 | +| RESTART_WHEN_JS_CRASH | 0x0001 | 发生JS_CRASH时**重启**应用。 | +| RESTART_WHEN_APP_FREEZE | 0x0002 | 发生APP_FREEZE时**重启**应用。 | +| NO_RESTART | 0xFFFF | 总是不重启应用。 | + +**适配指导** + +按新的语义进行适配。 + + +## cl.ability.3 appRecovery新增saveAppState接口 + +新增接口saveAppState(context?: UIAbilityContext): boolean; + +**变更影响** + +基于OpenHarmony4.0.5.2及之后的SDK版本开发的应用,可以使用saveAppState接口传入指定Ability Context,实现主动保存指定的Ability状态。 + +**关键接口/组件变更** + +@ohos.app.ability.appRecovery.d.ts中新增saveAppState接口。 + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| -- | -- | -- | -- | +| @ohos.app.ability.appRecovery.d.ts | appRecovery | saveAppState(context?: UIAbilityContext): boolean; | 新增 | + +**适配指导** + +通过调用saveAppState传入UIAbility Context参数主动保存此指定的Ability的状态。 + +```ts +import appRecovery from '@ohos.app.ability.appRecovery'; +onBackground() { + hilog.info(0x0000, '[demo]', '%{public}s', 'EntryAbility onBackground'); + appRecovery.saveAppState(this.context) +} +``` +## cl.ability.appRecovery新增setRestartWant接口 + +新增接口setRestartWant(want: Want): void; + +**变更影响** + +基于OpenHarmony4.0.5.2及之后的SDK版本开发的应用,可以使用setRestartWant接口设置下次由恢复主动拉起场景下的Ability。 + +**关键接口/组件变更** + +@ohos.app.ability.appRecovery.d.ts中新增setRestartWant接口。 + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| -- | -- | -- | -- | +| @ohos.app.ability.appRecovery.d.ts | appRecovery | setRestartWant(want: Want): void; | 新增 | + +**适配指导** + +通过调用setRestartWant设置下次恢复到的指定Ability。 + +```ts +import appRecovery from '@ohos.app.ability.appRecovery'; +Button("启动到恢复Ability") + .fontSize(40) + .fontWeight(FontWeight.Bold) + .onClick(()=> { + // set restart want + let want = { + bundleName: "ohos.samples.recovery", + abilityName: "RecoveryAbility" + }; + + appRecovery.setRestartWant(want); + }) +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-accesstoken.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-accesstoken.md new file mode 100644 index 0000000000000000000000000000000000000000..1a8369c1e143394448444df7a4f70b78322e1625 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-accesstoken.md @@ -0,0 +1,33 @@ +# 程序访问控制子系统ChangeLog + +OpenHarmony 4.0.3.2 版本相较于OpenHarmony 之前的版本,程序访问控制子系统的API变更如下。 + +## cl.access_token.1 getPermissionUsedRecords命名变更 + +接口getPermissionUsedRecords由于命名规范问题,名称变更为getPermissionUsedRecord。 + +**变更影响** + +接口getPermissionUsedRecords,在4.0.3.3版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + function getPermissionUsedRecords + +- 变更前: + + ```ts + function getPermissionUsedRecords + ``` + +- 变更后: + + ```ts + function getPermissionUsedRecord + ``` + +**适配指导** + +请使用getPermissionUsedRecord替换getPermissionUsedRecords \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-account_os_account.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-account_os_account.md new file mode 100644 index 0000000000000000000000000000000000000000..909a37513e0f413ac2596960e4883cc17f9888e6 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-account_os_account.md @@ -0,0 +1,408 @@ +# 帐号子系统ChangeLog + +## cl.account_os_account.1 分布式帐号昵称和头像规格扩大 + +已有分布式帐号的昵称长度和头像大小的规格过小,无法满足其他昵称较长、头像较大的使用场景。 + +因此,将分布式帐号昵称长度和头像大小的规格扩大。 + +**变更影响** + +该接口变更前向兼容,基于此前版本开发的应用可按照最新规格使用该接口,原有逻辑不受影响。 + +**关键接口/组件变更** + +变更前: + - 昵称长度限制为20个字符,头像大小限制为3M + +变更后: + - 昵称长度限制为1024个字符,头像大小限制为10M + + +## cl.account_os_account.2 应用帐号isAccountRemovable命名变更 + +类Authenticator中的成员函数isAccountRemovable由于命名不统一问题,名称变更为checkAccountRemovable。 + +**变更影响** + +类Authenticator中的成员函数isAccountRemovable,在4.0.3.2版本及后续版本中无法继续正常使用,由checkAccountRemovable代替。 + +**关键的接口/组件变更** + +- 涉及接口 + ```ts + class Authenticator { + ... + isAccountRemovable + ... + } + ``` +- 变更前: + + ```ts + class Authenticator { + ... + /** + * Checks whether the specified account can be removed. + * @param name Indicates the account name. + * @param callback Indicates the authenticator callback. + * @returns void. + * @since 9 + */ + isAccountRemovable(name: string, callback: AuthCallback): void; + ... + } + ``` + +- 变更后: + + ```ts + class Authenticator { + ... + /** + * Checks whether the specified account can be removed. + * @param name Indicates the account name. + * @param callback Indicates the authenticator callback. + * @returns void. + * @since 9 + */ + checkAccountRemovable(name: string, callback: AuthCallback): void; + ... + } + ``` + +## cl.account_os_account.3 系统帐号checkConstraintEnabled命名变更 + +checkConstraintEnabled由于命名不统一问题,名称变更为checkOsAccountConstraintEnabled。 + +**变更影响** + +checkConstraintEnabled接口,在4.0.3.2版本及后续版本中无法继续正常使用,由checkOsAccountConstraintEnabled代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + checkConstraintEnabled + ... +} +``` + +- 变更前: + + ```ts + checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; + checkConstraintEnabled(localId: number, constraint: string): Promise; + ``` + +- 变更后: + + ```ts + checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; + checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; + ``` + +## cl.account_os_account.4 系统帐号checkOsAccountConstraintEnabled权限场景变更 + +checkOsAccountConstraintEnabled接口的权限管控新增可选权限:ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS。 + +**变更影响** + +在4.0.3.2版本及后续版本中,应用申请ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS权限亦可调用checkOsAccountConstraintEnabled, +切此前版本申请ohos.permission.MANAGE_LOCAL_ACCOUNTS权限的不影响使用 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + checkOsAccountConstraintEnabled + ... +} +``` + +- 变更前: + + ```ts + ... + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS + ... + checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; + checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; + ``` + +- 变更后: + + ```ts + ... + * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS + ... + checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void; + checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise; + ``` + +## cl.account_os_account.5 系统帐号queryOsAccountLocalIdFromProcessd命名变更 + +queryOsAccountLocalIdFromProcess由于命名不统一问题,名称变更为getOsAccountLocalId。 + +**变更影响** + +queryOsAccountLocalIdFromProcess接口,在4.0.3.2版本及后续版本中无法继续正常使用,由getOsAccountLocalId代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + queryOsAccountLocalIdFromProcess + ... +} +``` +- 变更前: + + ```ts + queryOsAccountLocalIdFromProcess(callback: AsyncCallback): void; + queryOsAccountLocalIdFromProcess(): Promise; + ``` + +- 变更后: + + ```ts + getOsAccountLocalId(callback: AsyncCallback): void; + getOsAccountLocalId(): Promise; + ``` + +## cl.account_os_account.6 系统帐号queryOsAccountLocalIdFromUid命名变更 + +queryOsAccountLocalIdFromUid由于命名不统一问题,名称变更为getOsAccountLocalIdForUid。 + +**变更影响** + +queryOsAccountLocalIdFromUid接口,在4.0.3.2版本及后续版本中无法继续正常使用,由getOsAccountLocalIdForUid代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + queryOsAccountLocalIdFromUid + ... +} +``` + +- 变更前: + + ```ts + queryOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback): void; + queryOsAccountLocalIdFromUid(uid: number): Promise; + ``` + +- 变更后: + + ```ts + getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback): void; + getOsAccountLocalIdForUid(uid: number): Promise; + ``` + +## cl.account_os_account.7 系统帐号queryOsAccountLocalIdFromDomain命名变更 + +queryOsAccountLocalIdFromDomain由于命名不统一问题,名称变更为getOsAccountLocalIdForDomain。 + +**变更影响** + +queryOsAccountLocalIdFromDomain接口,在4.0.3.2版本及后续版本中无法继续正常使用,由getOsAccountLocalIdForDomain代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + queryOsAccountLocalIdFromDomain + ... +} +``` + +- 变更前: + + ```ts + queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void; + queryOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise; + ``` + +- 变更后: + + ```ts + getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback): void; + getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise; + ``` + +## cl.account_os_account.8 系统帐号getActivatedOsAccountIds命名变更 + +getActivatedOsAccountIds由于命名不统一问题,名称变更为getActivatedOsAccountLocalIds。 + +**变更影响** + +getActivatedOsAccountIds接口,在4.0.3.2版本及后续版本中无法继续正常使用,由getActivatedOsAccountLocalIds代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + getActivatedOsAccountIds + ... +} +``` + +- 变更前: + + ```ts + getActivatedOsAccountIds(callback: AsyncCallback>): void; + getActivatedOsAccountIds(): Promise>; + ``` + +- 变更后: + + ```ts + getActivatedOsAccountLocalIds(callback: AsyncCallback>): void; + getActivatedOsAccountLocalIds(): Promise>; + ``` + +## cl.account_os_account.9 系统帐号queryOsAccountLocalIdBySerialNumber命名变更 + +queryOsAccountLocalIdBySerialNumber由于命名不统一问题,名称变更为getOsAccountLocalIdForSerialNumber。 + +**变更影响** + +queryOsAccountLocalIdBySerialNumber接口,在4.0.3.2版本及后续版本中无法继续正常使用,由getOsAccountLocalIdForSerialNumber代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + queryOsAccountLocalIdBySerialNumber + ... +} +``` + +- 变更前: + + ```ts + queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback): void; + queryOsAccountLocalIdBySerialNumber(serialNumber: number): Promise; + ``` + +- 变更后: + + ```ts + getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback): void; + getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise; + ``` + +## cl.account_os_account.10 系统帐号querySerialNumberByOsAccountLocalId命名变更 + +querySerialNumberByOsAccountLocalId由于命名不统一问题,名称变更为getSerialNumberForOsAccountLocalId。 + +**变更影响** + +querySerialNumberByOsAccountLocalId接口,在4.0.3.2版本及后续版本中无法继续正常使用,由getSerialNumberForOsAccountLocalId代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + querySerialNumberByOsAccountLocalId + ... +} +``` + +- 变更前: + + ```ts + querySerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback): void; + querySerialNumberByOsAccountLocalId(localId: number): Promise; + ``` + +- 变更后: + + ```ts + getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback): void; + getSerialNumberForOsAccountLocalId(localId: number): Promise; + ``` + +## cl.account_os_account.11 系统帐号getBundleIdFromUid命名变更 + +getBundleIdFromUid由于命名不统一问题,名称变更为getBundleIdForUid。 + +**变更影响** + +getBundleIdFromUid接口,在4.0.3.2版本及后续版本中无法继续正常使用,由getBundleIdForUid代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + getBundleIdFromUid + ... +} +``` + +- 变更前: + + ```ts + getBundleIdFromUid(uid: number, callback: AsyncCallback): void; + getBundleIdFromUid(uid: number): Promise; + ``` + +- 变更后: + + ```ts + getBundleIdForUid(uid: number, callback: AsyncCallback): void; + getBundleIdForUid(uid: number): Promise; + ``` + +## cl.account_os_account.12 系统帐号queryOsAccountConstraintSourceTypes命名变更 + +queryOsAccountConstraintSourceTypes由于命名不统一问题,名称变更为getOsAccountConstraintSourceTypes。 + +**变更影响** + +queryOsAccountConstraintSourceTypes接口,在4.0.3.2版本及后续版本中无法继续正常使用,由getOsAccountConstraintSourceTypes代替。 + +**关键的接口/组件变更** + +- 涉及接口 +``` +interface AccountManager { + ... + queryOsAccountConstraintSourceTypes + ... +} +``` + +- 变更前: + + ```ts + queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback>): void; + queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>; + ``` + +- 变更后: + + ```ts + getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback>): void; + getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise>; + ``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ans.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ans.md new file mode 100644 index 0000000000000000000000000000000000000000..b508759665a64bca8e6f723ea81a1c316dc99ca0 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ans.md @@ -0,0 +1,21 @@ +# ANS通知子系统ChangeLog + +## cl.notificationManager.1 接口名变更 + +基于此前接口名定义不够规范,与其他功能类型的接口命名不一致,对此接口名进行变更。 + +**变更影响** + +底层仍支持原接口功能,不影响4.0.2.3版本调用该接口的应用。 + +**关键接口/组件变更** + +| 包名 | 旧接口 | 新接口 | +| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(callback: AsyncCallback): **void**; | **function** isSupportDoNotDisturbMode(callback: AsyncCallback): **void**; | +| ohos.notificationManager.d.ts | **function** supportDoNotDisturbMode(): Promise; | **function** isSupportDoNotDisturbMode(): Promise; | + +**适配指导** + +按新的接口isSupportDoNotDisturbMode调用。 + diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkcompiler.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkcompiler.md new file mode 100644 index 0000000000000000000000000000000000000000..50d6e6dd99a079fec1bcdd4d018d0aaacbead2a4 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkcompiler.md @@ -0,0 +1,165 @@ +# 语言编译运行时子系统ChangeLog +## cl.arkcompiler.1 LLVM新增告警及已有告警增强 + +**变更影响** + +OpenHarmony NDK默认不开启-Werror选项,对于已经开启-Werror选项的开发者,建议基于告警检查提示修改错误业务代码或屏蔽 + + **关键的编译检查规则变更** + +| 新增检查选项 | 作用 | 修改建议 | +| --- | --- | --- | +| Wunused-but-set-variable | 当代码中有未使用的变量时(包含++操作符)提出告警 | 定义变量时添加"maybe_unused"属性或者使用宏区分 | +| Wdeprecated-non-prototype | 当代码中存在没有原型的函数时提出告警 | 添加函数原型并明确参数 | +| Wunqualified-std-cast-call | 当代码中错误使用std::move等时提出告警 | 明确移动语义的使用场景并检查代码 | +| Wdeprecated-builtins | 当代码中使用了废弃的内置函数时提出告警 | 替换使用新版函数 | +| Warray-parameter | 当函数参数中包含数组并且重复定义了不一致的形式时提出告警 | 确认函数参数的一致性 | +| Wbitwise-instead-of-logical | 当在布尔运算中使用按位或时提出告警 | 更新代码在布尔运算中使用逻辑或 | +| Wint-conversion | 当代码中出现int变量转换为指针时提出告警 | 更新代码替换使用新的实现方式 | +| Wdeprecated-declarations | 当代码中使用了废弃的定义(包含函数和变量等)时提出告警 | 更新代码替换使用新的实现方式 | +| Wnull-pointer-subtraction | 当代码中出现空指针减法时提出告警 | 更新代码避免空指针参与减法运算 | +| Wunused-but-set-parameter | 当函数中出现未使用的参数时提出告警 | 更新代码去掉未使用的参数 | +| Warray-bounds | 当代码中出现对数组的越界访问时提出告警 | 检查代码并修改越界访问 | +| Wdeprecated-pragma | 当代码中使用了废弃的宏时提出告警 | 更新代码避免使用废弃的宏 | +| Wreserved-identifier | 当代码中使用了"__"开头的变量时提出告警 | 检查代码避免"__"开头的变量被外部使用 | + + **适配指导** + +1. 对于用户代码中存在的LLVM-12未检测出来的问题,需要用户检查并更新代码。 +2. LLVM更新废弃了一些旧的实现,需要用户代码适配并更新代码。 +3. 开发者评估暂时规避的告警,可采用-Wno-xxx选项规避该error。 + +问题代码实例 + +``` +void Heap::Resume(TriggerGCType gcType) +{ + if (mode_ != HeapMode::SPAWN && + activeSemiSpace_->AdjustCapacity(inactiveSemiSpace_->GetAllocatedSizeSinceGC())) { + // if activeSpace capacity changes, oldSpace maximumCapacity should change, too. + size_t multiple = 2; + // oldSpaceMaxLimit被赋值了但未被使用 + size_t oldSpaceMaxLimit = 0; + if (activeSemiSpace_->GetInitialCapacity() >= inactiveSemiSpace_->GetInitialCapacity()) { + size_t delta = activeSemiSpace_->GetInitialCapacity() - inactiveSemiSpace_->GetInitialCapacity(); + oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() - delta * multiple; + } else { + size_t delta = inactiveSemiSpace_->GetInitialCapacity() - activeSemiSpace_->GetInitialCapacity(); + oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() + delta * multiple; + } + inactiveSemiSpace_->SetInitialCapacity(activeSemiSpace_->GetInitialCapacity()); + } + // irrelated code ... +} +``` + +oldSpaceMaxLimit变量并未使用,编译器提出告警 + +``` +../../arkcompiler/ets_runtime/ecmascript/mem/heap.cpp:247:16: error: variable 'oldSpaceMaxLimit' set but not used [-Werror,-Wunused-but-set-variable] + size_t oldSpaceMaxLimit = 0; +``` + +添加属性后解决 + +``` +void Heap::Resume(TriggerGCType gcType) +{ + if (mode_ != HeapMode::SPAWN && + activeSemiSpace_->AdjustCapacity(inactiveSemiSpace_->GetAllocatedSizeSinceGC())) { + // if activeSpace capacity changes, oldSpace maximumCapacity should change, too. + size_t multiple = 2; + // 添加maybe_unused属性,声明不一定使用变量oldSpaceMaxLimit + [[maybe_unused]] size_t oldSpaceMaxLimit = 0; + if (activeSemiSpace_->GetInitialCapacity() >= inactiveSemiSpace_->GetInitialCapacity()) { + size_t delta = activeSemiSpace_->GetInitialCapacity() - inactiveSemiSpace_->GetInitialCapacity(); + oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() - delta * multiple; + } else { + size_t delta = inactiveSemiSpace_->GetInitialCapacity() - activeSemiSpace_->GetInitialCapacity(); + oldSpaceMaxLimit = oldSpace_->GetMaximumCapacity() + delta * multiple; + } + inactiveSemiSpace_->SetInitialCapacity(activeSemiSpace_->GetInitialCapacity()); + } + // irrelated code ... +} +``` + +## cl.arkcompiler.2 LLVM解析格式差异 + + **变更影响** + +对于业务依赖version-script或-gcc-toolchain选项的开发者,在沿用LLVM12配置文件或选项时,可能会解析失败 + + **关键的编译规则变更** + +1. 新版本中修改了符号的表示,现在连续的">"会被编译器表示为">>",这个在旧版本中会被表示为"> >",错误使用将导致符号不被解析匹配 +2. 废弃-xx选项,如-gcc-toolchain选项,改用--gcc-toolchain选项(该选项在clang3.4以后的版本已表示会弃用,LLVM15上正式废弃) + + **适配指导** + +version-script使用方法可以参考 + +适配实例 + +对于代码中出现连续两个“>”(忽略中间空格数量),在version-script中(由于 mangling差异)会被分别解析为如下"> >"与">>"两种情况,在15中我们需要使用">>" + +原始配置文件 + +``` +{ + global: + extern "C++" { + "google::protobuf::TextFormat::ParseFromString(std::__cxx11::basic_string, std::allocator > const&, google::protobuf::Message*)"; + // LLVM12 "> >"可以被解析,但">>"不行 + "google::protobuf::TextFormat::PrintToString(google::protobuf::Message const&, std::__cxx11::basic_string, std::allocator >*)"; + }; + local: + *; +} +``` + +修改后的配置文件 + +``` +{ + global: + extern "C++" { + "google::protobuf::TextFormat::ParseFromString(std::__cxx11::basic_string, std::allocator> const&, google::protobuf::Message*)"; + // LLVM15 只会解析">>" + "google::protobuf::TextFormat::PrintToString(google::protobuf::Message const&, std::__cxx11::basic_string, std::allocator>*)"; + }; + local: + *; +} +``` + +## cl.arkcompiler.3 LLVM emu-tls变更 + + **变更影响** + +对于LLVM12/LLVM15工具链混用的开发者(禁止行为),会产生libc++.so emu-tls符号无法找到的问题 + + **关键的库依赖变更** + +LLVM15中将emu-tls符号从目标二进制抽取到了libc++.so中,即__emutls_get_address的属性从内部符号变为外部可见的符号(libc++.so中会包含该符号),可能会导致编译出来的动态库依赖libc++.so。 + + **适配指导** + +该符号同时也在libclang_rt.builtin.a中,如果不希望依赖libc++.so可以静态链接libclang_rt.builtin.a库。 + +## cl.arkcompiler.4 LLVM官方release note + + **变更影响** + +新增特性及内部接口变更(如LLVM内部的IR,编译器前端修改),详见官方变更文档 + + **关键变更文档** + +https://releases.llvm.org/13.0.0/docs/ReleaseNotes.html +https://releases.llvm.org/14.0.0/docs/ReleaseNotes.html +https://releases.llvm.org/15.0.0/docs/ReleaseNotes.html + + **适配指导** + +详细修改信息以及适配指导见官方文档 + diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkui.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkui.md new file mode 100644 index 0000000000000000000000000000000000000000..b6cc271b246f65064f2f6efec6bca8d4995a7c18 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkui.md @@ -0,0 +1,516 @@ +# arkui子系统ChangeLog + +## cl.arkui.1 状态变量数据类型声明使用限制。 + +1. 所有的状态装饰器变量需要显式声明变量类型,不允许声明any,不支持Date数据类型。 + + 示例: + + ```ts + // xxx.ets + @Entry + @Component + struct DatePickerExample { + // 错误写法: @State isLunar: any = false + @State isLunar: boolean = false + // 错误写法: @State selectedDate: Date = new Date('2021-08-08') + private selectedDate: Date = new Date('2021-08-08') + + build() { + Column() { + Button('切换公历农历') + .margin({ top: 30 }) + .onClick(() => { + this.isLunar = !this.isLunar + }) + DatePicker({ + start: new Date('1970-1-1'), + end: new Date('2100-1-1'), + selected: this.selectedDate + }) + .lunar(this.isLunar) + .onChange((value: DatePickerResult) => { + this.selectedDate.setFullYear(value.year, value.month, value.day) + console.info('select current date is: ' + JSON.stringify(value)) + }) + + }.width('100%') + } + } + ``` + + ![datePicker](../../../application-dev/reference/arkui-ts/figures/datePicker.gif) + +2. @State、@Provide、 @Link和@Consume四种状态变量的数据类型声明只能由简单数据类型或引用数据类型的其中一种构成。 + + 类型定义中的Length、ResourceStr、ResourceColor三个类型是简单数据类型或引用数据类型的组合,所以不能被以上四种状态装饰器变量使用。 + Length、ResourceStr、ResourceColor的定义请看文档[arkui-ts类型定义](../../../application-dev/reference/arkui-ts/ts-types.md)。 + + 示例: + + ```ts + // xxx.ets + @Entry + @Component + struct IndexPage { + // 错误写法: @State message: string | Resource = 'Hello World' + @State message: string = 'Hello World' + // 错误写法: @State message: ResourceStr = $r('app.string.hello') + @State resourceStr: Resource = $r('app.string.hello') + + build() { + Row() { + Column() { + Text(`${this.message}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + } + .height('100%') + } + } + ``` + + ![hello](../../../application-dev/quick-start/figures/hello.PNG) + +**变更影响** + +1. 如果状态装饰器变量没有显式声明变量类型,声明any,编译拦截报错; + ```ts + // ArkTS:ERROR Please define an explicit type, not any. + @State isLunar: any = false + ``` +2. 状态装饰器变量声明变量类型为Date,编译拦截报错; + ```ts + // ArkTS:ERROR The @State property 'selectedDate' cannot be a 'Date' object. + @State selectedDate: Date = new Date('2021-08-08') + ``` +3. @State、@Provide、 @Link和@Consume四种状态变量使用框架提供的Length、ResourceStr、ResourceColor, + 编译拦截报错。 + ```ts + /* ArkTS:ERROR The state variable type here is 'ResourceStr', it contains both a simple type and an object type, + which are not allowed to be defined for state variable of a struct.*/ + @State message: ResourceStr = $r('app.string.hello') + ``` + +**关键的接口/组件变更** + +不涉及。 + +**适配指导** + +1. 状态装饰器变量声明具体的变量类型替代any; +2. 使用Date对象的状态装饰器变量,修改为不加状态装饰器修饰的常规变量; +3. 因为Length(string|number|Resource), ResourceStr(string|Resource), ResourceColor(string|number|Color|Resource) + 的三个类型是简单数据类型或引用数据类型的组合,使用@State、@Provide、 @Link和@Consume四种状态变量场景参考以下修改: + ```ts + // 错误写法: + @State message: ResourceStr = $r('app.string.hello') + // 修正后的写法: + @State resourceStr: Resource = $r('app.string.hello') + ``` + +## cl.arkui.2 自定义组件成员变量初始化的规则与约束。 + +通过构造函数方法初始化成员变量,需要遵循如下规则: + +| **从父组件中的变量(右)到子组件中的变量(下)** | **regular** | **@State** | **@Link** | **@Prop** | **@Provide** | **@Consume** | **@ObjectLink** | +| -------------------------- | ----------- | ---------- | --------- | --------- | ------------ | ------------ | --------------- | +| **regular** | 支持 | 支持 | 支持 | 支持 | 不支持 | 不支持 | 支持 | +| **@State** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | +| **@Link** | 不支持 | 支持(1) | 支持(1) | 支持(1) | 支持(1) | 支持(1) | 支持(1) | +| **@Prop** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | +| **@Provide** | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | 支持 | +| **@Consume** | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | +| **@ObjectLink** | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | 不支持 | + +| **从父组件中的变量(右)到子组件中的变量(下)** | **@StorageLink** | **@StorageProp** | **@LocalStorageLink** | **@LocalStorageProp** | +| -------------------------- | ---------------- | ---------------- | --------------------- | --------------------- | +| **regular** | 支持 | 不支持 | 不支持 | 不支持 | +| **@State** | 支持 | 支持 | 支持 | 支持 | +| **@Link** | 支持(1) | 支持(1) | 支持(1) | 支持(1) | +| **@Prop** | 支持 | 支持 | 支持 | 支持 | +| **@Provide** | 支持 | 支持 | 支持 | 支持 | +| **@Consume** | 不支持 | 不支持 | 不支持 | 不支持 | +| **@ObjectLink** | 不支持 | 不支持 | 不支持 | 不支持 | + +> **说明** +> +> **支持(1)**:必须使用`$`, 例如 `this.$varA`。 +> **regular**:未加修饰的常规变量。 + +不允许从父组件初始化`@StorageLink`, `@StorageProp`, `@LocalStorageLink`, `@LocalStorageProp`修饰的变量。 + +**变更影响** + +1. 不允许从父组件初始化`@LocalStorageLink`, `@LocalStorageProp`修饰的变量。 + ```ts + @Entry + @Component + struct LocalStorageComponent { + build() { + Column() { + Child({ + /* ArkTS:ERROR Property 'simpleVarName' in the custom component 'Child' cannot + initialize here (forbidden to specify). */ + simpleVarName: 1, + /* ArkTS:ERROR Property 'objectName' in the custom component 'Child' cannot + initialize here (forbidden to specify). */ + objectName: new ClassA("x") + }) + } + } + } + @Component + struct Child { + @LocalStorageLink("storageSimpleProp") simpleVarName: number = 0; + @LocalStorageProp("storageObjectProp") objectName: ClassA = new ClassA("x"); + build() {} + } + ``` +2. 子组件的@ObjectLink变量不支持父组件装饰器变量的直接赋值,其父组件的源必须是数组的项或对象的属性,该数组或对象必现用`@State`、`@Link`、`@Provide`、`@Consume`或`@ObjectLink`装饰器修饰。 + ```ts + let NextID : number = 0; + + @Observed class ClassA { + public id : number; + public c: number; + constructor(c: number) { + this.id = NextID++; + this.c = c; + } + } + + @Component + struct Child { + @ObjectLink varA : ClassA; + build() { + Row() { + Text('ViewA-' + this.varA.id) + } + } + } + + @Component + struct Parent { + @Link linkValue: ClassA + build() { + Column() { + /* ArkTS:ERROR The @Link property 'linkValue' cannot be assigned to + the @ObjectLink property 'varA'.*/ + Child({ varA: this.linkValue }) + } + } + } + ``` + +**关键的接口/组件变更** + +不涉及。 + +**适配指导** +1. 构造子组件时,不对子组件的`@LocalStorageLink`, `@LocalStorageProp`修饰的变量进行。 + 如果需要在父组件中修改子组件的`@LocalStorageLink`, `@LocalStorageProp`修饰的变量,则使用LocalStorage提供的API接口方法(比如set方法)赋值。 +2. @ObjectLink的使用指导请参考文档[@ObjectLink使用指导](../../../application-dev/quick-start/arkts-observed-and-objectlink.md)。 + +## cl.arkui.3 List组件和Scroll组件onScrollBegin事件变更 + +List组件和Scroll组件onScrollBegin事件更名为onScrollFrameBegin事件,onScrollBegin事件中dx和dy参数分别表示X轴和Y轴方向滚动偏移量,更变为onScrollFrameBegin事件后使用offset参数表示滚动偏移量。onScrollFrameBegin事件新增ScrollState参数,用于表示当前时手指拖动滑动状态还是惯性滑动状态。 + +**变更影响** + +onScrollBegin事件不能再使用,需要使用onScrollFrameBegin事件。 + +**关键接口/组件变更** + +| 旧事件定义 | 新事件定义 | +| ---------------------------------------- | ---------------------------------------- | +| onScrollBegin(event: (dx: number, dy: number) => { dxRemain: number, dyRemain: number }) | onScrollFrameBegin(event: (offset: number, state: ScrollState) => { offsetRemain: number }) | + +onScrollFrameBegin事件说明参考API接口文档: +- [Scroll组件事件](../../../application-dev/reference/arkui-ts/ts-container-scroll.md#事件) +- [List组件事件](../../../application-dev/reference/arkui-ts/ts-container-list.md#事件) + +**适配指导** + +onScrollBegin改成使用onScrollFrameBegin事件,onScrollBegin事件的dx/dy参数改成onScrollFrameBegin事件的offset参数。原本需要更滚动组件的滚动轴来确定是使用dx还dy参数,使用onScrollFrameBegin事件后,只需要直接使用offset参数。 + +onScrollBegin事件典型使用示例: +```ts +@Entry +@Component +struct NestedScroll { + @State listPosition: number = 0; // 0代表滚动到List顶部,1代表中间值,2代表滚动到List底部。 + private arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + Text("Scroll Area") + .width("100%").height("40%").backgroundColor(0X330000FF) + .fontSize(16).textAlign(TextAlign.Center) + .onClick(() => { + this.scrollerForList.scrollToIndex(5) + }) + + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item) => { + ListItem() { + Text("ListItem" + item) + .width("100%").height("100%").borderRadius(15) + .fontSize(16).textAlign(TextAlign.Center).backgroundColor(Color.White) + }.width("100%").height(100) + }, item => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.None) + .onReachStart(() => { + this.listPosition = 0 + }) + .onReachEnd(() => { + this.listPosition = 2 + }) + .onScrollBegin((dx: number, dy: number) => { + if ((this.listPosition == 0 && dy >= 0) || (this.listPosition == 2 && dy <= 0)) { + this.scrollerForScroll.scrollBy(0, -dy) + return { dxRemain: dx, dyRemain: 0 } + } + this.listPosition = 1 + return { dxRemain: dx, dyRemain: dy }; + }) + + Text("Scroll Area") + .width("100%").height("40%").backgroundColor(0X330000FF) + .fontSize(16).textAlign(TextAlign.Center) + } + } + .width("100%").height("100%") + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} +``` +改成onScrollFrameBegin事件参考代码如下: +```ts +@Entry +@Component +struct NestedScroll { + @State listPosition: number = 0; // 0代表滚动到List顶部,1代表中间值,2代表滚动到List底部。 + private arr: number[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + private scrollerForScroll: Scroller = new Scroller() + private scrollerForList: Scroller = new Scroller() + + build() { + Flex() { + Scroll(this.scrollerForScroll) { + Column() { + Text("Scroll Area") + .width("100%").height("40%").backgroundColor(0X330000FF) + .fontSize(16).textAlign(TextAlign.Center) + .onClick(() => { + this.scrollerForList.scrollToIndex(5) + }) + + List({ space: 20, scroller: this.scrollerForList }) { + ForEach(this.arr, (item) => { + ListItem() { + Text("ListItem" + item) + .width("100%").height("100%").borderRadius(15) + .fontSize(16).textAlign(TextAlign.Center).backgroundColor(Color.White) + }.width("100%").height(100) + }, item => item) + } + .width("100%") + .height("50%") + .edgeEffect(EdgeEffect.None) + .onReachStart(() => { + this.listPosition = 0 + }) + .onReachEnd(() => { + this.listPosition = 2 + }) + .onScrollFrameBegin((offset: number, state: ScrollState) => { + if ((this.listPosition == 0 && offset >= 0) || (this.listPosition == 2 && offset <= 0)) { + this.scrollerForScroll.scrollBy(0, -offset) + return { offsetRemain: 0 } + } + this.listPosition = 1 + return { offsetRemain: offset }; + }) + + Text("Scroll Area") + .width("100%").height("40%").backgroundColor(0X330000FF) + .fontSize(16).textAlign(TextAlign.Center) + } + } + .width("100%").height("100%") + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding(20) + } +} +``` + + +## cl.arkui.4 getInspectorTree接口返回值从string修改为Object。 + +**变更影响** + +4.0.3.2之前使用getInspectorTree接口的代码需要适配 + +**关键的接口/组件变更** + +getInspectorTree接口返回值从string修改为Object + +**适配指导** + +将getInspectorTree返回值作为string使用的代码需要修改,比如以下示例代码: + +```typescript +console.info(getInspectorTree()) +``` + +需要修改成 + +```typescript +console.info(JSON.stringify(getInspectorTree())) +``` + +## cl.arkui.5 废弃GridItem的forceRebuild属性 + +**变更影响** + +无,该属性无作用 + +**关键的接口/组件变更** + +GridItem的forceRebuild属性废弃 + +**适配指导** + +如有使用可以直接删除,不影响GridItem功能 + + +## cl.arkui.6 API9 router接口整改。 + +ohos.router中的enableAlertBeforeBackPage、enableBackPageAlert、disableAlertBeforeBackPage接口名不利于开发者理解,更改为showAlertBeforeBackPage、hideAlertBeforeBackPage。 + +**变更影响** + +router的enableAlertBeforeBackPage、enableBackPageAlert接口需替换为showAlertBeforeBackPage; + +disableAlertBeforeBackPage接口需替换为hideAlertBeforeBackPage。 + +**关键的接口/组件变更** + +涉及router.enableAlertBeforeBackPage, router.enableBackPageAlert, router.disableAlertBeforeBackPage。 + +* 变更前: + +```ts +router.enableAlertBeforeBackPage(); +router.enableBackPageAlert() +``` + +* 变更后: + +```ts +router.showAlertBeforeBackPage() +``` + +* 变更前: + +```ts +router.disableAlertBeforeBackPage() +``` + +* 变更后: + +```ts +router.hideAlertBeforeBackPage() +``` + +**适配指导** + +将enableAlertBeforeBackPage、enableBackPageAlert替换为showAlertBeforeBackPage; + +将disableAlertBeforeBackPage替换为hideAlertBeforeBackPage。 + + +## cl.arkui.7 List组件和Gird组件滚动条默认状态变更 + +List组件和Gird组件滚动条默认状态从BarState.Off变更为BarState.Auto。 + +**变更影响** + +List组件和Gird组件,如果没有设置滚动条状态,变更前不会显示滚动条,变更以后滚动时会显示滚动条,滚动停止两秒后滚动条隐藏。 + +**关键接口/组件变更** + +List组件和Gird组件滚动条API接口文档: +- [List组件属性](../../../application-dev/reference/arkui-ts/ts-container-list.md#属性) +- [Grid组件属性](../../../application-dev/reference/arkui-ts/ts-container-grid.md#属性) + +**适配指导** + +对于不需要滚动条的场景,需要将List组件或Grid组件的scrollBar属性设置为BarState.Off。 + +参考代码如下: +```ts +// xxx.ets +@Entry +@Component +struct ListItemExample { + private arr: number[] = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + + build() { + Column() { + List({ space: 20, initialIndex: 0 }) { + ForEach(this.arr, (item) => { + ListItem() { + Text('' + item) + .width('100%').height(100).fontSize(16) + .textAlign(TextAlign.Center).borderRadius(10).backgroundColor(0xFFFFFF) + } + }, item => item) + } + .width('90%') + .scrollBar(BarState.Off) + }.width('100%').height('100%').backgroundColor(0xDCDCDC).padding({ top: 5 }) + } +} +``` + +## cl.arkui.8 修复Stack布局问题 + +修复问题:[Stack](../../../application-dev/reference/arkui-ts/ts-container-stack.md)设置alignContent,在子组件超出父组件的场景中,子组件未按照alignContent布局 +示例: +```ts +@Entry +@Component +struct StackExample { + build() { + Stack({alignContent:Alignment.TopEnd}){ + Text('First child, show in bottom') + .width(200).height(200).backgroundColor(0xd2cab3).margin(10) + }.width(150).height(150).backgroundColor(Color.Pink).margin(100) + } +} +``` +修复前:子组件未能按照alignContent:Alignment.TopEnd布局 +![stack](figures/stack_before.jpg) + +修复后:子组件可以按照alignContent:Alignment.TopEnd布局 +![stack](figures/stack_after.jpg) + + +**变更影响** + +1. 如果应用中有子组件大小大于父组件Stack的场景,需要应用进行适配。 +2. 应用之前可能采用的规避方案:给子组件设置Offset或者translate + +**适配指导** + + 去掉之前给子组件设置的Offset或者translate,使用alignContent实际布局方式进行布局。 \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bluetooth.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bluetooth.md new file mode 100644 index 0000000000000000000000000000000000000000..d90c795ae5ea074f17f119f09357484352d537b4 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bluetooth.md @@ -0,0 +1,173 @@ +# 蓝牙服务子系统ChangeLog + +## cl.bluetooth.1 接口迁移到新增的@ohos.bluetoothManager.d.ts + +@ohos.bluetooth.d.ts接口不支持抛出错误码,而API9以及SystemAPI都需要支持错误码抛出,为了支持该功能,把@ohos.bluetooth.d.ts中所有接口,迁移到新增的@ohos.bluetoothManager.d.ts中,并增加错误码描述。 + +后续需要import @ohos.bluetoothManager才能使用蓝牙服务的接口: + + ```ts + import bluetoothManager from '@ohos.bluetoothManager'; + ``` + + +**变更影响** + +对API9以及SystemAPI接口的使用有影响,需要import @ohos.bluetoothManager来使用抛错误码的接口: + + ```ts + import bluetoothManager from '@ohos.bluetoothManager'; + ``` + +**关键的接口/组件变更** + +| 类名 | 旧接口 | 新接口 | 变更类型 | +| -- | -- | -- | -- | +| bluetooth | function getState(): BluetoothState | function getState(): BluetoothState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | method | function getBtConnectionState(): ProfileConnectionState; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function pairDevice(deviceId: string): boolean | function pairDevice(deviceId: string): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function cancelPairedDevice(deviceId: string): boolean | function cancelPairedDevice(deviceId: string): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function getRemoteDeviceName(deviceId: string): string | function getRemoteDeviceName(deviceId: string): string| API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function getRemoteDeviceClass(deviceId: string): DeviceClass | function getRemoteDeviceClass(deviceId: string): DeviceClass | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function enableBluetooth(): boolean | function enableBluetooth(): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function disableBluetooth(): boolean | function disableBluetooth(): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function getLocalName(): string | function getLocalName(): string | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function getPairedDevices(): Array<string>; | function getPairedDevices(): Array<string>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function getProfileConnState(profileId: ProfileId): ProfileConnectionState | function getProfileConnectionState(profileId: ProfileId): ProfileConnectionState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口名修改为getProfileConnectionState | +| bluetooth | function setDevicePairingConfirmation(device: string, accept: boolean): boolean | function setDevicePairingConfirmation(device: string, accept: boolean): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function setLocalName(name: string): boolean; | function setLocalName(name: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function setBluetoothScanMode(mode: ScanMode, duration: number): boolean | function setBluetoothScanMode(mode: ScanMode, duration: number): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function getBluetoothScanMode(): ScanMod | function getBluetoothScanMode(): ScanMode | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function startBluetoothDiscovery(): boolean | function startBluetoothDiscovery(): void | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,新加权限ohos.permission.APPROXIMATELY_LOCATION,接口返回值改为void | +| bluetooth | function stopBluetoothDiscovery(): boolean; | function stopBluetoothDiscovery(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void; | function on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void; | function off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function on(type: "bondStateChange", callback: Callback<BondStateParam>): void; | function on(type: "bondStateChange", callback: Callbackk<BondStateParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void; | function off(type: "bondStateChange", callback?: Callback<BondStateParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void; | function on(type: "pinRequired", callback: Callback<PinRequiredParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void; | function off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function on(type: "stateChange", callback: Callback<BluetoothState>): void; | function on(type: "stateChange", callback: Callback<BluetoothState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function off(type: "stateChange", callback?: Callback<BluetoothState>): void; | function off(type: "stateChange", callback?: Callback<BluetoothState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void; | function sppListen(name: string, option: SppOption, callback: AsyncCallback<number>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; | function sppAccept(serverSocket: number, callback: AsyncCallback<number>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void; | function sppConnect(device: string, option: SppOption, callback: AsyncCallback<number>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function sppCloseServerSocket(socket: number): void; | function sppCloseServerSocket(socket: number): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function sppCloseClientSocket(socket: number): void; | function sppCloseClientSocket(socket: number): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function sppWrite(clientSocket: number, data: ArrayBuffer): boolean; | function sppWrite(clientSocket: number, data: ArrayBuffer): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| bluetooth | function on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void; | function on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts。 | +| bluetooth | function off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void; | function off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile; | function getProfileInstance(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口名修改为getProfileInstance | +| bluetooth | function getProfileInst(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | function getProfileInstance(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile | HidHostProfile | PanProfile; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口名修改为getProfileInstance | +| BaseProfile | getConnectionDevices(): Array<string>; | getConnectionDevices(): Array<string>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| BaseProfile | getDeviceState(device: string): ProfileConnectionState; | getDeviceState(device: string): ProfileConnectionState; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| A2dpSourceProfile | connect(device: string): boolean; | connect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| A2dpSourceProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| A2dpSourceProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| A2dpSourceProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| A2dpSourceProfile | getPlayingState(device: string): PlayingState; | getPlayingState(device: string): PlayingState; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| HandsFreeAudioGatewayProfile | connect(device: string): boolean; | connect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| HandsFreeAudioGatewayProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts ,接口返回值改为void | +| HandsFreeAudioGatewayProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| HandsFreeAudioGatewayProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| HidHostProfile | connect(device: string): boolean; | connect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| HidHostProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| HidHostProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| HidHostProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| PanProfile | disconnect(device: string): boolean; | disconnect(device: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| PanProfile | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | on(type: "connectionStateChange", callback: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| PanProfile | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | off(type: "connectionStateChange", callback?: Callback<StateChangeParam>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| PanProfile | setTethering(enable: boolean): void; | setTethering(enable: boolean): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| PanProfile | isTetheringOn(): boolean; | isTetheringOn(): boolean; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| BLE | function createGattServer(): GattServer; | function createGattServer(): GattServer; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| BLE | function createGattClientDevice(deviceId: string): GattClientDevice; | function createGattClientDevice(deviceId: string): GattClientDevice; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| BLE | function getConnectedBLEDevices(): Array<string>; | function getConnectedBLEDevices(): Array<string>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| BLE | function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void; | function startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,新加权限ohos.permission.APPROXIMATELY_LOCATION | +| BLE | function stopBLEScan(): void; | function stopBLEScan(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| BLE | mefunction on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void;thod | function on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| BLE | function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void; | function off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse?: AdvertiseData): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | stopAdvertising(): void; | stopAdvertising(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | addService(service: GattService): boolean; | addService(service: GattService): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattServer | removeService(serviceUuid: string): boolean; | removeService(serviceUuid: string): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattServer | close(): void; | close(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts +| GattServer | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): boolean; | notifyCharacteristicChanged(deviceId: string, notifyCharacteristic: NotifyCharacteristic): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattServer | sendResponse(serverResponse: ServerResponse): boolean; | sendResponse(serverResponse: ServerResponse): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattServer | on(type: "characteristicRead", callback: Callback<CharacteristicReadReq>): void; | on(type: "characteristicRead", callback: Callback<CharacteristicReadRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | off(type: "characteristicRead", callback?: Callback<CharacteristicReadReq>): void; | off(type: "characteristicRead", callback?: Callback<CharacteristicReadRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | on(type: "characteristicWrite", callback: Callback<CharacteristicWriteReq>): void; | on(type: "characteristicWrite", callback: Callback<CharacteristicWriteRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteReq>): void; | off(type: "characteristicWrite", callback?: Callback<CharacteristicWriteRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | on(type: "descriptorRead", callback: Callback<DescriptorReadReq>): void; | on(type: "descriptorRead", callback: Callback<DescriptorReadRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | off(type: "descriptorRead", callback?: Callback<DescriptorReadReq>): void; | off(type: "descriptorRead", callback?: Callback<DescriptorReadRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | on(type: "descriptorWrite", callback: Callback<DescriptorWriteReq>): void; | on(type: "descriptorWrite", callback: Callback<DescriptorWriteRequest>): void;| API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | off(type: "descriptorWrite", callback?: Callback<DescriptorWriteReq>): void; | off(type: "descriptorWrite", callback?: Callback<DescriptorWriteRequest>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void; | on(type: "connectStateChange", callback: Callback<BLEConnectChangedState>): void;| API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattServer | off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void; | off(type: "connectStateChange", callback?: Callback<BLEConnectChangedState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | connect(): boolean; | connect(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattClientDevice | disconnect(): boolean; | disconnect(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattClientDevice | close(): boolean; | close(): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattClientDevice | getDeviceName(callback: AsyncCallback<string>): void; | getDeviceName(callback: AsyncCallback<string>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | getDeviceName(): Promise<string>; | getDeviceName(): Promise<string>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | getServices(callback: AsyncCallback<Array<GattService>>): void; | getServices(callback: AsyncCallback<Array<GattService>>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | getServices(): Promise<Array<GattService>>; | getServices(): Promise<Array<GattService>>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; | readCharacteristicValue(characteristic: BLECharacteristic, callback: AsyncCallback<BLECharacteristic>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; | readCharacteristicValue(characteristic: BLECharacteristic): Promise<BLECharacteristic>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; | readDescriptorValue(descriptor: BLEDescriptor, callback: AsyncCallback<BLEDescriptor>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; | readDescriptorValue(descriptor: BLEDescriptor): Promise<BLEDescriptor>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | writeCharacteristicValue(characteristic: BLECharacteristic): boolean; | writeCharacteristicValue(characteristic: BLECharacteristic): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattClientDevice | writeDescriptorValue(descriptor: BLEDescriptor): boolean; | writeDescriptorValue(descriptor: BLEDescriptor): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattClientDevice | getRssiValue(callback: AsyncCallback<number>): void; | getRssiValue(callback: AsyncCallback<number>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | getRssiValue(): Promise<number>; | getRssiValue(): Promise<number>; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | setBLEMtuSize(mtu: number): boolean; | setBLEMtuSize(mtu: number): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattClientDevice | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): boolean; | setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolean): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts,接口返回值改为void | +| GattClientDevice | on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void; | on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void; | off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void; | on(type: "BLEConnectionStateChange", callback: Callback<BLEConnectChangedState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| GattClientDevice | off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void; | off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedState>): void; | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | GattService | GattService | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | BLECharacteristic | BLECharacteristic | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | BLEDescriptor | BLEDescriptor | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | NotifyCharacteristic | NotifyCharacteristic | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | CharacteristicReadReq | CharacteristicReadRequest | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | CharacteristicWriteReq | CharacteristicWriteRequest | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | DescriptorReadRe | DescriptorReadRequest | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | DescriptorWriteReq | DescriptorWriteRequest | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ServerResponse | ServerResponse | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | BLEConnectChangedState | BLEConnectChangedState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ScanResult | ScanResult | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | AdvertiseSetting | AdvertiseSetting | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | AdvertiseData | AdvertiseData | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ManufactureData | ManufactureData | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ServiceData | ServiceData | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ScanFilter | ScanFilter | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ScanOptions | ScanOptions | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | SppOption | SppOption | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | PinRequiredParam | PinRequiredParam | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | DeviceClass | DeviceClass | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | BondStateParam | BondStateParam | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | StateChangeParam | StateChangeParam | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ScanDuty | ScanDuty | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | MatchMode | MatchMode | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ProfileConnectionState | ProfileConnectionState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | BluetoothState | BluetoothState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | SppType | SppType | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ScanMode | ScanMode | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | BondState | BondState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | MajorClass | MajorClass | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | MajorMinorClass | MajorMinorClass | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | PlayingState | PlayingState | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | +| bluetooth | ProfileId | ProfileId | API9接口变更,迁移到@ohos.bluetoothManager.d.ts | + + + +**适配指导(可选,不涉及则可以删除)** + +以enableLocation为例,在新版本上需要使用如下方式进行调用: + + ```ts + import bluetoothManager from '@ohos.bluetoothManager'; + try { + var state = bluetoothManager.getState(); + } catch (err) { + console.error("errCode:" + err.code + ",errMessage:" + err.message); + } + ``` diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bundlemanager.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bundlemanager.md new file mode 100644 index 0000000000000000000000000000000000000000..0a77d2515fca906bd26ed30ea366d7670e08c571 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bundlemanager.md @@ -0,0 +1,153 @@ +# 包管理子系统ChangeLog + +## cl.bundlemanager.1 底层能力变更,安装hap时,hap中的文件不再解压到安装目录。 + +安装hap后,安装目录下只会存在hap文件,应用不能再使用拼接路径访问解压后的资源文件,应用想要访问资源文件,需要使用标准的资源管理接口。 + +**变更影响**
+如果应用使用拼接路径的形式访问资源文件,会访问失败。需要修改成使用资源管理接口访问资源文件。 + +**关键的接口/组件变更**
+不涉及接口及组件变更 + +**适配指导**
+资源管理子系统提供Js接口访问资源文件。参考[访问资源文件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md#getrawfilecontent9) + + +## cl.bundlemanager.2 包管理删除@ohos.bundle.bundleManager.d.ts中的getAbilityIcon接口,可以使用@ohos.resourceManager.d.ts中的getMediaContent替换。 + +包管理删除[@ohos.bundle.bundleManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts)中的getAbilityIcon接口,可以使用[@ohos.resourceManager.d.ts](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.resourceManager.d.ts)中的getMediaContent替换。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了getAbilityIcon接口的,需要改为使用getMediaContent接口。 + +**关键的接口/组件变更**
+删除@ohos.bundle.bundleManager.d.ts中的getAbilityIcon接口。 + +**适配指导**
+使用@ohos.bundle.bundleManager.d.ts下面的getAbilityIcon,需要修改为@ohos.resourceManager.d.ts中的getMediaContent。需要提前获取到图标的资源ID值,可参考该接口的[使用指导](../../../application-dev/reference/apis/js-apis-resource-manager.md#getmediacontent9)。 + +## cl.bundlemanager.3 包管理新增202错误码 + +包管理系统新增202错误码,非系统应用调用api9及之后包管理提供的系统api,将返回错误202。 + +**变更影响**
+非系统应用调用api9及之后包管理提供的系统api,将返回错误202。 + +**关键的接口/组件变更**
+所有包管理提供的api9及之后的系统api,非系统应用调用将返回错误202。 + +**适配指导**
+不影响已开发的程序,无需适配。 + + +## cl.bundlemanager.4 包管理底层能力变更,仅支持系统资源HAP自定义权限,其它HAP均不支持自定义权限。 + +仅支持系统资源HAP自定义权限,其它HAP均不支持自定义权限。包管理在解析HAP时,仅支持解析资源HAP(包名为:ohos.global.systemres)的配置文件中的definePermissions字段,该字段用来定义权限。其它HAP中配置的definePermissions字段将不会解析。 +如果有应用需要自定义权限,可以在资源HAP的[配置文件](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json)中definePermissions字段下面新增定义权限。格式可参考[定义权限](../../../application-dev/quick-start/module-structure.md#definepermissions对象内部结构)。 + + +**变更影响**
+升级新版本镜像后,应用自定义的权限将不会生效,使用方在申请该权限时,会授权失败。 + +**关键的接口/组件变更**
+包管理底层能力变更,仅支持系统资源HAP自定义权限,其它HAP均不支持自定义权限。 + +**适配指导**
+如果有应用需要自定义权限,可以在资源HAP的[配置文件](https://gitee.com/openharmony/utils_system_resources/blob/master/systemres/main/config.json)中definePermissions字段下面新增定义权限。格式可参考[定义权限](../../../application-dev/quick-start/module-structure.md#definepermissions对象内部结构)。 + +## cl.bundlemanager.5 包管理二级模块文件名称变更,修改为文件内对应的接口名称 + +包管理二级模块文件名称变更,修改为文件内对应的接口名称,变更文件如下: + +| 原文件名称 |变更后文件名称 | +|----|----| +| bundleManager/abilityInfo.d.ts | bundleManager/AbilityInfo.d.ts | +| bundleManager/applicationInfo.d.ts | bundleManager/ApplicationInfo.d.ts | +| bundleManager/bundleInfo.d.ts | bundleManager/BundleInfo.d.ts | +| bundleManager/dispatchInfo.d.ts | bundleManager/DispatchInfo.d.ts | +| bundleManager/elementName.d.ts | bundleManager/ElementName.d.ts | +| bundleManager/extensionAbilityInfo.d.ts | bundleManager/ExtensionAbilityInfo.d.ts | +| bundleManager/hapModuleInfo.d.ts | bundleManager/HapModuleInfo.d.ts | +| bundleManager/launcherAbilityInfo.d.ts | bundleManager/LauncherAbilityInfo.d.ts | +| bundleManager/metadata.d.ts | bundleManager/Metadata.d.ts | +| bundleManager/packInfo.d.ts | bundleManager/BundlePackInfo.d.ts | +| bundleManager/permissionDef.d.ts | bundleManager/PermissionDef.d.ts | +| bundleManager/remoteAbilityInfo.d.ts | bundleManager/RemoteAbilityInfo.d.ts | +| bundleManager/shortcutInfo.d.ts | bundleManager/ShortcutInfo.d.ts | + +除了免安装相关的BundlePackInfo文件名称增加了Bundle,其余文件名称均是修改为大写开头。 + +**变更影响**
+仅修改二级模块文件名称,不会影响一级模块的使用。在使用之前已发布的API 9各beta版本时,如果在ts文件中直接导入了bundleManager下面二级模块接口的,IDE中编译报错的话,需要修改导入的文件名称。 + +**关键的接口/组件变更**
+变更bundleManager文件夹下面的d.ts名称,修改为文件中的接口名称。 + +**适配指导**
+使用新的sdk后,正常情况下应用无需适配该变更。如果在应用中直接导入了bundleManager文件夹下面的文件,则需要修改导入的文件名称。可以按照如下的修改方式: + +**修改前:** +```ts +import {AbilityInfo} from 'bundleManger/abilityInfo'; +import {ExtensionAbilityInfo} from 'bundleManger/extensionAbilityInfo'; +import {BundlePackInfo} from 'bundleManger/packInfo'; +``` +**修改后:** +```ts +import {AbilityInfo} from 'bundleManger/AbilityInfo'; +import {ExtensionAbilityInfo} from 'bundleManger/ExtensionAbilityInfo'; +import {BundlePackInfo} from 'bundleManger/BundlePackInfo'; +``` + +## cl.bundlemanager.6 包管理LaunchType枚举类型名称变更,由STANDARD修改为MULTITON,枚举值不变。 + +包管理[LaunchType](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.bundle.bundleManager.d.ts)枚举类型变更,由STANDARD修改为MULTITON,枚举值不变,表示多实例类型。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了LaunchType.STANDARD的,需要改为使用LaunchType.MULTITON接口。 + +**关键的接口/组件变更**
+LaunchType枚举类型名称变更,由LaunchType.STANDARD修改为LaunchType.MULTITON。 + +**适配指导**
+由LaunchType.STANDARD修改为LaunchType.MULTITON。 + +## cl.bundlemanager.7 包管理AbilityInfo结构体中isVisible字段修改为exported,类型不变。 + +包管理[AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts)结构体中isVisible字段修改为exported,类型不变,表示当前ability是否支持导出,被其他的ability使用。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了isVisible的,需要改为使用exported。 + +**关键的接口/组件变更**
+包管理[AbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/AbilityInfo.d.ts)结构体中isVisible字段修改为exported,类型不变。 + +**适配指导**
+由isVisible修改为exported。 + +## cl.bundlemanager.8 包管理ExtensionAbilityInfo结构体中isVisible字段修改为exported,类型不变。 + +包管理[ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts)结构体中isVisible字段修改为exported,类型不变,表示当前ability是否支持导出,被其他的ability使用。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了isVisible的,需要改为使用exported。 + +**关键的接口/组件变更**
+包管理[ExtensionAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/ExtensionAbilityInfo.d.ts)结构体中isVisible字段修改为exported,类型不变。 + +**适配指导**
+由isVisible修改为exported。 + +## cl.bundlemanager.9 包管理ModuleAbilityInfo结构体中visible字段修改为exported,类型不变。 + +包管理[ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts)结构体中visible字段修改为exported,类型不变,表示当前ability是否支持导出,被其他的ability使用。 + +**变更影响**
+使用之前已发布的API 9各beta版本且使用到了visible的,需要改为使用exported。 + +**关键的接口/组件变更**
+包管理[ModuleAbilityInfo](https://gitee.com/openharmony/interface_sdk-js/blob/master/api/bundleManager/BundlePackInfo.d.ts)结构体中visible字段修改为exported,类型不变。 + +**适配指导**
+由visible修改为exported。 diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ces.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ces.md new file mode 100644 index 0000000000000000000000000000000000000000..2b9c3121806c4c7bad7fe5cc3fd755e270dcdde2 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ces.md @@ -0,0 +1,55 @@ +# 公共事件子系统ChangeLog + +## cl.ces.1 ohos.commonEvent中Support事件枚举值修改。 + +**变更影响** + +4.0.3.2之前使用ohos.commonEvent的下面的公共事件需要修改适配。 + +| 公共事件名 | +| ----------------------------------- | +| COMMON_EVENT_PACKAGE_CACHE_CLEARED | +| COMMON_EVENT_USB_STATE | +| COMMON_EVENT_USB_PORT_CHANGED | +| COMMON_EVENT_VOLUME_REMOVED | +| COMMON_EVENT_VOLUME_UNMOUNTED | +| COMMON_EVENT_VOLUME_MOUNTED | +| COMMON_EVENT_VOLUME_BAD_REMOVAL | +| COMMON_EVENT_VOLUME_EJECT | +| COMMON_EVENT_SLOT_CHANGE | +| COMMON_EVENT_SPN_INFO_CHANGED | +| COMMON_EVENT_QUICK_FIX_APPLY_RESULT | + +**关键的接口/组件变更** + +下面修改的ohos.commonEvent中的公共事件替换到ohos.commonEventManager中。 + +| 模块 | ohos.commonEvent | ohos.commonEventManager | +| ---------- | ----------------------------------- | ----------------------------------- | +| | COMMON_EVENT_PACKAGE_CACHE_CLEARED | COMMON_EVENT_PACKAGE_CACHE_CLEARED | +| | COMMON_EVENT_USB_STATE | COMMON_EVENT_USB_STATE | +| | COMMON_EVENT_USB_PORT_CHANGED | COMMON_EVENT_USB_PORT_CHANGED | +| | COMMON_EVENT_VOLUME_REMOVED | COMMON_EVENT_VOLUME_REMOVED | +| | COMMON_EVENT_VOLUME_UNMOUNTED | COMMON_EVENT_VOLUME_UNMOUNTED | +| **事件名** | COMMON_EVENT_VOLUME_MOUNTED | COMMON_EVENT_VOLUME_MOUNTED | +| | COMMON_EVENT_VOLUME_BAD_REMOVAL | COMMON_EVENT_VOLUME_BAD_REMOVAL | +| | COMMON_EVENT_VOLUME_EJECT | COMMON_EVENT_VOLUME_EJECT | +| | COMMON_EVENT_SLOT_CHANGE | COMMON_EVENT_SLOT_CHANGE | +| | COMMON_EVENT_SPN_INFO_CHANGED | COMMON_EVENT_SPN_INFO_CHANGED | +| | COMMON_EVENT_QUICK_FIX_APPLY_RESULT | COMMON_EVENT_QUICK_FIX_APPLY_RESULT | + +**适配指导** + +将调用ohos.commonEvent中的事件替换成调用@ohos.commonEventManager,比如以下示例代码: + +```typescript +import commonEvent from '@ohos.commonEvent'; +let event: string = commonEvent.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED; +``` + +需要修改成 + +```typescript +import commonEventManager from '@ohos.commonEventManager'; +let event: string = commonEventManager.Support.COMMON_EVENT_PACKAGE_CACHE_CLEARED; +``` diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-distributeddatamgr.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-distributeddatamgr.md new file mode 100644 index 0000000000000000000000000000000000000000..cea1a4047360d76a40fe1c715909a8709b83a375 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-distributeddatamgr.md @@ -0,0 +1,48 @@ +# 分布式数据管理子系统JS API变更Changelog + +## cl.distributeddatamgr.1 接口变更 +distributeddatamgr子系统relationalStore组件接口存在变更: + +变更前: +应用调用getRdbStore接口后,通过返回对象rdbStore的openStatus属性(openStatus == ON_CREATE)判断数据库是否为新创建。 +变更后: +应用调用getRdbStore接口后,通过返回对象rdbStore的version属性(version == 0)判断数据库是否为新创建。 + +开发者需要根据以下说明对应用进行适配。 + + **变更影响** + +影响API10版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。 + +**关键的接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------------------ | --------------- | ---------------- | ------- | +| @ohos.data.relationalStore | RdbStore | openStatus: number; 改为 version: number; | 变更 | + + +**适配指导** + +应用中设置和获取数据库版本可参考下列代码: + +```ts +const STORE_CONFIG = { + name: "rdbstore.db", + securityLevel: data_rdb.SecurityLevel.S1 +} +data_rdb.getRdbStore(this.context, STORE_CONFIG, function (err, rdbStore) { + // 变更前: + // if (rdbStore.openStatus == ON_CREATE) { + // rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx + // } + + // 变更后: + if (rdbStore.version == 0) { + rdbStore.executeSql("CREATE TABLE IF NOT EXISTS student (id INTEGER PRIMARY KEY AUTOINCREMENT, score REAL);", null) // create table xxx + // 设置数据库版本,值为大于0的正整数 + rdbStore.version == 3 + } + // 获取数据库版本 + console.info("Get RdbStore version is " + rdbStore.version) +}) +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-filemanagement.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-filemanagement.md new file mode 100644 index 0000000000000000000000000000000000000000..e5f4d8d7cc5ea4bd4629816894d3837011e5b723 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-filemanagement.md @@ -0,0 +1,167 @@ +# 文件管理子系统ChangeLog + +## cl.filemanagement.1 environment模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。environment模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现environment模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原environment使用的是@ohos.environment,以以下方式import: + +```js +import environment from '@ohos.environment'; +``` + +现environment使用的是@ohos.file.environment,以以下方式import: + +```js +import environment from '@ohos.file.environment'; +``` + +## cl.filemanagement.2 securityLabel模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。securityLabel模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现securityLabel模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原securityLabel使用的是@ohos.securityLabel,以以下方式import: + +```js +import securityLabel from '@ohos.securityLabel'; +``` + +现securityLabel使用的是@ohos.file.securityLabel,以以下方式import: + +```js +import securityLabel from '@ohos.file.securityLabel'; +``` + +## cl.filemanagement.3 fs模块变更 + +fs模块下Stat接口ino属性类型变更。 + +**变更影响** + +fs模块下Stat接口ino属性类型变更,由number变更为bigint,以适配文件系统下所有类型文件的inode范围。 + +**关键接口/组件变更** + +原Stat接口ino属性类型为number,现变更为bigint。 + +## cl.filemanagement.4 fileAccess模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。fileAccess模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现fileAccess模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原fileAccess使用的是@ohos.data.fileAccess,以以下方式import: + +```js +import fileAccess from '@ohos.data.fileAccess'; +``` + +现fileAccess使用的是@ohos.file.fileAccess,以以下方式import: + +```js +import fileAccess from '@ohos.file.fileAccess'; +``` + +## cl.filemanagement.5 fileExtensionInfo模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。fileExtensionInfo模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现fileExtensionInfo模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原fileExtensionInfo使用的是@ohos.fileExtensionInfo,以以下方式import: + +```js +import fileExtensionInfo from '@ohos.fileExtensionInfo'; +``` + +现fileExtensionInfo使用的是@ohos.file.fileExtensionInfo,以以下方式import: + +```js +import fileExtensionInfo from '@ohos.file.fileExtensionInfo'; +``` + +## cl.filemanagement.6 storageStatistics模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。fileExtensionInfo模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现storageStatistics模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原storageStatistics使用的是@ohos.storageStatistics,以以下方式import: + +```js +import storageStatistics from '@ohos.storageStatistics'; +``` + +现storageStatistics使用的是@ohos.file.storageStatistics,以以下方式import: + +```js +import storageStatistics from '@ohos.file.storageStatistics'; +``` + +## cl.filemanagement.7 volumeManager模块变更 + +文件管理子系统d.ts归档整改,现统一整改到file一层目录下。fileExtensionInfo模块支持错误码处理。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现volumeManager模块支持错误码处理,需注意错误码处理的使用。 + +**关键接口/组件变更** + +原volumeManager使用的是@ohos.volumeManager,以以下方式import: + +```js +import volumeManager from '@ohos.volumeManager'; +``` + +现volumeManager使用的是@ohos.file.volumeManager,以以下方式import: + +```js +import volumeManager from '@ohos.file.volumeManager'; +``` + +## cl.filemanagement.8 Filter类型模块变更 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现Filter类型变更至@ohos.file.fs模块下。Filter类型具体属性不变。 + +**关键接口/组件变更** + +原Filter类型在模块@ohos.fileio下,通过以下方式import: + +```js +import Filter from '@ohos.fileio'; +``` + +**适配指导** + +现Filter类型在模块@ohos.file.fs,通过以下方式import: + +```js +import Filter from '@ohos.file.fs'; +``` diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-geoLocationManager.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-geoLocationManager.md new file mode 100644 index 0000000000000000000000000000000000000000..f1e652c43fe7e78d6642b34871cadccd7c2ca85d --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-geoLocationManager.md @@ -0,0 +1,18 @@ +# 位置服务子系统ChangeLog + +## cl.location.1 删除API9接口geoLocationManager.requestEnableLocation + +在位置开关关闭的场景下,应用可以调用geoLocationManager.requestEnableLocation接口,以请求用户开启位置开关;实际该接口使用较少,并且该接口用户体验不太好,并没有告诉用户该应用在什么场景下使用位置信息。 + +因此变更为由应用本身弹框请求用户跳转到settings开启位置开关,并且在弹框上写清楚会在什么场景下使用位置信息,这样用户体验更好。 + +**变更影响** + +在API9上应用无法使用geoLocationManager.requestEnableLocation请求用户开启位置开关,需要应用自己实现弹框,请求用户开启位置开关。 + +**关键的接口/组件变更** + +| 类名 | 接口类型 | 接口声明 | 变更类型 | +| -- | -- | -- | -- | +|geoLocationManager| method | function requestEnableLocation(callback: AsyncCallback<boolean>): void; | 该接口从API9中删除 | +|geoLocationManager| method | function requestEnableLocation(): Promise<boolean>; | 该接口从API9中删除 | diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-global.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-global.md new file mode 100644 index 0000000000000000000000000000000000000000..4923e61187fa46f65358a4b497f5ed89275ec764 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-global.md @@ -0,0 +1,144 @@ +# 全球化子系统ChangeLog + +## cl.global.1 国际化模块系统接口添加运行时鉴权 + +全球化子系统国际化组件在如下场景中提供的系统接口添加运行时鉴权。从API9开始作以下变更: + - 设置系统语言、系统国家或地区、系统区域 + - 设置系统24小时制 + - 添加、移除系统偏好语言 + - 设置本地化数字 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +上述场景涉及的国际化系统接口添加运行时鉴权,只有具有UPDATE_CONFIGURATION权限的系统应用可以正常调用。 + +**关键的接口/组件变更** + + - 涉及接口 + - setSystemLanguage(language: string): void; + - setSystemRegion(region: string): void; + - setSystemLocale(locale: string): void; + - set24HourClock(option: boolean): void; + - addPreferredLanguage(language: string, index?: number): void; + - removePreferredLanguage(index: number): void; + - setUsingLocalDigit(flag: boolean): void; + +**适配指导** + +确保应用为系统应用,非系统应用禁止调用上述接口。 +当前权限不足或非系统应用调用该接口时会抛出异常,可以通过try-catch来捕获异常。 + +```js +import I18n from '@ohos.i18n' + +try { + I18n.System.setSystemLanguage('zh'); +} catch(error) { + console.error(`call System.setSystemLanguage failed, error code: ${error.code}, message: ${error.message}.`) +} +``` + + +## cl.resourceManager.1 资源获取rawfile文件描述符接口含义变更 + +相较于之前的版本,在4.0.2.2 版本中,新增不解压特性,rawfile文件描述符接口返回值的含义发生了变化。接口用于返回获取的rawfile文件的descriptor:RawFileDescriptor {fd,offset, length},由于不解压特性变更,返回值没发生变化,但返回值的含义发生了变化, 变化如下: + +**新增不解压特性前**: + +fd: 访问rawfile文件的文件描述符; + +offset: 访问rawfile文件的偏移量,此时为0; + +length: 访问rawfile文件的大小。 + +**新增不解压特性后**: + +fd: 访问rawfile文件所在hap的文件描述符; + +offset: 访问rawfile文件相对于hap的偏移量; + +length: 访问rawfile文件的大小。 + +**变更影响** + +之前只通过fd可以访问到rawfile文件,在4.0.2.2 及以上版本需要通过{fd, offset, length}三个参数才能访问到。 + +**关键接口/组件变更** + +| **涉及接口** | +| ---------------- | +| getRawFd(path: string, callback: AsyncCallback\): void | +| getRawFd(path: string): Promise\ | +| getRawFileDescriptor(path: string, callback: AsyncCallback\): void| +| getRawFileDescriptor(path: string): Promise\| +|| + +**示例代码** + +以调用接口getRawFd为例: +``` +try { + this.context.resourceManager.getRawFd("test.ogg", (error, value) => { + if (error != null) { + console.log(`callback getRawFd failed error code: ${error.code}, message: ${error.message}.`); + } else { + let fileDescriptor = { + fd = value.fd, + offset = value.offset, + length = value.length + } + this.avPlayer.fdSrc(fileDescriptor); // 以音频播放为例,调用fdSrc时需要传fileDescriptor,不能仅传fd。 + } + }); + } catch (error) { + console.error(`callback getRawFd failed, error code: ${error.code}, message: ${error.message}.`) + }; +``` + + +## cl.resourceManager.2 getStringSync、getStringByNameSync新增接口 + +相较于之前的版本,在4.0.6.2 版本中,为扩展getStringSync、getStringByNameSync接口字符串匹配功能,新增了接口以及相应的错误码。 + +| 包名 | 新增接口 | +| --------------- | ---------------------------------------------------- | +| ohos.resourceManager.d.ts | getStringSync(resId: number, ...args: Array): string; | +| ohos.resourceManager.d.ts | getStringSync(resource: Resource, ...args: Array): string; | +| ohos.resourceManager.d.ts | getStringByNameSync(resName: string, ...args: Array): string; | + +**变更影响** + +之前只能直接获取resources中的string资源的value值,在4.0.6.2 及以上版本中可用通过参数格式化string资源的value值,扩展了格式化字符串的查询能力。 + +新增错误码: + +9001007 根据当前id获取的资源格式化失败 + +9001008 根据当前名称获取的资源格式化失败 + +**示例代码** + +以调用接口getStringSync为例,变更前只支持示例1,变更后示例1、示例2都支持。 +``` +示例1: +try { + this.context.resourceManager.getStringSync($r('app.string.test').id); +} catch (error) { + console.error(`getStringSync failed, error code: ${error.code}, message: ${error.message}.`) +} +示例2: +try { + this.context.resourceManager.getStringSync($r('app.string.test').id, "format string", 787, 98.78); +} catch (error) { + console.error(`getStringSync failed, error code: ${error.code}, message: ${error.message}.`) +} +``` + +**适配指导** +请参考接口说明: + +[新增接口参考](../../../application-dev/reference/apis/js-apis-resource-manager.md) + +[新增错误码参考](../../../application-dev/reference/errorcodes/errorcode-resource-manager.md) \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-huks.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-huks.md new file mode 100644 index 0000000000000000000000000000000000000000..72952f500e0f12c395ed6174274753bbe1d5e812 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-huks.md @@ -0,0 +1,129 @@ +# HUKS子系统ChangeLog + +OpenHarmony 4.0.6.1 版本相较于OpenHarmony 之前的版本,HUKS的API使用权限变更如下。 + +## cl.huks.1 attestKeyItem接口使用权限变更 + +attestKeyItem是基于设备证书链封装业务公钥对用户指定的密钥进行证明,如果设备证书随意导出涉及用户隐私风险,所以此接口需要增加系统权限管控。 + +**变更影响** + +对于不具备system权限或者ohos.permission.ACCESS_IDS权限的应用,无法正常使用attestKeyItem接口。 + +**关键的接口/组件变更** + +- 涉及接口 + + attestKeyItem(keyAlias: string, options: HuksOptions, callback: AsyncCallback\): void; + attestKeyItem(keyAlias: string, options: HuksOptions): Promise\; + +- 变更前: + + 只针对传入ATTESTATION_ID相关TAG的应用校验AccessToken权限,其它情况无接口权限的限制。 + + +- 变更后: + + 只有具备system权限的系统应用或者申请了ohos.permission.ACCESS_IDS权限的普通应用才能正常使用attestKeyItem接口。 + +**适配指导** + +已经具备system权限的应用则可以正常使用attestKeyItem接口,其余普通应用需申请ohos.permission.ACCESS_IDS权限即可,申请方法参考[ACL权限配置说明](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/accesstoken-overview.md#%E8%AE%BF%E9%97%AE%E6%8E%A7%E5%88%B6%E5%88%97%E8%A1%A8acl%E8%AF%B4%E6%98%8E)。 + + +## cl.huks.2 HUKS支持可选设置rsa_pss_salt_length类型 + +变更之前,应用在签名/验签时,HUKS默认使用RSA_PSS_SALT_LEN_MAX进行处理; + +变更之后,应用在签名/验签需传入HuksRsaPssSaltLenType中定义的类型。若不传入,则默认使用RSA_PSS_SALT_LEN_MAX进行处理。 + +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 + +**关键的接口/组件变更** + +发布的JS接口不变, 传入接口的参数集合发生变更。 + +**适配指导** + +以RSA签名为例,示例代码如下: + +```js +import huks from '@ohos.security.huks'; + +let keyAlias = 'rsa_Key'; +let inData = new Uint8Array( + 0x4B, 0x1E, 0x22, 0x64, 0xA9, 0x89, 0x60, 0x1D, 0xEC, 0x78, 0xC0, 0x5D, 0xBE, 0x46, 0xAD, 0xCF, + 0x1C, 0x35, 0x16, 0x11, 0x34, 0x01, 0x4E, 0x9B, 0x7C, 0x00, 0x66, 0x0E, 0xCA, 0x09, 0xC0, 0xF3, +); +/* 签名参数 */ +let signProperties = new Array(); +signProperties[0] = { + tag: huks.HuksTag.HUKS_TAG_ALGORITHM, + value: huks.HuksKeyAlg.HUKS_ALG_RSA, +} +signProperties[1] = { + tag: huks.HuksTag.HUKS_TAG_PURPOSE, + value: + huks.HuksKeyPurpose.HUKS_KEY_PURPOSE_SIGN +} +signProperties[2] = { + tag: huks.HuksTag.HUKS_TAG_KEY_SIZE, + value: huks.HuksKeySize.HUKS_RSA_KEY_SIZE_2048, +} +signProperties[3] = { + tag: huks.HuksTag.HUKS_TAG_PADDING, + value: huks.HuksKeyPadding.HUKS_PADDING_PSS, +} +signProperties[4] = { + tag: huks.HuksTag.HUKS_TAG_DIGEST, + value: huks.HuksKeyDigest.HUKS_DIGEST_SHA1, +} +signProperties[5] = { + tag: huks.HuksTag.HUKS_TAG_RSA_PSS_SALT_LEN_TYPE, + value: huks.HuksRsaPssSaltLenType.HUKS_RSA_PSS_SALT_LEN_MAX, +} +let signOptions = { + properties: signProperties, + inData: inData +} + +huks.initSession(keyAlias, signOptions); +``` + +更多接口的示例代码可参考[HUKS-guidelines](../../../application-dev/security/huks-guidelines.md)和[HUKS API](../../../application-dev/reference/apis/js-apis-huks.md)。 + +## cl.huks.3 HUKS解决派生密钥/协商密钥的存储/导出问题 + +变更之前,派生密钥/协商密钥既支持存储,又支持导出,存在安全风险; + +变更之后,应用在派生密钥/协商密钥时需传入HuksKeyStorageType中定义的类型。应用只能选择存储,或者选择导出。若不传入,则默认同时支持存储和导出,存在安全问题,不推荐业务使用。 + +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 + +**关键的接口/组件变更** + +发布的JS接口不变, 传入接口的参数集合发生变更。 + +**适配指导** + +接口使用的示例代码可参考[HUKS-guidelines](../../../application-dev/security/huks-guidelines.md)和[HUKS API](../../../application-dev/reference/apis/js-apis-huks.md)。 + +## cl.huks.3 新增用于细粒度用户身份访问控制的Tag + +新增用于细粒度用户身份访问控制的HuksTag: HUKS_TAG_KEY_AUTH_PURPOSE,业务可在原有用户身份访问控制能力上,选择某种特定算法用途下需要用户身份访问控制能力。 + +**变更影响** + +新增的HuksTag,不影响已有的接口。 + +**关键的接口/组件变更** + +只新增了HuksTag: HUKS_TAG_KEY_AUTH_PURPOSE, 用于支持细粒度用户身份访问控制。 + +**适配指导** + +接口使用的示例代码可参考[密钥访问控制_细粒度用户身份认证访问控制](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/security/huks-guidelines.md#%E5%AF%86%E9%92%A5%E8%AE%BF%E9%97%AE%E6%8E%A7%E5%88%B6),接口定义参考[HuksTag](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-huks.md#hukstag)。 \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-imf.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-imf.md new file mode 100644 index 0000000000000000000000000000000000000000..a6cdab6b8d7e7fc6a97698ce9b2e2a84ba32076a --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-imf.md @@ -0,0 +1,21 @@ +# 输入法框架子系统-输入法框架服务ChangeLog + + +## @ohos.InputMethodSubtype 中输入法子类型中name、label、id属性值变更 +从API9开始,变更如上三个属性值 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +此三个属性的取值发生变化,需要开发者进行适配更新 + +| 名称 | 变更前 | 变更后 | +| -------- | -------- | -------- | +| label | (1)取值:输入法子类型的id。| (1)取值:输入法子类型的标签。| +| name | (1)说明:输入法子类型的名字;(2)取值:输入法子类型的标签。| (1)说明:输入法应用的包名;(2)取值:输入法应用的包名。| +| id | (1)取值:输入法应用的包名。| (1)取值:输入法子类型的id。| + +**适配指导** + +请按上述取值变更结果适配更新。 diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-media.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-media.md new file mode 100644 index 0000000000000000000000000000000000000000..1d1fadf9dbee56c3538e4462ee7936a364ec4445 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-media.md @@ -0,0 +1,312 @@ +# 媒体子系统ChangeLog + +## cl.media.1 播放功能接口变更 + +新增音视频播放接口[AVPlayer](../../../application-dev/reference/apis/js-apis-media.md#avplayer9)9+, 升级了状态机和错误码,推荐用户使用。旧版音频播放接口[AudioPlayer](../../../application-dev/reference/apis/js-apis-media.md#audioplayer)6+和视频播放接口[VideoPlayer](../../../application-dev/reference/apis/js-apis-media.md#videoplayer)8+停止维护。 + +**变更影响** + +原有的接口暂时可继续使用,但是停止维护,建议使用新接口进行开发。 + +**关键的接口/组件变更** + +新增接口如下: + +| 类名 | 新增接口声明 | +| -------------- | ------------------------------------------------------------ | +| media | createAVPlayer(callback: AsyncCallback\): void | +| media | createAVPlayer() : Promise\ | +| media.AVPlayer | interface AVPlayer | +| media.AVPlayer | videoScaleType ?: VideoScaleType | +| media.AVPlayer | url ?: string | +| media.AVPlayer | surfaceId ?: string | +| media.AVPlayer | stop(callback: AsyncCallback\): void | +| media.AVPlayer | stop(): Promise\ | +| media.AVPlayer | setVolume(volume: number): void | +| media.AVPlayer | setSpeed(speed: PlaybackSpeed): void | +| media.AVPlayer | setBitrate(bitrate: number): void | +| media.AVPlayer | seek(timeMs: number, mode?:SeekMode): void | +| media.AVPlayer | reset(callback: AsyncCallback\): void | +| media.AVPlayer | reset(): Promise\ | +| media.AVPlayer | release(callback: AsyncCallback\): void | +| media.AVPlayer | release(): Promise\ | +| media.AVPlayer | readonly width: number | +| media.AVPlayer | readonly state: AVPlayerState | +| media.AVPlayer | readonly height: number | +| media.AVPlayer | readonly duration: number | +| media.AVPlayer | readonly currentTime: number | +| media.AVPlayer | prepare(callback: AsyncCallback\): void | +| media.AVPlayer | prepare(): Promise\ | +| media.AVPlayer | play(callback: AsyncCallback\): void | +| media.AVPlayer | play(): Promise\ | +| media.AVPlayer | pause(callback: AsyncCallback\): void | +| media.AVPlayer | pause(): Promise\ | +| media.AVPlayer | on(type: 'volumeChange', callback: Callback\): void | +| media.AVPlayer | on(type: 'videoSizeChange', callback: (width: number, height: number) => void): void | +| media.AVPlayer | on(type: 'timeUpdate', callback: Callback\): void | +| media.AVPlayer | on(type: 'stateChange', callback: (state: AVPlayerState, reason: StateChangeReason) => void): void | +| media.AVPlayer | on(type: 'startRenderFrame', callback: Callback\): void | +| media.AVPlayer | on(type: 'speedDone', callback: Callback\): void | +| media.AVPlayer | on(type: 'seekDone', callback: Callback\): void | +| media.AVPlayer | on(type: 'error', callback: ErrorCallback): void | +| media.AVPlayer | on(type: 'endOfStream', callback: Callback\): void | +| media.AVPlayer | on(type: 'durationUpdate', callback: Callback\): void | +| media.AVPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | +| media.AVPlayer | on(type: 'bitrateDone', callback: Callback\): void | +| media.AVPlayer | on(type: 'availableBitrates', callback: (bitrates: Array\) => void): void | +| media.AVPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | +| media.AVPlayer | off(type: 'volumeChange'): void | +| media.AVPlayer | off(type: 'videoSizeChange'): void | +| media.AVPlayer | off(type: 'timeUpdate'): void | +| media.AVPlayer | off(type: 'stateChange'): void | +| media.AVPlayer | off(type: 'startRenderFrame'): void | +| media.AVPlayer | off(type: 'speedDone'): void | +| media.AVPlayer | off(type: 'seekDone'): void | +| media.AVPlayer | off(type: 'error'): void | +| media.AVPlayer | off(type: 'endOfStream'): void | +| media.AVPlayer | off(type: 'durationUpdate'): void | +| media.AVPlayer | off(type: 'bufferingUpdate'): void | +| media.AVPlayer | off(type: 'bitrateDone'): void | +| media.AVPlayer | off(type: 'availableBitrates'): void | +| media.AVPlayer | off(type: 'audioInterrupt'): void | +| media.AVPlayer | loop: boolean | +| media.AVPlayer | getTrackDescription(callback: AsyncCallback\>): void | +| media.AVPlayer | getTrackDescription() : Promise\> | +| media.AVPlayer | fdSrc ?: AVFileDescriptor | +| media.AVPlayer | audioInterruptMode ?: audio.InterruptMode | +| unnamed | type AVPlayerState = 'idle' \| 'initialized' \| 'prepared' \| 'playing' \| 'paused' \| 'completed' \| 'stopped' \| 'released' \| 'error' | + +停止维护接口如下: + +| 类名 | 停止维护接口声明 | +| ----------------- | ------------------------------------------------------------ | +| media | createVideoPlayer(callback: AsyncCallback\): void | +| media | createVideoPlayer() : Promise\ | +| media | createAudioPlayer(): AudioPlayer | +| media.AudioPlayer | interface AudioPlayer | +| media.AudioPlayer | play(): void | +| media.AudioPlayer | release(): void | +| media.AudioPlayer | audioInterruptMode ?: audio.InterruptMode | +| media.AudioPlayer | fdSrc: AVFileDescriptor | +| media.AudioPlayer | seek(timeMs: number): void | +| media.AudioPlayer | readonly duration: number | +| media.AudioPlayer | loop: boolean | +| media.AudioPlayer | readonly state: AudioState | +| media.AudioPlayer | getTrackDescription(callback: AsyncCallback\>): void | +| media.AudioPlayer | getTrackDescription() : Promise\> | +| media.AudioPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | +| media.AudioPlayer | on(type: 'play' \| 'pause' \| 'stop' \| 'reset' \| 'dataLoad' \| 'finish' \| 'volumeChange', callback: () => void): void | +| media.AudioPlayer | on(type: 'timeUpdate', callback: Callback\): void | +| media.AudioPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | +| media.AudioPlayer | on(type: 'error', callback: ErrorCallback): void | +| media.AudioPlayer | setVolume(vol: number): void | +| media.AudioPlayer | pause(): void | +| media.AudioPlayer | readonly currentTime: number | +| media.AudioPlayer | stop(): void | +| media.AudioPlayer | reset(): void | +| media.AudioPlayer | src: string | +| media.VideoPlayer | interface VideoPlayer | +| media.VideoPlayer | play(callback: AsyncCallback\): void | +| media.VideoPlayer | play(): Promise\ | +| media.VideoPlayer | prepare(callback: AsyncCallback\): void | +| media.VideoPlayer | prepare(): Promise\ | +| media.VideoPlayer | release(callback: AsyncCallback\): void | +| media.VideoPlayer | release(): Promise\ | +| media.VideoPlayer | audioInterruptMode ?: audio.InterruptMode | +| media.VideoPlayer | fdSrc: AVFileDescriptor | +| media.VideoPlayer | seek(timeMs: number, callback: AsyncCallback\): void | +| media.VideoPlayer | seek(timeMs: number, mode:SeekMode, callback: AsyncCallback\): void | +| media.VideoPlayer | seek(timeMs: number, mode?:SeekMode): Promise\ | +| media.VideoPlayer | readonly duration: number | +| media.VideoPlayer | loop: boolean | +| media.VideoPlayer | videoScaleType ?: VideoScaleType | +| media.VideoPlayer | readonly state: VideoPlayState | +| media.VideoPlayer | getTrackDescription(callback: AsyncCallback\>): void | +| media.VideoPlayer | getTrackDescription() : Promise\> | +| media.VideoPlayer | readonly height: number | +| media.VideoPlayer | on(type: 'playbackCompleted', callback: Callback\): void | +| media.VideoPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void | +| media.VideoPlayer | on(type: 'startRenderFrame', callback: Callback\): void | +| media.VideoPlayer | on(type: 'videoSizeChanged', callback: (width: number, height: number) => void): void | +| media.VideoPlayer | on(type: 'audioInterrupt', callback: (info: audio.InterruptEvent) => void): void | +| media.VideoPlayer | on(type: 'error', callback: ErrorCallback): void | +| media.VideoPlayer | setDisplaySurface(surfaceId: string, callback: AsyncCallback\): void | +| media.VideoPlayer | setDisplaySurface(surfaceId: string): Promise\ | +| media.VideoPlayer | setVolume(vol: number, callback: AsyncCallback\): void | +| media.VideoPlayer | setVolume(vol: number): Promise\ | +| media.VideoPlayer | url: string | +| media.VideoPlayer | pause(callback: AsyncCallback\): void | +| media.VideoPlayer | pause(): Promise\ | +| media.VideoPlayer | readonly currentTime: number | +| media.VideoPlayer | setSpeed(speed:number, callback: AsyncCallback\): void | +| media.VideoPlayer | setSpeed(speed:number): Promise\ | +| media.VideoPlayer | stop(callback: AsyncCallback\): void | +| media.VideoPlayer | stop(): Promise\ | +| media.VideoPlayer | readonly width: number | +| media.VideoPlayer | reset(callback: AsyncCallback\): void | +| media.VideoPlayer | reset(): Promise\ | +| unnamed | type AudioState = 'idle' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | +| unnamed | type VideoPlayState = 'idle' \| 'prepared' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | + +**适配指导** + +请参考各接口的[API参考](../../../application-dev/reference/apis/js-apis-media.md) + +## cl.media.2 录制功能接口变更 + +新增音视频录制接口[AVRecorder](../../../application-dev/reference/apis/js-apis-media.md#avrecorder9)9+, 升级了状态机和错误码,推荐用户使用。旧版音频录制接口[AudioRecorder](../../../application-dev/reference/apis/js-apis-media.md#audiorecorder)6+和视频录制接口[VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)9+停止维护。 + +新旧录制接口共用的[AudioSourceType](../../../application-dev/reference/apis/js-apis-media.md#audiosourcetype9)和[VideoSourceType](../../../application-dev/reference/apis/js-apis-media.md#videosourcetype9)接口,变更为非系统接口。 + +**变更影响** + +原有的接口[AudioRecorder](../../../application-dev/reference/apis/js-apis-media.md#audiorecorder)6+和[VideoRecorder](../../../application-dev/reference/apis/js-apis-media.md#videorecorder9)9+暂时可继续使用,但是停止维护,建议使用新接口进行开发[AVRecorder](../../../application-dev/reference/apis/js-apis-media.md#avrecorder9)9+。 + +**关键的接口/组件变更** + +新增接口如下: + +| 类名 | 新增接口声明 | +| ----------------------- | ------------------------------------------------------------ | +| media | createAVRecorder(callback: AsyncCallback\): void | +| media | createAVRecorder() : Promise\ | +| media.AVRecorder | interface AVRecorder | +| media.AVRecorder | prepare(config: AVRecorderConfig, callback: AsyncCallback\): void | +| media.AVRecorder | prepare(config: AVRecorderConfig): Promise\ | +| media.AVRecorder | release(callback: AsyncCallback\): void | +| media.AVRecorder | release(): Promise\ | +| media.AVRecorder | readonly state: AVRecorderState | +| media.AVRecorder | on(type: 'stateChange', callback: (state: AVRecorderState, reason: StateChangeReason) => void): void | +| media.AVRecorder | on(type: 'error', callback: ErrorCallback): void | +| media.AVRecorder | resume(callback: AsyncCallback\): void | +| media.AVRecorder | resume(): Promise\ | +| media.AVRecorder | start(callback: AsyncCallback\): void | +| media.AVRecorder | start(): Promise\ | +| media.AVRecorder | off(type: 'stateChange'): void | +| media.AVRecorder | off(type: 'error'): void | +| media.AVRecorder | pause(callback: AsyncCallback\): void | +| media.AVRecorder | pause(): Promise\ | +| media.AVRecorder | stop(callback: AsyncCallback\): void | +| media.AVRecorder | stop(): Promise\ | +| media.AVRecorder | reset(callback: AsyncCallback\): void | +| media.AVRecorder | reset(): Promise\ | +| media.AVRecorder | getInputSurface(callback: AsyncCallback\): void | +| media.AVRecorder | getInputSurface(): Promise\ | +| media.AVRecorderConfig | videoSourceType?: VideoSourceType | +| media.AVRecorderConfig | audioSourceType?: AudioSourceType | +| media.AVRecorderConfig | profile: AVRecorderProfile | +| media.AVRecorderConfig | rotation?: number | +| media.AVRecorderConfig | url: string | +| media.AVRecorderConfig | location?: Location | +| media.AVRecorderConfig | interface AVRecorderConfig | +| media.AVRecorderProfile | videoBitrate?: number | +| media.AVRecorderProfile | videoCodec?: CodecMimeType | +| media.AVRecorderProfile | audioCodec?: CodecMimeType | +| media.AVRecorderProfile | videoFrameRate?: number | +| media.AVRecorderProfile | videoFrameHeight?: number | +| media.AVRecorderProfile | audioSampleRate?: number | +| media.AVRecorderProfile | audioBitrate?: number | +| media.AVRecorderProfile | videoFrameWidth?: number | +| media.AVRecorderProfile | audioChannels?: number | +| media.AVRecorderProfile | fileFormat: ContainerFormatType | +| media.AVRecorderProfile | interface AVRecorderProfile | +| unnamed | type AVRecorderState = 'idle' \| 'prepared' \| 'started' \| 'paused' \| 'stopped' \| 'released' \| 'error' | + +停止维护接口如下: + +| 类名 | 停止维护接口声明 | +| -------------------------- | ------------------------------------------------------------ | +| media | createVideoRecorder(callback: AsyncCallback\): void | +| media | createVideoRecorder(): Promise\ | +| media | createAudioRecorder(): AudioRecorder | +| media.AudioRecorder | interface AudioRecorder | +| media.AudioRecorder | prepare(config: AudioRecorderConfig): void | +| media.AudioRecorder | release(): void | +| media.AudioRecorder | on(type: 'prepare' \| 'start' \| 'pause' \| 'resume' \| 'stop' \| 'release' \| 'reset', callback: () => void): void | +| media.AudioRecorder | on(type: 'error', callback: ErrorCallback): void | +| media.AudioRecorder | resume(): void | +| media.AudioRecorder | start(): void | +| media.AudioRecorder | pause(): void | +| media.AudioRecorder | stop(): void | +| media.AudioRecorder | reset(): void | +| media.AudioRecorderConfig | audioSampleRate?: number | +| media.AudioRecorderConfig | location?: Location | +| media.AudioRecorderConfig | fileFormat?: ContainerFormatType | +| media.AudioRecorderConfig | interface AudioRecorderConfig | +| media.AudioRecorderConfig | audioEncoder?: AudioEncoder | +| media.AudioRecorderConfig | audioEncodeBitRate?: number | +| media.AudioRecorderConfig | numberOfChannels?: number | +| media.AudioRecorderConfig | format?: AudioOutputFormat | +| media.AudioRecorderConfig | uri: string | +| media.AudioRecorderConfig | audioEncoderMime?: CodecMimeType | +| media.VideoRecorder | interface VideoRecorder | +| media.VideoRecorder | prepare(config: VideoRecorderConfig, callback: AsyncCallback\): void | +| media.VideoRecorder | prepare(config: VideoRecorderConfig): Promise\ | +| media.VideoRecorder | release(callback: AsyncCallback\): void | +| media.VideoRecorder | release(): Promise\ | +| media.VideoRecorder | readonly state: VideoRecordState | +| media.VideoRecorder | on(type: 'error', callback: ErrorCallback): void | +| media.VideoRecorder | resume(callback: AsyncCallback\): void | +| media.VideoRecorder | resume(): Promise\ | +| media.VideoRecorder | start(callback: AsyncCallback\): void | +| media.VideoRecorder | start(): Promise\ | +| media.VideoRecorder | pause(callback: AsyncCallback\): void | +| media.VideoRecorder | pause(): Promise\ | +| media.VideoRecorder | stop(callback: AsyncCallback\): void | +| media.VideoRecorder | stop(): Promise\ | +| media.VideoRecorder | reset(callback: AsyncCallback\): void | +| media.VideoRecorder | reset(): Promise\ | +| media.VideoRecorder | getInputSurface(callback: AsyncCallback\): void | +| media.VideoRecorder | getInputSurface(): Promise\ | +| media.VideoRecorderConfig | videoSourceType: VideoSourceType | +| media.VideoRecorderConfig | audioSourceType?: AudioSourceType | +| media.VideoRecorderConfig | profile: VideoRecorderProfile | +| media.VideoRecorderConfig | rotation?: number | +| media.VideoRecorderConfig | url: string | +| media.VideoRecorderConfig | location?: Location | +| media.VideoRecorderConfig | interface VideoRecorderConfig | +| media.VideoRecorderProfile | readonly videoBitrate: number | +| media.VideoRecorderProfile | readonly videoCodec: CodecMimeType | +| media.VideoRecorderProfile | readonly audioCodec: CodecMimeType | +| media.VideoRecorderProfile | readonly videoFrameRate: number | +| media.VideoRecorderProfile | readonly videoFrameHeight: number | +| media.VideoRecorderProfile | readonly audioSampleRate: number | +| media.VideoRecorderProfile | readonly audioBitrate: number | +| media.VideoRecorderProfile | readonly videoFrameWidth: number | +| media.VideoRecorderProfile | readonly audioChannels: number | +| media.VideoRecorderProfile | readonly fileFormat: ContainerFormatType | +| media.VideoRecorderProfile | interface VideoRecorderProfile | +| unnamed | type VideoRecordState = 'idle' \| 'prepared' \| 'playing' \| 'paused' \| 'stopped' \| 'error' | + +变更接口如下: + +| 类名 | 接口声明 | 变更前能力 | 变更后能力 | 变更前是否为系统接口 | 变更后是否为系统接口 | +| --------------------- | ------------------------------------------------------------ | ----------------------------------------------- | -------------------------------------------- | -------------------- | -------------------- | +| media.AudioSourceType | enum AudioSourceType { /** * default audio source type. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ AUDIO_SOURCE_TYPE_DEFAULT = 0, /** * source type mic. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ AUDIO_SOURCE_TYPE_MIC = 1, } | SystemCapability.Multimedia.Media.VideoRecorder | SystemCapability.Multimedia.Media.AVRecorder | 是 | 否 | +| media.VideoSourceType | enum VideoSourceType { /** * surface raw data. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, /** * surface ES data. * @since 9 * @syscap SystemCapability.Multimedia.Media.AVRecorder */ VIDEO_SOURCE_TYPE_SURFACE_ES = 1, } | SystemCapability.Multimedia.Media.VideoRecorder | SystemCapability.Multimedia.Media.AVRecorder | 是 | 否 | + +**适配指导** + +请参考各接口的[API参考](../../../application-dev/reference/apis/js-apis-media.md) + +## cl.media.3 错误码变更 + +新增标准的错误枚举类型[AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)9+替代原有错误枚举类型[MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)8+。 + +**变更影响** + +以往接口返回错误码枚举类型为[MediaErrorCode](../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode)8+不变。新增接口错误码类型均采用[AVErrorCode9](../../../application-dev/reference/apis/js-apis-media.md#averrorcode)9+。 + +**关键的接口/组件变更** + +新增接口如下: + +| 类名 | 新增错误码声明 | +| ----------------- | ------------------------------------------------------------ | +| media.AVErrorCode | enum AVErrorCode { /** * operation success. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_OK = 0, /** * permission denied. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_NO_PERMISSION = 201, /** * invalid parameter. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_INVALID_PARAMETER = 401, /** * the api is not supported in the current version * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_UNSUPPORT_CAPABILITY = 801, /** * the system memory is insufficient or the number of services reaches the upper limit * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_NO_MEMORY = 5400101, /** * current status does not allow or do not have permission to perform this operation * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_OPERATE_NOT_PERMIT = 5400102, /** * data flow exception information * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_IO = 5400103, /** * system or network response timeout. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_TIMEOUT = 5400104, /** * service process died. * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_SERVICE_DIED = 5400105, /** * unsupported media format * @since 9 * @syscap SystemCapability.Multimedia.Media.Core */ AVERR_UNSUPPORT_FORMAT = 5400106, } | + +停止维护接口如下: + +| 类名 | 停止维护错误码声明 | +| -------------------- | ------------------------------------------------------------ | +| media.MediaErrorCode | enum MediaErrorCode { /** * operation success. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_OK = 0, /** * malloc or new memory failed. maybe system have no memory. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_NO_MEMORY = 1, /** * no permission for the operation. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_OPERATION_NOT_PERMIT = 2, /** * invalid argument. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_INVALID_VAL = 3, /** * an I/O error occurred. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_IO = 4, /** * operation time out. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_TIMEOUT = 5, /** * unknown error. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_UNKNOWN = 6, /** * media service died. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_SERVICE_DIED = 7, /** * operation is not permit in current state. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_INVALID_STATE = 8, /** * operation is not supported in current version. * @since 8 * @syscap SystemCapability.Multimedia.Media.Core */ MSERR_UNSUPPORTED = 9, } | \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-miscdevice.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-miscdevice.md new file mode 100644 index 0000000000000000000000000000000000000000..6dc3abac37c52062ad1b39ac77e72064382783c1 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-miscdevice.md @@ -0,0 +1,95 @@ +# 泛Sensor子系统Changelog + +## cl.vibrator.isSupportEffect接口新增 + +新增isSupportEffect接口。 + +**变更影响** + +基于OpenHarmony4.0.5.2及之后的SDK版本开发的应用,可使用isSupportEffect接口查询传入effectId是否支持。 + +**关键接口/组件变更** + +@ohos.vibrator.d.ts中新增isSupportEffect接口。 + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| -- | -- | -- | -- | +| @ohos.vibrator.d.ts | vibrator | isSupportEffect(effectId: string, callback: AsyncCallback<boolean>): void | 新增 | +| @ohos.vibrator.d.ts | vibrator | isSupportEffect(effectId: string): Promise<boolean> | 新增 | + +**适配指导**
+ +通过调用isSupportEffect接口查询是否支持传入的参数effectId。 + +```ts +import vibrator from '@ohos.vibrator'; +try { + // 查询是否支持'haptic.clock.timer' + vibrator.isSupportEffect('haptic.clock.timer', function (err, state) { + if (err) { + console.error('isSupportEffect failed, error:' + JSON.stringify(err)); + return; + } + console.log('The effectId is ' + (state ? 'supported' : 'unsupported')); + if (state) { + try { + vibrator.startVibration({ // 使用startVibration需要添加ohos.permission.VIBRATE权限 + type: 'preset', + effectId: 'haptic.clock.timer', + count: 1, + }, { + usage: 'unknown' + }, (error) => { + if(error) { + console.error('haptic.clock.timer vibrator error:' + JSON.stringify(error)); + } else { + console.log('haptic.clock.timer vibrator success'); + } + }); + } catch (error) { + console.error('Exception in, error:' + JSON.stringify(error)); + } + } + }) +} catch (error) { + console.error('Exception in, error:' + JSON.stringify(error)); +} +``` + +## cl.vibrator.stopVibration接口新增 + +新增stopVibration接口。 + +**变更影响** + +基于OpenHarmony4.0.5.2及之后的SDK版本开发的应用,可使用stopVibration接口停止所有类型的振动。 + +**关键接口/组件变更** + +@ohos.vibrator.d.ts中新增stopVibration接口。 + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| ------------------- | -------- | -------------------------------------------------------- | -------- | +| @ohos.vibrator.d.ts | vibrator | stopVibration(callback: AsyncCallback<void>): void | 新增 | +| @ohos.vibrator.d.ts | vibrator | stopVibration(): Promise<void> | 新增 | + +**适配指导**
+ +通过调用stopVibration接口停止所有类型的振动。 + +```ts +import vibrator from '@ohos.vibrator'; +try { + // 停止所有模式的马达振动 + vibrator.stopVibration(function (error) { + if (error) { + console.log('error.code' + error.code + 'error.message' + error.message); + return; + } + console.log('Callback returned to indicate successful.'); + }) +} catch (error) { + console.info('errCode: ' + error.code + ' ,msg: ' + error.message); +} +``` + diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-pasteboard.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-pasteboard.md new file mode 100644 index 0000000000000000000000000000000000000000..29f562ed9ceb239771cdc78b59ebbf91959877f0 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-pasteboard.md @@ -0,0 +1,66 @@ +# 剪贴板子系统ChangeLog + +OpenHarmony 4.0.3.2 版本相较于OpenHarmony 之前的版本,剪贴板子系统的API变更如下。 + +## cl.pasteboard.1 convertToTextV9接口变更 + +接口convertToTextV9由于命名规范和接口返回方式问题,名称变更为toPlainText(),返回方式改为同步方式。 + +**变更影响** + +4.0.3.3版本之前使用接口convertToTextV9开发的应用,在4.0.3.3版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + function convertToTextV9 + +- 变更前: + + ```ts + convertToTextV9(callback: AsyncCallback): void; + convertToTextV9(): Promise; + ``` + +- 变更后: + + ```ts + toPlainText(): string; + ``` +变更前: + +**适配指导** + +请使用toPlainText替换convertToTextV9,并注意接口返回方式。 + +## cl.pasteboard.2 ShareOption属性名称变更,删除了未支持的属性 + +ShareOption枚举命名从**大驼峰**改成了**全大写**。 + +**变更影响** + +4.0.3.3版本之前使用InApp/LocalDevice/CrossDevice类型开发的应用,在4.0.3.3版本及后续版本中无法继续正常使用。 + +**关键接口/组件变更** + +ShareOption9+ + +变更前: +| 名称 | 值 | 说明 | +| ---- |---|-------------------| +| InApp | 0 | 表示仅允许同应用内粘贴。 | +| LocalDevice | 1 | 表示允许在此设备中任何应用内粘贴。 | +| CrossDevice | 2 | 表示允许跨设备在任何应用内粘贴。 | + + +变更后: +| 名称 | 值 | 说明 | +| ---- |---|-------------------| +| INAPP | 0 | 表示仅允许同应用内粘贴。 | +| LOCALDEVICE | 1 | 表示允许在此设备中任何应用内粘贴。 | +| CROSSDEVICE | 2 | 表示允许跨设备在任何应用内粘贴。 | + +**适配指导** + +按新的语义进行适配。 \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-power.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-power.md new file mode 100644 index 0000000000000000000000000000000000000000..adabd439b923924906b465a4122016e401d13e86 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-power.md @@ -0,0 +1,82 @@ +# 电源子系统ChangeLog + +## cl.powermgr.1 CommonEventBatteryChangedCode接口变更 + +[ @ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) (电量信息)中的CommonEventBatteryChangedCode枚举类进行如下变更: + +- 类名称变更为CommonEventBatteryChangedKey; +- 删除EXTRA_MAX_CURRENT、EXTRA_MAX_VOLTAGE和EXTRA_CHARGE_COUNTER; +- 枚举值类型从数值变更为字符串。 + +#### 变更影响 + +基于此前版本开发的应用,需适配接口的变更,否则会影响原有业务逻辑。 + +#### 关键的接口/组件变更 + +变更前: + +| 名称 | 值 | 说明 | +| -------------------- | ---- | -------------------------------------------------- | +| EXTRA_SOC | 0 | 表示剩余电池电量百分比的查询键。 | +| EXTRA_VOLTAGE | 1 | 表示当前设备电池电压的查询键。 | +| EXTRA_TEMPERATURE | 2 | 表示当前设备电池温度的查询键。 | +| EXTRA_HEALTH_STATE | 3 | 表示当前设备电池健康状态的查询键。 | +| EXTRA_PLUGGED_TYPE | 4 | 表示当前设备连接的充电器类型的查询键。 | +| EXTRA_MAX_CURRENT | 5 | 表示当前设备电池最大电流的查询键。 | +| EXTRA_MAX_VOLTAGE | 6 | 表示当前设备电池最大电压的查询键。 | +| EXTRA_CHARGE_STATE | 7 | 表示当前设备电池充电状态的查询键。 | +| EXTRA_CHARGE_COUNTER | 8 | 表示当前设备电池充电次数的查询键。 | +| EXTRA_PRESENT | 9 | 表示当前设备是否支持电池或者电池是否在位的查询键。 | +| EXTRA_TECHNOLOGY | 10 | 表示当前设备电池技术型号的查询键。 | +| EXTRA_CAPACITY_LEVEL | 11 | 表示当前设备电池电量等级的查询键。 | + +变更后: + +| 名称 | 值 | 说明 | +| -------------------- | --------------- | -------------------------------------------------- | +| EXTRA_SOC | "soc" | 表示剩余电池电量百分比的查询键。 | +| EXTRA_CHARGE_STATE | "chargeState" | 表示当前设备电池充电状态的查询键。 | +| EXTRA_HEALTH_STATE | "healthState" | 表示当前设备电池健康状态的查询键。 | +| EXTRA_PLUGGED_TYPE | "pluggedType" | 表示当前设备连接的充电器类型的查询键。 | +| EXTRA_VOLTAGE | "voltage" | 表示当前设备电池电压的查询键。 | +| EXTRA_TECHNOLOGY | "technology" | 表示当前设备电池技术型号的查询键。 | +| EXTRA_TEMPERATURE | "temperature" | 表示当前设备电池温度的查询键。 | +| EXTRA_PRESENT | "present" | 表示当前设备是否支持电池或者电池是否在位的查询键。 | +| EXTRA_CAPACITY_LEVEL | "capacityLevel" | 表示当前设备电池电量等级的查询键。 | + +#### 适配指导 + +请参考[@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) (电量信息)接口的API参考。 +## cl.powermgr.2 estimatedRemainingChargeTime系统接口变更 + +[@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) (电量信息)中的estimatedRemainingChargeTime属性变更为系统接口。 + +#### 变更影响 + +基于此前版本开发的应用,需适配新的系统权限,否则会影响原有业务逻辑。 + +#### 适配指导 + +请参考[@ohos.batteryInfo](../../../application-dev/reference/apis/js-apis-battery-info.md) (电量信息)接口的API参考。 + +## cl.powermgr.3 系统公共事件行为变更 + +电量信息通过[@ohos.commonEventManager (公共事件模块)](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-commonEventManager.md)提供了如下几种系统公共事件: + +- COMMON_EVENT_BATTERY_LOW,表示电池电量低的的公共事件的动作,包含剩余电池电量百分比信息; +- COMMON_EVENT_BATTERY_OKAY,表示电池电量正常的公共事件的动作,包含剩余电池电量百分比信息; +- COMMON_EVENT_POWER_CONNECTED,表示设备连接到外部电源的公共事件的动作,包含设备连接的电源类型信息; +- COMMON_EVENT_POWER_DISCONNECTED,表示设备与外部电源断开的公共事件的动作,包含设备连接的电源类型信息; +- COMMON_EVENT_CHARGING,表示系统开始为电池充电的公共事件的动作,包含充电状态信息; +- COMMON_EVENT_DISCHARGING,表示系统停止为电池充电的公共事件的动作,包含充电状态信息。 + +这几种公共事件的数据的获取方式从CommonEventData.data变更为CommonEventData.code。 + +#### 变更影响 + +基于此前版本开发的应用,需适配新的数据获取方式,否则会影响原有业务逻辑。 + +#### 适配指导 + +请参考[ @ohos.commonEventManager (公共事件模块)](../../../application-dev/reference/apis/js-apis-commonEventManager.md)接口的API参考。 diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-resourceschedule.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-resourceschedule.md new file mode 100644 index 0000000000000000000000000000000000000000..ed8c1b666f686ecabef67f7d6b61f0063edd6e3a --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-resourceschedule.md @@ -0,0 +1,107 @@ +# 资源调度子系统ChangeLog + +## cl.resourceschedule.workScheduler.1 + +WorkSchedulerExtensionAbility提供默认的WorkSchedulerExtensionContext。 + +**变更影响** + +基于OpenHarmony4.0.5.1及之后的SDK版本开发的应用,可使用默认的context属性作为WorkSchedulerExtension的上下文环境。 + +**关键接口/组件变更** + +@ohos.WorkSchedulerExtensionAbility.d.ts中新增context属性。新增文件application/WorkSchedulerExtensionContext.d.ts,继承自ExtensionContext。 + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| -- | -- | -- | -- | +| @ohos.WorkSchedulerExtensionAbility.d.ts | WorkSchedulerExtensionAbility | context: WorkSchedulerExtensionContext; | 新增 | +| application/WorkSchedulerExtensionContext.d.ts | WorkSchedulerExtensionContext | - | 新增 | + +**适配指导**
+ +通过WorkSchedulerExtensionAbility子类实例来获取WorkSchedulerExtensionContext。 + +```ts +import WorkSchedulerExtensionAbility from '@ohos.WorkSchedulerExtensionAbility'; + +class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { + onWorkStart(workInfo) { + let WorkSchedulerExtensionContext = this.context; // 获取WorkSchedulerExtensionContext + } +} +``` + + +## cl.resourceschedule.reminderAgent.1 + +提醒代理支持系统应用设置自定义按钮,并且自定义按钮可跳转指定应用界面。 + +**变更影响** + +基于OpenHarmony4.0.7.1及之后的SDK版本开发的系统应用,可设置提醒自定义按钮。 + +**关键接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| -- | -- | -- | -- | +| reminderAgentManager | ActionButtonType | ACTION_BUTTON_TYPE_CUSTOM = 2 | 新增 | +| reminderAgentManager | ActionButton | wantAgent?: WantAgent | 新增 | +| reminderAgentManager | WantAgent | uri?: string | 新增 | +| reminderAgentManager | ReminderRequest | actionButton?: [ActionButton?, ActionButton?, ActionButton?] | 变更 | + +**适配指导**
+ +```ts +import reminderAgentManager from '@ohos.reminderAgentManager'; + +let targetReminderAgent: reminderAgentManager.ReminderRequestAlarm = { + reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_ALARM, // 提醒类型为闹钟类型 + ... + actionButton: [ + { + title: '稍后提醒', + type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_SNOOZE + }, + { + title: '关闭', + type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CLOSE + }, + { + title: '自定义', + type: reminderAgentManager.ActionButtonType.ACTION_BUTTON_TYPE_CUSTOM, + wantAgent: { + pkgName: "com.example.myapplication", + abilityName: "EntryAbility", + } + }, + ] +} +``` + +## cl.resourceschedule.reminderAgent.2 + +提醒代理支持设置通知自动消失和自动消失时间。 + +**变更影响** + +基于OpenHarmony4.0.7.1及之后的SDK版本开发的系统应用,可设置提醒自动消失。 + +**关键接口/组件变更** + +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| -- | -- | -- | -- | +| reminderAgentManager | ReminderRequest | tapDismissed?: boolean | 新增 | +| reminderAgentManager | ReminderRequest | autoDeletedTime?: number | 新增 | + +**适配指导**
+ +```ts +import reminderAgentManager from '@ohos.reminderAgentManager'; + +let targetReminderAgent: reminderAgentManager.ReminderRequestAlarm = { + reminderType: reminderAgentManager.ReminderType.REMINDER_TYPE_ALARM, // 提醒类型为闹钟类型 + ... + tapDismissed: true, + autoDeletedTime: 300, +} +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-screenlock.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-screenlock.md new file mode 100644 index 0000000000000000000000000000000000000000..8e5a2fab3671eb32db8accb72d764a1194f26ff1 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-screenlock.md @@ -0,0 +1,155 @@ +# 主题框架子系统-锁屏管理服务ChangeLog + + +## cl.screenlock.1 isLocked、unlock接口使用权限变更 +从API9开始,变更为systemapi,停止对三方应用开放。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。 + +- 涉及接口 + +```js + function isLocked(): boolean; + function unlock(callback: AsyncCallback): void; + function unlock():Promise; +``` + +- 变更前: + +```js + * Checks whether the screen is currently locked. + * + * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 9 + */ + function isLocked(): boolean; + + /** + * Unlock the screen. + * + * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 9 + */ + function unlock(callback: AsyncCallback): void; + + /** + * Unlock the screen. + * + * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 9 + */ + function unlock():Promise; +``` + +- 变更后: + +```js + * Checks whether the screen is currently locked. + * + * @returns Returns {@code true} if the screen is currently locked; returns {@code false} otherwise. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.ScreenLock + * @systemapi Hide this for inner system use. + * @since 9 + */ + function isLocked(): boolean; + + /** + * Unlock the screen. + * + * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 9 + */ + function unlock(callback: AsyncCallback): void; + + /** + * Unlock the screen. + * + * @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise. + * @throws {BusinessError} 13200002 - the screenlock management service is abnormal. + * @syscap SystemCapability.MiscServices.ScreenLock + * @since 9 + */ + function unlock():Promise; +``` + + +**适配指导** + +该接口变更为系统应用后,三方应用已无法使用。 +系统应用可正常使用。 +示例代码如下: + +```js + try { + let ret = screenLock.isLocked(); + console.error(`Obtain whether the screen is locked successfully , ret is: ${ret}`); + } catch (error) { + console.error(`Failed to obtain whether the screen is locked, error is : ${error.code}, ${error.message}`); + } +``` + +```js + screenlock.unlock((err, data) => { + if (err) { + console.error(`Failed to unlock the screen, because: ${err.message}`); + return; + } + console.info(`unlock the screen successfully. result: ${data}`); + }); +``` + +```js + screenlock.unlock().then((data) => { + console.info(`unlock the screen successfully. result: ${data}`); + }).catch((err) => { + console.error(`Failed to unlock the screen, because: ${err.message}`); + }); +``` + + +## cl.screenlock.2 isSecure接口废弃变更 +从API9开始,废弃此接口。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +该接口删除无法再使用,请使用进行更新使用,否则会影响原有功能。 + +- 涉及接口 + +```js + function isSecure(): boolean; +``` + +- 变更前: + +```js + function isSecure(): boolean; +``` + +- 变更后:删除接口,停止对外开放。 + + +**适配指导** + +该接口删除后无法再使用,请适配更新。 diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-security.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-security.md new file mode 100644 index 0000000000000000000000000000000000000000..90166d4d21265578bcdfd8236236d53f15671260 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-security.md @@ -0,0 +1,87 @@ +# security子系统ChangeLog + +## cl.security.1 ParamsSpec属性名变更为algName。 +结构体ParamsSpec的属性algoName由于API命名统一,名称更改为algName。 + +**变更影响** + +影响已发布的JS接口,对ParamsSpec以及其子类IvParamsSpec,GcmParamsSpec与CcmParamsSpec,使用这些对象作为参数或返回值时,其属性名需要更改为algName。 +应用需要进行适配,才可以在新版本SDK环境正常编译通过。 + +**关键的接口/组件变更** + +修改前的接口原型: + + ```ts +interface ParamsSpec { + /** + * Indicates the algorithm name. Should be set before initialization of a cipher object. + * @type { string } + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ + algoName : string; +} + ``` +修改后的接口原型: + + ```ts +interface ParamsSpec { + /** + * Indicates the algorithm name. Should be set before initialization of a cipher object. + * @type { string } + * @syscap SystemCapability.Security.CryptoFramework + * @since 9 + */ + algName : string; +} + ``` + +**适配指导** + +对ParamsSpec以及其子类IvParamsSpec,GcmParamsSpec与CcmParamsSpec,使用这些对象作为参数或返回值时,其属性名需要从algoName更改为algName。 + ```ts +function genGcmParamsSpec() { + let arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0 , 0, 0]; // 12 bytes + let dataIv = new Uint8Array(arr); + let ivBlob = {data : dataIv}; + + arr = [0, 0, 0, 0 , 0, 0, 0, 0]; // 8 bytes + let dataAad = new Uint8Array(arr); + let aadBlob = {data : dataAad}; + + arr = [0, 0, 0, 0 , 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0]; // 16 bytes + let dataTag = new Uint8Array(arr); + let tagBlob = {data : dataTag}; + let gcmParamsSpec = {iv : ivBlob, aad : aadBlob, authTag : tagBlob, algName : "GcmParamsSpec"}; + return gcmParamsSpec; +} + ``` +详细查看API参考中ParamsSpec对应的接口适配指南: +[加解密算法库框架-ParamsSpec-API参考](../../../application-dev/reference/apis/js-apis-cryptoFramework.md#paramsspec) + +## cl.security.2 ECC密码算法的参数名从ECC512变更为ECC521 + +**变更影响** + +影响已发布的JS接口,接口行为发生变更。 +应用需要进行适配,才可以在新版本SDK环境获取正确结果。 + +**关键的接口/组件变更** +发布的JS接口不变, 传入接口的参数发生变化,由ECC512变化为ECC521,具体可见[加解密算法库框架-ECC密码算法参数参考](../../../application-dev/security/cryptoFramework-overview.md#密钥生成规格),涉及的接口有: + +cryptoFramework.createAsyKeyGenerator + +cryptoFramework.createSign + +cryptoFramework.createVerify + +cryptoFramework.createKeyAgreement + +**适配指导** + +```js +import cryptoFramework from "@ohos.security.cryptoFramework" + +let asyKeyGenerator = cryptoFramework.createAsyKeyGenerator("ECC521"); +``` \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-sensor.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-sensor.md new file mode 100644 index 0000000000000000000000000000000000000000..602f155fcfdaf5464ea0be5eb248b630746565cc --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-sensor.md @@ -0,0 +1,49 @@ +# 泛sensor子系统ChangeLog + +## cl.ability.1 Sensor接口中venderName属性名称变更,更改为vendorName。 + +venderName为错别字,更正为vendorName。 + +**变更影响** + +该venderName属性无法再使用,请使用新增属性vendorName替换。 + +**关键的接口/组件变更** + +- 变更前: + +```js + interface Sensor { + sensorName:string; /**< Sensor name */ + venderName:string; /**< Sensor vendor version */ + firmwareVersion:string; /**< Sensor firmware version */ + hardwareVersion:string; /**< Sensor hardware version */ + sensorId:number; /**< Sensor type ID, {@code SensorType} */ + maxRange:number; /**< Maximum measurement range of the sensor */ + minSamplePeriod:number; /**< Minimum sample period allowed, in ns */ + maxSamplePeriod:number; /**< maximum sample period allowed, in ns */ + precision:number; /**< Sensor accuracy */ + power:number; /**< Sensor power */ + } +``` + +- 变更后: + +```js + interface Sensor { + sensorName:string; /**< Sensor name */ + vendorName:string; /**< Sensor vendor version */ + firmwareVersion:string; /**< Sensor firmware version */ + hardwareVersion:string; /**< Sensor hardware version */ + sensorId:number; /**< Sensor type ID, {@code SensorType} */ + maxRange:number; /**< Maximum measurement range of the sensor */ + minSamplePeriod:number; /**< Minimum sample period allowed, in ns */ + maxSamplePeriod:number; /**< maximum sample period allowed, in ns */ + precision:number; /**< Sensor accuracy */ + power:number; /**< Sensor power */ + } +``` + +**适配指导** + +该venderName属性删除无法再使用,请使用新增属性vendorName替换。 \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-softbus.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-softbus.md new file mode 100644 index 0000000000000000000000000000000000000000..24592f1d4670c682785e7b4abbf7189edfe74f53 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-softbus.md @@ -0,0 +1,27 @@ +# 软总线子系统ChangeLog + +## cl.softbus.1 IPC接口中unregisterDeathRecipient接口返回值变更,更改为void。 + +unregisterDeathRecipient(recipient: DeathRecipient, flags: number)方法返回值为boolean,更正为void。 + +**变更影响** + +该unregisterDeathRecipient接口如果需要继续使用,建议优先使用removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean方法。 + +**关键的接口/组件变更** + +- 变更前: + +```js + unregisterDeathRecipient(recipient: DeathRecipient, flags: number): boolean +``` + +- 变更后: + +```js + unregisterDeathRecipient(recipient: DeathRecipient, flags: number): void +``` + +**适配指导** + +该unregisterDeathRecipient接口如果需要继续使用,建议优先使用removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean方法。 \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-startup.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-startup.md new file mode 100644 index 0000000000000000000000000000000000000000..576e35701471fd1640f5b6205a5e1cc05e983cf9 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-startup.md @@ -0,0 +1,16 @@ +# 启动子系统JS API变更ChangeLog + +## cl.startup.1 包名变更 + +**变更影响** + +原有的@ohos.systemParameterV9包名将被删除无法再使用,需更换为新的@ohos.systemParameterEnhance包名。 + +**适配指导** + +原有的@ohos.systemParameterV9需要变更为@ohos.systemParameterEnhance,包内接口都不变,示例: + +```js +import @ohos.systemParameterEnhance +``` + diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-telephony.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-telephony.md new file mode 100644 index 0000000000000000000000000000000000000000..4af67bf47de693c4678408d588be693b9c698a1a --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-telephony.md @@ -0,0 +1,130 @@ +# 电话子系统ChangeLog + + + +## cl.telephony.radio.1 isNrSupported接口变更 + + +NR是专有名词,需要全部大写。 + +开发者需要根据以下说明对应用进行适配。 + + + +**变更影响** + +基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。 + + + +**关键的接口/组件变更** + +- 涉及接口 + + isNrSupported(): boolean; + isNrSupported(slotId: number): boolean; + +- 变更前: + +```js +function isNrSupported(): boolean; +function isNrSupported(slotId: number): boolean; +``` + +- 变更后: + +```js +function isNRSupported(): boolean; +function isNRSupported(slotId: number): boolean; +``` + + + +**适配指导** + +使用变更后的接口,示例代码如下: + +```js +let result = radio.isNrSupported(); +console.log("Result: "+ result); +``` + + +```js +let slotId = 0; +let result = radio.isNRSupported(slotId); +console.log("Result: "+ result); +``` + + +## cl.telephony.call.2 dial接口变更 + +从API9开始,废弃此接口,改为使用dialCall接口。 + +开发者需要根据以下说明对应用进行适配。 + + +**变更影响** + +该接口删除无法再使用,请使用新增的接口dialCall替换,否则会影响原有功能。 + + +**关键的接口/组件变更** + +- 涉及接口 + + dial(phoneNumber: string, callback: AsyncCallback): void; + dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback): void; + dial(phoneNumber: string, options?: DialOptions): Promise; + +- 变更前: + +```js +function dial(phoneNumber: string, callback: AsyncCallback): void; +function dial(phoneNumber: string, options: DialOptions, callback: AsyncCallback): void; +function dial(phoneNumber: string, options?: DialOptions): Promise; +``` + +- 变更后: + +```js +function dialCall(phoneNumber: string, callback: AsyncCallback): void; +function dialCall(phoneNumber: string, options: DialCallOptions, callback: AsyncCallback): void; +function dialCall(phoneNumber: string, options?: DialCallOptions): Promise; +``` + + + +**适配指导** + +该接口删除无法再使用,请使用新增的接口dialCall替换。 +使用变更后的接口,示例代码如下: + +```js +call.dialCall("138xxxxxxxx", (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +```js +call.dialCall("138xxxxxxxx", { + accountId: 0, + videoState: 0, + dialScene: 0, + dialType: 0, +}, (err, data) => { + console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`); +}); +``` + + +```js +try { + call.dialCall('138xxxxxxxx'); + console.log(`dialCall success, promise: data->${JSON.stringify(data)}`); +} catch (error) { + console.log(`dialCall fail, promise: err->${JSON.stringify(error)}`); +} +``` + diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-testfwk_arkxtest.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-testfwk_arkxtest.md new file mode 100644 index 0000000000000000000000000000000000000000..d508e473d7d48695a059508de789b84730b4f13e --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-testfwk_arkxtest.md @@ -0,0 +1,42 @@ +# 测试子系统ChangeLog + +## cl.testfwk_arkxtest.1 Rect控件边框信息类接口名称变更 + +表示控件边框信息的枚举类型Rect定义自4.0.2.1版本起进行了变更。 + +## 变更影响 + +此变更影响@ohos.uitest提供的Rect接口。用户此前在测试用例开发中使用了@ohos.uitest-api9 中Rect接口的,需要进行适配才可以在新版本SDK环境正常编译通过。 + +## 关键的接口/组件变更 + +### Rect9+ + +变更前: + +| 名称 | 值 | 说明 | +| ------- | ---- | ------------------------- | +| leftX | 1 | 控件边框的左上角的X坐标。 | +| topY | 2 | 控件边框的左上角的Y坐标。 | +| rightX | 3 | 控件边框的右下角的X坐标。 | +| bottomY | 4 | 控件边框的右下角的Y坐标。 | + +变更后: + +| 名称 | 值 | 说明 | +| ------ | ---- | ------------------------- | +| left | 1 | 控件边框的左上角的X坐标。 | +| top | 2 | 控件边框的左上角的Y坐标。 | +| right | 3 | 控件边框的右下角的X坐标。 | +| bottom | 4 | 控件边框的右下角的Y坐标。 | + +## 适配指导 + +### 适配接口名称变更 + +可按照如下规则做类名替换: + +- `leftX-->left` +- `topY-->top` +- `rightX-->right` +- `bottomY-->bottom` diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-usb.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-usb.md new file mode 100644 index 0000000000000000000000000000000000000000..c6eca27ffd91461c1d56ef1a5d561fa366b35d99 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-usb.md @@ -0,0 +1,88 @@ +# USB服务子系统ChangeLog + +## cl.usb_manager.1 系统接口变更 + +USB系统API运行时鉴权,异步接口以Promise reject形式抛出错误码。 + +基于此前版本开发的应用,需修改函数的返回值,否则会影响原有业务逻辑。 + +**关键接口/组件变更** + +| 包名 | 旧接口 | 新接口 | +| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| ohos.usbV9.d.ts | function setCurrentFunctions(funcs: FunctionType): Promise; | function setCurrentFunctions(funcs: FunctionType): Promise; | +| ohos.usbV9.d.ts | function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; | function setPortRoles(portId: number, powerRole: PowerRoleType, dataRole: DataRoleType): Promise; | + +## cl.usb_manager.2 sdk接口删除 + +继OpenHarmony 4.0.5.5版本3.30之后,@ohos.usbV9.d.ts文件已删除。 + +后续需要import @ohos.usbManager才能使用USB服务的接口: + + ```ts + import usbManager from '@ohos.usbManager'; + ``` + +**适配指导** + +请参考各接口的[API文档](../../../application-dev/reference/apis/js-apis-usbManager.md) + + +## cl.usb_manager.2 包名变更 + +基于此前版本开发的应用,需修改导入的包名,否则会影响原有业务逻辑。 + +**关键接口/组件变更** + +| 旧包名 | 新包名 | +|------------------ | ------------------- | +| ohos.usbV9.d.ts | ohos.usbManager.d.ts | + +**适配指导** + +开发者导入时将@ohos.usbV9更换为@ohos.usbManager即可。 + +## cl.usb_manager.3 接口参数类型变更 + +基于此前版本开发的应用,需修改参数类型,否则会影响原有业务逻辑。 + +**关键接口/组件变更** + +| 旧类名 | 新类名 | +|---------------| ------------- | +| interface USBConfig | interface USBConfiguration | + +| 旧命名空间 | 新命名空间 | +|---------------| ------------- | +| @namespace usbV9 | @namespace usbManager | + +| 包名 | 旧接口 | 新接口 | +| --------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | +| ohos.usbManager.d.ts | function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | function setConfiguration(pipe: USBDevicePipe, config: USBConfiguration): number; | + +**适配指导** + +调用setConfiguration接口时参数类型USBConfig修改为USBConfiguration即可。 + + +## cl.usb_manager.4 sdk接口删除 + +基于此前版本开发的应用,需修改导入的包名,否则会影响原有业务逻辑。 + +**关键接口/组件变更** + +@ohos.usbV9.d.ts文件已删除,由@ohos.usbManager.d.ts替代。 + +| 新包名 | 旧包名 | 已删除包名 | +| -------------------- | ------------- | --------------- | +| ohos.usbManager.d.ts | ohos.usb.d.ts | ohos.usbV9.d.ts | + +后续需要import @ohos.usbManager才能使用USB服务的接口: + + ```ts + import usbManager from '@ohos.usbManager'; + ``` + +**适配指导** + +请参考各接口的[API文档](../../../application-dev/reference/apis/js-apis-usbManager.md) diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-wallpaper.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-wallpaper.md new file mode 100644 index 0000000000000000000000000000000000000000..13baab45851959398ccf4689543f91c5e1aa1d68 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-wallpaper.md @@ -0,0 +1,304 @@ +# 主题框架子系统-壁纸管理服务ChangeLog + + +## cl.wallpaper.1 getColorsSync、getMinHeightSync、getMinWidthSync、restore、setImage接口使用权限变更 +从API9开始,变更为systemapi,停止对三方应用开放。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。 + +- 涉及接口 + +```js + function getColorsSync(wallpaperType: WallpaperType): Array; + function getMinHeightSync(): number; + function getMinWidthSync(): number; + function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + function restore(wallpaperType: WallpaperType): Promise; + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; +``` + +- 变更前: + +```js + /** + * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. + * @param wallpaperType Indicates the wallpaper type. + * @returns { Array } the Array returned by the function. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getColorsSync(wallpaperType: WallpaperType): Array; + + /** + * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * @returns { number } the number returned by the function. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getMinHeightSync(): number; + + /** + * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * @returns { number } the number returned by the function. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function getMinWidthSync(): number; + + /** + * Removes a wallpaper of the specified type and restores the default one. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Removes a wallpaper of the specified type and restores the default one. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function restore(wallpaperType: WallpaperType): Promise; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @systemapi Hide this for inner system use. + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; +``` + +- 变更后: + +```js + /** + * Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function. + * @param wallpaperType Indicates the wallpaper type. + * @returns { Array } the Array returned by the function. + * @throws {BusinessError} 401 - parameter error. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function getColorsSync(wallpaperType: WallpaperType): Array; + + /** + * Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * @returns { number } the number returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function getMinHeightSync(): number; + + /** + * Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set. + * @returns { number } the number returned by the function. + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function getMinWidthSync(): number; + + /** + * Removes a wallpaper of the specified type and restores the default one. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function restore(wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Removes a wallpaper of the specified type and restores the default one. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function restore(wallpaperType: WallpaperType): Promise; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback): void; + + /** + * Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file. + * @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file. + * @param wallpaperType Indicates the wallpaper type. + * @throws {BusinessError} 401 - parameter error. + * @throws {BusinessError} 201 - permission denied. + * @permission ohos.permission.SET_WALLPAPER + * @syscap SystemCapability.MiscServices.Wallpaper + * @since 9 + */ + function setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise; +``` + + +**适配指导** + +该接口变更为系统应用后,三方应用已无法使用。 +系统应用可正常使用。 +示例代码如下: + +```js + try { + let colors = wallpaper.getColorsSync(wallpaper.WallpaperType.WALLPAPER_SYSTEM); + console.log(`success to getColorsSync: ${JSON.stringify(colors)}`); + } catch (error) { + console.error(`failed to getColorsSync because: ${JSON.stringify(error)}`); + } +``` + +```js + let minHeight = wallpaper.getMinHeightSync(); +``` + +```js + let minWidth = wallpaper.getMinWidthSync(); +``` + +```js + wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => { + if (error) { + console.error(`failed to restore because: ${JSON.stringify(error)}`); + return; + } + console.log(`success to restore.`); + }); +``` + +```js + wallpaper.restore(wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => { + console.log(`success to restore.`); + }).catch((error) => { + console.error(`failed to restore because: ${JSON.stringify(error)}`); + }); +``` + +```js + // source类型为string + let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg"; + wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM, (error) => { + if (error) { + console.error(`failed to setImage because: ${JSON.stringify(error)}`); + return; + } + console.log(`success to setImage.`); + }); +``` + +```js + // source类型为string + let wallpaperPath = "/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg"; + wallpaper.setImage(wallpaperPath, wallpaper.WallpaperType.WALLPAPER_SYSTEM).then(() => { + console.log(`success to setImage.`); + }).catch((error) => { + console.error(`failed to setImage because: ${JSON.stringify(error)}`); + }); +``` + + +## cl.wallpaper.2 getIdSync、getFileSync、isChangeAllowed、isUserChangeAllowed、on、off、RgbaColor接口废弃变更 +从API9开始,废弃此接口。 + +开发者需要根据以下说明对应用进行适配。 + +**变更影响** + +该接口删除无法再使用,请使用进行更新使用,否则会影响原有功能。 + +- 涉及接口 + +```js + function getIdSync(wallpaperType: WallpaperType): number; + function getFileSync(wallpaperType: WallpaperType): number; + function isChangeAllowed(): boolean; + function isUserChangeAllowed(): boolean; + function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void; + function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void; + interface RgbaColor { + red: number; + green: number; + blue: number; + alpha: number; + } +``` + +- 变更前: + +```js + function getIdSync(wallpaperType: WallpaperType): number; + function getFileSync(wallpaperType: WallpaperType): number; + function isChangeAllowed(): boolean; + function isUserChangeAllowed(): boolean; + function on(type: 'colorChange', callback: (colors: Array, wallpaperType: WallpaperType) => void): void; + function off(type: 'colorChange', callback?: (colors: Array, wallpaperType: WallpaperType) => void): void; + interface RgbaColor { + red: number; + green: number; + blue: number; + alpha: number; + } +``` + +- 变更后:删除接口,停止对外开放。 + + +**适配指导** + +该接口删除后无法再使用,请适配更新。 diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-web.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-web.md new file mode 100644 index 0000000000000000000000000000000000000000..f5af20f5f3c7a7f5e380e8b3c4c0077ece6a3f55 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-web.md @@ -0,0 +1,621 @@ +# web子系统ChangeLog + +OpenHarmony 4.0.2.1 版本相较于OpenHarmony 之前的版本,web的API变更如下。 + +## cl.web.1 postMessageEvent参数类型变更 + +该接口postMessageEvent原先仅支持string类型,从4.0.2.1版本开始新增支持ArrayBuffer类型。 + +**变更影响** + +该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,原有功能不受影响。 + +**关键的接口/组件变更** + +- 涉及接口 + + postMessageEvent(message: string): void + +- 变更前: + + ```ts + postMessageEvent(message: string): void + ``` + +- 变更后: + + ```ts + type WebMessage = ArrayBuffer | string + postMessageEvent(message: WebMessage): void + ``` + +**适配指导** + +该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,原有功能不受影响。 + +## cl.web.2 onMessageEvent参数类型变更 + +该接口onMessageEvent原先仅支持string类型,从4.0.2.1版本开始新增支持ArrayBuffer类型。 + +**变更影响** + +该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,增加相应的逻辑处理,原有功能不受影响。 + +**关键的接口/组件变更** + +- 涉及接口 + + onMessageEvent(callback: (result: string) => void): void + +- 变更前: + + ```ts + onMessageEvent(callback: (result: string) => void): void + ``` + +- 变更后: + + ```ts + type WebMessage = ArrayBuffer | string + onMessageEvent(callback: (result: WebMessage) => void): void + ``` + +**适配指导** + +该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,增加相应的逻辑处理,原有功能不受影响。 + + +## cl.web.3 删除webDebuggingAccess接口 + +该接口定义不合理,该属性对所有web实例生效的,属于全局配置。用本次新增的接口setWebDebuggingAccess替换。 + +**变更影响** + +该接口删除无法再使用,请使用新增的接口setWebDebuggingAccess替换。 + +**关键的接口/组件变更** + +| 类名 | 接口类型 | 接口声明 | 变更类型 | +| -- | -- | -- | -- | +|WebAttribute | method | webDebugggingAccess(webDebugggingAccess: boolean): WebAttribute| 删除 | + +**适配指导** + +该接口删除无法再使用,请使用新增的接口setWebDebuggingAccess替换。 + +## cl.web.4 新增setWebDebuggingAccess接口 + +WebviewController提供静态方法来设置调试模式开关,该设置对所有web实例生效。 + +**变更影响** + +原有webDebugggingAccess属性定义不合理,因此新增该静态接口来设置调试模式开关。应用侧需要使用该接口来打开调试模式开关。 + +**关键的接口/组件变更** + +| 类名 | 接口类型 | 接口声明 | 变更类型 | +| -- | -- | -- | -- | +|webview.WebviewController | method | static setWebDebugggingAccess(webDebugggingAccess: boolean): void| 新增 | + +**适配指导** + +以打开调试开关为例,示例代码如下: + +```ts +// xxx.ets +import web_webview from '@ohos.web.webview'; + +@Entry +@Component +struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController(); + + aboutToAppear():void { + try { + web_webview.WebviewController.setWebDebuggingAccess(true); + } catch(error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + } + + build() { + Column() { + Web({ src: 'www.example.com', controller: this.controller }) + } + } +} + +## cl.web.5 HitTestTypeV9命名变更 + +枚举类HitTestTypeV9由于命名规范问题,名称变更为WebHitTestType。 + +**变更影响** + +枚举类HitTestTypeV9,以及使用HitTestTypeV9作为参数或返回值的接口,在4.0.3.2版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + enum HitTestTypeV9 + +- 变更前: + + ```ts + enum HitTestTypeV9 + ``` + +- 变更后: + + ```ts + enum WebHitTestType + ``` + +**适配指导** + +请使用WebHitTestType替换HitTestTypeV9。 + +## cl.web.6 HeaderV9命名变更 + +结构体HeaderV9由于命名规范问题,名称变更为WebHeader。 + +**变更影响** + +结构体HeaderV9,以及使用HeaderV9作为参数或返回值的接口,在4.0.3.2版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + interface HeaderV9 + +- 变更前: + + ```ts + interface HeaderV9 + ``` + +- 变更后: + + ```ts + interface WebHeader + ``` + +**适配指导** + +请使用WebHeader替换HeaderV9。 + +## cl.web.7 HitTestValue结构体成员类型变更 + +结构体HitTestValue中的成员变量HitTestTypeV9由于命名规范问题,名称变更为WebHitTestType。 + +**变更影响** + +结构体HitTestValue,以及使用HitTestValue作为参数或返回值的接口,在4.0.3.2版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + interface HitTestValue + +- 变更前: + + ```ts + interface HitTestValue { + + /** + * Get the hit test type. + * + * @since 9 + */ + type: HitTestTypeV9; + + /** + * Get the hit test extra data. + * + * @since 9 + */ + extra: string; + } + ``` + +- 变更后: + + ```ts + interface HitTestValue { + + /** + * Get the hit test type. + * + * @since 9 + */ + type: WebHitTestType; + + /** + * Get the hit test extra data. + * + * @since 9 + */ + extra: string; + } + ``` + +**适配指导** + +请使用WebHitTestType替换HitTestTypeV9。 + +## cl.web.8 loadUrl参数类型变更 + +loadUrl接口中的参数headers,由于其类型的命名规范问题,类型变更为WebHeader。 + +**变更影响** + +loadUrl接口若使用了headers参数,则在4.0.3.2版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + loadUrl(url: string | Resource, headers?: Array): void + +- 变更前: + + ```ts + loadUrl(url: string | Resource, headers?: Array): void + ``` + +- 变更后: + + ```ts + loadUrl(url: string | Resource, headers?: Array): void + ``` + +**适配指导** + +在loadUrl中设置headers参数时,请使用WebHeader类型替换HeaderV9类型。 + +## cl.web.9 getHitTest返回值类型变更 + +getHitTest接口中的返回值,由于其类型的命名规范问题,变更为WebHitTest。 + +**变更影响** + +getHitTest接口,在4.0.3.2版本及后续版本中无法继续正常使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + getHitTest(): HitTestTypeV9 + +- 变更前: + + ```ts + getHitTest(): HitTestTypeV9 + ``` + +- 变更后: + + ```ts + getHitTest(): WebHitTestType + ``` + +**适配指导** + +在使用getHitTest接口的返回值时,请使用WebHitTestType类型替换HitTestTypeV9类型。 + +## cl.web.10 WebMessagePort类迁移 + +WebMessagePort类迁移至@ohos.web.webview.d.ts,并新增错误码抛出。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现该类下接口支持错误码处理,需注意错误码处理的使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + postMessageEvent(message: WebMessageEvent): void; + onMessageEvent(callback: (result: string) => void): void; + +- 变更前: + + ```ts + postMessageEvent(message: WebMessageEvent): void; + onMessageEvent(callback: (result: string) => void): void; + ``` + +- 变更后: + + ```ts + postMessageEvent(message: WebMessage): void; + onMessageEvent(callback: (result: WebMessage) => void): void; + ``` + +**适配指导** + +原WebMessagePort类不需要import,现WebMessagePort类使用的是@ohos.web.webview,以下方式import: + + ```ts + import web_webview from '@ohos.web.webview'; + ``` + +## cl.web.11 HitTestValue类迁移 + +HitTestValue类迁移至@ohos.web.webview.d.ts,HitTestValue类变更为接口,getType,getExtra变更为属性。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。 + +**关键的接口/组件变更** + +- 涉及接口 + + getType(): HitTestType; + getExtra(): string; + +- 变更前: + + ```ts + getType(): HitTestType; + getExtra(): string; + ``` + +- 变更后: + + ```ts + type: WebHitTestType; + extra: string; + ``` + +**适配指导** + +原HitTestValue类不需要import,现HitTestValue类使用的是@ohos.web.webview,以下方式import: + + ```ts + import web_webview from '@ohos.web.webview'; + ``` + +## cl.web.12 WebCookie类下api9接口迁移 + +WebCookie类下api9接口迁移,WebCookie类下api9接口迁移到web.webview.webview.WebCookieManager。 +并新增接口错误码抛出。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现该类下接口支持错误码处理,需注意错误码处理的使用。 +该类方法变为静态方法。 + +**关键的接口/组件变更** + +- 涉及接口 + + isCookieAllowed(): boolean; + isThirdPartyCookieAllowed(): boolean; + putAcceptCookieEnabled(accept: boolean): void; + putAcceptThirdPartyCookieEnabled(accept: boolean): void; + setCookie(url: string, value: string): boolean; + saveCookieSync(): boolean; + getCookie(url: string): string; + existCookie(): boolean; + deleteEntireCookie(): void; + deleteSessionCookie(): void; + +- 变更前: + + ```ts + isCookieAllowed(): boolean; + isThirdPartyCookieAllowed(): boolean; + putAcceptCookieEnabled(accept: boolean): void; + putAcceptThirdPartyCookieEnabled(accept: boolean): void; + setCookie(url: string, value: string): boolean; + saveCookieSync(): boolean; + getCookie(url: string): string; + existCookie(): boolean; + deleteEntireCookie(): void; + deleteSessionCookie(): void; + ``` + +- 变更后: + + ```ts + static isCookieAllowed(): boolean; + static isThirdPartyCookieAllowed(): boolean; + static putAcceptCookieEnabled(accept: boolean): void; + static putAcceptThirdPartyCookieEnabled(accept: boolean): void; + static setCookie(url: string, value: string): void; + static saveCookieAsync(): Promise; + static saveCookieAsync(callback: AsyncCallback): void; + static getCookie(url: string): string; + static existCookie(): boolean; + static deleteEntireCookie(): void; + static deleteSessionCookie(): void; + ``` + +**适配指导** + +原WebCookie类不需要import,现WebCookieManager使用的是@ohos.web.webview,以下方式import: + + ```ts + import web_webview from '@ohos.web.webview'; + ``` + +## cl.web.13 WebController类下api9接口迁移 + +WebController类下api9接口迁移至web.webview.webview.WebviewController,并新增接口错误码抛出。 + +**变更影响** + +基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现该类下接口支持错误码处理,需注意错误码处理的使用。 +getDefaultUserAgent接口更名为getUserAgent。 + +**关键的接口/组件变更** + +- 涉及接口 + + zoomIn(): boolean; + zoomOut(): boolean; + createWebMessagePorts(): Array; + postMessage(options: { message: WebMessageEvent, uri: string}): void; + getHitTestValue(): HitTestValue; + getWebId(): number; + getDefaultUserAgent(): string; + getTitle(): string; + getPageHeight(): number; + backOrForward(step: number): void; + searchAllAsync(searchString: string): void; + clearMatches(): void; + searchNext(forward: boolean): void; + clearSslCache(): void; + clearClientAuthenticationCache(): void; + getUrl(): string; + +- 变更前: + + ```ts + zoomIn(): boolean; + zoomOut(): boolean; + createWebMessagePorts(): Array; + postMessage(options: { message: WebMessageEvent, uri: string}): void; + getHitTestValue(): HitTestValue; + getWebId(): number; + getDefaultUserAgent(): string; + getTitle(): string; + getPageHeight(): number; + backOrForward(step: number): void; + searchAllAsync(searchString: string): void; + clearMatches(): void; + searchNext(forward: boolean): void; + clearSslCache(): void; + clearClientAuthenticationCache(): void; + getUrl(): string; + ``` + +- 变更后: + + ```ts + zoomIn(): void; + zoomOut(): void; + createWebMessagePorts(): Array; + postMessage(name: string, ports: Array, uri: string): void; + getHitTestValue(): HitTestValue; + getWebId(): number; + getUserAgent(): string; + getTitle(): string; + getPageHeight(): number; + backOrForward(step: number): void; + searchAllAsync(searchString: string): void; + clearMatches(): void; + searchNext(forward: boolean): void; + clearSslCache(): void; + clearClientAuthenticationCache(): void; + getUrl(): string; + ``` + +**适配指导** + +原WebController类不需要import,现WebviewController类使用的是@ohos.web.webview,以下方式import: + + ```ts + import web_webview from '@ohos.web.webview'; + ``` + +## cl.web.14 WebAsyncController类迁移 + +WebAsyncController类下接口迁移至web.webview.webview.WebviewController,并新增接口错误码抛出。 + +**变更影响** + +基于此前版本开发的应用,需注意错误码处理的使用。 + +**关键的接口/组件变更** + +- 涉及接口 + + storeWebArchive(baseName: string, autoName: boolean): Promise; + storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback): void; + +- 变更前: + + ```ts + storeWebArchive(baseName: string, autoName: boolean): Promise; + storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback): void; + ``` + +- 变更后: + + ```ts + storeWebArchive(baseName: string, autoName: boolean): Promise; + storeWebArchive(baseName: string, autoName: boolean, callback : AsyncCallback): void; + ``` + +**适配指导** + +使用示例: + + ```ts + // xxx.ets + import web_webview from '@ohos.web.webview' + + @Entry + @Component + struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController(); + + build() { + Column() { + Button('saveWebArchive') + .onClick(() => { + try { + this.controller.storeWebArchive("/data/storage/el2/base/", true, (error, filename) => { + if (error) { + console.info(`save web archive error: ` + JSON.stringify(error)) + return; + } + if (filename != null) { + console.info(`save web archive success: ${filename}`) + } + }); + } catch (error) { + console.error(`ErrorCode: ${error.code}, Message: ${error.message}`); + } + }) + Web({ src: 'www.example.com', controller: this.controller }) + } + } + } + ``` + + +## cl.web.15 createWebMessagePorts接口参数 + +由于WebMessagePort需要新增支持更多数据类型,因此在该接口增加一个可选参数来区分新老接口。 + +**变更影响** + +无,可选参数,可前向兼容。 + +**关键的接口/组件变更** + +- 涉及接口 + + createWebMessagePorts(): Array; + +- 变更前: + + ```ts + createWebMessagePorts(): Array; + ``` + +- 变更后: + + ```ts + createWebMessagePorts(isExtentionType?: boolean): Array; + ``` + +**适配指导** + +已有应用无需适配。 \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-wifiManager.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-wifiManager.md new file mode 100644 index 0000000000000000000000000000000000000000..e24ff589dd249e8593c17b5fddaf3f217a655743 --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-wifiManager.md @@ -0,0 +1,62 @@ +# 基础通信子系统WiFi ChangeLog + +## cl.location.1 位置服务权限变更 + +从API9开始,增加ohos.permission.APPROXIMATELY_LOCATION,表示模糊位置权限。 + +如果应用开发者使用的API版本大于等于9,则需要同时申请ohos.permission.LOCATION和ohos.permission.APPROXIMATELY_LOCATION,单独申请ohos.permission.LOCATION会失败。 + +**变更影响** + +如果是存量应用(使用的API版本小于9),则无影响。如果使用的API版本大于等于9,位置服务权限申请方式有变更,详情如下: + +应用在使用系统能力前,需要检查是否已经获取用户授权访问设备位置信息。如未获得授权,可以向用户申请需要的位置权限,申请方式请参考下文。 + +系统提供的定位权限有: + +- ohos.permission.LOCATION + +- ohos.permission.APPROXIMATELY_LOCATION + +- ohos.permission.LOCATION_IN_BACKGROUND + +访问设备的位置信息,必须申请权限,并且获得用户授权。 + +API9之前的版本,申请ohos.permission.LOCATION即可。 + +API9及之后的版本,需要申请ohos.permission.APPROXIMATELY_LOCATION或者同时申请ohos.permission.APPROXIMATELY_LOCATION和ohos.permission.LOCATION;无法单独申请ohos.permission.LOCATION。 + +| 使用的API版本 | 申请位置权限 | 申请结果 | 位置的精确度 | +| -------- | -------- | -------- | -------- | +| 小于9 | ohos.permission.LOCATION | 成功 | 获取到精准位置,精准度在米级别。 | +| 大于等于9 | ohos.permission.LOCATION | 失败 | 无法获取位置。 | +| 大于等于9 | ohos.permission.APPROXIMATELY_LOCATION | 成功 | 获取到模糊位置,精确度为5公里。 | +| 大于等于9 | ohos.permission.APPROXIMATELY_LOCATION和ohos.permission.LOCATION | 成功 | 获取到精准位置,精准度在米级别。 | + +如果应用在后台运行时也需要访问设备位置,除需要将应用声明为允许后台运行外,还必须申请ohos.permission.LOCATION_IN_BACKGROUND权限,这样应用在切入后台之后,系统可以继续上报位置信息。 + +开发者可以在应用配置文件中声明所需要的权限,具体可参考[授权申请指导](../../../application-dev/security/accesstoken-guidelines.md)。 + +**关键的接口/组件变更** + +| 类名 | 接口类型 | 接口声明 | 变更类型 | +| -- | -- | -- | -- | +|wifiManager| method | function scan(): void; | 权限变更为ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function getScanResults(): Promise<Array<WifiScanInfo>>; | 权限变更为ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION)) | +|wifiManager| method | function getScanResults(callback: AsyncCallback<Array<WifiScanInfo>>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION)) | +|wifiManager| method | function getScanResultsSync(): Array<WifiScanInfo>; | 权限变更为ohos.permission.GET_WIFI_INFO and (ohos.permission.GET_WIFI_PEERS_MAC or (ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION)) | +|wifiManager| method | function getCandidateConfigs(): Array<WifiDeviceConfig>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function getDeviceConfigs(): Array<WifiDeviceConfig>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.GET_WIFI_CONFIG | +|wifiManager| method | function getStations(): Array<StationInfo>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION and ohos.permission.MANAGE_WIFI_HOTSPOT | +|wifiManager| method | function getCurrentGroup(): Promise<WifiP2pGroupInfo>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function getCurrentGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function getP2pPeerDevices(): Promise<WifiP2pDevice[]>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function p2pConnect(config: WifiP2PConfig): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function startDiscoverDevices(): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function getP2pGroups(): Promise<Array<WifiP2pGroupInfo>>; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function on(type: "p2pDeviceChange", callback: Callback<WifiP2pDevice>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function off(type: "p2pDeviceChange", callback?: Callback<WifiP2pDevice>): void; | 权限变更为ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function on(type: "p2pPeerDeviceChange", callback: Callback<WifiP2pDevice[]>): void; | 权限变更为ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | +|wifiManager| method | function off(type: "p2pPeerDeviceChange", callback?: Callback<WifiP2pDevice[]>): void; | 权限变更为ohos.permission.LOCATION and ohos.permission.APPROXIMATELY_LOCATION | \ No newline at end of file diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/figures/stack_after.jpg b/zh-cn/release-notes/changelogs/v4.0-beta1/figures/stack_after.jpg new file mode 100644 index 0000000000000000000000000000000000000000..eacfe82a9b1175a8a944be8a793ec940a4a80e0d Binary files /dev/null and b/zh-cn/release-notes/changelogs/v4.0-beta1/figures/stack_after.jpg differ diff --git a/zh-cn/release-notes/changelogs/v4.0-beta1/figures/stack_before.jpg b/zh-cn/release-notes/changelogs/v4.0-beta1/figures/stack_before.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b7b26a73935e28ce34d9895ac3e0cf519bbb41b5 Binary files /dev/null and b/zh-cn/release-notes/changelogs/v4.0-beta1/figures/stack_before.jpg differ diff --git a/zh-cn/website.md b/zh-cn/website.md index cee2cd8aa0534eb9e2c3802e1f31fc0714060a88..82ac867958baed51607d9a077375591fb9d033d9 100644 --- a/zh-cn/website.md +++ b/zh-cn/website.md @@ -3,7 +3,11 @@ - [了解OpenHarmony开源项目](OpenHarmony-Overview_zh.md) - [术语](glossary.md) - 版本说明 + - OpenHarmony 4.x Releases + - [OpenHarmony v4.0 Beta1 (2023-06-03)](release-notes/OpenHarmony-v4.0-beta1.md) - OpenHarmony 3.x Releases + - [OpenHarmony v3.2 Release (2023-04-09)](release-notes/OpenHarmony-v3.2-release.md) + - [OpenHarmony v3.2.1 Release (2023-05-22)](release-notes/OpenHarmony-v3.2.1-release.md) - [OpenHarmony v3.2 Beta5 (2023-01-30)](release-notes/OpenHarmony-v3.2-beta5.md) - [OpenHarmony v3.2 Beta4 (2022-11-30)](release-notes/OpenHarmony-v3.2-beta4.md) - [OpenHarmony v3.2 Beta3 (2022-09-30)](release-notes/OpenHarmony-v3.2-beta3.md) @@ -33,6 +37,142 @@ - [OpenHarmony v1.1.1 LTS (2021-06-22)](release-notes/OpenHarmony-1-1-1-LTS.md) - [OpenHarmony v1.1.0 LTS (2021-04-01)](release-notes/OpenHarmony-1-1-0-LTS.md) - API差异报告 + - OpenHarmony 4.0 Beta1 + - JS API差异报告 + - [元能力](release-notes/api-diff/v4.0-beta1/js-apidiff-ability.md) + - [无障碍服务](release-notes/api-diff/v4.0-beta1/js-apidiff-accessibility.md) + - [帐号](release-notes/api-diff/v4.0-beta1/js-apidiff-account.md) + - [ArkUI](release-notes/api-diff/v4.0-beta1/js-apidiff-arkui.md) + - [电源管理](release-notes/api-diff/v4.0-beta1/js-apidiff-battery.md) + - [包管理](release-notes/api-diff/v4.0-beta1/js-apidiff-bundle.md) + - [通信](release-notes/api-diff/v4.0-beta1/js-apidiff-communication.md) + - [语言编译运行时](release-notes/api-diff/v4.0-beta1/js-apidiff-compiler-and-runtime.md) + - [定制服务](release-notes/api-diff/v4.0-beta1/js-apidiff-customization.md) + - [分布式数据管理](release-notes/api-diff/v4.0-beta1/js-apidiff-distributed-data.md) + - [分布式硬件](release-notes/api-diff/v4.0-beta1/js-apidiff-distributed-hardware.md) + - [文件管理](release-notes/api-diff/v4.0-beta1/js-apidiff-file-management.md) + - [位置](release-notes/api-diff/v4.0-beta1/js-apidiff-geolocation.md) + - [全球化](release-notes/api-diff/v4.0-beta1/js-apidiff-global.md) + - [图形](release-notes/api-diff/v4.0-beta1/js-apidiff-graphic.md) + - [Misc软件](release-notes/api-diff/v4.0-beta1/js-apidiff-misc.md) + - [MSDP](release-notes/api-diff/v4.0-beta1/js-apidiff-msdp.md) + - [多模输入](release-notes/api-diff/v4.0-beta1/js-apidiff-multi-modal-input.md) + - [媒体](release-notes/api-diff/v4.0-beta1/js-apidiff-multimedia.md) + - [事件与通知](release-notes/api-diff/v4.0-beta1/js-apidiff-notification.md) + - [资源调度](release-notes/api-diff/v4.0-beta1/js-apidiff-resource-scheduler.md) + - [安全基础服务](release-notes/api-diff/v4.0-beta1/js-apidiff-security.md) + - [泛Sensor](release-notes/api-diff/v4.0-beta1/js-apidiff-sensor.md) + - [电话服务](release-notes/api-diff/v4.0-beta1/js-apidiff-telephony.md) + - [测试框架](release-notes/api-diff/v4.0-beta1/js-apidiff-unitest.md) + - [升级服务](release-notes/api-diff/v4.0-beta1/js-apidiff-update.md) + - [用户IAM](release-notes/api-diff/v4.0-beta1/js-apidiff-user-iam.md) + - [Web](release-notes/api-diff/v4.0-beta1/js-apidiff-web.md) + - [窗口](release-notes/api-diff/v4.0-beta1/js-apidiff-window.md) + - API变更说明 + - [元能力](release-notes/changelogs/v4.0-beta1/changelogs-ability.md) + - [程序访问控制](release-notes/changelogs/v4.0-beta1/changelogs-accesstoken.md) + - [帐号](release-notes/changelogs/v4.0-beta1/changelogs-account_os_account.md) + - [通知](release-notes/changelogs/v4.0-beta1/changelogs-ans.md) + - [语言编译运行时](release-notes/changelogs/v4.0-beta1/changelogs-arkcompiler.md) + - [ArkUI](release-notes/changelogs/v4.0-beta1/changelogs-arkui.md) + - [蓝牙](release-notes/changelogs/v4.0-beta1/changelogs-bluetooth.md) + - [包管理](release-notes/changelogs/v4.0-beta1/changelogs-bundlemanager.md) + - [事件](release-notes/changelogs/v4.0-beta1/changelogs-ces.md) + - [分布式数据管理](release-notes/changelogs/v4.0-beta1/changelogs-distributeddatamgr.md) + - [文件管理](release-notes/changelogs/v4.0-beta1/changelogs-filemanagement.md) + - [位置](release-notes/changelogs/v4.0-beta1/changelogs-geoLocationManager.md) + - [全球化](release-notes/changelogs/v4.0-beta1/changelogs-global.md) + - [安全-huks](release-notes/changelogs/v4.0-beta1/changelogs-huks.md) + - [输入法框架](release-notes/changelogs/v4.0-beta1/changelogs-imf.md) + - [媒体](release-notes/changelogs/v4.0-beta1/changelogs-media.md) + - [Misc软件](release-notes/changelogs/v4.0-beta1/changelogs-miscdevice.md) + - [剪贴板](release-notes/changelogs/v4.0-beta1/changelogs-pasteboard.md) + - [电源](release-notes/changelogs/v4.0-beta1/changelogs-power.md) + - [资源调度](release-notes/changelogs/v4.0-beta1/changelogs-resourceschedule.md) + - [主题框架-锁屏](release-notes/changelogs/v4.0-beta1/changelogs-screenlock.md) + - [安全基础能力](release-notes/changelogs/v4.0-beta1/changelogs-security.md) + - [泛Sensor](release-notes/changelogs/v4.0-beta1/changelogs-sensor.md) + - [分布式软总线](release-notes/changelogs/v4.0-beta1/changelogs-softbus.md) + - [启动服务](release-notes/changelogs/v4.0-beta1/changelogs-startup.md) + - [电话服务](release-notes/changelogs/v4.0-beta1/changelogs-telephony.md) + - [测试框架](release-notes/changelogs/v4.0-beta1/changelogs-testfwk_arkxtest.md) + - [USB](release-notes/changelogs/v4.0-beta1/changelogs-usb.md) + - [主题框架-壁纸](release-notes/changelogs/v4.0-beta1/changelogs-wallpaper.md) + - [Web](release-notes/changelogs/v4.0-beta1/changelogs-web.md) + - [WIFI](release-notes/changelogs/v4.0-beta1/changelogs-wifiManager.md) + - OpenHarmony 3.2 Release (相比3.1 Release) + - JS API差异报告 + - [元能力](release-notes/api-diff/v3.2-Release/js-apidiff-ability.md) + - [无障碍](release-notes/api-diff/v3.2-Release/js-apidiff-accessibility.md) + - [帐号](release-notes/api-diff/v3.2-Release/js-apidiff-account.md) + - [应用](release-notes/api-diff/v3.2-Release/js-apidiff-application.md) + - [ArkUI](release-notes/api-diff/v3.2-Release/js-apidiff-arkui.md) + - [电源服务](release-notes/api-diff/v3.2-Release/js-apidiff-battery.md) + - [包管理](release-notes/api-diff/v3.2-Release/js-apidiff-bundle.md) + - [网络及通信](release-notes/api-diff/v3.2-Release/js-apidiff-communication.md) + - [语言编译器运行时](release-notes/api-diff/v3.2-Release/js-apidiff-compiler-and-runtime.md) + - [定制](release-notes/api-diff/v3.2-Release/js-apidiff-customization.md) + - [DFX](release-notes/api-diff/v3.2-Release/js-apidiff-dfx.md) + - [分布式数据](release-notes/api-diff/v3.2-Release/js-apidiff-distributed-data.md) + - [分布式硬件](release-notes/api-diff/v3.2-Release/js-apidiff-distributed-hardware.md) + - [文件管理](release-notes/api-diff/v3.2-Release/js-apidiff-file-management.md) + - [位置服务](release-notes/api-diff/v3.2-Release/js-apidiff-geolocation.md) + - [全球化](release-notes/api-diff/v3.2-Release/js-apidiff-global.md) + - [图形图像](release-notes/api-diff/v3.2-Release/js-apidiff-graphic.md) + - [Misc软件](release-notes/api-diff/v3.2-Release/js-apidiff-misc.md) + - [MSDP](release-notes/api-diff/v3.2-Release/js-apidiff-msdp.md) + - [多模输入](release-notes/api-diff/v3.2-Release/js-apidiff-multi-modal-input.md) + - [媒体服务](release-notes/api-diff/v3.2-Release/js-apidiff-multimedia.md) + - [事件与通知](release-notes/api-diff/v3.2-Release/js-apidiff-notification.md) + - [资源调度](release-notes/api-diff/v3.2-Release/js-apidiff-resource-scheduler.md) + - [安全](release-notes/api-diff/v3.2-Release/js-apidiff-security.md) + - [泛Sensor](release-notes/api-diff/v3.2-Release/js-apidiff-sensor.md) + - [启动](release-notes/api-diff/v3.2-Release/js-apidiff-start-up.md) + - [电话服务](release-notes/api-diff/v3.2-Release/js-apidiff-telephony.md) + - [测试服务](release-notes/api-diff/v3.2-Release/js-apidiff-unitest.md) + - [升级](release-notes/api-diff/v3.2-Release/js-apidiff-update.md) + - [USB服务](release-notes/api-diff/v3.2-Release/js-apidiff-usb.md) + - [用户IAM](release-notes/api-diff/v3.2-Release/js-apidiff-user-iam.md) + - [Web](release-notes/api-diff/v3.2-Release/js-apidiff-web.md) + - [窗口](release-notes/api-diff/v3.2-Release/js-apidiff-window.md) + - OpenHarmony 3.2 Release (相比3.2 Beta5) + - JS API差异报告 + - [元能力](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-ability.md) + - [帐号](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-account.md) + - [应用](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-application.md) + - [ArkUI](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-arkui.md) + - [电源服务](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-battery.md) + - [包管理](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-bundle.md) + - [网络及通信](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-communication.md) + - [语言编译器运行时](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-compiler-and-runtime.md) + - [DFX](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-dfx.md) + - [分布式数据](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-distributed-data.md) + - [文件管理](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-file-management.md) + - [Misc软件](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-misc.md) + - [媒体服务](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-multimedia.md) + - [事件与通知](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-notification.md) + - [资源调度](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-resource-scheduler.md) + - [安全](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-security.md) + - [泛Sensor](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-sensor.md) + - [启动](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-start-up.md) + - [电话服务](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-telephony.md) + - [测试服务](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-unitest.md) + - [升级](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-update.md) + - [USB服务](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-usb.md) + - [用户IAM](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-user-iam.md) + - [Web](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-web.md) + - [窗口](release-notes/api-diff/Beta5%20to%20v3.2-Release/js-apidiff-window.md) + - 变更说明 + - [元能力](release-notes/changelogs/v3.2-release/changelogs-ability.md) + - [ArkUI](release-notes/changelogs/v3.2-release/changelogs-arkui.md) + - [包管理](release-notes/changelogs/v3.2-release/changelogs-bundlemanager.md) + - [输入法框架](release-notes/changelogs/v3.2-release/changelogs-imf.md) + - [全局资源调度](release-notes/changelogs/v3.2-release/changelogs-resourceschedule.md) + - [主题框架-锁屏](release-notes/changelogs/v3.2-release/changelogs-screenlock.md) + - [电话服务](release-notes/changelogs/v3.2-release/changelogs-telephony.md) + - [util](release-notes/changelogs/v3.2-release/changelogs-util.md) + - [主题框架-壁纸](release-notes/changelogs/v3.2-release/changelogs-wallpaper.md) + - [web组件](release-notes/changelogs/v3.2-release/changelogs-web.md) - OpenHarmony 3.2 Beta4 - JS API差异报告 - [元能力](release-notes/api-diff/v3.2-beta4/js-apidiff-ability.md) @@ -217,3 +357,5 @@ - [写作规范](contribute/写作规范.md) - [社区沟通与交流](contribute/社区沟通与交流.md) - [FAQ](contribute/FAQ.md) + + \ No newline at end of file