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 index ddabc17980b28b7bc618f18a33299839c0ae0478..1032ef81260deb27c75625e8ad99f7ed535b20b9 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/Readme-CN.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/Readme-CN.md @@ -1,33 +1,21 @@ # 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 +| 子系统 | 变更类型 | 变更说明 | +| :------------- | ------------ | ------------------------------------------------------------ | +| 通用 | 校验增强 | [System API校验权限增强,只有系统应用允许使用system-api,三方应用使用system-api将返回202错误](changelogs-common.md) | +| 元能力 | 行为变更 | [apprecovery接口中RestartFlag枚举命名从特定故障发生后不重启改成了特定故障发生后重启](changelogs-ability.md) | +| 语言编译运行时 | 解析规则变更 | [LLVM解析格式变更,对于业务依赖version-script或gcc-toolchain选项的开发者,在沿用LLVM12配置文件或选项时,部分规则发生变化,可能会解析失败](changelogs-arkcompiler.md) | +| 语言编译运行时 | 校验增强 | [LLVM新增告警及已有告警增强,LLVM从12升级15,新增告警/对已有的告警校验增强](changelogs-arkcompiler.md) | +| 语言编译运行时 | 校验增强 | [LLVM emu-tls变更,对于LLVM12/LLVM15工具链混用的开发者,会产生libc++.so emu-tls符号无法找到的问题](changelogs-arkcompiler.md) | +| 语言编译运行时 | 校验增强 | [LLVM12~15官方变更差异继承新增特性及内部接口变更](changelogs-arkcompiler.md) | +| ArkUI | 行为变更 | [修复Stack布局问题](changelogs-arkui.md) | +| ArkUI | 默认值变更 | [List组件和Gird组件滚动条默认状态变更](changelogs-arkui.md) | +| ArkUI | UX变更 | [Button组件hover状态效果变更,由100-105%放大效果变更为0-5%](changelogs-arkui.md) | +| ArkUI | UX变更 | [toast组件多行文本对齐方式由居中对齐变更为左对齐](changelogs-arkui.md) | +| 包管理 | 机制变更 | [安装hap时,hap中的文件不在解压到安装目录](changelogs-bundlemanager.md) | +| 全球化 | 接口扩展 | [getStringSync、getStringByNameSync接口能力扩展](changelogs-global.md) | +| 全球化 | 行为变更 | [资源获取rawfile文件描述符接口含义变更相较于之前的版本返回值发生了变化](changelogs-global.md) | +| 安全-huks | 行为变更 | [解决在派生密钥/协商密钥时需传入HuksKeyStorageType中定义的类型](changelogs-huks.md) | +| 安全-huks | 权限变更 | [attestKeyitem是基于设备证书链封装业务公钥对用户指定的密钥进行证明](changelogs-huks.md) | +| Web | 新增入参 | [setResponseData接口支持Resource类型](changelogs-web.md) | +| 资源调度 | 行为变更 | [提醒代理支持系统应用设置自定义按钮,并且自定义按钮可跳转指定应用界面](changelogs-resourceschedule.md) | 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 index e637842e79f52518d6d83087b5d8942ba90a4374..9fc74280029e368e55e89f60e4e9da9501d612fc 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ability.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ability.md @@ -1,146 +1,7 @@ # 元能力子系统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属性名称变更,删除了未支持的属性 +## cl.ability.1 appRecovery接口中RestartFlag属性名称变更,删除了未支持的属性 appRecovery接口中RestartFlag枚举命名从特定故障发生后**不重启**改成了特定故障发生后**重启**。 删除了CPP_CRASH_NO_RESTART。 @@ -174,67 +35,3 @@ appRecovery接口中RestartFlag枚举命名从特定故障发生后**不重启** **适配指导** 按新的语义进行适配。 - - -## 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 deleted file mode 100644 index 1a8369c1e143394448444df7a4f70b78322e1625..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-accesstoken.md +++ /dev/null @@ -1,33 +0,0 @@ -# 程序访问控制子系统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 deleted file mode 100644 index 909a37513e0f413ac2596960e4883cc17f9888e6..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-account_os_account.md +++ /dev/null @@ -1,408 +0,0 @@ -# 帐号子系统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 deleted file mode 100644 index b508759665a64bca8e6f723ea81a1c316dc99ca0..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ans.md +++ /dev/null @@ -1,21 +0,0 @@ -# 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 index 50d6e6dd99a079fec1bcdd4d018d0aaacbead2a4..84b146981cfb7b5ff609c9ff98f34a05d8e39491 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkcompiler.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkcompiler.md @@ -161,5 +161,4 @@ https://releases.llvm.org/15.0.0/docs/ReleaseNotes.html **适配指导** -详细修改信息以及适配指导见官方文档 - +详细修改信息以及适配指导见官方文档 \ No newline at end of file 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 index b6cc271b246f65064f2f6efec6bca8d4995a7c18..fb31700be5dfcbe794abfefdb4db5f8c75fcde3d 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkui.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-arkui.md @@ -1,445 +1,7 @@ # 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组件滚动条默认状态变更 +## cl.arkui.1 List组件和Gird组件滚动条默认状态变更 List组件和Gird组件滚动条默认状态从BarState.Off变更为BarState.Auto。 @@ -483,7 +45,7 @@ struct ListItemExample { } ``` -## cl.arkui.8 修复Stack布局问题 +## cl.arkui.2 修复Stack布局问题 修复问题:[Stack](../../../application-dev/reference/arkui-ts/ts-container-stack.md)设置alignContent,在子组件超出父组件的场景中,子组件未按照alignContent布局 示例: @@ -513,4 +75,12 @@ struct StackExample { **适配指导** - 去掉之前给子组件设置的Offset或者translate,使用alignContent实际布局方式进行布局。 \ No newline at end of file + 去掉之前给子组件设置的Offset或者translate,使用alignContent实际布局方式进行布局。 + +## cl.arkui.3 Button组件hover状态效果变更 + +Button组件的hover状态由100-105%放大效果变更为0-5%不透明度的叠加效果,hover状态切换到press状态的效果变更为5-10%不透明度的叠加效果。 + +**变更影响** + +影响Button的hover状态的视觉效果以及hover状态切换到press状态的视觉效果。 \ 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 deleted file mode 100644 index d90c795ae5ea074f17f119f09357484352d537b4..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bluetooth.md +++ /dev/null @@ -1,173 +0,0 @@ -# 蓝牙服务子系统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 index 0a77d2515fca906bd26ed30ea366d7670e08c571..772fca32de66e85fb2f1c37a8cad793494288557 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bundlemanager.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-bundlemanager.md @@ -11,143 +11,4 @@ 不涉及接口及组件变更 **适配指导**
-资源管理子系统提供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。 +资源管理子系统提供Js接口访问资源文件。参考[访问资源文件](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md#getrawfilecontent9) \ No newline at end of file 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 deleted file mode 100644 index 2b9c3121806c4c7bad7fe5cc3fd755e270dcdde2..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-ces.md +++ /dev/null @@ -1,55 +0,0 @@ -# 公共事件子系统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-common.md b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-common.md new file mode 100644 index 0000000000000000000000000000000000000000..8059df59a9baf2c0b5b56af0762fd37c732d8f7c --- /dev/null +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-common.md @@ -0,0 +1,13 @@ +# 通用能力ChangeLog + +## cl.common.1 SystemAPI使用规则变更 + +目前子系统提供的system-api在调用时未做系统应用校验,三方应用使用Full版本的SDK就可以使用这些system-api,存在安全隐患,因此在OpenHarmony 4.0.2.1版本开始增加应用身份校验。 + +**变更影响** + +只有系统应用允许使用system-api,三方应用使用system-api将返回202错误,返回202错误的方式有两种:1.抛异常;2.异步回调 + +**适配指导** + +非系统应用使用systemapi有两种方法:1.申请系统应用权限 2.更换接口使用 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 deleted file mode 100644 index cea1a4047360d76a40fe1c715909a8709b83a375..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-distributeddatamgr.md +++ /dev/null @@ -1,48 +0,0 @@ -# 分布式数据管理子系统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 deleted file mode 100644 index e5f4d8d7cc5ea4bd4629816894d3837011e5b723..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-filemanagement.md +++ /dev/null @@ -1,167 +0,0 @@ -# 文件管理子系统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 deleted file mode 100644 index f1e652c43fe7e78d6642b34871cadccd7c2ca85d..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-geoLocationManager.md +++ /dev/null @@ -1,18 +0,0 @@ -# 位置服务子系统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 index 4923e61187fa46f65358a4b497f5ed89275ec764..36fda1512aeb094246af0f185c355362d9de71e7 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-global.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-global.md @@ -1,45 +1,5 @@ # 全球化子系统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文件描述符接口含义变更 @@ -67,9 +27,9 @@ length: 访问rawfile文件的大小。 **关键接口/组件变更** -| **涉及接口** | -| ---------------- | -| getRawFd(path: string, callback: AsyncCallback\): void | +| **涉及接口** | +| ---------------- | +| getRawFd(path: string, callback: AsyncCallback\): void | | getRawFd(path: string): Promise\ | | getRawFileDescriptor(path: string, callback: AsyncCallback\): void| | getRawFileDescriptor(path: string): Promise\| 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 index 72952f500e0f12c395ed6174274753bbe1d5e812..b3a2b755ed05cd502f35a28de5d3285967cf43fe 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-huks.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-huks.md @@ -30,71 +30,7 @@ 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解决派生密钥/协商密钥的存储/导出问题 +## cl.huks.2 HUKS解决派生密钥/协商密钥的存储/导出问题 变更之前,派生密钥/协商密钥既支持存储,又支持导出,存在安全风险; @@ -111,19 +47,3 @@ 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 新增用于细粒度用户身份访问控制的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 deleted file mode 100644 index a6cdab6b8d7e7fc6a97698ce9b2e2a84ba32076a..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-imf.md +++ /dev/null @@ -1,21 +0,0 @@ -# 输入法框架子系统-输入法框架服务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 deleted file mode 100644 index 1d1fadf9dbee56c3538e4462ee7936a364ec4445..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-media.md +++ /dev/null @@ -1,312 +0,0 @@ -# 媒体子系统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 deleted file mode 100644 index 6dc3abac37c52062ad1b39ac77e72064382783c1..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-miscdevice.md +++ /dev/null @@ -1,95 +0,0 @@ -# 泛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 deleted file mode 100644 index 29f562ed9ceb239771cdc78b59ebbf91959877f0..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-pasteboard.md +++ /dev/null @@ -1,66 +0,0 @@ -# 剪贴板子系统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 deleted file mode 100644 index adabd439b923924906b465a4122016e401d13e86..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-power.md +++ /dev/null @@ -1,82 +0,0 @@ -# 电源子系统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 index ed8c1b666f686ecabef67f7d6b61f0063edd6e3a..b139ffe6e12658c9d0d43db7024eebd6915d749e 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-resourceschedule.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-resourceschedule.md @@ -1,36 +1,5 @@ # 资源调度子系统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 @@ -42,12 +11,12 @@ class MyWorkSchedulerExtensionAbility extends WorkSchedulerExtensionAbility { **关键接口/组件变更** -| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | +| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 | | -- | -- | -- | -- | -| reminderAgentManager | ActionButtonType | ACTION_BUTTON_TYPE_CUSTOM = 2 | 新增 | -| reminderAgentManager | ActionButton | wantAgent?: WantAgent | 新增 | -| reminderAgentManager | WantAgent | uri?: string | 新增 | -| reminderAgentManager | ReminderRequest | actionButton?: [ActionButton?, ActionButton?, ActionButton?] | 变更 | +| reminderAgentManager | ActionButtonType | ACTION_BUTTON_TYPE_CUSTOM = 2 | 新增 | +| reminderAgentManager | ActionButton | wantAgent?: WantAgent | 新增 | +| reminderAgentManager | WantAgent | uri?: string | 新增 | +| reminderAgentManager | ReminderRequest | actionButton?: [ActionButton?, ActionButton?, ActionButton?] | 变更 | **适配指导**
@@ -77,31 +46,3 @@ let targetReminderAgent: reminderAgentManager.ReminderRequestAlarm = { ] } ``` - -## 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 deleted file mode 100644 index 8e5a2fab3671eb32db8accb72d764a1194f26ff1..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-screenlock.md +++ /dev/null @@ -1,155 +0,0 @@ -# 主题框架子系统-锁屏管理服务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 deleted file mode 100644 index 90166d4d21265578bcdfd8236236d53f15671260..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-security.md +++ /dev/null @@ -1,87 +0,0 @@ -# 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 deleted file mode 100644 index 602f155fcfdaf5464ea0be5eb248b630746565cc..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-sensor.md +++ /dev/null @@ -1,49 +0,0 @@ -# 泛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 deleted file mode 100644 index 24592f1d4670c682785e7b4abbf7189edfe74f53..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-softbus.md +++ /dev/null @@ -1,27 +0,0 @@ -# 软总线子系统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 deleted file mode 100644 index 576e35701471fd1640f5b6205a5e1cc05e983cf9..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-startup.md +++ /dev/null @@ -1,16 +0,0 @@ -# 启动子系统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 deleted file mode 100644 index 4af67bf47de693c4678408d588be693b9c698a1a..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-telephony.md +++ /dev/null @@ -1,130 +0,0 @@ -# 电话子系统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 deleted file mode 100644 index d508e473d7d48695a059508de789b84730b4f13e..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-testfwk_arkxtest.md +++ /dev/null @@ -1,42 +0,0 @@ -# 测试子系统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 deleted file mode 100644 index c6eca27ffd91461c1d56ef1a5d561fa366b35d99..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-usb.md +++ /dev/null @@ -1,88 +0,0 @@ -# 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 deleted file mode 100644 index 13baab45851959398ccf4689543f91c5e1aa1d68..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-wallpaper.md +++ /dev/null @@ -1,304 +0,0 @@ -# 主题框架子系统-壁纸管理服务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 index f5af20f5f3c7a7f5e380e8b3c4c0077ece6a3f55..b232d4c7fc93fa71e0e2202ef089c220ac66fc4d 100644 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-web.md +++ b/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-web.md @@ -1,621 +1,126 @@ -# web子系统ChangeLog +# web子系统ChangeLog -OpenHarmony 4.0.2.1 版本相较于OpenHarmony 之前的版本,web的API变更如下。 +OpenHarmony 4.0.7.3 版本相较于OpenHarmony 之前的版本,web的API变更如下。 -## cl.web.1 postMessageEvent参数类型变更 - -该接口postMessageEvent原先仅支持string类型,从4.0.2.1版本开始新增支持ArrayBuffer类型。 +## cl.web.1 setResponseData接口参数新增 **变更影响** -该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,原有功能不受影响。 - -**关键的接口/组件变更** - -- 涉及接口 - - 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类型。 +setResponseData(data: string | number | Resource),新增入参类型`Resource` -**变更影响** - -该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,增加相应的逻辑处理,原有功能不受影响。 +在应用hap不解压场景,应用hap中的文件路径已不存在。当需要读取hap包内资源时,通过使用入参`data:Resource`替代`data:number`,实现对本应用下的资源访问。 **关键的接口/组件变更** - 涉及接口 - onMessageEvent(callback: (result: string) => void): void + setResponseData - 变更前: - ```ts - onMessageEvent(callback: (result: string) => void): void + ``` + setResponseData(data: string | number) ``` - 变更后: - ```ts - type WebMessage = ArrayBuffer | string - onMessageEvent(callback: (result: WebMessage) => void): void + ``` + setResponseData(data: string | number | Resource) ``` **适配指导** -该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,增加相应的逻辑处理,原有功能不受影响。 - - -## 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| 新增 | - -**适配指导** - -以打开调试开关为例,示例代码如下: +应用hap解压时,打开并持有资源文件fd,最后通过`setResponseData(data:number)`将资源响应数据传递给内核。 -```ts +``` // xxx.ets -import web_webview from '@ohos.web.webview'; +import web_webview from '@ohos.web.webview' +import fileio from '@ohos.fileio'; @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}`); - } - } + controller: web_webview.WebviewController = new web_webview.WebviewController() + responseweb: WebResourceResponse = new WebResourceResponse() + heads: Header[] = new Array() build() { Column() { Web({ src: 'www.example.com', controller: this.controller }) + .onInterceptRequest((event) => { + console.log('url:' + event.request.getRequestUrl()) + var head1:Header = { + headerKey:"Connection", + headerValue:"keep-alive" + } + var head2:Header = { + headerKey:"Cache-Control", + headerValue:"no-cache" + } + var length = this.heads.push(head1) + length = this.heads.push(head2) + this.responseweb.setResponseHeader(this.heads) + this.responseweb.setResponseEncoding('utf-8') + this.responseweb.setResponseMimeType('text/html') + this.responseweb.setResponseCode(200) + this.responseweb.setReasonMessage('OK') + + //// fd方案 --start + // '/xxx/.../test.html'为文件的本地路径 + // @ts-ignore + let fd = fileio.openSync('/xxx/.../test.html', 0o102, 0o666) + this.responseweb.setResponseData(fd) + //// fd方案 --end + + return this.responseweb + }) } } } +``` -## 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 - ``` +应用hap不解压时,应用hap中的文件路径已不存在,通过`setResponseData(data:Resource)`将资源响应数据传递给内核。 -- 变更后: - - ```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' +``` +// xxx.ets +import web_webview from '@ohos.web.webview' - @Entry - @Component - struct WebComponent { - controller: web_webview.WebviewController = new web_webview.WebviewController(); +@Entry +@Component +struct WebComponent { + controller: web_webview.WebviewController = new web_webview.WebviewController() + responseweb: WebResourceResponse = new WebResourceResponse() + heads: Header[] = new Array() - 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 }) - } + build() { + Column() { + Web({ src: 'www.example.com', controller: this.controller }) + .onInterceptRequest((event) => { + console.log('url:' + event.request.getRequestUrl()) + var head1:Header = { + headerKey:"Connection", + headerValue:"keep-alive" + } + var head2:Header = { + headerKey:"Cache-Control", + headerValue:"no-cache" + } + var length = this.heads.push(head1) + length = this.heads.push(head2) + this.responseweb.setResponseHeader(this.heads) + this.responseweb.setResponseEncoding('utf-8') + this.responseweb.setResponseMimeType('text/html') + this.responseweb.setResponseCode(200) + this.responseweb.setReasonMessage('OK') + + //// Resource方案 --start + // 指定hap包中rawfile目录下的目标文件 + this.responseweb.setResponseData($rawfile('test.html')) + //// Resource方案 --end + + return this.responseweb + }) } } - ``` - - -## cl.web.15 createWebMessagePorts接口参数 - -由于WebMessagePort需要新增支持更多数据类型,因此在该接口增加一个可选参数来区分新老接口。 - -**变更影响** - -无,可选参数,可前向兼容。 - -**关键的接口/组件变更** - -- 涉及接口 - - createWebMessagePorts(): Array; - -- 变更前: - - ```ts - createWebMessagePorts(): Array; - ``` - -- 变更后: - - ```ts - createWebMessagePorts(isExtentionType?: boolean): Array; - ``` - -**适配指导** - -已有应用无需适配。 \ No newline at end of file +} +``` \ 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 deleted file mode 100644 index e24ff589dd249e8593c17b5fddaf3f217a655743..0000000000000000000000000000000000000000 --- a/zh-cn/release-notes/changelogs/v4.0-beta1/changelogs-wifiManager.md +++ /dev/null @@ -1,62 +0,0 @@ -# 基础通信子系统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