Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
c53b66ba
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c53b66ba
编写于
2月 23, 2023
作者:
N
ningning
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update changelog
Signed-off-by:
N
ningning
<
3248127340@qq.com
>
上级
bef315d6
变更
47
隐藏空白更改
内联
并排
Showing
47 changed file
with
5237 addition
and
359 deletion
+5237
-359
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-dmsfwk.md
...n/release-notes/changelogs/v3.2-beta4/changelog-dmsfwk.md
+122
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-resourceschedule.md
...notes/changelogs/v3.2-beta4/changelog-resourceschedule.md
+316
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-web.md
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-web.md
+128
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-wifi.md
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-wifi.md
+115
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-ability.md
...release-notes/changelogs/v3.2-beta4/changelogs-ability.md
+1
-1
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-account_os_account.md
...es/changelogs/v3.2-beta4/changelogs-account_os_account.md
+113
-2
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md
...n/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md
+59
-1
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-camera.md
.../release-notes/changelogs/v3.2-beta4/changelogs-camera.md
+783
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-device-manager.md
...-notes/changelogs/v3.2-beta4/changelogs-device-manager.md
+106
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-device-usb.md
...ease-notes/changelogs/v3.2-beta4/changelogs-device-usb.md
+27
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-dsoftbus.md
...elease-notes/changelogs/v3.2-beta4/changelogs-dsoftbus.md
+145
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md
...ogs/v3.2-beta4/changelogs-enterprise_device_management.md
+159
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-filemanagement.md
...-notes/changelogs/v3.2-beta4/changelogs-filemanagement.md
+90
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-geolocation.md
...ase-notes/changelogs/v3.2-beta4/changelogs-geolocation.md
+116
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-global.md
.../release-notes/changelogs/v3.2-beta4/changelogs-global.md
+57
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md
...changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md
+196
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-multimedia.md
...ease-notes/changelogs/v3.2-beta4/changelogs-multimedia.md
+262
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-power.md
...n/release-notes/changelogs/v3.2-beta4/changelogs-power.md
+68
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-request.md
...release-notes/changelogs/v3.2-beta4/changelogs-request.md
+108
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-resource-manager.md
...otes/changelogs/v3.2-beta4/changelogs-resource-manager.md
+66
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-telephony.md
...lease-notes/changelogs/v3.2-beta4/changelogs-telephony.md
+1
-1
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-testfwk_arkxtest.md
...otes/changelogs/v3.2-beta4/changelogs-testfwk_arkxtest.md
+41
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-theme.md
...n/release-notes/changelogs/v3.2-beta4/changelogs-theme.md
+148
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-useriam.md
...release-notes/changelogs/v3.2-beta4/changelogs-useriam.md
+74
-0
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md
...lease-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md
+90
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelog-LocalStorage.md
...ase-notes/changelogs/v3.2-beta5/changelog-LocalStorage.md
+116
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelog-resourceschedule.md
...notes/changelogs/v3.2-beta5/changelog-resourceschedule.md
+111
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelog-security.md
...release-notes/changelogs/v3.2-beta5/changelog-security.md
+129
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelog-x-x.md
zh-cn/release-notes/changelogs/v3.2-beta5/changelog-x-x.md
+31
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ability.md
...release-notes/changelogs/v3.2-beta5/changelogs-ability.md
+177
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-account_os_account.md
...es/changelogs/v3.2-beta5/changelogs-account_os_account.md
+96
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-bundlemanager.md
...e-notes/changelogs/v3.2-beta5/changelogs-bundlemanager.md
+0
-33
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-container.md
...lease-notes/changelogs/v3.2-beta5/changelogs-container.md
+23
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md
...es/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md
+7
-9
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md
...-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md
+145
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md
...changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md
+30
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-media.md
...n/release-notes/changelogs/v3.2-beta5/changelogs-media.md
+0
-312
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md
...se-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md
+116
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md
+61
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-notification.md
...se-notes/changelogs/v3.2-beta5/changelogs-notification.md
+48
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md
...angelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md
+107
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geolocation.md
...otes/changelogs/v3.2-beta5/changelogs-ohos-geolocation.md
+92
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-request.md
...release-notes/changelogs/v3.2-beta5/changelogs-request.md
+42
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-system-geolocation.md
...es/changelogs/v3.2-beta5/changelogs-system-geolocation.md
+50
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-telephony.md
...lease-notes/changelogs/v3.2-beta5/changelogs-telephony.md
+59
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-time.md
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-time.md
+336
-0
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-url.md
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-url.md
+70
-0
未找到文件。
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-dmsfwk.md
0 → 100644
浏览文件 @
c53b66ba
# 分布式调度子系统ChangeLog
## cl.DistributedManagerService.1 continuationManager事件监听接口on/off变更
-
continuationManager事件监听接口on/off传入的参数事件类型名,命名不符合OpenHarmony的API接口规范。
-
continuationManager.on对于不同的事件接口返回值未进行统一,不符合OpenHarmony的API接口规范。
已做出以下变更:
-
continuationManager.on和continuationManager.off的设备选择事件名由原来的"deviceConnect"变更为"deviceSelected",设备取消选择事件名由原来的"deviceDisconnect"变更为"deviceUnselected"。
-
continuationManager.on对于不同事件统一callback返回值类型"Callback
<
Array
<
ContinuationResult
>>
"。
**变更影响**
基于此前版本开发的应用,需适配变更接口,否则会影响原有业务逻辑。
**关键的接口/组件变更**
-
涉及接口
continuationManager.on;
continuationManager.off;
-
变更前:
```
js
function
on
(
type
:
"
deviceConnect
"
,
token
:
number
,
callback
:
Callback
<
Array
<
ContinuationResult
>>
):
void
;
function
off
(
type
:
"
deviceConnect
"
,
token
:
number
):
void
;
function
on
(
type
:
"
deviceDisconnect
"
,
token
:
number
,
callback
:
Callback
<
Array
<
string
>>
):
void
;
function
off
(
type
:
"
deviceDisconnect
"
,
token
:
number
):
void
;
```
-
变更后:
```
js
function
on
(
type
:
"
deviceSelected
"
,
token
:
number
,
callback
:
Callback
<
Array
<
ContinuationResult
>>
):
void
;
function
off
(
type
:
"
deviceSelected
"
,
token
:
number
):
void
;
function
on
(
type
:
"
deviceUnselected
"
,
token
:
number
,
callback
:
Callback
<
Array
<
ContinuationResult
>>
):
void
;
function
off
(
type
:
"
deviceUnselected
"
,
token
:
number
):
void
;
```
**适配指导**
修改事件名称,示例代码如下:
continuationManager.on 设备选择事件
```
ts
let
token
=
1
;
try
{
continuationManager
.
on
(
"
deviceSelected
"
,
token
,
(
data
)
=>
{
console
.
info
(
'
onDeviceSelected len:
'
+
data
.
length
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
'
onDeviceSelected deviceId:
'
+
JSON
.
stringify
(
data
[
i
].
id
));
console
.
info
(
'
onDeviceSelected deviceType:
'
+
JSON
.
stringify
(
data
[
i
].
type
));
console
.
info
(
'
onDeviceSelected deviceName:
'
+
JSON
.
stringify
(
data
[
i
].
name
));
}
});
}
catch
(
err
)
{
console
.
error
(
'
on failed, cause:
'
+
JSON
.
stringify
(
err
));
}
```
continuationManager.off 设备选择事件
```
ts
let
token
=
1
;
try
{
continuationManager
.
off
(
"
deviceSelected
"
,
token
);
}
catch
(
err
)
{
console
.
error
(
'
off failed, cause:
'
+
JSON
.
stringify
(
err
));
}
```
continuationManager.on 设备取消选择事件
```
ts
let
token
=
1
;
try
{
continuationManager
.
on
(
"
deviceUnselected
"
,
token
,
(
data
)
=>
{
console
.
info
(
'
onDeviceUnselected len:
'
+
data
.
length
);
for
(
let
i
=
0
;
i
<
data
.
length
;
i
++
)
{
console
.
info
(
'
onDeviceUnselected deviceId:
'
+
JSON
.
stringify
(
data
[
i
].
id
));
console
.
info
(
'
onDeviceUnselected deviceType:
'
+
JSON
.
stringify
(
data
[
i
].
type
));
console
.
info
(
'
onDeviceUnselected deviceName:
'
+
JSON
.
stringify
(
data
[
i
].
name
));
}
console
.
info
(
'
onDeviceUnselected finished.
'
);
});
}
catch
(
err
)
{
console
.
error
(
'
on failed, cause:
'
+
JSON
.
stringify
(
err
));
}
```
continuationManager.off 设备取消选择事件
```
ts
let
token
=
1
;
try
{
continuationManager
.
off
(
"
deviceUnselected
"
,
token
);
}
catch
(
err
)
{
console
.
error
(
'
off failed, cause:
'
+
JSON
.
stringify
(
err
));
}
```
## cl.DistributedManagerService.2 continuationManager接口新增DATASYNC权限校验
此前版本continuationManager接口未对调用方进行校验,不符合OpenHarmony的API接口规范。
已做出以下变更:调用方使用continuationManager前需提前申请"ohos.permission.DISTRIBUTED_DATASYNC"权限。
**变更影响**
基于此前版本开发的应用,需提前申请"ohos.permission.DISTRIBUTED_DATASYNC"权限,否则会影响原有业务逻辑。
**关键的接口/组件变更**
涉及接口
-
continuationManager.registerContinuation;
-
continuationManager.on;
-
continuationManager.off;
-
continuationManager.unregisterContinuation;
-
continuationManager.updateContinuationState;
-
continuationManager.startContinuationDeviceManager;
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-resourceschedule.md
0 → 100644
浏览文件 @
c53b66ba
# 资源调度子系统ChangeLog
## cl.resourceschedule.backgroundTaskManager
对资源调度子系统backgroundTaskManager仓原有接口进行整改,原有API8及之前的接口全部废弃,原有API9接口删除,需要使用新的API9接口。新的API9接口符合错误码规范。
**变更影响**
基于OpenHarmony3.2.8.2及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
以下方法、属性、枚举和常量均从API9变更。废弃@ohos.backgroundTaskManager.d.ts文件,新增@ohos.resourceschedule.backgroundTaskManager.d.ts文件,将相关接口变更至对应的文件。
| 类名 | 接口类型 | 接口声明 | 说明 |
| -- | -- | -- | -- |
| backgroundTaskManager | namespace | declare namespace backgroundTaskManager | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts,修改为function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; |
| backgroundTaskManager | method | function stopBackgroundRunning(context: Context): Promise
<void>
; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function stopBackgroundRunning(context: Context, callback: AsyncCallback
<void>
): void; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise
<void>
; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback
<void>
): void; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function requestSuspendDelay(reason: string, callback: Callback
<void>
): DelaySuspendInfo; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number): Promise
<number>
; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function getRemainingDelayTime(requestId: number, callback: AsyncCallback
<number>
): void; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function cancelSuspendDelay(requestId: number): void; | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | export enum BackgroundMode | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | DATA_TRANSFER = 1 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | AUDIO_PLAYBACK = 2 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | AUDIO_RECORDING = 3 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | LOCATION = 4 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | BLUETOOTH_INTERACTION = 5 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | MULTI_DEVICE_CONNECTION = 6 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | WIFI_INTERACTION = 7 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | VOIP = 8 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.BackgroundMode | enum | TASK_KEEPING = 9 | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.DelaySuspendInfo | interface | interface DelaySuspendInfo | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.DelaySuspendInfo | field | requestId: number | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.DelaySuspendInfo | field | actualDelayTime: number | 接口从API9开始废弃,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | export enum ResourceType | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | CPU = 1 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | 接口API9变更,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
**适配指导**
<br>
导入backgroundTaskManager模块。
```
import bundle form '@ohos.resourceschedule.backgroundTaskManager'
```
此外还需要适配异常处理,具体参考
[
backgroundTaskManager接口文档
](
../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md
)
。
## c2.resourceschedule.usageStatistics
对资源调度子系统deviceUsageStatistics仓原有接口进行整改,原有API8及之前的接口全部废弃,原有API9接口删除,需要使用新的API9接口。新的API9接口符合错误码规范。
**变更影响**
基于OpenHarmony3.2.8.2及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
以下方法、属性、枚举和常量均从API9变更,废弃@ohos.bundleState.d.ts文件,新增@ohos.resourceschedule.usageStatistics.d.ts文件,类名也将从bundleState变更为usageStatistics。
| 类名 | 接口类型 | 方法/属性/枚举/常量 | 变更类型 |
| ----------------------------------------- | --------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| bundleState | method | function isIdleState(bundleName: string, callback: AsyncCallback
<boolean>
): void; | 废弃,移动到usageStatistics.isIdleState |
| bundleState | method | function isIdleState(bundleName: string): Promise
<boolean>
; | 废弃,移动到usageStatistics.isIdleState |
| bundleState | method | function queryAppUsagePriorityGroup(callback: AsyncCallback
<number>
): void; | 废弃,修改为function queryAppGroup(callback: AsyncCallback
<number>
): void; |
| bundleState | method | function queryAppUsagePriorityGroup(): Promise
<number>
; | 废弃,修改为function queryAppGroup(): Promise
<number>
; |
| bundleState | method | function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback
<BundleActiveInfoResponse>
): void; | 废弃,修改为function queryBundleStatsInfos(begin: number, end: number, callback: AsyncCallback
<BundleStatsMap>
): void; |
| bundleState | method | function queryBundleStateInfos(begin: number, end: number): Promise
<BundleActiveInfoResponse>
; | 废弃, 修改为function queryBundleStatsInfos(begin: number, end: number): Promise
<BundleStatsMap>
; |
| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise
<Array
<
BundleStateInfo
>
>; | 废弃,修改为function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise
<Array
<
BundleStatsInfo
>
>; |
| bundleState | method | function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback
<Array
<
BundleStateInfo
>
>): void; | 废弃,修改为function queryBundleStatsInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback
<Array
<
BundleStatsInfo
>
>): void; |
| bundleState | method | function queryBundleActiveStates(begin: number, end: number): Promise
<Array
<
BundleActiveState
>
>; | 废弃,修改为function queryBundleEvents(begin: number, end: number): Promise
<Array
<
BundleEvents
>
>; |
| bundleState | method | function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback
<Array
<
BundleActiveState
>
>): void; | 废弃,修改为function queryBundleEvents(begin: number, end: number, callback: AsyncCallback
<Array
<
BundleEvents
>
>): void; |
| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number): Promise
<Array
<
BundleActiveState
>
>; | 废弃,修改为function queryCurrentBundleEvents(begin: number, end: number): Promise
<Array
<
BundleEvents
>
>; |
| bundleState | method | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback
<Array
<
BundleActiveState
>
>): void; | 废弃,修改为function queryCurrentBundleEvents(begin: number, end: number, callback: AsyncCallback
<Array
<
BundleEvents
>
>): void; |
| bundleState | method | function getRecentlyUsedModules(maxNum?: number): Promise
<Array
<
BundleActiveModuleInfo
>
>; | 废弃,修改为两个接口function QueryModuleUsageRecords(maxNum: number): Promise
<Array
<
HapModuleInfo
>
>; function QueryModuleUsageRecords(): Promise
<Array
<
HapModuleInfo
>
>; |
| bundleState | method | function getRecentlyUsedModules(maxNum?: number, callback: AsyncCallback
<Array
<
BundleActiveModuleInfo
>
>): void; | 废弃,修改为两个接口function QueryModuleUsageRecords(maxNum: number, callback: AsyncCallback
<Array
<
HapModuleInfo
>
>): void; function QueryModuleUsageRecords(callback: AsyncCallback
<Array
<
HapModuleInfo
>
>): void; |
| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string): Promise
<number>
; | 废弃,修改为function queryAppGroup(bundleName: string): Promise
<number>
; |
| bundleState | method | function queryAppUsagePriorityGroup(bundleName? : string, callback: AsyncCallback
<number>
): void; | 废弃,修改为function queryAppGroup(bundleName: string, callback: AsyncCallback
<number>
): void; |
| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback
<void>
): void; | 废弃,修改为function setAppGroup(bundleName: string, newGroup: GroupType, callback: AsyncCallback
<void>
): void; |
| bundleState | method | function setBundleGroup(bundleName: string, newGroup: GroupType): Promise
<void>
; | 废弃,修改为function setAppGroup(bundleName: string, newGroup: GroupType): Promise
<void>
; |
| bundleState | method | function registerGroupCallBack(callback: Callback
<BundleActiveGroupCallbackInfo>
, callback: AsyncCallback
<void>
): void; | 废弃,修改为function registerAppGroupCallBack(callback: Callback
<AppGroupCallbackInfo>
, callback: AsyncCallback
<void>
): void; |
| bundleState | method | function registerGroupCallBack(callback: Callback
<BundleActiveGroupCallbackInfo>
): Promise
<void>
; | 废弃,修改为function registerAppGroupCallBack(callback: Callback
<AppGroupCallbackInfo>
): Promise
<void>
; |
| bundleState | method | function unRegisterGroupCallBack(callback: AsyncCallback
<void>
): void; | 变更,修改为function unregisterAppGroupCallBack(): Promise
<void>
; |
| bundleState | method | function unRegisterGroupCallBack(): Promise
<void>
; | 变更,修改为function unregisterAppGroupCallBack(): Promise
<void>
; |
| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number, callback: AsyncCallback
<Array
<
BundleActiveEventState
>
>): void; | 变更,修改为function queryDeviceEventStats(begin: number, end: number, callback: AsyncCallback
<Array
<
DeviceEventStats
>
>): void; |
| bundleState | method | function queryBundleActiveEventStates(begin: number, end: number): Promise
<Array
<
BundleActiveEventState
>
>; | 接口从API9变更,修改为function queryDeviceEventStats(begin: number, end: number): Promise
<Array
<
DeviceEventStats
>
>; |
| bundleState | method | function queryAppNotificationNumber(begin: number, end: number, callback: AsyncCallback
<Array
<
BundleActiveEventState
>
>): void; | 接口从API9变更,修改为function queryNotificationEventStats(begin: number, end: number, callback: AsyncCallback
<Array
<
NotificationEventStats
>
>): void; |
| bundleState | method | function queryAppNotificationNumber(begin: number, end: number): Promise
<Array
<
BundleActiveEventState
>
>; | 接口从API9变更,修改为function queryNotificationEventStats(begin: number, end: number): Promise
<Array
<
NotificationEventStats
>
>; |
| bundleState.BundleActiveGroupCallbackInfo | interface | interface BundleActiveGroupCallbackInfo | 变更,修改为usageStatistics.AppGroupCallbackInfo |
| bundleState.BundleActiveGroupCallbackInfo | field | bundleName: string | 变更,移动到usageStatistics.AppGroupCallbackInfo |
| bundleState.BundleActiveGroupCallbackInfo | field | changeReason: number | 变更,移动到usageStatistics.AppGroupCallbackInfo |
| bundleState.BundleActiveGroupCallbackInfo | field | userId: number | 变更,移动到usageStatistics.AppGroupCallbackInfo |
| bundleState.BundleActiveGroupCallbackInfo | field | appUsageNewGroup: number | 废弃,修改为appNewGroup |
| bundleState.BundleActiveGroupCallbackInfo | field | appUsageOldGroup: number | 废弃,修改为appOldGroup |
| bundleState.BundleActiveEventState | interface | interface BundleActiveEventState | 废弃,修改为usageStatistics.DeviceEventStats |
| bundleState.BundleActiveEventState | field | count: number | 变更,移动到usageStatistics.DeviceEventStats |
| bundleState.BundleActiveEventState | field | eventId: number | 变更,移动到usageStatistics.DeviceEventStats |
| bundleState.BundleActiveEventState | field | name: string | 变更,移动到usageStatistics.DeviceEventStats |
| bundleState.BundleActiveModuleInfo | interface | interface BundleActiveModuleInfo | 接口从API9变更,修改为usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | formRecords: Array
<BundleActiveFormInfo>
| 变更,修改为formRecords: Array
<HapModuleInfo>
|
| bundleState.BundleActiveModuleInfo | field | lastModuleUsedTime: number | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | launchedCount: number | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | abilityIconId?: number | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | abilityDescriptionId?: number | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | abilityLableId?: number | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | descriptionId?: number; | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | labelId?: number | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | appLabelId?: number | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | abilityName?: string | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | moduleName: string | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | bundleName: string | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.BundleActiveModuleInfo | field | deviceId?: string | 变更,移动到usageStatistics.HapModuleInfo |
| bundleState.GroupType | enum | enum GroupType | 变更,移动到usageStatistics.GroupType |
| bundleState.GroupType | enum | ACTIVE_GROUP_ALIVE | 废弃,修改为ALIVE_GROUP |
| bundleState.GroupType | enum | ACTIVE_GROUP_DAILY | 废弃,修改为DAILY_GROUP |
| bundleState.GroupType | enum | ACTIVE_GROUP_FIXED | 废弃,修改为FIXED_GROUP |
| bundleState.GroupType | enum | ACTIVE_GROUP_RARE | 废弃,修改为RARE_GROUP |
| bundleState.GroupType | enum | ACTIVE_GROUP_LIMIT | 废弃,修改为LIMITED_GROUP |
| bundleState.GroupType | enum | ACTIVE_GROUP_NEVER | 废弃,修改为NEVER_GROUP |
| bundleState.IntervalType | enum | enum IntervalType | 废弃,移动到usageStatistics.IntervalType |
| bundleState.IntervalType | enum | BY_OPTIMIZED | 废弃,移动到usageStatistics.IntervalType |
| bundleState.IntervalType | enum | BY_DAILY | 废弃,移动到usageStatistics.IntervalType |
| bundleState.IntervalType | enum | BY_WEEKLY | 废弃,移动到usageStatistics.IntervalType |
| bundleState.IntervalType | enum | BY_MONTHLY | 废弃,移动到usageStatistics.IntervalType |
| bundleState.IntervalType | enum | BY_ANNUALLY | 废弃,移动到usageStatistics.IntervalType |
| bundleState.BundleActiveInfoResponse | interface | interface BundleActiveInfoResponse | 废弃,修改为usageStatistics.BundleStatsMap |
| bundleState.BundleActiveState | interface | interface BundleActiveState | 废弃,修改为usageStatistics.BundleEvents |
| bundleState.BundleActiveState | field | stateType?: number | 废弃,修改为eventId |
| bundleState.BundleActiveState | field | stateOccurredTime?: number | 废弃,修改为eventOccurredTime |
| bundleState.BundleActiveState | field | nameOfClass?: string | 废弃,移动到usageStatistics.BundleEvents |
| bundleState.BundleActiveState | field | indexOfLink?: string | 废弃,移动到usageStatistics.BundleEvents |
| bundleState.BundleActiveState | field | bundleName?: string | 废弃,移动到usageStatistics.BundleEvents |
| bundleState.BundleActiveState | field | appUsagePriorityGroup?: number | 废弃,修改为appGroup |
| bundleState.BundleStateInfo | interface | interface BundleStateInfo | 废弃,修改为usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | method | merge(toMerge: BundleStateInfo): void | 废弃 |
| bundleState.BundleStateInfo | field | infosEndTime?: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | infosBeginTime?: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | fgAbilityPrevAccessTime?: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | fgAbilityAccessTotalTime?: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | bundleName?: string | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | abilitySeenTotalTime?: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | abilityPrevSeenTime?: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | abilityPrevAccessTime?: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | abilityInFgTotalTime?: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState.BundleStateInfo | field | id: number | 废弃,移动到usageStatistics.BundleStatsInfo |
| bundleState | namespace | declare namespace bundleState | 废弃,修改为usageStatistics,移植到ohos.resourceschedule.usageStatistics.d.ts |
**适配指导**
<br>
导入usageStatistics模块。
```
import bundle form '@ohos.resourceschedule.usageStatistics'
```
此外还需要适配异常处理,具体参考
[
usageStatistics接口文档
](
../../../application-dev/reference/apis/js-apis-resourceschedule-deviceUsageStatistics.md
)
。
## c3.resourceschedule.workScheduler
对资源调度子系统workScheduler仓原有接口进行整改,原有API9接口变更为新的API9接口。新的API9接口符合错误码规范。
**变更影响**
基于OpenHarmony3.2.8.2及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
以下方法、属性、枚举和常量均从API9变更。废弃@ohos.workScheduler.d.ts文件,新增@ohos.resourceschedule.workScheduler.d.ts文件,将相关接口变更至对应的文件中。
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
| workScheduler | namespace | declare namespace workScheduler | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | interface | export interface WorkInfo | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | idleWaitTime?: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | isDeepIdle?: boolean | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | repeatCount?: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | isRepeat?: boolean | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | repeatCycleTime?: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | batteryLevel?: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | chargerType?: ChargingType | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | isCharging?: boolean | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | networkType?: NetworkType | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | isPersisted?: boolean | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | abilityName: string | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | bundleName: string | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | workId: number | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback
<void>
): boolean; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function stopAndClearWorks(): boolean; | 接口API8变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function stopAndClearWorks(): boolean; |
| workScheduler | method | function obtainAllWorks(): Promise
<Array
<
WorkInfo
>
>; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function obtainAllWorks(callback: AsyncCallback
<void>
): Array
<WorkInfo>
; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function getWorkStatus(workId: number): Promise
<WorkInfo>
; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback
<WorkInfo>
): void; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | 接口API8变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function stopWork(work: WorkInfo, needCancel?: boolean): void; |
| workScheduler | method | function startWork(work: WorkInfo): boolean; | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function startWork(work: WorkInfo): void; |
| workScheduler.NetworkType | enum | export enum NetworkType | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | export enum ChargingType | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | export enum BatteryStatus | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.StorageRequest | enum | export enum StorageRequest | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | 接口API9变更,移植到ohos.resourceschedule.workScheduler.d.ts |
**适配指导**
<br>
导入workScheduler模块。
```
import bundle form '@ohos.resourceschedule.workScheduler'
```
此外还需要适配异常处理,具体参考
[
workScheduler接口文档
](
../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md
)
。
## c4.resourceschedule.reminderAgent
对资源调度子系统提醒代理原有接口进行整改,原有API8及之前的接口全部废弃,原有API9接口删除,需要使用新的API9接口。新的API9接口符合错误码规范。
**变更影响**
基于OpenHarmony3.2.8.2及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
以下方法、属性、枚举和常量均从API9变更,废弃@ohos.reminderAgent.d.ts文件,新增@ohos.reminderAgentManager.d.ts文件,类名也将从reminderAgent变更为reminderAgentManager。
| 类名 | 接口类型 | 方法/属性/枚举/常量 | 变更类型 |
| --------------------- | ----------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| reminderAgent | method | publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback
<number>
): void; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | publishReminder(reminderReq: ReminderRequest): Promise
<number>
; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | cancelReminder(reminderId: number, callback: AsyncCallback
<void>
): void; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | cancelReminder(reminderId: number): Promise
<void>
; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | getValidReminders(callback: AsyncCallback
<Array
<
ReminderRequest
>
>): void; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | getValidReminders(): Promise
<Array
<
ReminderRequest
>
>; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | cancelAllReminders(callback: AsyncCallback
<void>
): void; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | cancelAllReminders(): Promise
<void>
; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback
<void>
): void; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | addNotificationSlot(slot: NotificationSlot): Promise
<void>
; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback
<void>
): void; | 废弃,移动到reminderAgentManager |
| reminderAgent | method | removeNotificationSlot(slotType: notification.SlotType): Promise
<void>
; | 废弃,移动到reminderAgentManager |
| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_CLOSE | 废弃,移动到reminderAgentManager.ActionButtonType |
| reminderAgent.ActionButtonType | enum | ACTION_BUTTON_TYPE_SNOOZE | 废弃,移动到reminderAgentManager.ActionButtonType |
| reminderAgent.ReminderType | enum | REMINDER_TYPE_TIMER | 废弃,移动到reminderAgentManager.ReminderType |
| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | 废弃,移动到reminderAgentManager.ReminderType |
| reminderAgent.ReminderType | enum | REMINDER_TYPE_CALENDAR | 废弃,移动到reminderAgentManager.ReminderType |
| reminderAgent.ActionButton | field | title:string | 废弃,移动到reminderAgentManager.ActionButton |
| reminderAgent.ActionButton | field | type:ActionButtonType | 废弃,移动到reminderAgentManager.ActionButton |
| reminderAgent.WantAgent | field | pkgName:string | 废弃,移动到reminderAgentManager.WantAgent |
| reminderAgent.WantAgent | field | abilityName:string | 废弃,移动到reminderAgentManager.WantAgent |
| reminderAgent.MaxScreenWantAgent | field | pkgName:string | 废弃,移动到reminderAgentManager.MaxScreenWantAgent |
| reminderAgent.MaxScreenWantAgent | field | abilityName:string | 废弃,移动到reminderAgentManager.MaxScreenWantAgent |
| reminderAgent.ReminderRequest | field | reminderType:ReminderType | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | actionButton?:ActionButton | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | wantAgent?:WantAgent | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | maxScreenWantAgent?:MaxScreenWantAgent | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | ringDuration?:number | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | snoozeTimes?:number | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | timeInterval?:number | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | title?:string | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | content?:string | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | expiredContent?:string | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | snoozeContent?:string | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | notificationId?:number | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequest | field | slotType?: notification.SlotType | 废弃,移动到reminderAgentManager.ReminderRequest |
| reminderAgent.ReminderRequestCalendar | field | dateTime:LocalDateTime | 废弃,移动到reminderAgentManager.ReminderRequestCalendar |
| reminderAgent.ReminderRequestCalendar | field | repeatMonths?:Array
<number>
| 废弃,移动到reminderAgentManager.ReminderRequestCalendar |
| reminderAgent.ReminderRequestCalendar | field | repeatDays?:Array
<number>
| 废弃,移动到reminderAgentManager.ReminderRequestCalendar |
| reminderAgent.ReminderRequestAlarm | field | hour:number | 废弃,移动到reminderAgentManager.ReminderRequestAlarm |
| reminderAgent.ReminderRequestAlarm | field | minute:number | 废弃,移动到reminderAgentManager.ReminderRequestAlarm |
| reminderAgent.ReminderRequestAlarm | field | daysOfWeek?:Array
<number>
| 废弃,移动到reminderAgentManager.ReminderRequestAlarm |
| reminderAgent.ReminderRequestTimer | field | triggerTimeInSeconds:number | 废弃,移动到reminderAgentManager.ReminderRequestTimer |
| reminderAgent.LocalDateTime | field | year:number | 废弃,移动到reminderAgentManager.LocalDateTime |
| reminderAgent.LocalDateTime | field | month:number | 废弃,移动到reminderAgentManager.LocalDateTime |
| reminderAgent.LocalDateTime | field | day:number | 废弃,移动到reminderAgentManager.LocalDateTime |
| reminderAgent.LocalDateTime | field | hour:number | 废弃,移动到reminderAgentManager.LocalDateTime |
| reminderAgent.LocalDateTime | field | minute:number | 废弃,移动到reminderAgentManager.LocalDateTime |
| reminderAgent.LocalDateTime | field | second?:number | 废弃,移动到reminderAgentManager.LocalDateTime |
**适配指导**
<br>
导入reminderAgentManager模块。
```
import bundle form '@ohos.reminderAgentManager'
```
此外还需要适配异常处理,具体参考
[
reminderAgentManager接口文档
](
../../../application-dev/reference/apis/js-apis-reminderAgentManager.md
)
。
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-web.md
0 → 100644
浏览文件 @
c53b66ba
# web子系统ChangeLog
OpenHarmony 3.2.9.1 sp8版本相较于OpenHarmony 3.2.8.1版本,web的API变更如下
## cl.web.1 删除无用错误码
web子系统webviewController接口存在变更:
-
去除forward,backward和backOrForward接口的@throws { BusinessError } 17100007 - Invalid back or forward operation.
-
去除zoom,zoomIn和zoomOut接口的@throws { BusinessError } 17100009 - Cannot zoom in or zoom out.
开发者需要根据以下说明对应用进行适配。
**变更影响**
影响已发布的JS接口,应用无需进行适配即可在新版本SDK环境正常编译通过。
**关键的接口/组件变更**
涉及接口: forward, backward, backOrForward, zoom, zoomIn, zoomOut;
涉及组件: web;
**适配指导**
无需适配
## cl.web.2 setWebController入参修改
已发布的部分web子系统controller迁移至webviewController,老的webController做废弃处理。从API9开始做出以下变更:
setWebController入参由老controller替换为新的webviewController
**变更影响**
基于此前版本开发的应用,需适配变更js接口的入参,否则会影响原有功能。
**关键的接口/组件变更**
-
涉及接口
setWebController(controller: WebviewController): void;
-
变更前:
```
js
setWebController
(
controller
:
WebController
):
void
;
```
-
变更后:
```
js
setWebController
(
controller
:
WebviewController
):
void
;
```
**适配指导**
示例代码如下:
变更前:
```
js
// xxx.ets
@
Entry
@
Component
struct
WebComponent
{
controller
:
WebController
=
new
WebController
()
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
multiWindowAccess
(
true
)
.
onWindowNew
((
event
)
=>
{
console
.
log
(
"
onWindowNew...
"
)
var
popController
:
WebController
=
new
WebController
()
event
.
handler
.
setWebController
(
popController
)
})
}
}
}
```
变更后:
```
js
// xxx.ets
@
Entry
@
Component
struct
WebComponent
{
controller
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
()
build
()
{
Column
()
{
Web
({
src
:
'
www.example.com
'
,
controller
:
this
.
controller
})
.
multiWindowAccess
(
true
)
.
onWindowNew
((
event
)
=>
{
console
.
log
(
"
onWindowNew...
"
)
var
popController
:
web_webview
.
WebviewController
=
new
web_webview
.
WebviewController
()
event
.
handler
.
setWebController
(
popController
)
})
}
}
}
```
## cl.web.3 getUnfilterendLinkUrl接口名修改
getUnfilterendLinkUrl接口拼写错误,应改为getUnfilteredLinkUrl
**变更影响**
基于此前版本开发的应用,需适配变更js接口名,否则会影响原有功能。
**关键的接口/组件变更**
-
涉及接口
getUnfilteredLinkUrl(): string;
-
变更前:
```
js
getUnfilterendLinkUrl
():
string
;
```
-
变更后:
```
js
getUnfilteredLinkUrl
():
string
;
```
**适配指导**
基于此前版本开发的应用,需适配变更js接口名,使用新的接口名替换旧的接口名,否则会影响原有功能。
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta4/changelog-wifi.md
0 → 100644
浏览文件 @
c53b66ba
# 基础通信WIFI子系统ChangeLog
## cl.wifi.1 系统API和API9接口迁移到新增的@ohos.wifiManager.d.ts
@ohos.wifi.d.ts接口不支持抛出错误码,而API9以及SystemAPI都需要支持错误码抛出,为支持该功能,将@ohos.wifi.d.ts中的所有SystemAPI以及API9接口迁移到新增的@ohos.wifiManager.d.ts当中,并添加错误码描述。
后续需要import @ohos.wifiManager.d.ts才能够使用wifi的系统API以及API9接口:
import wifiManager from '@ohos.wifiManager';
**变更影响**
仅对系统API以及API9所有接口的使用有影响,需要import @ohos.wifiManager才能使用wifi的系统API和API9接口
import wifiManager from '@ohos.wifiManager';
对于其他接口无影响
**关键的接口/组件变更**
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
| wifi | namespace | declare namespace wifi | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function enableWifi(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值改为void |
| wifi | method | function disableWifi(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值改为void |
| wifi | method | function scan(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值改为void |
| wifi | method | function getScanResults(): Promise
<
Array
<
WifiScanInfo
>>
| API9接口变更,迁移到@ohos.wifiManager.d.ts,由getScanInfos修改为getScanResults |
| wifi | method | function getScanResults(callback: AsyncCallback
<
Array
<
WifiScanInfo
>>
): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,由getScanInfos修改为getScanResults |
| wifi | method | function getScanResultsSync():
Array
<
[WifiScanInfo]
>
| API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function addCandidateConfig(config: WifiDeviceConfig): Promise
<
number
>
| API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback
<
number
>
): void | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function removeCandidateConfig(networkId: number): Promise
<
void
>
| API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function removeCandidateConfig(networkId: number, callback: AsyncCallback
<
void
>
): void | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig): Promise
<
boolean
>
| API9接口变更,该接口删除 |
| wifi | method | function addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback
<
boolean
>
): void | API9接口变更,该接口删除 |
| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig): Promise
<
boolean
>
| API9接口变更,该接口删除 |
| wifi | method | function removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback
<
boolean
>
): void | API9接口变更,该接口删除 |
| wifi | method | function getCandidateConfigs():
Array
<
[WifiDeviceConfig]
>
| API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function connectToCandidateConfig(networkId: number): void | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function connectToNetwork(networkId: number): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function connectToDevice(config: WifiDeviceConfig): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function disconnect(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function reassociate(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function reconnect(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function disableNetwork(netId: number): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function removeAllNetwork(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function removeDevice(id: number): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function enableHotspot(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function disableHotspot(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function setHotspotConfig(config: HotspotConfig): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function getP2pLocalDevice(): Promise
<
WifiP2pDevice
>
| API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function getP2pLocalDevice(callback: AsyncCallback
<
WifiP2pDevice
>
): void | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function getP2pGroups(): Promise
<
Array
<
WifiP2pGroupInfo
>>
| API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function getP2pGroups(callback: AsyncCallback
<
Array
<
WifiP2pGroupInfo
>>
): void | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | method | function createGroup(config: WifiP2PConfig): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function removeGroup(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function p2pConnect(config: WifiP2PConfig): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function p2pCancelConnect(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function startDiscoverDevices(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function stopDiscoverDevices(): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function deletePersistentGroup(netId: number): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | method | function setDeviceName(devName: string): void | API9接口变更,迁移到@ohos.wifiManager.d.ts,返回值修改为void |
| wifi | interface | export interface WifiEapConfig | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | enum | export enum EapMethod | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | enum | export enum Phase2Method | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | interface | export interface WifiDeviceConfig | API9接口变更,迁移到@ohos.wifiManager.d.ts,增加eapConfig参数 |
| wifi | interface | export interface IpConfig | API9接口变更,迁移到@ohos.wifiManager.d.ts,增加prefixLength参数 |
| wifi | interface | export interface WifiInfoElem | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | enum | export enum WifiChannelWidth | API9接口变更,迁移到@ohos.wifiManager.d.ts |
| wifi | interface | export interface WifiScanInfo | API9接口变更,迁移到@ohos.wifiManager.d.ts,增加centerFrequency0、centerFrequency1、infoElems三个参数 |
| wifi | enum | export enum WifiSecurityType | API9接口变更,迁移到@ohos.wifiManager.d.ts,增加4种加密类型 |
| wifi | interface | export interface WifiLinkedInfo | API9接口变更,迁移到@ohos.wifiManager.d.ts,增加MacType参数 |
**适配指导(可选,不涉及则可以删除)**
以getLinkedInfo为例,在新版本中需要使用如下方式进行调用:
```
import wifiManager from '@ohos.wifiManager'
wifiManager.getLinkedInfo((err, data) => {
if (err) {
console.error("get linked info error");
return;
}
console.info("get linked info: " + JSON.stringify(data));
});
wifiManager.getLinkedInfo().then(data => {
console.info("get linked info: " + JSON.stringify(data));
}).catch(error => {
console.info("get linked info error");
});
```
## cl.wifiext.1 系统API和API9接口迁移到新增的@ohos.wifiManagerExt.d.ts
@ohos.wifiext.d.ts接口不支持抛出错误码,而API9以及SystemAPI都需要支持错误码抛出,为支持该功能,将@ohos.wifiext.d.ts中的所有SystemAPI以及API9接口迁移到新增的@ohos.wifiManagerExt.d.ts当中,并添加错误码描述
后续需要import @ohos.wifiManagerExt.d.ts才能够使用wifi的系统API以及API9接口:
import wifiManagerExt from '@ohos.wifiManagerExt';
**变更影响**
仅对系统API以及API9所有接口的使用有影响,需要import @ohos.wifiManagerExt才能使用wifi的系统API和API9接口,与wifiManager配套使用
import wifiManagerExt from '@ohos.wifiManagerExt';
对于其他接口无影响
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-ability.md
浏览文件 @
c53b66ba
...
...
@@ -228,7 +228,7 @@
**关键接口/组件变更**
为适配统一的API异常处理方式,对元能力相关接口进行废弃(下表中 原接口 列内容),并新增对应接口(下表中 新接口 列内容)。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致。
为适配统一的API异常处理方式,对元能力相关接口进行废弃(下表中 原接口 列内容
,其中的API9接口将被删除,API8及以前的接口将被标注为废弃
),并新增对应接口(下表中 新接口 列内容)。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致。
| 原接口 | 新接口 |
| ----------------------------------------------- | ----------------------------------------------- |
...
...
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-account_os_account.md
浏览文件 @
c53b66ba
# 帐号子系统changeLog
## cl.account_os_account.1 变更错误码定义及其返回方式
针对帐号子系统API存在错误码定义不统一和抛出方式不符合OpenHarmony错误码规范的问题,从API9开始作以下变更:
-
新增统一的错误码定义:
-
[
帐号公共错误码
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-account.md
)
-
[
应用帐号错误码
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-app-account.md
)
-
按以下方式返回错误码:
-
异步接口:错误信息通过AsyncCallback或Promise的error对象返回。其中,参数类型和数量错误信息,通过抛出异常的方式返回。
-
同步接口:错误信息通过抛出异常的方式返回。
**变更影响**
基于此前版本开发的应用,需适配变更后的新错误码和错误信息返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
以下接口涉及新错误码和错误信息返回方式变更:
-
class AccountManager
-
activateOsAccount(localId: number, callback: AsyncCallback
<
void
>
): void;
-
removeOsAccount(localId: number, callback: AsyncCallback
<
void
>
): void;
-
setOsAccountConstraints(localId: number, constraints: Array
<
string
>
, enable: boolean, callback: AsyncCallback
<
void
>
): void;
-
setOsAccountName(localId: number, localName: string, callback: AsyncCallback
<
void
>
): void;
-
queryMaxOsAccountNumber(callback: AsyncCallback
<
number
>
): void;
-
queryAllCreatedOsAccounts(callback: AsyncCallback
<
Array
<
OsAccountInfo
>>
): void;
-
createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback
<
OsAccountInfo
>
): void;
-
createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback
<
OsAccountInfo
>
): void;
-
queryOsAccountById(localId: number, callback: AsyncCallback
<
OsAccountInfo
>
): void;
-
getOsAccountProfilePhoto(localId: number, callback: AsyncCallback
<
string
>
): void;
-
setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback
<
void
>
): void;
-
on(type: 'activate' | 'activating', name: string, callback: Callback
<
number
>
): void;
-
off(type: 'activate' | 'activating', name: string, callback?: Callback
<
number
>
): void;
-
isMainOsAccount(callback: AsyncCallback
<
boolean
>
): void;
-
queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callback: AsyncCallback
<
Array
<
ConstraintSourceTypeInfo
>>
): void;
-
class UserAuth
-
constructor();
-
getVersion(): number;
-
getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
-
getProperty(request: GetPropertyRequest, callback: AsyncCallback
<
ExecutorProperty
>
): void;
-
setProperty(request: SetPropertyRequest, callback: AsyncCallback
<
number
>
): void;
-
auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array;
-
authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array;
-
cancelAuth(contextID: Uint8Array): number;
-
class PINAuth
-
constructor();
-
registerInputer(inputer: IInputer): boolean;
-
unregisterInputer(authType: AuthType): void;
-
class UserIdentityManager
-
constructor();
-
openSession(callback: AsyncCallback
<
Uint8Array
>
): void;
-
addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
-
updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
-
closeSession(): void;
-
cancel(challenge: Uint8Array): number;
-
delUser(token: Uint8Array, callback: IIdmCallback): void;
-
delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): void;
-
getAuthInfo(callback: AsyncCallback
<
Array
<
EnrolledCredInfo
>>
): void;
-
interface IInputData
-
onSetData: (authSubType: AuthSubType, data: Uint8Array) =
>
void;
**适配指导**
异步接口的错误信息处理逻辑以activateOsAccount为例,示例代码如下:
```
ts
import
account_osAccount
from
"
@ohos.account.osAccount
"
let
accountMgr
=
account_osAccount
.
getAccountManager
()
let
callbackFunc
=
(
err
)
=>
{
if
(
err
!=
null
)
{
// handle the bussiness error
console
.
log
(
"
account_osAccount failed, error:
"
+
JSON
.
stringify
(
err
));
}
else
{
console
.
log
(
"
account_osAccount successfully
"
);
}
}
try
{
accountMgr
.
activateOsAccount
(
"
100
"
,
callbackFunc
);
}
catch
(
err
)
{
// handle the parameter type error
console
.
log
(
"
account_osAccount failed for incorrect parameter type, error:
"
+
JSON
.
stringify
(
err
));
}
try
{
accountMgr
.
activateOsAccount
();
}
catch
(
err
)
{
// handle the parameter number error
console
.
log
(
"
account_osAccount failed for incorrect parameter number, error:
"
+
JSON
.
stringify
(
err
));
}
```
同步接口的错误信息处理以registerInputer为例,示例代码如下:
```
ts
import
account_osAccount
from
"
@ohos.account.osAccount
"
let
pinAuth
=
new
account_osAccount
.
PINAuth
()
try
{
pinAuth
.
registerInputer
({})
}
catch
(
err
)
{
// handle the parameter type error
console
.
log
(
"
account_osAccount failed for incorrect parameter type, error:
"
+
JSON
.
stringify
(
err
));
}
try
{
pinAuth
.
registerInputer
()
}
catch
(
err
)
{
// handle the parameter number error
console
.
log
(
"
account_osAccount failed for incorrect parameter number, error:
"
+
JSON
.
stringify
(
err
));
}
```
# 帐号子系统ChangeLog
## cl.account_os_account.
1
帐号SystemAPI错误信息返回方式变更
## cl.account_os_account.
2
帐号SystemAPI错误信息返回方式变更
已发布的部分帐号SystemAPI使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误码规范。从API9开始作以下变更:
...
...
@@ -15,6 +121,7 @@
**关键接口/组件变更**
变更前:
-
class UserAuth
-
setProperty(request: SetPropertyRequest, callback: AsyncCallback
<
number
>
): void;
-
setProperty(request: SetPropertyRequest): Promise
<
number
>
;
...
...
@@ -25,6 +132,7 @@
-
cancel(challenge: Uint8Array): number;
变更后:
-
class UserAuth
-
setProperty(request: SetPropertyRequest, callback: AsyncCallback
<
void
>
): void;
-
setProperty(request: SetPropertyRequest): Promise
<
void
>
;
...
...
@@ -83,7 +191,7 @@ try {
}
```
## cl.account_os_account.
2
应用帐号鉴权服务ACTION定义变更
## cl.account_os_account.
3
应用帐号鉴权服务ACTION定义变更
**变更影响**
...
...
@@ -106,6 +214,7 @@ ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth"
**适配指导**
提供应用帐号鉴权服务的三方应用,需要在相关ServiceAbility的配置文件(FA模型为config.json或Stage模型为module.json5)中适配变更后的应用帐号认证ACTION,示例如下:
```
"abilities": [
{
...
...
@@ -122,3 +231,5 @@ ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth"
}
}]
}
```
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-arkui.md
浏览文件 @
c53b66ba
...
...
@@ -65,4 +65,62 @@ ArkUI子系统alertDialog, actionSheet, customDialog组件及prompt, promptActio
**适配指导**
无需适配
\ No newline at end of file
无需适配
## cl.arkui.3 自定义组件成员变量初始化的方式与约束校验场景补全
[
自定义组件成员变量初始化规则
](
../../../application-dev/quick-start/arkts-restrictions-and-extensions.md#自定义组件成员变量初始化的方式与约束
)
请参考文档,此版本修复了某些遗漏场景的校验。
**变更影响**
如果未按照文档规范,进行自定义组件成员变量初始化赋值,编译报错。
**关键的接口/组件变更**
不涉及。
**适配指导**
按文档提示修改。
## cl.arkui.4 自定义父子组件成员变量赋值约束校验场景补全
[
自定义父子组件成员变量赋值规则
](
../../../application-dev/quick-start/arkts-restrictions-and-extensions.md#自定义组件成员变量初始化的方式与约束
)
请参考文档,此版本修复了某些遗漏场景的校验。
**变更影响**
如果自定义父子组件成员变量初始化未按照文档规范,编译报错。
**关键的接口/组件变更**
不涉及。
**适配指导**
按文档提示修改,使用其它装饰器变量或常规变量赋值。
## cl.arkui.5 单一子组件校验补全
对 'Button', 'FlowItem','GridItem','GridCol','ListItem','Navigator','Refresh','RichText','ScrollBar','StepperItem','TabContent'等只支持一个子组件的开启校验。
**变更影响**
如果上述组件内有超过一个子组件,编译报错。
**关键的接口/组件变更**
```
js
RichText
(
'
RichText
'
)
{
Text
(
'
Text1
'
)
Text
(
'
Text2
'
)
}
/* ArkTS:ERROR File: /root/newOH/developtools/ace-ets2bundle/compiler/sample/pages/home.ets:25:7
The component 'RichText' can only have a single child component. */
```
**适配指导**
按报错提示修改,指定组件内只能有一个子组件。
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-camera.md
0 → 100644
浏览文件 @
c53b66ba
# 媒体子系统JS API变更Changelog
OpenHarmony3.2 Beta4版本相较于OpenHarmony3.2 Beta3版本,媒体子系统camera部件API变更如下
## camera接口变更
基于以下原因新增部分功能接口以及废弃部分接口:
1.
提升开发者使用相机接口的便利。
2.
帮助开发者快速掌握相机开发接口,快速投入到开发当中。
3.
易于后续版本中框架功能的扩展,降低框架模块之间的耦合度。
具体参考下方变更内容,开发者需要根据以下说明对应用进行适配。
**变更影响**
影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
| ---------------------- | ----------------------- | ------------------------------------------------------------ | -------- |
| ohos.multimedia.camera | Profile | readonly format:CameraFormat; | 新增 |
| ohos.multimedia.camera | Profile | readonly size: Size; | 新增 |
| ohos.multimedia.camera | FrameRateRange | readonly min: number; | 新增 |
| ohos.multimedia.camera | FrameRateRange | readonly max: number; | 新增 |
| ohos.multimedia.camera | VideoProfile | readonly frameRateRange: FrameRateRange; | 新增 |
| ohos.multimedia.camera | CameraOutputCapability | readonly previewProfiles: Array
<Profile>
; | 新增 |
| ohos.multimedia.camera | CameraOutputCapability | readonly photoProfiles: Array
<Profile>
; | 新增 |
| ohos.multimedia.camera | CameraOutputCapability | readonly videoProfiles: Array
<VideoProfile>
; | 新增 |
| ohos.multimedia.camera | CameraOutputCapability | readonly supportedMetadataObjectTypes: Array
<MetadataObjectType>
; | 新增 |
| ohos.multimedia.camera | CameraManager | getSupportedCameras(callback: AsyncCallback
<Array
<
CameraDevice
>
>): void;
<br/>
getSupportedCameras(): Promise
<Array
<
CameraDevice
>
>; | 新增 |
| ohos.multimedia.camera | CameraManager | getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback
<CameraOutputCapability>
): void;
<br/>
getSupportedOutputCapability(camera: CameraDevice): Promise
<CameraOutputCapability>
; | 新增 |
| ohos.multimedia.camera | CameraManager | isCameraMuted(): boolean; | 新增 |
| ohos.multimedia.camera | CameraManager | isCameraMuteSupported(): boolean; | 新增 |
| ohos.multimedia.camera | CameraManager | muteCamera(mute: boolean): void; | 新增 |
| ohos.multimedia.camera | CameraManager | createCameraInput(camera: CameraDevice, callback: AsyncCallback
<CameraInput>
): void;
<br/>
createCameraInput(camera: CameraDevice): Promise
<CameraInput>
; | 新增 |
| ohos.multimedia.camera | CameraManager | createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback
<PreviewOutput>
): void;
<br/>
createPreviewOutput(profile: Profile, surfaceId: string): Promise
<PreviewOutput>
; | 新增 |
| ohos.multimedia.camera | CameraManager | createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback
<PhotoOutput>
): void;
<br/>
createPhotoOutput(profile: Profile, surfaceId: string): Promise
<PhotoOutput>
; | 新增 |
| ohos.multimedia.camera | CameraManager | createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback
<VideoOutput>
): void;
<br/>
createVideoOutput(profile: VideoProfile, surfaceId: string): Promise
<VideoOutput>
; | 新增 |
| ohos.multimedia.camera | CameraManager | createMetadataOutput(metadataObjectTypes: Array
<MetadataObjectType>
, callback: AsyncCallback
<MetadataOutput>
): void;
<br/>
createMetadataOutput(metadataObjectTypes: Array
<MetadataObjectType>
): Promise
<MetadataOutput>
; | 新增 |
| ohos.multimedia.camera | CameraManager | createCaptureSession(callback: AsyncCallback
<CaptureSession>
): void;
<br/>
createCaptureSession(): Promise
<CaptureSession>
; | 新增 |
| ohos.multimedia.camera | CameraManager | on(type: 'cameraMute', callback: AsyncCallback
<boolean>
): void; | 新增 |
| ohos.multimedia.camera | CameraManager | getCameras(callback: AsyncCallback
<Array
<
Camera
>
>): void;
<br/>
getCameras(): Promise
<Array
<
Camera
>
>; | 废弃 |
| ohos.multimedia.camera | CameraManager | createCameraInput(cameraId: string, callback: AsyncCallback
<CameraInput>
): void;
<br/>
createCameraInput(cameraId: string): Promise
<CameraInput>
; | 废弃 |
| ohos.multimedia.camera | CameraManager | createCaptureSession(context: Context, callback: AsyncCallback
<CaptureSession>
): void;
<br/>
createCaptureSession(context: Context): Promise
<CaptureSession>
; | 废弃 |
| ohos.multimedia.camera | CameraManager | createPreviewOutput(surfaceId: string, callback: AsyncCallback
<PreviewOutput>
): void;
<br/>
createPreviewOutput(surfaceId: string): Promise
<PreviewOutput>
; | 废弃 |
| ohos.multimedia.camera | CameraManager | CreatePhotoOutput(surfaceId: string, callback: AsyncCallback
<PhotoOutput>
): void;
<br/>
CreatePhotoOutput(surfaceId: string): Promise
<PhotoOutput>
; | 废弃 |
| ohos.multimedia.camera | CameraManager | createVideoOutput(surfaceId: string, callback: AsyncCallback
<VideoOutput>
): void;
<br/>
createVideoOutput(surfaceId: string): Promise
<VideoOutput>
; | 废弃 |
| ohos.multimedia.camera | CameraManager | createMetadataOutput(callback: AsyncCallback
<MetadataOutput>
): void;
<br/>
createVideoOutput(): Promise
<MetadataOutput>
; | 废弃 |
| ohos.multimedia.camera | CameraStatusInfo | camera: CameraDevice; | 新增 |
| ohos.multimedia.camera | CameraStatusInfo | camera: Camera; | 废弃 |
| ohos.multimedia.camera | CameraDevice | interface CameraDevice | 新增 |
| ohos.multimedia.camera | Camera | interface Camera | 废弃 |
| ohos.multimedia.camera | CameraInput | open(callback: AsyncCallback
<void>
): void;
<br/>
open(): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CameraInput | close(callback: AsyncCallback
<void>
): void;
<br/>
close(): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CameraInput | on(type: 'error', camera: CameraDevice, callback: ErrorCallback
<CameraInputError>
): void; | 新增 |
| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback
<boolean>
): void;
<br/>
isFocusModeSupported(afMode: FocusMode): Promise
<boolean>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback
<FocusMode>
): void;
<br/>
getFocusMode(): Promise
<FocusMode>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback
<void>
): void;
<br/>
setFocusMode(afMode: FocusMode): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback
<Array
<
number
>
>): void;
<br/>
getZoomRatioRange(): Promise
<Array
<
number
>
>; | 废弃 |
| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback
<number>
): void;
<br/>
getZoomRatio(): Promise
<number>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback
<void>
): void;
<br/>
setZoomRatio(zoomRatio: number): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getCameraId(callback: AsyncCallback
<string>
): void;
<br/>
getCameraId(): Promise
<string>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getExposurePoint(callback: AsyncCallback
<Point>
): void;
<br/>
getExposurePoint(): Promise
<Point>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setExposurePoint(exposurePoint: Point, callback: AsyncCallback
<void>
): void;
<br/>
setExposurePoint(exposurePoint: Point): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | hasFlash(callback: AsyncCallback
<boolean>
): void;
<br/>
hasFlash(): Promise
<boolean>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback
<boolean>
): void;
<br/>
isFlashModeSupported(flashMode: FlashMode): Promise
<boolean>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getFlashMode(callback: AsyncCallback
<FlashMode>
): void;
<br/>
getFlashMode(): Promise
<FlashMode>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setFlashMode(flashMode: FlashMode, callback: AsyncCallback
<void>
): void;
<br/>
setFlashMode(flashMode: FlashMode): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback
<boolean>
): void;
<br/>
isExposureModeSupported(aeMode: ExposureMode): Promise
<boolean>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getExposureMode(callback: AsyncCallback
<ExposureMode>
): void;
<br/>
getExposureMode(): Promise
<ExposureMode>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setExposureMode(aeMode: ExposureMode, callback: AsyncCallback
<void>
): void;
<br/>
setExposureMode(aeMode: ExposureMode): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getMeteringPoint(callback: AsyncCallback
<Point>
): void;
<br/>
getMeteringPoint(): Promise
<Point>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setMeteringPoint(point: Point, callback: AsyncCallback
<void>
): void;
<br/>
setMeteringPoint(point: Point): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getExposureBiasRange(callback: AsyncCallback
<Array
<
number
>
>): void;
<br/>
getExposureBiasRange(): Promise
<Array
<
number
>
>; | 废弃 |
| ohos.multimedia.camera | CameraInput | setExposureBias(exposureBias: number, callback: AsyncCallback
<void>
): void;
<br/>
setExposureBias(exposureBias: number): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getExposureValue(callback: AsyncCallback
<number>
): void;
<br/>
getExposureValue(): Promise
<number>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback
<boolean>
): void;
<br/>
isFocusModeSupported(afMode: FocusMode): Promise
<boolean>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getFocusMode(callback: AsyncCallback
<FocusMode>
): void;
<br/>
getFocusMode(): Promise
<FocusMode>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setFocusMode(afMode: FocusMode, callback: AsyncCallback
<void>
): void;
<br/>
setFocusMode(afMode: FocusMode): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setFocusPoint(point: Point, callback: AsyncCallback
<void>
): void;
<br/>
setFocusPoint(point: Point): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getFocusPoint(callback: AsyncCallback
<Point>
): void;
<br/>
getFocusPoint(): Promise
<Point>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getFocalLength(callback: AsyncCallback
<number>
): void;
<br/>
getFocalLength(): Promise
<number>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | getZoomRatioRange(callback: AsyncCallback
<Array
<
number
>
>): void;
<br/>
getZoomRatioRange(): Promise
<Array
<
number
>
>; | 废弃 |
| ohos.multimedia.camera | CameraInput | getZoomRatio(callback: AsyncCallback
<number>
): void;
<br/>
getZoomRatio(): Promise
<number>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | setZoomRatio(zoomRatio: number, callback: AsyncCallback
<void>
): void;
<br/>
setZoomRatio(zoomRatio: number): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CameraInput | on(type: 'focusStateChange', callback: AsyncCallback
<FocusState>
): void; | 废弃 |
| ohos.multimedia.camera | CameraInput | on(type: 'exposureStateChange', callback: AsyncCallback
<ExposureState>
): void; | 废弃 |
| ohos.multimedia.camera | CameraInput | on(type: 'error', callback: ErrorCallback
<CameraInputError>
): void; | 废弃 |
| ohos.multimedia.camera | CameraInputErrorCode | ERROR_NO_PERMISSION = 0 | 新增 |
| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_PREEMPTED = 1 | 新增 |
| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_DISCONNECTED = 2 | 新增 |
| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DEVICE_IN_USE = 3 | 新增 |
| ohos.multimedia.camera | CameraInputErrorCode | ERROR_DRIVER_ERROR = 4 | 新增 |
| ohos.multimedia.camera | CameraFormat | CAMERA_FORMAT_RGBA_8888 = 3 | 新增 |
| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_AUTO = 1 | 新增 |
| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_CONTINUOUS_AUTO = 2 | 新增 |
| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_AUTO | 废弃 |
| ohos.multimedia.camera | ExposureMode | EXPOSURE_MODE_CONTINUOUS_AUTO | 废弃 |
| ohos.multimedia.camera | VideoStabilizationMode | LOW = 1 | 新增 |
| ohos.multimedia.camera | VideoStabilizationMode | MIDDLE = 2 | 新增 |
| ohos.multimedia.camera | VideoStabilizationMode | HIGH = 3 | 新增 |
| ohos.multimedia.camera | VideoStabilizationMode | AUTO = 4 | 新增 |
| ohos.multimedia.camera | VideoStabilizationMode | LOW | 废弃 |
| ohos.multimedia.camera | VideoStabilizationMode | MIDDLE | 废弃 |
| ohos.multimedia.camera | VideoStabilizationMode | HIGH | 废弃 |
| ohos.multimedia.camera | VideoStabilizationMode | AUTO | 废弃 |
| ohos.multimedia.camera | CaptureSession | addOutput(cameraOutput: CameraOutput, callback: AsyncCallback
<void>
): void;
<br/>
addOutput(cameraOutput: CameraOutput): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback
<void>
): void;
<br/>
removeOutput(cameraOutput: CameraOutput): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode, callback: AsyncCallback
<boolean>
): void;
<br/>
isVideoStabilizationModeSupported(vsMode: VideoStabilizationMode): Promise
<boolean>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getActiveVideoStabilizationMode(callback: AsyncCallback
<VideoStabilizationMode>
): void;
<br/>
getActiveVideoStabilizationMode(): Promise
<VideoStabilizationMode>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | setVideoStabilizationMode(mode: VideoStabilizationMode, callback: AsyncCallback
<void>
): void;
<br/>
setVideoStabilizationMode(mode: VideoStabilizationMode): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | on(type: 'focusStateChange', callback: AsyncCallback
<FocusState>
): void; | 新增 |
| ohos.multimedia.camera | CaptureSession | hasFlash(callback: AsyncCallback
<boolean>
): void;
<br/>
hasFlash(): Promise
<boolean>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback
<boolean>
): void;
<br/>
isFlashModeSupported(flashMode: FlashMode): Promise
<boolean>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getFlashMode(callback: AsyncCallback
<FlashMode>
): void;
<br/>
getFlashMode(): Promise
<FlashMode>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | setFlashMode(flashMode: FlashMode, callback: AsyncCallback
<void>
): void;
<br/>
setFlashMode(flashMode: FlashMode): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback
<boolean>
): void;
<br/>
isExposureModeSupported(aeMode: ExposureMode): Promise
<boolean>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getExposureMode(callback: AsyncCallback
<ExposureMode>
): void;
<br/>
getExposureMode(): Promise
<ExposureMode>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | setExposureMode(aeMode: ExposureMode, callback: AsyncCallback
<void>
): void;
<br/>
setExposureMode(aeMode: ExposureMode): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getMeteringPoint(callback: AsyncCallback
<Point>
): void;
<br/>
getMeteringPoint(): Promise
<Point>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | setMeteringPoint(point: Point, callback: AsyncCallback
<void>
): void;
<br/>
setMeteringPoint(point: Point): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getExposureBiasRange(callback: AsyncCallback
<Array
<
number
>
>): void;
<br/>
getExposureBiasRange(): Promise
<Array
<
number
>
>; | 新增 |
| ohos.multimedia.camera | CaptureSession | setExposureBias(exposureBias: number, callback: AsyncCallback
<void>
): void;
<br/>
setExposureBias(exposureBias: number): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getExposureValue(callback: AsyncCallback
<number>
): void;
<br/>
getExposureValue(): Promise
<number>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback
<boolean>
): void;
<br/>
isFocusModeSupported(afMode: FocusMode): Promise
<boolean>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getFocusMode(callback: AsyncCallback
<FocusMode>
): void;
<br/>
getFocusMode(): Promise
<FocusMode>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | setFocusMode(afMode: FocusMode, callback: AsyncCallback
<void>
): void;
<br/>
setFocusMode(afMode: FocusMode): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | setFocusPoint(point: Point, callback: AsyncCallback
<void>
): void;
<br/>
setFocusPoint(point: Point): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getFocusPoint(callback: AsyncCallback
<Point>
): void;
<br/>
getFocusPoint(): Promise
<Point>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getFocalLength(callback: AsyncCallback
<number>
): void;
<br/>
getFocalLength(): Promise
<number>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | getZoomRatioRange(callback: AsyncCallback
<Array
<
number
>
>): void;
<br/>
getZoomRatioRange(): Promise
<Array
<
number
>
>; | 新增 |
| ohos.multimedia.camera | CaptureSession | getZoomRatio(callback: AsyncCallback
<number>
): void;
<br/>
getZoomRatio(): Promise
<number>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | setZoomRatio(zoomRatio: number, callback: AsyncCallback
<void>
): void;
<br/>
setZoomRatio(zoomRatio: number): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | CaptureSession | addOutput(previewOutput: PreviewOutput, callback: AsyncCallback
<void>
): void;
<br/>
addOutput(previewOutput: PreviewOutput): Promise
<void>
;
<br/>
addOutput(photoOutput: PhotoOutput, callback: AsyncCallback
<void>
): void;
<br/>
addOutput(photoOutput: PhotoOutput): Promise
<void>
;
<br/>
addOutput(videoOutput: VideoOutput, callback: AsyncCallback
<void>
): void;
<br/>
addOutput(videoOutput: VideoOutput): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CaptureSession | removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback
<void>
): void;
<br/>
removeOutput(previewOutput: PreviewOutput): Promise
<void>
;
<br/>
removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback
<void>
): void;
<br/>
removeOutput(photoOutput: PhotoOutput): Promise
<void>
;removeOutput(videoOutput: VideoOutput, callback: AsyncCallback
<void>
): void;
<br/>
removeOutput(videoOutput: VideoOutput): Promise
<void>
;
<br/>
removeOutput(metadataOutput: MetadataOutput, callback: AsyncCallback
<void>
): void;
<br/>
removeOutput(metadataOutput: MetadataOutput): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_INSUFFICIENT_RESOURCES = 0 | 新增 |
| ohos.multimedia.camera | CaptureSessionErrorCode | ERROR_TIMEOUT = 1 | 新增 |
| ohos.multimedia.camera | CameraOutput | release(callback: AsyncCallback
<void>
): void;
<br/>
release(): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | PreviewOutput | start(callback: AsyncCallback
<void>
): void;
<br/>
start(): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | PreviewOutput | stop(callback: AsyncCallback
<void>
): void;
<br/>
stop(): Promise
<void>
; | 新增 |
| ohos.multimedia.camera | PreviewOutput | release(callback: AsyncCallback
<void>
): void;
<br/>
release(): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | PhotoOutput | release(callback: AsyncCallback
<void>
): void;
<br/>
release(): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | VideoOutput | release(callback: AsyncCallback
<void>
): void;
<br/>
release(): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | PhotoCaptureSetting | mirror?: boolean; | 新增 |
| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_DRIVER_ERROR = 0 | 新增 |
| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_INSUFFICIENT_RESOURCES = 1 | 新增 |
| ohos.multimedia.camera | PhotoOutputErrorCode | ERROR_TIMEOUT = 2 | 新增 |
| ohos.multimedia.camera | VideoOutputErrorCode | ERROR_DRIVER_ERROR = 0 | 新增 |
| ohos.multimedia.camera | MetadataObjectType | FACE_DETECTION = 0 | 新增 |
| ohos.multimedia.camera | MetadataObjectType | FACE = 0 | 废弃 |
| ohos.multimedia.camera | MetadataOutput | on(type: 'error', callback: ErrorCallback
<MetadataOutputError>
): void; | 新增 |
| ohos.multimedia.camera | MetadataOutput | setCapturingMetadataObjectTypes(metadataObjectTypes: Array
<MetadataObjectType>
, callback: AsyncCallback
<void>
): void;
<br/>
setCapturingMetadataObjectTypes(metadataObjectTypes: Array
<MetadataObjectType>
): Promise
<void>
; | 废弃 |
| ohos.multimedia.camera | MetadataOutput | getSupportedMetadataObjectTypes(callback: AsyncCallback
<Array
<
MetadataObjectType
>
>): void;
<br/>
getSupportedMetadataObjectTypes(): Promise
<Array
<
MetadataObjectType
>
>; | 废弃 |
| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_UNKNOWN = -1 | 新增 |
| ohos.multimedia.camera | MetadataOutputErrorCode | ERROR_INSUFFICIENT_RESOURCES = 0 | 新增 |
| ohos.multimedia.camera | MetadataOutputError | code: MetadataOutputErrorCode; | 新增 |
**适配指导**
除新增接口,和废弃接口之外,开发者需要关注变更的接口的适配:
从Beta4版本开始,对以下接口进行调整:
**新增接口**
1.
Profile接口
属性1:readonly format,类型:CameraFormat;
属性2:readonly size,类型:Size;
2.
FrameRateRange接口
属性1:readonly min,类型:number;
属性2:readonly max,类型:number;
3.
VideoProfile接口,继承自Profile
属性:readonly frameRateRange,类型:FrameRateRange;
4.
CameraOutputCapability接口
属性1:readonly previewProfiles,类型:Array
<Profile>
;
属性2:readonly photoProfiles,类型:Array
<Profile>
;
属性3:readonly videoProfiles,类型:Array
<VideoProfile>
;
属性4:readonly supportedMetadataObjectTypes,类型:Array
<MetadataObjectType>
;
5.
CameraManager中新增
getSupportedOutputCapability(camera: CameraDevice, callback: AsyncCallback
<CameraOutputCapability>
): void;
getSupportedOutputCapability(camera: CameraDevice): Promise
<CameraOutputCapability>
;
参考代码如下:
```
cameraManager.getSupportedCameras().then((cameras) => {
let cameraDevice = cameras[0];
cameraManager.getSupportedOutputCapability(cameraDevice, (err, CameraOutputCapability) => {
if (err) {
console.error(`Failed to get the outputCapability. ${err.message}`);
return;
}
console.log('Callback returned with an array of supported outputCapability');
})
})
```
```
cameraManager.getSupportedCameras().then((cameras) => {
let cameraDevice = cameras[0];
cameraManager.getSupportedOutputCapability(cameraDevice).then((cameraoutputcapability) => {
console.log('Promise returned with an array of supported outputCapability');
})
})
```
6.
CameraManager中新增isCameraMuted(): boolean;
参考代码如下:
```
let ismuted = cameraManager.isCameraMuted();
```
7.
CameraManager中新增isCameraMuteSupported(): boolean;
参考代码如下:
```
let ismutesuppotred = cameraManager.isCameraMuteSupported();
```
8.
CameraManager中新增muteCamera(mute: boolean): void;
参考代码如下:
```
let mute = true;
cameraManager.muteCamera(mute);
```
9.
CameraManager中新增on(type: 'cameraMute', callback: AsyncCallback
<boolean>
): void;
参考代码如下:
```
cameraManager.on('cameraMute', (err, curMuetd) => {
if (err) {
console.error(`Failed to get cameraMute callback. ${err.message}`);
return;
}
})
```
10.
CameraInput中新增open(callback: AsyncCallback
<void>
): void;以及open(): Promise
<void>
;
参考代码如下:
```
cameraInput.open((err) => {
if (err) {
console.error(`Failed to open the camera. ${err.message}`);
return;
}
console.log('Callback returned with camera opened.');
})
```
```
cameraInput.open().then(() => {
console.log('Promise returned with camera opened.');
})
```
11.
CameraInput中新增close(callback: AsyncCallback
<void>
): void;以及close(): Promise
<void>
;
参考代码如下:
```
cameraInput.close((err) => {
if (err) {
console.error(`Failed to close the cameras. ${err.message}`);
return;
}
console.log('Callback returned with camera closed.');
})
```
```
cameraInput.close().then(() => {
console.log('Promise returned with camera closed.');
})
```
12.
枚举CameraInputErrorCode中新增
枚举值名称:ERROR_NO_PERMISSION,值:0;
枚举值名称:ERROR_DEVICE_PREEMPTED,值:1;
枚举值名称:ERROR_DEVICE_DISCONNECTED,值:2;
枚举值名称:ERROR_DEVICE_IN_USE,值:3;
枚举值名称:ERROR_DRIVER_ERROR,值:4;
13.
枚举CameraFormat中新增
枚举值名称:CAMERA_FORMAT_RGBA_8888,值:3;
14.
CaptureSession中新增getMeteringPoint(callback: AsyncCallback
<Point>
): void;以及getMeteringPoint(): Promise
<Point>
;
参考代码如下:
```
captureSession.getMeteringPoint((err, exposurePoint) => {
if (err) {
console.log(`Failed to get the current exposure point ${err.message}`);
return ;
}
console.log(`Callback returned with current exposure point: ${exposurePoint}`);
})
```
```
captureSession.getMeteringPoint().then((exposurePoint) => {
console.log(`Promise returned with current exposure point : ${exposurePoint}`);
})
```
15.
CaptureSession中新增setMeteringPoint(point: Point, callback: AsyncCallback
<void>
): void;以及setMeteringPoint(point: Point): Promise
<void>
;
参考代码如下:
```
const Point1 = {x: 1, y: 1};
captureSession.setMeteringPoint(Point1,(err) => {
if (err) {
console.log(`Failed to set the exposure point ${err.message}`);
return ;
}
console.log('Callback returned with the successful execution of setMeteringPoint');
})
```
```
const Point2 = {x: 2, y: 2};
captureSession.setMeteringPoint(Point2).then(() => {
console.log('Promise returned with the successful execution of setMeteringPoint');
})
```
16.
枚举CaptureSessionErrorCode中新增
枚举值名称:ERROR_INSUFFICIENT_RESOURCES,值:0;
枚举值名称:ERROR_TIMEOUT,值:1;
17.
新增接口CameraOutput,接口下有release(callback: AsyncCallback
<void>
): void;以及release(): Promise
<void>
;方法
参考代码如下:用previewOutput做示例
```
previewOutput.release((err) => {
if (err) {
console.error(`Failed to release the PreviewOutput instance ${err.message}`);
return;
}
console.log('Callback invoked to indicate that the PreviewOutput instance is released successfully.');
});
```
```
previewOutput.release().then(() => {
console.log('Promise returned to indicate that the PreviewOutput instance is released successfully.');
})
```
18.
PreviewOutput中新增start(callback: AsyncCallback
<void>
): void;以及start(): Promise
<void>
;
参考代码如下
```
previewOutput.start((err) => {
if (err) {
console.error(`Failed to start the previewOutput. ${err.message}`);
return;
}
console.log('Callback returned with previewOutput started.');
})
```
```
previewOutput.start().then(() => {
console.log('Promise returned with previewOutput started.');
})
```
19.
PreviewOutput中新增stop(callback: AsyncCallback
<void>
): void;以及stop(): Promise
<void>
;
参考代码如下
```
previewOutput.stop((err) => {
if (err) {
console.error(`Failed to stop the previewOutput. ${err.message}`);
return;
}
console.log('Callback returned with previewOutput stopped.');
})
```
```
previewOutput.stop().then(() => {
console.log('Callback returned with previewOutput stopped.');
})
```
20.
PhotoCaptureSetting接口
属性1:mirror?,类型:boolean;
21.
枚举PhotoOutputErrorCode中新增
枚举值名称:ERROR_DRIVER_ERROR,值:0;
枚举值名称:ERROR_INSUFFICIENT_RESOURCES,值:1;
枚举值名称:ERROR_TIMEOUT,值:2;
22.
枚举VideoOutputErrorCode中新增
枚举值名称:ERROR_DRIVER_ERROR,值:0;
23.
MetadataOutput中新增on(type: 'error', callback: ErrorCallback
<MetadataOutputError>
): void;
参考代码如下
```
metadataOutput.on('error', (metadataOutputError) => {
console.log(`Metadata output error code: ${metadataOutputError.code}`);
})
```
24.
MetadataOutputErrorCode枚举
枚举值名称:ERROR_UNKNOWN,值:-1;
枚举值名称:ERROR_INSUFFICIENT_RESOURCES,值:0;
25.
MetadataOutputError接口
属性名称:code,值:MetadataOutputErrorCode
**废弃接口**
1.
CameraInput中废弃接口on(type: 'exposureStateChange', callback: AsyncCallback
<ExposureState>
): void;
2.
previewOutput中废弃接口release(callback: AsyncCallback
<void>
): void;以及release(): Promise
<void>
;
3.
metadataOutput中废弃接口
setCapturingMetadataObjectTypes(metadataObjectTypes: Array
<MetadataObjectType>
, callback: AsyncCallback
<void>
): void;
<br/>
setCapturingMetadataObjectTypes(metadataObjectTypes: Array
<MetadataObjectType>
): Promise
<void>
;
4.
metadataOutput中废弃接口
getSupportedMetadataObjectTypes(callback: AsyncCallback
<Array
<
MetadataObjectType
>
>): void;
<br/>
getSupportedMetadataObjectTypes(): Promise
<Array
<
MetadataObjectType
>
>;
5.
PreviewOutput中废弃接口release(callback: AsyncCallback
<void>
): void;以及release(): Promise
<void>
;
6.
PhotoOutput中废弃接口release(callback: AsyncCallback
<void>
): void;以及release(): Promise
<void>
;
7.
VideoOutput中废弃接口release(callback: AsyncCallback
<void>
): void;以及release(): Promise
<void>
;
8.
CameraInput中废弃接口getCameraId(callback: AsyncCallback
<string>
): void;以及getCameraId(): Promise
<string>
;
9.
CameraInput中废弃接口getExposurePoint(callback: AsyncCallback
<Point>
): void;以及getExposurePoint(): Promise
<Point>
;
10.
CameraInput中废弃接口setExposurePoint(exposurePoint: Point, callback: AsyncCallback
<void>
): void;以及setExposurePoint(exposurePoint: Point): Promise
<void>
;
**接口变更**
1.
CameraManager中接口getCameras返回值由Array
<Camera>
变更为Array
<CameraDevice>
,接口名由getCameras 更换为 getSupportedCameras,因此旧接口getCameras(callback: AsyncCallback
<Array
<
Camera
>
>): void;以及getCameras(): Promise
<Array
<
Camera
>
>;变更为getSupportedCameras(callback: AsyncCallback
<Array
<
CameraDevice
>
>): void和getSupportedCameras(): Promise
<Array
<
CameraDevice
>
>;
参考代码如下:
```
cameraManager.getSupportedCameras((err, cameras) => {
if (err) {
console.error(`Failed to get the cameras. ${err.message}`);
return;
}
console.log(`Callback returned with an array of supported cameras: ${cameras.length}`);
})
```
```
cameraManager.getSupportedCameras().then((cameras) => {
console.log(`Promise returned with an array of supported cameras: ${cameras.length}`);
})
```
2.
CameraManager中接口createCameraInput传递参数由原来cameraId: string变更为camera: CameraDevice,因此旧接口createCameraInput(cameraId: string, callback: AsyncCallback
<CameraInput>
): void;以及createCameraInput(cameraId: string): Promise
<CameraInput>
;变更为createCameraInput(camera: CameraDevice, callback: AsyncCallback
<CameraInput>
): void;和createCameraInput(camera: CameraDevice): Promise
<CameraInput>
;
参考代码如下:
```
let cameraDevice = cameras[0];
cameraManager.createCameraInput(cameraDevice, (err, cameraInput) => {
if (err) {
console.error(`Failed to create the CameraInput instance. ${err.message}`);
return;
}
console.log('Callback returned with the CameraInput instance.');
})
```
```
let cameraDevice = cameras[0];
cameraManager.createCameraInput(cameraDevice).then((cameraInput) => {
console.log('Promise returned with the CameraInput instance');
})
```
3.
CameraManager中接口createPreviewOutput新增传递参数profile: Profile,profile参数由getSupportedOutputCapability接口获取,因此旧接口createPreviewOutput(surfaceId: string, callback: AsyncCallback
<PreviewOutput>
): void;以及createPreviewOutput(surfaceId: string): Promise
<PreviewOutput>
;变更为createPreviewOutput(profile: Profile, surfaceId: string, callback: AsyncCallback
<PreviewOutput>
): void;createPreviewOutput(profile: Profile, surfaceId: string): Promise
<PreviewOutput>
;
参考代码如下:
```
let profile = cameraoutputcapability.previewProfiles[0];
cameraManager.createPreviewOutput(profile, surfaceId, (err, previewOutput) => {
if (err) {
console.error(`Failed to gcreate previewOutput. ${err.message}`);
return;
}
console.log('Callback returned with previewOutput created.');
})
```
```
let profile = cameraoutputcapability.previewProfiles[0];
cameraManager.createPreviewOutput(profile, surfaceId).then((previewOutput) => {
console.log('Promise returned with previewOutput created.');
})
```
4.
CameraManager中接口createPhotoOutput新增传递参数profile: Profile,profile参数由getSupportedOutputCapability接口获取,因此旧接口CreatePhotoOutput(surfaceId: string, callback: AsyncCallback
<PhotoOutput>
): void;以及CreatePhotoOutput(surfaceId: string): Promise
<PhotoOutput>
;变更为createPhotoOutput(profile: Profile, surfaceId: string, callback: AsyncCallback
<PhotoOutput>
): void;和createPhotoOutput(profile: Profile, surfaceId: string): Promise
<PhotoOutput>
;
参考代码如下:
```
let profile = cameraoutputcapability.photoProfiles[0];
cameraManager.createPhotoOutput(profile, surfaceId, (err, photoOutput) => {
if (err) {
console.error(`Failed to create photoOutput. ${err.message}`);
return;
}
console.log('Callback returned with photoOutput created.');
})
```
```
let profile = cameraoutputcapability.photoProfiles[0];
cameraManager.createPhotoOutput(profile, surfaceId).then((photoOutput) => {
console.log('Promise returned with photoOutput created.');
})
```
5.
CameraManager中接口createVideoOutput新增传递参数profile: Profile,profile参数由getSupportedOutputCapability接口获取,因此旧接口createVideoOutput(surfaceId: string, callback: AsyncCallback
<VideoOutput>
): void;以及createVideoOutput(surfaceId: string): Promise
<VideoOutput>
;变更为createVideoOutput(profile: VideoProfile, surfaceId: string, callback: AsyncCallback
<VideoOutput>
): void;和createVideoOutput(profile: VideoProfile, surfaceId: string): Promise
<VideoOutput>
;
参考代码如下:
```
let profile = cameraoutputcapability.videoProfiles[0];
cameraManager.createVideoOutput(profile, surfaceId, (err, videoOutput) => {
if (err) {
console.error(`Failed to create videoOutput. ${err.message}`);
return;
}
console.log('Callback returned with an array of supported outputCapability' );
})
```
```
let profile = cameraoutputcapability.videoProfiles[0];
cameraManager.createVideoOutput(profile, surfaceId).then((videoOutput) => {
console.log('Promise returned with videoOutput created.');
})
```
6.
CameraManager中接口createMetadataOutput新增传递参数metadataObjectTypes: Array
<MetadataObjectType>
,metadataObjectTypes参数由getSupportedOutputCapability接口获取,因此旧接口function createMetadataOutput(callback: AsyncCallback
<MetadataOutput>
): void;以及function createMetadataOutput(): Promise
<MetadataOutput>
;变更为createMetadataOutput(metadataObjectTypes: Array
<MetadataObjectType>
, callback: AsyncCallback
<MetadataOutput>
): void;和createMetadataOutput(metadataObjectTypes: Array
<MetadataObjectType>
): Promise
<MetadataOutput>
;
参考代码如下:
```
let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes;
cameraManager.createMetadataOutput(metadataObjectTypes, (err, metadataOutput) => {
if (err) {
console.error(`Failed to create metadataOutput. ${err.message}`);
return;
}
console.log('Callback returned with metadataOutput created.');
})
```
```
let metadataObjectTypes = cameraoutputcapability.supportedMetadataObjectTypes;
cameraManager.createMetadataOutput(metadataObjectTypes).then((metadataOutput) => {
console.log('Promise returned with metadataOutput created.');
})
```
7.
CameraManager中createCaptureSession不需要考虑context属性,因此旧接口createCaptureSession(context: Context, callback: AsyncCallback
<CaptureSession>
): void;以及createCaptureSession(context: Context): Promise
<CaptureSession>
;改为createCaptureSession(callback: AsyncCallback
<CaptureSession>
): void;和createCaptureSession(): Promise
<CaptureSession>
;
参考代码如下:
```
typescript
cameraManager
.
createCaptureSession
((
err
,
captureSession
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to create captureSession.
${
err
.
message
}
`
);
return
;
}
console
.
log
(
'
Callback returned with captureSession created.
'
);
})
```
```
cameraManager.createCaptureSession().then((captureSession) => {
console.log('Promise returned with captureSession created.');
})
```
8.
CameraStatusInfo接口下属性camera类型由Camera变更为CameraDevice
9.
CameraInput中接口on(type: 'error')新增传递参数camera: CameraDevice,因此旧接口on(type: 'error', callback: ErrorCallback
<CameraInputError>
): void;变更为on(type: 'error', camera: CameraDevice, callback: ErrorCallback
<CameraInputError>
): void;
参考代码如下:
```
let cameraDevice = cameras[0];
cameraInput.on('error', cameraDevice, (cameraInputError) => {
console.log(`Camera input error code: ${cameraInputError.code}`);
})
```
10.
CameraInput中以下接口调整到CaptureSession中
hasFlash(callback: AsyncCallback<boolean>): void;<br/>hasFlash(): Promise<boolean>;<br/>
isFlashModeSupported(flashMode: FlashMode, callback: AsyncCallback<boolean>): void;<br/>isFlashModeSupported(flashMode: FlashMode): Promise<boolean>;<br/>
getFlashMode(callback: AsyncCallback<FlashMode>): void;<br/>getFlashMode(): Promise<FlashMode>;<br/>
setFlashMode(flashMode: FlashMode, callback: AsyncCallback<void>): void;<br/>setFlashMode(flashMode: FlashMode): Promise<void>;<br/>
isExposureModeSupported(aeMode: ExposureMode, callback: AsyncCallback<boolean>): void;<br/>isExposureModeSupported(aeMode: ExposureMode): Promise<boolean>;<br/>
getExposureMode(callback: AsyncCallback<ExposureMode>): void;<br/>getExposureMode(): Promise<ExposureMode>;<br/>
setExposureMode(aeMode: ExposureMode, callback: AsyncCallback<void>): void;<br/>setExposureMode(aeMode: ExposureMode): Promise<void>;<br/>
getMeteringPoint(callback: AsyncCallback<Point>): void;<br/>getMeteringPoint(): Promise<Point>;<br/>
setMeteringPoint(point: Point, callback: AsyncCallback<void>): void;<br/>setMeteringPoint(point: Point): Promise<void>;<br/>
getExposureBiasRange(callback: AsyncCallback<Array<number>>): void;<br/>getExposureBiasRange(): Promise<Array<number>>;<br/>
setExposureBias(exposureBias: number, callback: AsyncCallback<void>): void;<br/>setExposureBias(exposureBias: number): Promise<void>;<br/>
getExposureValue(callback: AsyncCallback<number>): void;<br/>getExposureValue(): Promise<number>;<br/>
isFocusModeSupported(afMode: FocusMode, callback: AsyncCallback<boolean>): void;<br/>isFocusModeSupported(afMode: FocusMode): Promise<boolean>;<br/>
getFocusMode(callback: AsyncCallback<FocusMode>): void;<br/>getFocusMode(): Promise<FocusMode>;<br/>
setFocusMode(afMode: FocusMode, callback: AsyncCallback<void>): void;<br/>setFocusMode(afMode: FocusMode): Promise<void>;<br/>
setFocusPoint(point: Point, callback: AsyncCallback<void>): void;<br/>setFocusPoint(point: Point): Promise<void>;<br/>
getFocusPoint(callback: AsyncCallback<Point>): void;<br/>getFocusPoint(): Promise<Point>;<br/>
getFocalLength(callback: AsyncCallback<number>): void;<br/>getFocalLength(): Promise<number>;<br/>
getZoomRatioRange(callback: AsyncCallback<Array<number>>): void;<br/>getZoomRatioRange(): Promise<Array<number>>;<br/>
getZoomRatio(callback: AsyncCallback<number>): void;<br/>getZoomRatio(): Promise<number>;<br/>
setZoomRatio(zoomRatio: number, callback: AsyncCallback<void>): void;<br/>setZoomRatio(zoomRatio: number): Promise<void>;
11.
CameraInput中接口on(type: 'focusStateChange', callback: AsyncCallback
<FocusState>
): void;调整到CaptureSession中,对应接口on(type: 'focusStateChange', callback: AsyncCallback
<FocusState>
): void;
参考代码如下:
```
captureSession.on('focusStateChange', (focusState) => {
console.log(`Focus state : ${focusState}`);
})
```
12.
枚举ExposureMode中
枚举值名称:EXPOSURE_MODE_AUTO,初值由默认变更为1;
枚举值名称:EXPOSURE_MODE_CONTINUOUS_AUTO,初值由默认变更为2;
13.
枚举VideoStabilizationMode中
枚举值名称:LOW,初值由默认变更为1;
枚举值名称:MIDDLE,初值由默认变更为2;
枚举值名称:HIGH,初值由默认变更为3;
枚举值名称:AUTO,初值由默认变更为4;
14.
CaptureSession中接口addOutput参数由原来子类类型(PreviewOutput,PhotoOutput,VideoOutput,MetadataOutput)统一修改为基类类型(CameraOutput),变更后由原来8个接口缩减为2个接口。
改变前接口为:
addOutput(previewOutput: PreviewOutput, callback: AsyncCallback<void>): void;<br/>addOutput(previewOutput: PreviewOutput): Promise<void>;<br/>addOutput(photoOutput: PhotoOutput, callback: AsyncCallback<void>): void;<br/>addOutput(photoOutput: PhotoOutput): Promise<void>;<br/>addOutput(videoOutput: VideoOutput, callback: AsyncCallback<void>): void;<br/>addOutput(videoOutput: VideoOutput): Promise<void>;<br/>addOutput(metadataOutput: MetadataOutput, callback: AsyncCallback<void>): void;<br/>addOutput(metadataOutput: MetadataOutput): Promise<void>;
改变后接口为:
addOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br/>addOutput(cameraOutput: CameraOutput): Promise<void>;
参考代码如下:以PreviewOutput为例
```
captureSession.addOutput(previewOutput, (err) => {
if (err) {
console.error(`Failed to add output. ${err.message}`);
return;
}
console.log('Callback returned with output added.');
})
```
```
captureSession.addOutput(previewOutput).then(() => {
console.log('Promise returned with cameraOutput added.');
})
```
15.
CaptureSession中接口removeOutput参数由原来子类类型(PreviewOutput,PhotoOutput,VideoOutput,MetadataOutput)统一修改为基类类型(CameraOutput),变更后由原来8个接口缩减为2个接口。
改变前接口为:
removeOutput(previewOutput: PreviewOutput, callback: AsyncCallback<void>): void;<br/>removeOutput(previewOutput: PreviewOutput): Promise<void>;<br/>removeOutput(photoOutput: PhotoOutput, callback: AsyncCallback<void>): void;<br/>removeOutput(photoOutput: PhotoOutput): Promise<void>;<br/>removeOutput(videoOutput: VideoOutput, callback: AsyncCallback<void>): void;<br/>removeOutput(videoOutput: VideoOutput): Promise<void>;<br/>removeOutput(metadataOutput: MetadataOutput, callback: AsyncCallback<void>): void;<br/>removeOutput(metadataOutput: MetadataOutput): Promise<void>;
改变后接口为:
removeOutput(cameraOutput: CameraOutput, callback: AsyncCallback<void>): void;<br/>removeOutput(cameraOutput: CameraOutput): Promise<void>;
参考代码如下:以PreviewOutput为例
```
captureSession.removeOutput(previewOutput, (err) => {
if (err) {
console.error(`Failed to remove the CameraOutput instance. ${err.message}`);
return;
}
console.log('Callback invoked to indicate that the CameraOutput instance is removed.');
});
```
```
captureSession.removeOutput(previewOutput).then(() => {
console.log('Promise returned to indicate that the CameraOutput instance is removed.');
})
```
16.
枚举MetadataObjectType中
枚举值名称由FACE变更为FACE_DETECTION;
17.
接口Camera名称更改为CameraDevice
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-device-manager.md
0 → 100644
浏览文件 @
c53b66ba
# 设备管理changeLog
## cl.device_manager.1 API错误信息返回方式变更
设备管理接口使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误码规范。从API9开始作以下变更:
异步接口:通过AsyncCallback或Promise的error对象返回错误信息。
同步接口:通过抛出异常的方式返回错误信息。
**变更影响**
基于此前版本开发的应用,需适配接口的错误信息返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
在以下接口增加错误码处理:
-
createDeviceManager(bundleName: string, callback: AsyncCallback
<
DeviceManager
>
): void;
-
release(): void;
-
getTrustedDeviceListSync(): Array
<
DeviceInfo
>
-
getTrustedDeviceList(callback:AsyncCallback
<
Array
<
DeviceInfo
>>
): void;
-
getTrustedDeviceList(): Promise
<
Array
<
DeviceInfo
>>
-
getLocalDeviceInfoSync(): DeviceInfo;
-
getLocalDeviceInfo(callback:AsyncCallback
<
DeviceInfo
>
): void;
-
getLocalDeviceInfo(): Promise
<
DeviceInfo
>
-
startDeviceDiscovery(subscribeInfo: SubscribeInfo): void;
-
startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions?: string): void;
-
stopDeviceDiscovery(subscribeId: number): void;
-
publishDeviceDiscovery(publishInfo: PublishInfo): void;
-
unPublishDeviceDiscovery(publishId: number): void;
-
authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback
<
{deviceId: string, pinToken ?: number}
>
): void;
-
unAuthenticateDevice(deviceInfo: DeviceInfo): void;
-
verifyAuthInfo(authInfo: AuthInfo, callback: AsyncCallback
<
{deviceId: string, level: number}
>
): void;
-
setUserOperation(operateAction: number, params: string): void;
-
on(type: 'uiStateChange', callback: Callback
<
{ param: string}
>
): void;
-
off(type: 'uiStateChange', callback?: Callback
<
{ param: string}
>
): void;
-
on(type: 'deviceStateChange', callback: Callback
<
{ action: DeviceStateChangeAction, device: DeviceInfo }
>
): void;
-
off(type: 'deviceStateChange', callback?: Callback
<
{ action: DeviceStateChangeAction, device: DeviceInfo }
>
): void;
-
on(type: 'deviceFound', callback: Callback
<
{ subscribeId: number, device: DeviceInfo }
>
): void;
-
off(type: 'deviceFound', callback?: Callback
<
{ subscribeId: number, device: DeviceInfo }
>
): void;
-
on(type: 'discoverFail', callback: Callback
<
{ subscribeId: number, reason: number }
>
): void;
-
off(type: 'discoverFail', callback?: Callback
<
{ subscribeId: number, reason: number }
>
): void;
-
on(type: 'publishSuccess', callback: Callback
<
{ publishId: number }
>
): void;
-
off(type: 'publishSuccess', callback?: Callback
<
{ publishId: number }
>
): void;
-
on(type: 'publishFail', callback: Callback
<
{ publishId: number, reason: number }
>
): void;
-
off(type: 'publishFail', callback?: Callback
<
{ publishId: number, reason: number }
>
): void;
-
on(type: 'serviceDie', callback: () =
>
void): void;
-
off(type: 'serviceDie', callback?: () =
>
void): void;
**适配指导**
异步接口以getTrustedDeviceList为例,示例代码如下:
```
ts
import
account_osAccount
from
"
@ohos.distributedHardware.deviceManager
"
dmInstance
.
getTrustedDeviceList
((
err
,
data
)
=>
{
console
.
log
(
"
getTrustedDeviceList err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
get trusted device info:
'
+
JSON
.
stringify
(
data
));
});
try
{
dmInstance
.
getTrustedDeviceList
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
"
getTrustedDeviceList errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
return
;
}
console
.
log
(
'
get trusted device info:
'
+
JSON
.
stringify
(
data
));
});
}
catch
(
err
)
{
console
.
error
(
"
getTrustedDeviceList errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
同步接口以startDeviceDiscovery为例,示例代码如下:
```
ts
// 生成发现标识,随机数确保每次调用发现接口的标识不一致
var
subscribeId
=
Math
.
floor
(
Math
.
random
()
*
10000
+
1000
);
var
subscribeInfo
=
{
"
subscribeId
"
:
subscribeId
,
"
mode
"
:
0xAA
,
// 主动模式
"
medium
"
:
0
,
// 自动发现类型,同时支持多种发现类型
"
freq
"
:
2
,
// 高频率
"
isSameAccount
"
:
false
,
"
isWakeRemote
"
:
false
,
"
capability
"
:
1
};
dmInstance
.
startDeviceDiscovery
(
subscribeInfo
);
// 当有设备发现时,通过deviceFound回调通知给应用程序
// 生成发现标识,随机数确保每次调用发现接口的标识不一致
var
subscribeId
=
Math
.
floor
(
Math
.
random
()
*
10000
+
1000
);
var
subscribeInfo
=
{
"
subscribeId
"
:
subscribeId
,
"
mode
"
:
0xAA
,
// 主动模式
"
medium
"
:
0
,
// 自动发现类型,同时支持多种发现类型
"
freq
"
:
2
,
// 高频率
"
isSameAccount
"
:
false
,
"
isWakeRemote
"
:
false
,
"
capability
"
:
1
};
try
{
dmInstance
.
startDeviceDiscovery
(
subscribeInfo
);
// 当有设备发现时,通过deviceFound回调通知给应用程序
}
catch
(
err
)
{
console
.
error
(
"
startDeviceDiscovery errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-device-usb.md
0 → 100644
浏览文件 @
c53b66ba
# USB管理 changeLog
## cl.usb_manager.1 API错误信息返回方式变更
USB管理接口使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误码规范。从API9开始作出变更,选择通过抛出异常的方式返回错误信息。
**变更影响**
基于此前版本开发的应用,需适配接口的错误信息返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
USB模块名由@ohos.usb.d.ts 变更为 @ohos.usbV9.d.ts,模块内所有接口均增加错误码处理。
**适配指导**
接口以getDevices为例,示例代码如下:
```
ts
import
usbV9
from
'
@ohos.usbV9
'
try
{
usbV9
.
getDevices
();
// 如果给该接口传入不合适的参数,则会抛出异常
}
catch
(
err
)
{
console
.
error
(
"
getDevices errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-dsoftbus.md
0 → 100644
浏览文件 @
c53b66ba
# 软总线子系统Changelog
## IPC&RPC API支持异常处理方式和支持传入布尔值与数值选择同步或异步方式发送信息变更
1.
软总线IPC&RPC部分接口使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误规范;
2.
支持传入布尔值选择同步或异步方式发送信息。
#### 变更影响
此版本兼容之前的应用开发,不需要适配,后续可调用新增接口支持以下两个变更:
1.
支持异常处理并返回错误码;
2.
提供通过布尔值或通过0与非0数字选择同步或异步发消息。
#### 关键接口/组件变更
为适配统一的API异常处理方式,对IPC&RPC相关接口进行废弃,并新增对应接口和方法。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致。
| 类名 | 废弃接口 | 新增替换类名 | 新增替代接口 |
| ------------ | ------------ | ------------ | ------------ |
| MessageParcel | static create(): MessageParcel | MessageSequence | static create(): MessageSequence |
| MessageParcel | reclaim(): void | MessageSequence | reclaim(): void |
| MessageParcel | writeRemoteObject(object: IRemoteObject): boolean| MessageSequence |writeRemoteObject(object: IRemoteObject): void|
| MessageParcel | readRemoteObject(): IRemoteObject | MessageSequence | readRemoteObject(): IRemoteObject |
| MessageParcel | writeInterfaceToken(token: string): boolean | MessageSequence | writeInterfaceToken(token: string): void |
| MessageParcel | readInterfaceToken(): string | MessageSequence | readInterfaceToken(): string |
| MessageParcel | getSize(): number | MessageSequence | getSize(): number |
| MessageParcel | getCapacity(): number | MessageSequence | getCapacity(): number|
| MessageParcel | setSize(size: number): boolean | MessageSequence | setCapacity(size: number): void |
| MessageParcel | getReadableBytes(): number | MessageSequence | getReadableBytes(): number |
| MessageParcel | getReadPosition(): number | MessageSequence | getReadPosition(): number |
| MessageParcel | getWritePosition(): number | MessageSequence | getWritePosition(): number |
| MessageParcel | rewindRead(pos: number): boolean | MessageSequence | rewindRead(pos: number): void |
| MessageParcel | rewindWrite(pos: number): boolean | MessageSequence | rewindWrite(pos: number): void |
| MessageParcel | writeNoException(): void | MessageSequence | writeNoException(): void |
| MessageParcel | readException(): void | MessageSequence | readException(): void |
| MessageParcel | writeByte(val: number): boolean | MessageSequence | writeByte(val: number): void |
| MessageParcel | writeShort(val: number): boolean | MessageSequence | writeShort(val: number): void |
| MessageParcel | writeInt(val: number): boolean | MessageSequence | writeInt(val: number): void |
| MessageParcel | writeLong(val: number): boolean | MessageSequence | writeLong(val: number): void |
| MessageParcel | writeFloat(val: number): boolean | MessageSequence | writeFloat(val: number): void |
| MessageParcel | writeDouble(val: number): boolean | MessageSequence | writeDouble(val: number): void |
| MessageParcel | writeBoolean(val: boolean): boolean | MessageSequence | writeBoolean(val: boolean): void |
| MessageParcel | writeChar(val: number): boolean | MessageSequence | writeChar(val: number): void |
| MessageParcel | writeString(val: string): boolean | MessageSequence | writeString(val: string): void |
| MessageParcel | writeSequenceable(val: Sequenceable): boolean | MessageSequence | writeParcelable(val: Parcelable): void |
| MessageParcel | writeByteArray(byteArray: number[]): boolean | MessageSequence | writeByteArray(byteArray: number[]): void |
| MessageParcel | writeShortArray(shortArray: number[]): boolean | MessageSequence | writeShortArray(shortArray: number[]): void |
| MessageParcel | writeIntArray(intArray: number[]): boolean | MessageSequence | writeIntArray(intArray: number[]): void |
| MessageParcel | writeLongArray(longArray: number[]): boolean | MessageSequence | writeLongArray(longArray: number[]): void |
| MessageParcel | writeFloatArray(floatArray: number[]): boolean | MessageSequence | writeFloatArray(floatArray: number[]): void |
| MessageParcel | writeDoubleArray(doubleArray: number[]): boolean | MessageSequence | writeDoubleArray(doubleArray: number[]): void |
| MessageParcel | writeBooleanArray(booleanArray: boolean[]): boolean | MessageSequence | writeBooleanArray(booleanArray: boolean[]): void |
| MessageParcel | writeCharArray(charArray: number[]): boolean | MessageSequence | writeCharArray(charArray: number[]): void |
| MessageParcel | writeStringArray(stringArray: string[]): boolean | MessageSequence | writeStringArray(stringArray: string[]): void |
| MessageParcel | writeSequenceableArray(sequenceableArray: Sequenceable[]): boolean | MessageSequence | writeParcelableArray(sequenceableArray: Parcelable[]): void |
| MessageParcel | writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean | MessageSequence | writeRemoteObjectArray(objectArray: IRemoteObject[]): void |
| MessageParcel | readByte(): number | MessageSequence | readByte(): number |
| MessageParcel | readShort(): number | MessageSequence | readShort(): number |
| MessageParcel | readLong(): number | MessageSequence | readLong(): number |
| MessageParcel | readFloat(): number | MessageSequence | readFloat(): number |
| MessageParcel | readDouble(): number | MessageSequence | readDouble(): number |
| MessageParcel | readBoolean(): boolean | MessageSequence | readBoolean(): boolean |
| MessageParcel | readChar(): number | MessageSequence | readChar(): number |
| MessageParcel | readString(): string | MessageSequence | readString(): string |
| MessageParcel | readSequenceable(dataIn: Sequenceable) : boolean | MessageSequence | readSequenceable(dataIn: Parcelable) : void |
| MessageParcel | readByteArray(dataIn: number[]) : void | MessageSequence | readByteArray(dataIn: number[]) : void |
| MessageParcel | readByteArray(): number[] | MessageSequence | readByteArray(): number[] |
| MessageParcel | readShortArray(dataIn: number[]) : void | MessageSequence | readShortArray(dataIn: number[]) : void |
| MessageParcel | readShortArray(): number[] | MessageSequence | readShortArray(): number[] |
| MessageParcel | readIntArray(dataIn: number[]) : void | MessageSequence | readIntArray(dataIn: number[]) : void |
| MessageParcel | readIntArray() : number[] | MessageSequence | readIntArray() : number[] |
| MessageParcel | readLongArray(dataIn: number[]) : void | MessageSequence | readLongArray(dataIn: number[]) : void |
| MessageParcel | readLongArray(): number[] | MessageSequence | readLongArray(): number[] |
| MessageParcel | readFloatArray(dataIn: number[]) : void | MessageSequence | readFloatArray(dataIn: number[]) : void |
| MessageParcel | readFloatArray(): number[] | MessageSequence | readFloatArray(): number[] |
| MessageParcel | readDoubleArray(dataIn: number[]) : void | MessageSequence | readDoubleArray(dataIn: number[]) : void |
| MessageParcel | readDoubleArray(): number[] | MessageSequence | readDoubleArray(): number[] |
| MessageParcel | readBooleanArray(dataIn: boolean[]) : void | MessageSequence | readBooleanArray(dataIn: boolean[]) : void |
| MessageParcel | readBooleanArray(): boolean[] | MessageSequence | readBooleanArray(): boolean[] |
| MessageParcel | readCharArray(dataIn: number[]) : void | MessageSequence | readCharArray(dataIn: number[]) : void |
| MessageParcel | readCharArray(): number[] | MessageSequence | readCharArray(): number[] |
| MessageParcel | readStringArray(dataIn: string[]) : void | MessageSequence | readStringArray(dataIn: string[]) : void |
| MessageParcel | readStringArray(): string[] | MessageSequence | readStringArray(): string[] |
| MessageParcel | readSequenceableArray(sequenceableArray: Sequenceable[]): void | MessageSequence | readSequenceableArray(sequenceableArray: Parcelable[]): void |
| MessageParcel | readRemoteObjectArray(objects: IRemoteObject[]): void | MessageSequence | readRemoteObjectArray(objects: IRemoteObject[]): void |
| MessageParcel | readRemoteObjectArray(): IRemoteObject[] | MessageSequence | readRemoteObjectArray(): IRemoteObject[] |
| MessageParcel | static closeFileDescriptor(fd: number): void | MessageSequence | static closeFileDescriptor(fd: number): void |
| MessageParcel | static dupFileDescriptor(fd: number) :number | MessageSequence | static dupFileDescriptor(fd: number) :number |
| MessageParcel | containFileDescriptors(): boolean | MessageSequence | containFileDescriptors(): boolean |
| MessageParcel | writeFileDescriptor(fd: number): boolean | MessageSequence | writeFileDescriptor(fd: number): void |
| MessageParcel | readFileDescriptor(): number | MessageSequence | readFileDescriptor(): number |
| MessageParcel | writeAshmem(ashmem: Ashmem): boolean | MessageSequence | writeAshmem(ashmem: Ashmem): void |
| MessageParcel | readAshmem(): Ashmem | MessageSequence | readAshmem(): Ashmem |
| MessageParcel | writeRawData(rawData: number[], size: number): boolean | MessageSequence | writeRawData(rawData: number[], size: number): void |
| MessageParcel | readRawData(size: number): number[] | MessageSequence | readRawData(size: number): number[] |
| Sequenceable | marshalling(dataOut: MessageParcel): boolean | Parcelable | marshalling(dataOut: MessageSequence): boolean |
| Sequenceable | unmarshalling(dataIn: MessageParcel) : boolean | Parcelable | unmarshalling(dataIn: MessageSequence) : boolean |
| SendRequestResult | errCode: number | RequestResult | errCode: number |
| SendRequestResult | code: number | RequestResult | code: number |
| SendRequestResult | data: MessageParcel | RequestResult | data: MessageSequence |
| SendRequestResult | reply: MessageParcel | RequestResult | reply: MessageSequence |
| IRemoteObject | queryLocalInterface(descriptor: string): IRemoteBroker | NA | getLocalInterface(descriptor: string): IRemoteBroker |
| IRemoteObject | getInterfaceDescriptor(): string | NA | getDescriptor(): string |
| IRemoteObject | addDeathRecipient(recipient: DeathRecipient, flags: number): boolean | NA | registerDeathRecipient(recipient: DeathRecipient, flags: number): void |
| IRemoteObject | removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean | NA | unregisterDeathRecipient(recipient: DeathRecipient, flags: number): void |
| IRemoteObject | NA | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): Promise
<RequestResult>
|
| IRemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback
<SendRequestResult>
): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption,callback: AsyncCallback
<RequestResult>
): void |
| MessageOption | NA | NA | isAsync(): boolean |
| MessageOption | NA | NA | setAsync(async: boolean): void |
| MessageOption | NA | NA | constructor(async?: boolean) |
| RemoteObject | queryLocalInterface(descriptor: string): IRemoteBroker | NA | getLocalInterface(descriptor: string): IRemoteBroker |
| RemoteObject | attachLocalInterface(localInterface: IRemoteBroker, descriptor: string): void | NA | modifyLocalInterface(localInterface: IRemoteBroker, descriptor: string): void |
| RemoteObject | getInterfaceDescriptor(): string | NA | getDescriptor(): string |
| RemoteObject | onRemoteRequestEx(code : number, data : MessageParcel, reply: MessageParcel, options : MessageOption): boolean
\|
Promise
<boolean>
| NA | onRemoteMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): boolean
\|
Promise
<boolean>
|
| RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption): Promise
<SendRequestResult>
| NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): Promise
<RequestResult>
|
| RemoteObject | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback
<SendRequestResult>
): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption, callback: AsyncCallback
<RequestResult>
): void |
| RemoteProxy | queryLocalInterface(interface: string): IRemoteBroker | NA | getLocalInterface(descriptor: string): IRemoteBroker |
| RemoteProxy | getInterfaceDescriptor(): string | NA | getDescriptor(): string |
| RemoteProxy | addDeathRecipient(recipient: DeathRecipient, flags: number): boolean | NA | registerDeathRecipient(recipient: DeathRecipient, flags: number): void |
| RemoteProxy | removeDeathRecipient(recipient: DeathRecipient, flags: number): boolean | NA | unregisterDeathRecipient(recipient: DeathRecipient, flags: number): void |
| RemoteProxy | NA | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption): Promise
<RequestResult>
|
| RemoteProxy | sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: MessageOption, callback: AsyncCallback
<SendRequestResult>
): void | NA | sendMessageRequest(code: number, data: MessageSequence, reply: MessageSequence, options: MessageOption, callback: AsyncCallback
<RequestResult>
): void |
| IPCSkeleton | static flushCommands(object: IRemoteObject): number | NA | static flushCmdBuffer(object: IRemoteObject): void |
| IPCSkeleton | static setCallingIdentity(identity: string): boolean | NA | static restoreCallingIdentity(identity: string): void |
| Ashmem | static createAshmem(name: string, size: number): Ashmem | NA | static create(name: string, size: number): Ashmem |
| Ashmem | static createAshmemFromExisting(ashmem: Ashmem): Ashmem | NA | static create(ashmem: Ashmem): Ashmem |
| Ashmem | mapAshmem(mapType: number): boolean | NA | mapTypedAshmem(mapType: number): void |
| Ashmem | mapReadAndWriteAshmem(): boolean | NA | mapReadWriteAshmem(): void |
| Ashmem | mapReadOnlyAshmem(): boolean | NA | mapReadonlyAshmem(): void |
| Ashmem | setProtection(protectionType: number): boolean | NA | setProtectionType(protectionType: number): void |
| Ashmem | writeToAshmem(buf: number[], size: number, offset: number): boolean | NA | writeAshmem(buf: number[], size: number, offset: number): void |
| Ashmem | readFromAshmem(size: number, offset: number): number[] | NA | readAshmem(size: number, offset: number): number[] |
#### 适配指导
新增的接口以抛异常的方式返回错误码及对应的错误信息,以MessageParcel中的create接口为例,使用示例代码如下:
```
js
import
rpc
from
'
@ohos.rpc
'
try
{
var
data
=
rpc
.
MessageParcel
.
create
();
data
.
reclaim
();
}
catch
(
error
)
{
console
.
info
(
"
create meassageParcel failed, errorCode =
"
+
error
.
errCode
);
console
.
info
(
"
create meassageParcel failed, errorMessage =
"
+
error
.
errorMessage
);
}
```
更多接口的示例代码可参考
[
RPC通信API文档
](
../../../application-dev/reference/apis/js-apis-rpc.md
)
。
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-enterprise_device_management.md
0 → 100644
浏览文件 @
c53b66ba
# 定制子系统ChangeLog
OpenHarmony 3.2.8.3 版本相较于OpenHarmony 3.2.8.1版本,定制子系统的API变更如下:
## cl.Customization.1 企业设备管理模块名称变更
从Opeharmonny 3.2.8.3版本开始,将"@ohos.enterpriseDeviceManager.d.ts"改为"@ohos.enterprise.adminManager.d.ts",开发者需要根据以下说明对应用进行适配。
**变更影响**
在Opeharmonny 3.2.8.3之前版本已开发的应用,需要进行适配动才可以在新版本SDK环境正常编译通过。
**关键的接口/组件变更**
| 原接口 | 新接口 |
| --------------------------------- | ---------------------------------- |
| @ohos.enterpriseDeviceManager.d.ts | @ohos.enterprise.adminManager.d.ts |
**适配指导**
如上所述,仅将老接口平移到了新的namespace中,所以可以通过修改import来解决适配问题:
如原先接口使用了@ohos.enterpriseDeviceManager:
```
js
import
enterpriseDeviceManager
from
'
@ohos.enterpriseDeviceManager
'
;
```
可以通过直接修改import,来切换到新的namespace上:
```
js
import
enterpriseDeviceManager
from
'
@ohos.enterprise.adminManager
'
;
```
## cl.Customization.2 enterpriseDeviceManager/DeviceSettingsManager.d.ts模块变更
从Opeharmonny 3.2.8.3版本开始,将enterpriseDeviceManager/DeviceSettingsManager.d.ts更改为"ohos.enterprise.dateTimeManager.d.ts"。
**变更影响**
在Opeharmonny 3.2.8.3之前版本已开发的应用,需要进行适配动才可以在新版本SDK环境正常编译通过。
**关键的接口/组件变更**
| 原接口 | 原接口类型 | 新接口 | 新接口类型 |
| --------------------------------- | --------- | ---------------------------------- | ----- |
| enterpriseDeviceManager/DeviceSettingsManager.d.ts | interface | @ohos.enterprise.dateTimeManager.d.ts | namespace |
**适配指导**
若原先使用的enterpriseDeviceManager/DeviceSettingsManager.d.ts的setDateTime接口。
```
js
import
enterpriseDeviceManager
from
'
@ohos.enterpriseDeviceManager
'
let
wantTemp
=
{
bundleName
:
"
bundleName
"
,
abilityName
:
"
abilityName
"
,
};
enterpriseDeviceManager
.
getDeviceSettingsManager
((
error
,
mgr
)
=>
{
if
(
error
)
{
console
.
log
(
"
error code:
"
+
error
.
code
+
"
error message:
"
+
error
.
message
);
return
;
}
mgr
.
setDateTime
(
wantTemp
,
1526003846000
,
(
error
)
=>
{
if
(
error
)
{
console
.
log
(
"
error code:
"
+
error
.
code
+
"
error message:
"
+
error
.
message
);
}
});
});
```
需要import新的namespace进行适配。
```
js
import
dateTimeManager
from
'
@ohos.enterprise.dateTimeManager
'
let
wantTemp
=
{
bundleName
:
"
bundleName
"
,
abilityName
:
"
abilityName
"
,
};
dateTimeManager
.
setDateTime
(
wantTemp
,
1526003846000
,
(
error
)
=>
{
if
(
error
)
{
console
.
log
(
"
error code:
"
+
error
.
code
+
"
error message:
"
+
error
.
message
);
}
})
```
## cl.Customization.3 systemapi变更
从Opeharmonny 3.2.8.3版本开始,企业设备管理所有接口变更为systemapi。
**变更影响**
所有接口只允许系统应用调用,非系统应用无法调用接口。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.enterprise.adminManager | adminManager |
**function**
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise
<
**void**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableAdmin(admin: Want, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableAdmin(admin: Want, userId: number, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableAdmin(admin: Want, userId?: number): Promise
<
**void**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableSuperAdmin(bundleName: String, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableSuperAdmin(bundleName: String): Promise
<
**void**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
isAdminEnabled(admin: Want, callback: AsyncCallback
<
**boolean**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
isAdminEnabled(admin: Want, userId: number, callback: AsyncCallback
<
**boolean**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
isAdminEnabled(admin: Want, userId?: number): Promise
<
**boolean**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
getEnterpriseInfo(admin: Want, callback: AsyncCallback
<
**EnterpriseInfo**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
getEnterpriseInfo(admin: Want): Promise
<
**EnterpriseInfo**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise
<
**void**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
isSuperAdmin(bundleName: String, callback: AsyncCallback
<
**boolean**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
isSuperAdmin(bundleName: String): Promise
<
**boolean**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
subscribeManagedEvent(admin: Want, managedEvents: Array
<
**ManagedEvent**
>
, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
subscribeManagedEvent(admin: Want, managedEvents: Array
<
**ManagedEvent**
>
): Promise
<
**void**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
unsubscribeManagedEvent(admin: Want, managedEvents: Array
<
**ManagedEvent**
>
, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**function**
unsubscribeManagedEvent(admin: Want, managedEvents: Array
<
**ManagedEvent**
>
): Promise
<
**void**
>
; | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**interface**
EnterpriseInfo | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**enum**
AdminType | systemapi |
| @ohos.enterprise.adminManager | adminManager |
**enum**
ManagedEvent | systemapi |
| @ohos.enterprise.dataTimeManager | dateTimeManager |
**function**
setDateTime(admin: Want, time: number, callback: AsyncCallback
<
**void**
>
): void; | systemapi |
| @ohos.enterprise.dataTimeManager | dateTimeManager |
**function**
setDateTime(admin: Want, time: number): Promise
<
**void**
>
; | systemapi |
## cl.Customization.4 接口权限变更
从Opeharmonny 3.2.8.3版本开始,部分接口新增权限校验。
**变更影响**
在Opeharmonny 3.2.8.3之前版本已开发的应用,需要持有相应权限,否则无法正常调用接口。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 新增权限 |
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.enterprise.adminManager | adminManager |
**function**
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager |
**function**
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId: number, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager |
**function**
enableAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, userId?: number): Promise
<
**void**
>
; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableAdmin(admin: Want, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableAdmin(admin: Want, userId: number, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableAdmin(admin: Want, userId?: number): Promise
<
**void**
>
; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableSuperAdmin(bundleName: String, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager |
**function**
disableSuperAdmin(bundleName: String): Promise
<
**void**
>
; | ohos.permission.MANAGE_ENTERPRISE_DEVICE_ADMIN |
| @ohos.enterprise.adminManager | adminManager |
**function**
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.SET_ENTERPRISE_INFO |
| @ohos.enterprise.adminManager | adminManager |
**function**
setEnterpriseInfo(admin: Want, enterpriseInfo: EnterpriseInfo): Promise
<
**void**
>
; | ohos.permission.SET_ENTERPRISE_INFO |
| @ohos.enterprise.adminManager | adminManager |
**function**
subscribeManagedEvent(admin: Want, managedEvents: Array
<
**ManagedEvent**
>
, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT |
| @ohos.enterprise.adminManager | adminManager |
**function**
subscribeManagedEvent(admin: Want, managedEvents: Array
<
**ManagedEvent**
>
): Promise
<
**void**
>
; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT |
| @ohos.enterprise.adminManager | adminManager |
**function**
unsubscribeManagedEvent(admin: Want, managedEvents: Array
<
**ManagedEvent**
>
, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT |
| @ohos.enterprise.adminManager | adminManager |
**function**
unsubscribeManagedEvent(admin: Want, managedEvents: Array
<
**ManagedEvent**
>
): Promise
<
**void**
>
; | ohos.permission.ENTERPRISE_SUBSCRIBE_MANAGED_EVENT |
| @ohos.enterprise.dataTimeManager | dateTimeManager |
**function**
setDateTime(admin: Want, time: number, callback: AsyncCallback
<
**void**
>
): void; | ohos.permission.ENTERPRISE_SET_DATETIME |
| @ohos.enterprise.dataTimeManager | dateTimeManager |
**function**
setDateTime(admin: Want, time: number): Promise
<
**void**
>
; | ohos.permission.ENTERPRISE_SET_DATETIME |
**适配指导**
调用以上接口,需要申请相应的权限才能正常调用。
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-filemanagement.md
0 → 100644
浏览文件 @
c53b66ba
# 文件管理子系统ChangeLog
## cl.filemanagement.1 fileio相关接口异常处理方式变更
file_api部件fileio接口返回值不包含错误码error.code,现进行错误码整改,废弃原有相关接口,新增相关接口。
**变更影响**
基于此前版本开发的应用,需注意废弃接口的迭代更新。新接口在接口规格上进行了微调,需注意新接口使用方法。
**关键接口/组件变更**
为适配统一的API异常处理方式,对fileio相关接口进行废弃,并新增对应接口,原接口位于@ohos.fileio,新接口位于@ohos.file.fs。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致,参数上有微调。
| 模块名 | 方法/属性/枚举/常量 | 变更类型 |
| ------------------------- | ------------------------------------------------------------ | -------- |
| @ohos.fileio |
**function**
open(path: string, flags?: number, mode?: number, callback?: AsyncCallback
<number>
): void
\|
Promise
<number>
; | 废弃 |
| @ohos.fileio |
**function**
openSync(path: string, flags?: number, mode?: number): number; | 废弃 |
| @ohos.file.fs |
**function**
open(path: string, mode?: number, callback?: AsyncCallback
<File>
): void
\|
Promise
<File>
; | 新增 |
| @ohos.file.fs |
**function**
openSync(path: string, mode?: number): File; | 新增 |
| @ohos.fileio |
**function**
read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }, callback?: AsyncCallback
<ReadOut>
): void
\|
Promise
<ReadOut>
; | 废弃 |
| @ohos.fileio |
**function**
readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): number; | 废弃 |
| @ohos.file.fs |
**function**
read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }, callback?: AsyncCallback
<number>
): void
\|
Promise
<number>
; | 新增 |
| @ohos.file.fs |
**function**
readSync(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; }): number; | 新增 |
| @ohos.fileio |
**function**
stat(path: string, callback?: AsyncCallback
<Stat>
): void
\|
Promise
<Stat>
; | 废弃 |
| @ohos.fileio |
**function**
statSync(path: string): Stat; | 废弃 |
| @ohos.fileio |
**function**
fstat(fd: number, callback?: AsyncCallback
<Stat>
): void
\|
Promise
<Stat>
; | 废弃 |
| @ohos.fileio |
**function**
fstatSync(fd: number): Stat; | 废弃 |
| @ohos.file.fs |
**function**
stat(file: string
\|
number, callback?: AsyncCallback
<Stat>
): void
\|
Promise
<Stat>
; | 新增 |
| @ohos.file.fs |
**function**
statSync(file: string
\|
number): Stat; | 新增 |
| @ohos.fileio |
**function**
truncate(path: string, len?: number, callback?: AsyncCallback
<void>
): void
\|
Promise
<void>
; | 废弃 |
| @ohos.fileio |
**function**
truncateSync(path: string, len?: number): void; | 废弃 |
| @ohos.fileio |
**function**
ftruncate(fd: number, len?: number, callback?: AsyncCallback
<void>
): void
\|
Promise
<void>
; | 废弃 |
| @ohos.fileio |
**function**
ftruncateSync(fd: number, len?: number): void; | 废弃 |
| @ohos.file.fs |
**function**
truncate(file: string
\|
number, len?: number, callback?: AsyncCallback
<void>
): void
\|
Promise
<void>
; | 新增 |
| @ohos.file.fs |
**function**
truncateSync(file: string
\|
number, len?: number): void; | 新增 |
| @ohos.fileio |
**function**
write(fd: number, buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }, callback?: AsyncCallback
<number>
): void
\|
Promise
<void>
; | 废弃 |
| @ohos.fileio |
**function**
writeSync(fd: number, buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): number; | 废弃 |
| @ohos.file.fs |
**function**
write(fd: number, buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; encoding?: string; }, callback?: AsyncCallback
<number>
): void
\|
Promise
<void>
; | 新增 |
| @ohos.file.fs |
**function**
writeSync(fd: number, buffer: ArrayBuffer
\|
string, options?: { offset?: number; length?: number; encoding?: string; }): number; | 新增 |
**适配指导**
原接口使用的是@ohos.fileio,以以下方式import:
```
js
import
fileio
from
'
@ohos.fileio
'
;
```
现新接口使用的是@ohos.file.fs,以以下方式import:
```
js
import
fs
from
'
@ohos.file.fs
'
;
```
此外还需要适配异常处理,同步接口异常处理示例代码:
```
js
import
fs
from
'
@ohos.file.fs
'
try
{
let
file
=
fs
.
openSync
(
path
,
fs
.
OpenMode
.
READ_ONLY
);
}
catch
(
err
)
{
console
.
error
(
"
openSync errCode:
"
+
err
.
code
+
"
, errMessage:
"
+
err
.
message
);
}
```
异步接口promise方法异常处理示例代码:
```
js
import
fs
from
'
@ohos.file.fs
'
try
{
let
file
=
await
fs
.
open
(
path
,
fs
.
OpenMode
.
READ_ONLY
);
}
catch
(
err
)
{
console
.
error
(
"
open promise errCode:
"
+
err
.
code
+
"
, errMessage:
"
+
err
.
message
);
}
```
异步接口callback方法异常处理示例代码:
```
js
import
fs
from
'
@ohos.file.fs
'
try
{
fs
.
open
(
path
,
fs
.
OpenMode
.
READ_ONLY
,
function
(
e
,
file
){
//异步线程的错误(如系统调用等)在回调中获取
if
(
e
)
{
console
.
error
(
"
open in async errCode:
"
+
e
.
code
+
"
, errMessage:
"
+
e
.
message
);
}
});
}
catch
(
err
)
{
//主线程的错误(如非法参数等)通过try catch获取
console
.
error
(
"
open callback errCode:
"
+
err
.
code
+
"
, errMessage:
"
+
err
.
message
);
}
```
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-geolocation.md
0 → 100644
浏览文件 @
c53b66ba
# 位置服务子系统ChangeLog
## cl.location.1 系统API和API9接口迁移到新增的@ohos.geoLocationManager.d.ts
@ohos.geolocation.d.ts接口不支持抛出错误码,而API9和systemApi都需要支持抛出错误码,为了支持该功能,把@ohos.geolocation.d.ts中systemApi和API9所有接口,迁移到新增的@ohos.geoLocationManager.d.ts中,并增加错误码描述。
后续需要import @ohos.geoLocationManager才能使用位置服务的系统API和API9接口:
import geoLocationManager from '@ohos.geoLocationManager';
**变更影响**
仅对系统API和API9所有接口的使用有影响,需要import @ohos.geoLocationManager才能使用位置服务的系统API和API9接口:
import geoLocationManager from '@ohos.geoLocationManager';
对于其他接口无影响。
**关键的接口/组件变更**
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
|geolocation| namespace | declare namespacegeolocation| API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation | interface | export interface ReverseGeocodingMockInfo | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation | interface | export interface LocationMockConfig | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation | interface | export interface CountryCode | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation | enum | export enum CountryCodeType | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation.GeoAddress | field | isFromMock?: Boolean; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation.Location | field | isFromMock?: Boolean; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation.GeoLocationErrorCode | field | NOT_SUPPORTED = 100 | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation.GeoLocationErrorCode | field | QUERY_COUNTRY_CODE_ERROR | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function on(type: 'countryCodeChange', callback: Callback
<
CountryCode
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function off(type: 'countryCodeChange', callback?: Callback
<
CountryCode
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCountryCode(callback: AsyncCallback
<
CountryCode
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCountryCode(): Promise
<
CountryCode
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function enableLocationMock(scenario: LocationRequestScenario, callback: AsyncCallback
<
void
>
): void; | API9接口变更,该接口删除。 |
|geolocation| method | function enableLocationMock(callback: AsyncCallback
<
void
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function enableLocationMock(scenario: LocationRequestScenario): Promise
<
void
>
; | API9接口变更,该接口删除。 |
|geolocation| method | function enableLocationMock(): Promise
<
void
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function disableLocationMock(scenario: LocationRequestScenario, callback: AsyncCallback
<
void
>
): void; | API9接口变更,该接口删除。 |
|geolocation| method | function disableLocationMock(callback: AsyncCallback
<
void
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function disableLocationMock(scenario: LocationRequestScenario): Promise
<
void
>
; | API9接口变更,该接口删除。 |
|geolocation| method | function disableLocationMock(): Promise
<
void
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback
<
void
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function setMockedLocations(config: LocationMockConfig): Promise
<
void
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function enableReverseGeocodingMock(callback: AsyncCallback
<
void
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function enableReverseGeocodingMock(): Promise
<
void
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function disableReverseGeocodingMock(callback: AsyncCallback
<
void
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function disableReverseGeocodingMock(): Promise
<
void
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array
<
ReverseGeocodingMockInfo
>
, callback: AsyncCallback
<
void
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array
<
ReverseGeocodingMockInfo
>
): Promise
<
void
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback
<
boolean
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType): Promise
<
boolean
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback
<
boolean
>
): void; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts,callback返回值改为void。 |
|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise
<
boolean
>
; | API9接口变更,迁移到@ohos.geoLocationManager.d.ts,promise返回值改为void。 |
**适配指导(可选,不涉及则可以删除)**
以enableLocation为例,在新版本上需要使用如下方式进行调用:
```
ts
import
geoLocationManager
from
'
@ohos.geoLocationManager
'
;
try
{
geoLocationManager
.
enableLocation
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
enableLocation: err=
'
+
JSON
.
stringify
(
err
));
}
});
}
catch
(
err
)
{
console
.
error
(
"
errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
## cl.location.2 位置服务权限变更
从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
)
。
**关键的接口/组件变更**
如果是存量应用(使用的API版本小于9),则无影响。
如果使用的API版本大于等于9,则在使用@ohos.geolocation和@ohos.geoLocationManager中需要ohos.permission.LOCATION权限的接口时,都需要按照上文所述方式申请对应权限。
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-global.md
0 → 100644
浏览文件 @
c53b66ba
# 全球化子系统ChangeLog
## cl.global.1 国际化模块接口支持错误码
全球化子系统国际化组件在如下场景中提供的接口修改为支持错误码。从API9开始作以下变更:
-
获取国家、语言的本地化显示
-
获取系统支持的语言列表、语言支持的地区列表
-
判断语言与地区是否匹配
-
获取、设置系统语言、系统国家或地区、系统区域
-
获取、设置系统24小时制
-
获取、添加、移除系统偏好语言
-
获取、设置本地化数字
开发者需要根据以下说明对应用进行适配。
**变更影响**
上述接口修改为System类的静态方法,调用时需要在模块名后加上类名。
设置类接口,返回值由boolean类型修改为void类型。例如,setSystemLanguage接口。
接口调用失败时会根据失败原因抛出相应的错误码。例如,当应用未正确配置权限时,抛出201错误码。
**关键的接口/组件变更**
-
涉及接口
-
getDisplayCountry(country: string, locale: string, sentenceCase?: boolean): string;
-
getDisplayLanguage(language: string, locale: string, sentenceCase?: boolean): string;
-
getSystemLanguages(): Array
<string>
;
-
getSystemCountries(language: string): Array
<string>
;
-
isSuggested(language: string, region?: string): boolean;
-
getSystemLanguage(): string;
-
setSystemLanguage(language: string): void;
-
getSystemRegion(): string;
-
setSystemRegion(region: string): void;
-
getSystemLocale(): string;
-
setSystemLocale(locale: string): void;
-
is24HourClock(): boolean;
-
set24HourClock(option: boolean): void;
-
addPreferredLanguage(language: string, index?: number): void;
-
removePreferredLanguage(index: number): void;
-
getPreferredLanguageList(): Array
<string>
;
-
getFirstPreferredLanguage(): string;
-
getAppPreferredLanguage(): string;
-
setUsingLocalDigit(flag: boolean): void;
-
getUsingLocalDigit(): boolean;
**适配指导**
使用try-catch块捕获接口抛出的日常。
```
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}.`)
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-inputmethod-framworks.md
0 → 100644
浏览文件 @
c53b66ba
# 输入法框架changeLog
## cl.inputmethod_frameworks.1 API错误信息返回方式变更
下列模块内部接口使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误码规范。在API9进行变更。
-
输入法框架模块:系统接口,@ohos.inputmethod.d.ts
-
输入法服务模块:系统接口,@ohos.inputmethodengine.d.ts
-
输入法ExtentionAbility模块:系统接口,@ohos.inputmethodextensionability.d.ts
-
输入法ExtentionContext模块:系统接口,@ohos.inputmethodextensioncontext.d.ts
-
输入法子类型模块:系统接口,@ohos.inputMethodSubtype.d.ts
异步接口:通过AsyncCallback或Promise的error对象返回错误信息。
同步接口:通过抛出异常的方式返回错误信息。
**变更影响**
基于此前版本开发的应用,需适配接口的错误信息返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
在以下接口增加错误码处理:
-
getSetting(): InputMethodSetting;
-
getController(): InputMethodController;
-
switchInputMethod(target: InputMethodProperty, callback: AsyncCallback
<boolean>
): void;
-
switchInputMethod(target: InputMethodProperty): Promise
<boolean>
;
-
switchCurrentInputMethodSubtype(target: InputMethodSubtype, callback: AsyncCallback
<boolean>
): void;
-
switchCurrentInputMethodSubtype(target: InputMethodSubtype): Promise
<boolean>
;
-
switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype, callback: AsyncCallback
<boolean>
): void;
-
switchCurrentInputMethodAndSubtype(inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype): Promise
<boolean>
;
-
listInputMethodSubtype(inputMethodProperty: InputMethodProperty, callback: AsyncCallback
<Array
<
InputMethodSubtype
>
>): void;
-
listInputMethodSubtype(inputMethodProperty: InputMethodProperty): Promise
<Array
<
InputMethodSubtype
>
>;
-
listCurrentInputMethodSubtype(callback: AsyncCallback
<Array
<
InputMethodSubtype
>
>): void;
-
listCurrentInputMethodSubtype(): Promise
<Array
<
InputMethodSubtype
>
>;
-
getInputMethods(enable: boolean, callback: AsyncCallback
<Array
<
InputMethodProperty
>
>): void;
-
getInputMethods(enable: boolean): Promise
<Array
<
InputMethodProperty
>
>;
-
showOptionalInputMethods(callback: AsyncCallback
<boolean>
): void;
-
showOptionalInputMethods(): Promise
<boolean>
;
-
stopInputSession(callback: AsyncCallback
<boolean>
): void;
-
stopInputSession(): Promise
<boolean>
;
-
showSoftKeyboard(callback: AsyncCallback
<void>
): void;
-
showSoftKeyboard():Promise
<void>
;
-
hideSoftKeyboard(callback: AsyncCallback
<void>
): void;
-
hideSoftKeyboard():Promise
<void>
;
-
hide(callback: AsyncCallback
<void>
): void;
-
hide(): Promise
<void>
;
-
onCreate(want: Want): void;
-
onDestroy(): void;
InputClient 接口下:
-
sendKeyFunction(action: number, callback: AsyncCallback
<boolean>
): void;
-
sendKeyFunction(action: number): Promise
<boolean>
;
-
deleteForward(length: number, callback: AsyncCallback
<boolean>
): void;
-
deleteForward(length: number): Promise
<boolean>
;
-
deleteBackward(length: number, callback: AsyncCallback
<boolean>
): void;
-
deleteBackward(length: number): Promise
<boolean>
;
-
insertText(text: string, callback: AsyncCallback
<boolean>
): void;
-
insertText(text: string): Promise
<boolean>
;
-
getForward(length: number, callback: AsyncCallback
<string>
): void;
-
getForward(length: number): Promise
<string>
;
-
getBackward(length: number, callback: AsyncCallback
<string>
): void;
-
getBackward(length: number): Promise
<string>
;
-
getEditorAttribute(callback: AsyncCallback
<EditorAttribute>
): void;
-
getEditorAttribute(): Promise
<EditorAttribute>
;
-
moveCursor(direction: number, callback: AsyncCallback
<void>
): void;
-
moveCursor(direction: number): Promise
<void>
;
InputMethodExtensionAbility 类下:
-
onCreate(want: Want): void;
-
onDestroy(): void;
**适配指导**
异步接口以showOptionalInputMethods为例,示例代码如下:
callback回调:
```
js
import
inputMethod
from
'
@ohos.inputmethod
'
;
let
inputMethodSetting
=
inputMethod
.
getSetting
();
try
{
inputMethodSetting
.
showOptionalInputMethods
((
err
,
data
)
=>
{
if
(
err
!==
undefined
)
{
console
.
error
(
'
Failed to showOptionalInputMethods:
'
+
JSON
.
stringify
(
err
));
return
;
}
console
.
info
(
'
Succeeded in showing optionalInputMethods.
'
);
});
}
catch
(
err
)
{
console
.
error
(
'
Failed to showOptionalInputMethods:
'
+
JSON
.
stringify
(
err
));
}
```
Promise回调:
```
js
import
inputMethod
from
'
@ohos.inputmethod
'
;
let
inputMethodSetting
=
inputMethod
.
getSetting
();
inputMethodSetting
.
showOptionalInputMethods
().
then
((
data
)
=>
{
console
.
info
(
'
Succeeded in showing optionalInputMethods.
'
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to showOptionalInputMethods:
'
+
JSON
.
stringify
(
err
));
})
```
## cl.inputmethod_frameworks.2 API部分接口废弃
以下接口标记废除:
-
getInputMethodSetting(): InputMethodSetting;
-
getInputMethodController(): InputMethodController;
-
listInputMethod(callback: AsyncCallback
<Array
<
InputMethodProperty
>
>): void;
-
listInputMethod(): Promise
<Array
<
InputMethodProperty
>
>;
-
displayOptionalInputMethod(callback: AsyncCallback
<void>
): void;
-
displayOptionalInputMethod(): Promise
<void>
;
-
stopInput(callback: AsyncCallback
<boolean>
): void;
-
stopInput(): Promise
<boolean>
;
interface InputMethodProperty:
-
readonly packageName: string;
-
readonly methodId: string;
-
getInputMethodEngine(): InputMethodEngine;
-
createKeyboardDelegate(): KeyboardDelegate;
-
hideKeyboard(callback: AsyncCallback
<void>
): void;
-
hideKeyboard(): Promise
<void>
;
替代接口如下:
-
getSetting(): InputMethodSetting;
-
getController(): InputMethodController;
-
getInputMethods(enable: boolean, callback: AsyncCallback
<Array
<
InputMethodProperty
>
>): void;
-
getInputMethods(enable: boolean): Promise
<Array
<
InputMethodProperty
>
>;
-
showOptionalInputMethods(callback: AsyncCallback
<boolean>
): void;
-
showOptionalInputMethods(): Promise
<boolean>
;
-
stopInputSession(callback: AsyncCallback
<boolean>
): void;
-
stopInputSession(): Promise
<boolean>
;
interface InputMethodProperty:
-
readonly name: string;
-
readonly id: string;
-
getInputMethodAbility(): InputMethodAbility;
-
getKeyboardDelegate(): KeyboardDelegate;
-
hide(callback: AsyncCallback
<void>
): void;
-
hide(): Promise
<void>
;
**特别注意:**
使用getInputMethodAbility()接口获取到InputMethodAbility对象,代替使用getInputMethodEngine()接口获取InputMethodEngine对象。
使用InputMethodAbility中的方法,不要再使用InputMethodEngine中的方法。
使用InputMethodAbility中的on('inputStart')方法,获取到KeyboardController实例与InputClient实例,不要再使用InputMethodEngine中的on('inputStart')方法去获取TextInputClient实例。
之前:
```
js
inputMethodEngine
.
getInputMethodEngine
().
on
(
'
inputStart
'
,
(
kbController
,
textClient
)
=>
{
let
keyboardController
=
kbController
;
let
textInputClient
=
textClient
;
// 获取到TextInputClient实例
});
```
之后:
```
js
inputMethodEngine
.
getInputMethodAbility
().
on
(
'
inputStart
'
,
(
kbController
,
client
)
=>
{
let
keyboardController
=
kbController
;
let
inputClient
=
client
;
// // 获取到InputClient实例
});
```
## cl.inputmethod_frameworks.3 API部分接口变更
变更前:
-
listInputMethod(enable: boolean, callback: AsyncCallback
<Array
<
InputMethodProperty
>
>): void;
-
listInputMethod(enable: boolean): Promise
<Array
<
InputMethodProperty
>
>;
-
terminateSelf(callback: AsyncCallback
<void>
): void;
-
terminateSelf(): Promise
<void>
;
变更后:
-
getInputMethods(enable: boolean, callback: AsyncCallback
<Array
<
InputMethodProperty
>
>): void;
-
getInputMethods(enable: boolean): Promise
<Array
<
InputMethodProperty
>
>;
-
destroy(callback: AsyncCallback
<void>
): void;
-
destroy(): Promise
<void>
;
删除API9接口:
-
startAbility(want: Want, callback: AsyncCallback
<void>
): void;
-
startAbility(want: Want, options: StartOptions, callback: AsyncCallback
<void>
): void;
-
startAbility(want: Want, options?: StartOptions): Promise
<void>
;
其他新增接口:
-
on(type: 'imeChange', callback: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void): void;
-
off(type: 'imeChange', callback?: (inputMethodProperty: InputMethodProperty, inputMethodSubtype: InputMethodSubtype) => void): void;
-
interface InputMethodProperty:
-
readonly label?: string;
-
readonly icon?: string;
-
readonly iconId?: number;
-
extra: object;
-
interface InputMethodAbility:
-
on(type: 'setSubtype', callback: (inputMethodSubtype: InputMethodSubtype) => void): void;
-
off(type: 'setSubtype', callback?: (inputMethodSubtype: InputMethodSubtype) => void): void;
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-multimedia.md
0 → 100644
浏览文件 @
c53b66ba
# 多媒体子系统ChangeLog
## cl.multimedia.audio.001 getRoutingManager()调用方式变更
getRoutingManager()接口的调用方法由异步变为同步。
**变更影响**
如不符合上述调用规则,将会在编译执行时出错。
**关键的接口/组件变更**
变更前
```
js
getRoutingManager
(
callback
:
AsyncCallback
<
AudioRoutingManager
>
):
void
;
getRoutingManager
():
Promise
<
AudioRoutingManager
>
;
```
变更后
```
js
getRoutingManager
():
AudioRoutingManager
;
```
## cl.multimedia.audio.002 getStreamManager()调用方式变更
getStreamManager()接口的调用方法由异步变为同步。
**变更影响**
如不符合上述调用规则,将会在编译执行时出错。
**关键的接口/组件变更**
变更前
```
js
getStreamManager
(
callback
:
AsyncCallback
<
AudioStreamManager
>
):
void
;
getStreamManager
():
Promise
<
AudioStreamManager
>
;
```
变更后
```
js
getStreamManager
():
AudioStreamManager
;
```
## cl.multimedia.audio.003 原AudioRoutingManager中micStateChange监听注册方式变更
原AudioRoutingManager中,on()函数的micStateChange监听注册方式变更。
**变更影响**
如不符合上述调用规则,将会在编译执行时出错。
**关键的接口/组件变更**
变更前
```
js
interface
AudioRoutingManager
{
on
(
type
:
'
micStateChange
'
,
callback
:
Callback
<
MicStateChangeEvent
>
):
void
;
}
```
变更后
```
js
interface
AudioVolumeGroupManager
{
on
(
type
:
'
micStateChange
'
,
callback
:
Callback
<
MicStateChangeEvent
>
):
void
;
}
```
## cl.multimedia.audio.004 getVolumeGroups()调用方式变更
getVolumeGroups()接口的调用方式变更。
**变更影响**
如不符合上述调用规则,将会在编译执行时出错。
**关键的接口/组件变更**
变更前
```
js
getVolumeGroups
(
networkId
:
string
,
callback
:
AsyncCallback
<
VolumeGroupInfos
>
):
void
;
getVolumeGroups
(
networkId
:
string
):
Promise
<
VolumeGroupInfos
>
;
```
变更后
```
js
getVolumeManager
():
AudioVolumeManager
;
interface
AudioVolumeManager
{
getVolumeGroupInfos
(
networkId
:
string
,
callback
:
AsyncCallback
<
VolumeGroupInfos
>
):
void
;
getVolumeGroupInfos
(
networkId
:
string
):
Promise
<
VolumeGroupInfos
>
;
}
```
## cl.multimedia.audio.005 getGroupManager()调用方式变更
getGroupManager()接口的调用方式变更。
**变更影响**
如不符合上述调用规则,将会在编译执行时出错。
**关键的接口/组件变更**
变更前
```
js
getGroupManager
(
groupId
:
number
,
callback
:
AsyncCallback
<
AudioGroupManager
>
):
void
;
getGroupManager
(
groupId
:
number
):
Promise
<
AudioGroupManager
>
;
```
变更后
```
js
getVolumeManager
():
AudioVolumeManager
;
interface
AudioVolumeManager
{
getVolumeGroupManager
(
groupId
:
number
,
callback
:
AsyncCallback
<
AudioVolumeGroupManager
>
):
void
;
getVolumeGroupManager
(
groupId
:
number
):
Promise
<
AudioVolumeGroupManager
>
;
}
```
## cl.multimedia.audio.006 枚举FocusType成员名变更
枚举FocusType中,成员FOCUS_TYPE_RECORDING重命名为FOCUS_TYPE_DEFAULT。
**变更影响**
如不符合上述调用规则,将会在编译执行时出错。
**关键的接口/组件变更**
变更前
```
js
enum
FocusType
{
FOCUS_TYPE_RECORDING
=
0
,
}
```
变更后
```
js
enum
InterruptRequestType
{
INTERRUPT_REQUEST_TYPE_DEFAULT
=
0
,
}
```
## cl.multimedia.audio.007 AudioRenderer中interrupt监听注册名称变更
AudioRenderer中on()函数的interrupt监听注册名称变更。
**变更影响**
如不符合上述调用规则,将会在编译执行时出错。
**关键的接口/组件变更**
变更前
```
js
interface
AudioRenderer
{
on
(
type
:
'
interrupt
'
,
callback
:
Callback
<
InterruptEvent
>
):
void
;
}
```
变更后
```
js
interface
AudioRenderer
{
on
(
type
:
'
audioInterrupt
'
,
callback
:
Callback
<
InterruptEvent
>
):
void
;
}
```
## cl.multimedia.media.001 VideoRecorder相关接口变更为systemapi
录制在MR版本会提供正式的AVRecorder(音视频合一)的接口给外部用户使用。
VideoRecorder相关的api9接口变更为systemapi,当前只提供给系统用户使用,未来等内部用户都切换为AVRecorder之后,废弃VideoRecorder相关接口。
**变更影响**
如果VideoRecorder的调用者非系统用户,会调用失败。
涉及接口以及枚举如下:
function createVideoRecorder(callback: AsyncCallback
<VideoRecorder>
): void;
function createVideoRecorder(): Promise
<VideoRecorder>
;
type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error';
interface VideoRecorder{
prepare(config: VideoRecorderConfig, callback: AsyncCallback
<void>
): void;
prepare(config: VideoRecorderConfig): Promise
<void>
;
getInputSurface(callback: AsyncCallback
<string>
): void;
getInputSurface(): Promise
<string>
;
start(callback: AsyncCallback
<void>
): void;
start(): Promise
<void>
;
pause(callback: AsyncCallback
<void>
): void;
pause(): Promise
<void>
;
resume(callback: AsyncCallback
<void>
): void;
resume(): Promise
<void>
;
stop(callback: AsyncCallback
<void>
): void;
stop(): Promise
<void>
;
release(callback: AsyncCallback
<void>
): void;
release(): Promise
<void>
;
reset(callback: AsyncCallback
<void>
): void;
reset(): Promise
<void>
;
on(type: 'error', callback: ErrorCallback): void;
readonly state: VideoRecordState;
}
interface VideoRecorderProfile {
readonly audioBitrate: number;
readonly audioChannels: number;
readonly audioCodec: CodecMimeType;
readonly audioSampleRate: number;
readonly fileFormat: ContainerFormatType;
readonly videoBitrate: number;
readonly videoCodec: CodecMimeType;
readonly videoFrameWidth: number;
readonly videoFrameHeight: number;
readonly videoFrameRate: number;
}
enum AudioSourceType {
AUDIO_SOURCE_TYPE_DEFAULT = 0,
AUDIO_SOURCE_TYPE_MIC = 1,
}
enum VideoSourceType {
VIDEO_SOURCE_TYPE_SURFACE_YUV = 0,
VIDEO_SOURCE_TYPE_SURFACE_ES = 1,
}
enum VideoRecorderConfig {
audioSourceType?: AudioSourceType;
videoSourceType: VideoSourceType;
profile: VideoRecorderProfile;
url: string;
rotation?: number;
location?: Location;
}
## cl.multimedia.media.002 VideoPlayer中不对外提供多码率选择接口
VideoPlayer在API9中不对外提供多码率选择相关接口,相关接口会在MR版本中由AvPlayer提供。
**变更影响**
VideoPlayer多码率场景无法进行码率选择,相关功能由AVPlayer提供
**关键的接口/组件变更**
删除如下接口
interface VideoPlayer {
selectBitrate(bitrate: number): Promise
<number>
;
selectBitrate(bitrate: number, callback: AsyncCallback
<number>
): void;
on(type: 'availableBitratesCollect', callback: (bitrates: Array
<number>
) => void): void;
}
## cl.multimedia.media.003 VideoRecorder错误信息变更
VideoRecorder原有错误码与整体错误码规则不一致,变更错误码适配规则。
**变更影响**
VideoRecorder返回的错误码发生变更。
**关键的接口/组件变更**
VideoRecorder接口未发生变更,返回的错误码发生变更。
**适配指导**
异常处理具体参考接口文档。
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-media.md
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-power.md
0 → 100644
浏览文件 @
c53b66ba
# 电源子系统ChangeLog
## cl.powermgr.1 API错误信息返回方式变更
下列API使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误码规范。从API9进行变更。
-
耗电统计:
[
@ohos.batteryStatistics
](
../../../application-dev/reference/apis/js-apis-batteryStatistics.md
)
-
屏幕亮度:
[
@ohos.brightness
](
../../../application-dev/reference/apis/js-apis-brightness.md
)
-
系统电源管理:
[
@ohos.power
](
../../../application-dev/reference/apis/js-apis-power.md
)
-
Runninglock锁:
[
@ohos.runningLock
](
../../../application-dev/reference/apis/js-apis-runninglock.md
)
-
热管理:
[
@ohos.thermal
](
../../../application-dev/reference/apis/js-apis-thermal.md
)
异步接口:通过AsyncCallback或Promise的error对象返回错误信息。
同步接口:通过抛出异常的方式返回错误信息。
#### 变更影响
基于此前版本开发的应用,需适配接口的错误信息返回方式,否则会影响原有业务逻辑。
#### 关键的接口/组件变更
在以下接口增加错误码处理:
-
getBatteryStats(callback: AsyncCallback
<Array
&
lt
;
BatteryStatsInfo
&
gt
;
>
): void
-
getAppPowerValue(uid: number): number
-
getAppPowerPercent(uid: number): number
-
getHardwareUnitPowerValue(type: ConsumptionType): number
-
getHardwareUnitPowerPercent(type: ConsumptionType): number
-
setValue(value: number): void
-
shutdown(reason: string): void;
-
isActive(): boolean
-
wakeup(detail: string): void
-
suspend(): void
-
getPowerMode(): DevicePowerMode
-
setPowerMode(mode: DevicePowerMode, callback: AsyncCallback
<
void
>
): void
-
setPowerMode(mode: DevicePowerMode): Promise
<
void
>
-
hold(timeout: number): void
-
isHolding(): boolean
-
unhold(): void
-
isSupported(type: RunningLockType): boolean
-
isSupported(type: RunningLockType): boolean
-
create(name: string, type: RunningLockType, callback: AsyncCallback
<
RunningLock
>
): void
-
create(name: string, type: RunningLockType): Promise
<
RunningLock
>
-
registerThermalLevelCallback(callback: Callback
<
ThermalLevel
>
): void
-
unregisterThermalLevelCallback(callback?: Callback
<
void
>
): void
-
getLevel(): ThermalLevel
#### 适配指导
请参考各接口的API参考。
## cl.powermgr.2 系统接口变更
#### 变更影响
基于此前版本开发的应用,需适配新接口名和错误信息返回方式,否则会影响原有业务逻辑。
#### 关键的接口/组件变更
| 包名 | 旧接口 | 新接口 |
| ----------- | ------------------------------------ | ------------------------------ |
| @ohos.power | shutdownDevice(reason: string): void | shutdown(reason: string): void |
| @ohos.power | rebootDevice(reason: string): void | reboot(reason: string): void |
| @ohos.power | wakeupDevice(detail: string): void | wakeup(detail: string): void |
| @ohos.power | suspendDevice(): void | suspend(): void |
#### 适配指导
请参考系统电源管理
[
@ohos.power
](
../../../application-dev/reference/apis/js-apis-power.md
)
的API参考。
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-request.md
0 → 100644
浏览文件 @
c53b66ba
# 上传下载子系统ChangeLog
OpenHarmony 3.2.8.1版本相较于OpenHarmony 3.2.beta3版本,request子系统的API变更如下
## cl.request.1 错误码定义及API部分接口名称变更
-
新增上传下载接口的
[
错误码
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-request.md
)
处理。
-
错误信息通过AsyncCallback或Promise的error对象返回。其中,参数类型和数量错误信息,通过抛出异常的方式返回。
-
API部分接口需要用新的接口替换,参数不变。
**变更影响**
基于此前版本开发的应用,需适配变更后的新错误码和错误信息返回方式,否则会影响原有业务逻辑。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
|--------------|--------------|-----------------------------------------------------------------------------------------------------------------------|-----------|
| ohos.request | request | EXCEPTION_PERMISSION | 新增 |
| ohos.request | request | EXCEPTION_PARAMCHECK | 新增 |
| ohos.request | request | EXCEPTION_UNSUPPORTED | 新增 |
| ohos.request | request | EXCEPTION_FILEIO | 新增 |
| ohos.request | request | EXCEPTION_FILEPATH | 新增 |
| ohos.request | request | EXCEPTION_SERVICE | 新增 |
| ohos.request | request | EXCEPTION_OTHERS | 新增 |
| ohos.request | request | ERROR_OFFLINE | 新增 |
| ohos.request | request | ERROR_UNSUPPORTED_NETWORK_TYPE | 新增 |
| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback
<DownloadTask>
): void; | 新增 |
| ohos.request | request | function downloadFile(context: BaseContext, config: DownloadConfig): Promise
<DownloadTask>
; | 新增 |
| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback
<UploadTask>
): void; | 新增 |
| ohos.request | request | function uploadFile(context: BaseContext, config: UploadConfig): Promise
<UploadTask>
; | 新增 |
| ohos.request | DownloadTask | delete(callback: AsyncCallback
<boolean>
): void; | 新增 |
| ohos.request | DownloadTask | delete(): Promise
<boolean>
; | 新增 |
| ohos.request | DownloadTask | suspend(callback: AsyncCallback
<boolean>
): void; | 新增 |
| ohos.request | DownloadTask | suspend(): Promise
<boolean>
; | 新增 |
| ohos.request | DownloadTask | restore(callback: AsyncCallback
<boolean>
): void; | 新增 |
| ohos.request | DownloadTask | restore(): Promise
<boolean>
; | 新增 |
| ohos.request | DownloadTask | getTaskInfo(callback: AsyncCallback
<DownloadInfo>
): void; | 新增 |
| ohos.request | DownloadTask | getTaskInfo(): Promise
<DownloadInfo>
; | 新增 |
| ohos.request | DownloadTask | getTaskMimeType(callback: AsyncCallback
<string>
): void; | 新增 |
| ohos.request | DownloadTask | getTaskMimeType(): Promise
<string>
; | 新增 |
| ohos.request | UploadTask | delete(callback: AsyncCallback
<boolean>
): void; | 新增 |
| ohos.request | UploadTask | delete(): Promise
<boolean>
; | 新增 |
| ohos.request | request | function download(config: DownloadConfig, callback: AsyncCallback
<DownloadTask>
): void;
<br>
代替接口:function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback
<DownloadTask>
): void; | 废弃 |
| ohos.request | request | function download(config: DownloadConfig): Promise
<DownloadTask>
;
<br>
代替接口:function downloadFile(context: BaseContext, config: DownloadConfig): Promise
<DownloadTask>
; | 废弃 |
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback
<DownloadTask>
): void;
<br>
代替接口:function downloadFile(context: BaseContext, config: DownloadConfig, callback: AsyncCallback
<DownloadTask>
): void; | 废弃 |
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise
<DownloadTask>
;
<br>
代替接口:function downloadFile(context: BaseContext, config: DownloadConfig): Promise
<DownloadTask>
; | 废弃 |
| ohos.request | request | function upload(config: UploadConfig, callback: AsyncCallback
<UploadTask>
): void;
<br>
代替接口:function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback
<UploadTask>
): void; | 废弃 |
| ohos.request | request | function upload(config: UploadConfig): Promise
<UploadTask>
;
<br>
代替接口:function uploadFile(context: BaseContext, config: UploadConfig): Promise
<UploadTask>
; | 废弃 |
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback
<UploadTask>
): void;
<br>
代替接口:function uploadFile(context: BaseContext, config: UploadConfig, callback: AsyncCallback
<UploadTask>
): void; | 废弃 |
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise
<UploadTask>
;
<br>
代替接口:function uploadFile(context: BaseContext, config: UploadConfig): Promise
<UploadTask>
; | 废弃 |
| ohos.request | DownloadTask | remove(callback: AsyncCallback
<boolean>
): void;
<br>
代替接口:delete(callback: AsyncCallback
<boolean>
): void | 废弃 |
| ohos.request | DownloadTask | remove(): Promise
<boolean>
;
<br>
代替接口:delete(): Promise
<boolean>
; | 废弃 |
| ohos.request | DownloadTask | pause(callback: AsyncCallback
<boolean>
): void;
<br>
代替接口:suspend(callback: AsyncCallback
<boolean>
): void; | 废弃 |
| ohos.request | DownloadTask | pause(): Promise
<boolean>
;
<br>
代替接口:suspend(): Promise
<boolean>
; | 废弃 |
| ohos.request | DownloadTask | resume(callback: AsyncCallback
<boolean>
): void;
<br>
代替接口:restore(callback: AsyncCallback
<boolean>
): void; | 废弃 |
| ohos.request | DownloadTask | resume(): Promise
<boolean>
;
<br>
代替接口:restore(): Promise
<boolean>
; | 废弃 |
| ohos.request | DownloadTask | query(callback: AsyncCallback
<DownloadInfo>
): void;
<br>
代替接口:getTaskInfo(callback: AsyncCallback
<DownloadInfo>
): void; | 废弃 |
| ohos.request | DownloadTask | query(): Promise
<DownloadInfo>
;
<br>
代替接口:getTaskInfo(): Promise
<DownloadInfo>
; | 废弃 |
| ohos.request | DownloadTask | queryMimeType(callback: AsyncCallback
<string>
): void;
<br>
代替接口:getTaskMimeType(callback: AsyncCallback
<string>
): void; | 废弃 |
| ohos.request | DownloadTask | queryMimeType(): Promise
<string>
;
<br>
代替接口:getTaskMimeType(): Promise
<string>
; | 废弃 |
| ohos.request | UploadTask | remove(callback: AsyncCallback
<boolean>
): void;
<br>
代替接口:delete(callback: AsyncCallback
<boolean>
): void; | 废弃 |
| ohos.request | UploadTask | remove(): Promise
<boolean>
;
<br>
代替接口:delete(): Promise
<boolean>
; | 废弃 |
| system.request | UploadResponse | code | 废弃 |
| system.request | UploadResponse | data | 废弃 |
| system.request | UploadResponse | headers | 废弃 |
| system.request | DownloadResponse | token | 废弃 |
| system.request | OnDownloadCompleteResponse | uri | 废弃 |
| system.request | RequestFile | filename | 废弃 |
| system.request | RequestFile | name | 废弃 |
| system.request | RequestFile | uri | 废弃 |
| system.request | RequestFile | type | 废弃 |
| system.request | RequestData | name | 废弃 |
| system.request | RequestData | value | 废弃 |
| system.request | UploadRequestOptions | url | 废弃 |
| system.request | UploadRequestOptions | data | 废弃 |
| system.request | UploadRequestOptions | files | 废弃 |
| system.request | UploadRequestOptions | header | 废弃 |
| system.request | UploadRequestOptions | description | 废弃 |
| system.request | UploadRequestOptions | success | 废弃 |
| system.request | UploadRequestOptions | fail | 废弃 |
| system.request | UploadRequestOptions | complete | 废弃 |
| system.request | OnDownloadCompleteOptions | token | 废弃 |
| system.request | OnDownloadCompleteOptions | success | 废弃 |
| system.request | OnDownloadCompleteOptions | fail | 废弃 |
| system.request | OnDownloadCompleteOptions | complete | 废弃 |
| system.request | Request | static upload(options: UploadRequestOptions): void; | 废弃 |
| system.request | Request | static download(options: DownloadRequestOptions): void; | 废弃 |
| system.request | Request | static onDownloadComplete(options: OnDownloadCompleteOptions): void; | 废弃 |
**适配指导**
以downloadFile为例,在新版本上需要使用如下方式进行调用:
```
ts
try
{
request
.
downloadFile
(
globalThis
.
abilityContext
,
{
url
:
'
https://xxxx/xxxxx.hap
'
,
filePath
:
'
xxx/xxxxx.hap
'
},
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
Failed to request the download. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
});
}
catch
(
err
)
{
console
.
log
(
"
downloadFile callback fail.
"
+
"
errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-resource-manager.md
0 → 100644
浏览文件 @
c53b66ba
# 资源管理changeLog
## cl.resourceManager.1 资源API9部分多工程接口命名变更
资源管理从API9开始提供接口的错误码和错误信息返回,涉及API9提供的部分多工程接口需要适配。从API9开始作以下变更:
资源API部分多工程接口需要用新的接口替换,参数不变。
**变更影响**
基于此前版本开发的应用,涉及下面多工程接口的JS接口需要替换为新的接口。
**关键接口/组件变更**
|
**涉及接口**
|
**对应替换接口**
|
| ---------------- | ------------ |
| getString(resource: Resource,
</br>
callback: AsyncCallback
\<
string>): void; | getStringValue(resource: Resource,
</br>
callback: AsyncCallback
\<
string>): void; |
| getString(resource: Resource): Promise
\<
string>; | getStringValue(resource: Resource): Promise
\<
string>; |
| getStringArray(resource: Resource,
</br>
callback: AsyncCallback
\<
Array
\<
string>>): void; | getStringArrayValue(resource: Resource,
</br>
callback: AsyncCallback
\<
Array
\<
string>>): void; |
| getStringArray(resource: Resource): Promise
\<
Array
\<
string>>; | getStringArrayValue(resource: Resource): Promise
\<
Array
\<
string>>; |
| getMedia(resource: Resource,
</br>
callback: AsyncCallback
\<
Uint8Array>): void; | getMediaContent(resource: Resource,
</br>
callback: AsyncCallback
\<
Uint8Array>): void; |
| getMedia(resource: Resource): Promise
\<
Uint8Array>; | getMediaContent(resource: Resource): Promise
\<
Uint8Array>; |
| getMediaBase64(resource: Resource,
</br>
callback: AsyncCallback
\<
string>): void; | getMediaContentBase64(resource: Resource,
</br>
callback: AsyncCallback
\<
string>): void; |
| getMediaBase64(resource: Resource): Promise
\<
string>; | getMediaContentBase64(resource: Resource): Promise
\<
string>; |
| getPluralString(resource: Resource, num: number,
</br>
callback: AsyncCallback
<string>
): void; | getPluralStringValue(resource: Resource, num: number,
</br>
callback: AsyncCallback
\<
string>): void; |
| getPluralString(resource: Resource, num: number): Promise
\<
string>; | getPluralStringValue(resource: Resource, num: number): Promise
\<
string>; |
**适配指导**
以getMedia修改为getMediaContent的callback调用为例,其promise方式类似,只需修改函数名,且增加错误码和错误信息返回,其它不变。示例代码如下:
-
变更前:getMedia(resource: Resource, callback: AsyncCallback
<Uint8Array>
): void;
```
ts
let
resource
=
{
bundleName
:
"
com.example.myapplication
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
'
app.media.test
'
).
id
};
this
.
context
.
resourceManager
.
getMedia
(
resource
,
(
error
,
value
)
=>
{
if
(
error
!=
null
)
{
console
.
log
(
"
error is
"
+
error
);
}
else
{
let
media
=
value
;
}
});
```
-
变更后:getMediaContent(resource: Resource, callback: AsyncCallback
<Uint8Array>
): void;
```
ts
let
resource
=
{
bundleName
:
"
com.example.myapplication
"
,
moduleName
:
"
entry
"
,
id
:
$r
(
'
app.media.test
'
).
id
};
try
{
this
.
context
.
resourceManager
.
getMediaContent
(
resource
,
(
error
,
value
)
=>
{
if
(
error
!=
null
)
{
console
.
log
(
"
error is
"
+
error
);
}
else
{
let
media
=
value
;
}
});
}
catch
(
error
)
{
console
.
error
(
`callback getMediaContent failed, error code:
${
error
.
code
}
, message:
${
error
.
message
}
.`
)
}
```
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-telephony.md
浏览文件 @
c53b66ba
...
...
@@ -62,4 +62,4 @@ promise.then(data => {
}).
catch
(
err
=>
{
console
.
error
(
`isImsSmsSupported failed, promise: err->
${
JSON
.
stringify
(
err
)}
`
);
});
```
\ No newline at end of file
```
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-testfwk_arkxtest.md
0 → 100644
浏览文件 @
c53b66ba
# 测试子系统ChangeLog
## cl.testfwk_arkxtest.1 On、Driver、Component类接口新增支持异常处理
API8原有接口废弃,API9新增替代接口,API9接口支持异常处理,需使用try catch捕获接口抛出的异常。
## 变更影响
此变更影响@ohos.uitest提供的api9-JS接口。用户此前在测试用例开发中使用了@ohos.uitest-api9接口的,需要进行适配才可以在新版本SDK环境正常编译通过。
## 关键的接口/组件变更
-
废弃API8原有的
`By`
类,在API9中使用
`On`
类代替,
`On`
类接口新增支持异常处理机制;类内接口名称保持不变,
**例外**
:
`By#key`
接口替换为
`On.id`
。
-
废弃API8原有的
`BY`
对象,在API9中使用
`ON`
对象代替。
-
废弃API8原有的
`UiDriver`
类,在API9中使用
`Driver`
类代替,
`Driver`
类接口新增支持异常处理机制;类内接口名称保持不变。
-
废弃API8原有的
`UiComponent`
类,在API9中使用
`Component`
类代替,
`Component`
类接口新增支持异常处理机制;类内接口名称保持不变。
## 适配指导
### 1.适配接口名称变更
可按照如下规则做类名替换:
-
`By-->On`
-
`BY-->ON`
-
`UiDriver-->Driver`
-
`UiComponent-->Component`
### 2.捕获处理异常
使用try-catch处理接口捕获可能抛出的异常,例如:
```
typescript
import
{
Driver
,
ON
,
Component
}
from
'
@ohos.uitest
'
try
{
let
driver
=
Driver
.
create
();
}
catch
(
error
)
{
// error handle; error.code为错误码
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-theme.md
0 → 100644
浏览文件 @
c53b66ba
# 主题框架changeLog
## cl.theme.1 API9接口支持异常处理
下列模块内部接口使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误码规范。在API9进行变更。
-
壁纸管理服务:@ohos.wallpaper.d.ts
-
锁屏管理服务:@ohos.screenLock.d.ts
以上模块中的接口变更为:
同步接口:通过抛出异常的方式返回错误信息。
异步接口:参数检查错误同步抛出,业务逻辑错误通过AsyncCallback或Promise的error对象抛出。
**变更影响**
基于此前版本开发的应用,需适配接口的错误信息返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
以下标记为壁纸管理服务接口废除:
-
getColors(wallpaperType: WallpaperType, callback: AsyncCallback
<Array
<
RgbaColor
>
>): void;
-
getColors(wallpaperType: WallpaperType): Promise
<Array
<
RgbaColor
>
>;
-
getId(wallpaperType: WallpaperType, callback: AsyncCallback
<number>
): void;
-
getId(wallpaperType: WallpaperType): Promise
<number>
;
-
getMinHeight(callback: AsyncCallback
<number>
): void;
-
getMinHeight(): Promise
<number>
;
-
getMinWidth(callback: AsyncCallback
<number>
): void;
-
getMinWidth(): Promise
<number>
;
-
isChangePermitted(callback: AsyncCallback
<boolean>
): void;
-
isChangePermitted(): Promise
<boolean>
;
-
isOperationAllowed(callback: AsyncCallback
<boolean>
): void;
-
isOperationAllowed(): Promise
<boolean>
;
-
reset(wallpaperType: WallpaperType, callback: AsyncCallback
<void>
): void;
-
reset(wallpaperType: WallpaperType): Promise
<void>
;
-
setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback
<void>
): void;
-
setWallpaper(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise
<void>
;
-
getFile(wallpaperType: WallpaperType, callback: AsyncCallback
<number>
): void;
-
getFile(wallpaperType: WallpaperType): Promise
<number>
;
-
getPixelMap(wallpaperType: WallpaperType, callback: AsyncCallback
<image.PixelMap>
): void;
-
getPixelMap(wallpaperType: WallpaperType): Promise
<image.PixelMap>
;
壁纸管理服务替代接口如下:
-
getColorsSync(wallpaperType: WallpaperType): Array
<RgbaColor>
;
-
getIdSync(wallpaperType: WallpaperType): number;
-
getMinHeightSync(): number;
-
getMinWidthSync(): number;
-
isChangeAllowed(): boolean;
-
isUserChangeAllowed(): boolean;
-
restore(wallpaperType: WallpaperType, callback: AsyncCallback
<void>
): void;
-
restore(wallpaperType: WallpaperType): Promise
<void>
;
-
setImage(source: string | image.PixelMap, wallpaperType: WallpaperType, callback: AsyncCallback
<void>
): void;
-
setImage(source: string | image.PixelMap, wallpaperType: WallpaperType): Promise
<void>
;
-
getFileSync(wallpaperType: WallpaperType): number;
-
getImage(wallpaperType: WallpaperType, callback: AsyncCallback
<image.PixelMap>
): void;
-
getImage(wallpaperType: WallpaperType): Promise
<image.PixelMap>
;
以下标记为壁纸管理服务接口变更:
-
on(type: 'colorChange', callback: (colors: Array
<RgbaColor>
, wallpaperType: WallpaperType) => void): void
-
off(type: 'colorChange', callback?: (colors: Array
<RgbaColor>
, wallpaperType: WallpaperType) => void): void
以下标记为锁屏管理服务接口废除:
-
isScreenLocked(callback: AsyncCallback
<boolean>
): void;
-
isScreenLocked(): Promise
<boolean>
;
-
isSecureMode(callback: AsyncCallback
<boolean>
): void;
-
isSecureMode(): Promise
<boolean>
;
-
unlockScreen(callback: AsyncCallback
<void>
): void;
-
unlockScreen(): Promise
<void>
;
锁屏管理服务替代接口如下:
-
isLocked(): boolean;
-
isSecure(): boolean;
-
unlock(callback: AsyncCallback
<boolean>
): void;
-
unlock():Promise
<boolean>
;
以下标记为锁屏管理服务接口删除:
-
lockScreen(callback: AsyncCallback
<void>
): void;
-
lockScreen(): Promise
<void>
;
以下标记为锁屏管理服务接口新增:
-
lock(callback: AsyncCallback
<boolean>
): void;
-
lock():Promise
<boolean>
;
以下标记为锁屏管理服务接口变更:
-
onSystemEvent(callback: Callback
<SystemEvent>
): boolean;
-
sendScreenLockEvent(event: String, parameter: number, callback: AsyncCallback
<boolean>
): void;
-
sendScreenLockEvent(event: String, parameter: number): Promise
<boolean>
;
**壁纸管理服务适配指导**
异步接口以getImage为例,示例代码如下:
```
ts
import
pointer
from
'
@ohos.wallpaper
'
;
try
{
wallpaper
.
getImage
(
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
).
then
((
data
)
=>
{
console
.
log
(
`success to getImage:
${
JSON
.
stringify
(
data
)}
`
);
}).
catch
((
error
)
=>
{
console
.
error
(
`failed to getImage because:
${
JSON
.
stringify
(
error
)}
`
);
});
}
catch
(
err
)
{
console
.
error
(
`failed to getImage because:
${
JSON
.
stringify
(
err
)}
`
);
}
```
同步接口以getFileSync为例,示例代码如下:
```
ts
import
pointer
from
'
@ohos.wallpaper
'
;
try
{
let
file
=
wallpaper
.
getFileSync
(
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
);
}
catch
(
err
)
{
console
.
error
(
`failed to getFileSync because:
${
err
.
message
}
`
);
}
```
**锁屏管理服务适配指导**
异步接口以lock为例,示例代码如下:
```
ts
import
screenLock
from
'
@ohos.screenlock
'
;
try
{
screenLock
.
lock
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to lock the screen, because:
${
err
.
message
}
`
);
return
;
}
console
.
info
(
`lock the screen successfully. result:
${
data
}
`
);
});
}
catch
(
err
)
{
console
.
error
(
`Failed to lock the screen, because:
${
err
.
message
}
`
);
}
```
同步接口以onSystemEvent为例,示例代码如下:
```
ts
import
screenLock
from
'
@ohos.screenlock
'
;
try
{
let
isSuccess
=
screenLock
.
onSystemEvent
((
event
)
=>
{
console
.
log
(
`Register the system event which related to screenlock successfully. eventType:
${
event
.
eventType
}
`
)
});
}
catch
(
err
)
{
console
.
error
(
`Failed to register the system event which related to screenlock, because:
${
err
.
message
}
`
)
}
```
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-useriam.md
0 → 100644
浏览文件 @
c53b66ba
# 用户IAM子系统Changelog
## cl.useriam.1 API异常处理方式变更
用户IAM部分接口使用业务逻辑返回值表示错误信息,不符合OpenHarmony接口错误码规范。从API9开始作以下变更:
接口通过抛出异常的方式返回错误信息。
**变更影响**
基于此版本以前开发的应用不受影响,以后的需适配变更接口的错误信息返回方式,否则会影响业务逻辑。
**关键接口/组件变更**
为适配统一的API异常处理方式,对用户IAM相关接口进行废弃(下表中 原接口 列内容),并新增对应接口(下表中 新接口 列内容)。新增接口支持统一的错误码异常处理规范,功能上与原接口保持一致。
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
| ---------------------- | ------------------- | ------------------------- | ------------------------ |
| ohos.userIAM.userAuth | UserAuth | constructor() | 废弃 |
| ohos.userIAM.userAuth | UserAuth | getVersion() : number | 废弃 |
| ohos.userIAM.userAuth | UserAuth | getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : number | 废弃 |
| ohos.userIAM.userAuth | UserAuth | auth(challenge: Uint8Array, authType: UserAuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array | 废弃 |
| ohos.userIAM.userAuth | UserAuth | cancelAuth(contextID : Uint8Array) : number | 废弃 |
| ohos.userIAM.userAuth | IUserAuthCallback | onResult: (result : number, extraInfo : AuthResult) => void | 废弃 |
| ohos.userIAM.userAuth | IUserAuthCallback | onAcquireInfo ?: (module : number, acquire : number, extraInfo : any) => void | 废弃 |
| ohos.userIAM.userAuth | AuthResult | AuthResult {
</br>
token ?: Uint8Array;
</br>
remainTimes ?: number;
</br>
freezingTime ?: number;} | 废弃 |
| ohos.userIAM.userAuth | 枚举 | ResultCode {
</br>
SUCCESS = 0,
</br>
FAIL = 1,
</br>
GENERAL_ERROR = 2,
</br>
CANCELED = 3,
</br>
TIMEOUT = 4,
</br>
TYPE_NOT_SUPPORT = 5,
</br>
TRUST_LEVEL_NOT_SUPPORT = 6,
</br>
BUSY = 7,
</br>
INVALID_PARAMETERS = 8,
</br>
LOCKED = 9,
</br>
NOT_ENROLLED = 10,} | 废弃 |
| ohos.userIAM.userAuth | type | AuthEventKey = "result" | 新增 |
| ohos.userIAM.userAuth | type | EventInfo = AuthResultInfo | 新增 |
| ohos.userIAM.userAuth | AuthResultInfo | AuthResultInfo {
</br>
result : number;
</br>
token ?: Uint8Array;
</br>
remainAttempts ?: number;
</br>
lockoutDuration ?: number;} | 新增 |
| ohos.userIAM.userAuth | TipInfo | TipInfo {
</br>
module : number;
</br>
tip : number;} | 新增 |
| ohos.userIAM.userAuth | AuthInstance | AuthInstance {
</br>
on: (name: AuthEventKey, callback: AuthEvent) => void;
</br>
off: (name: AuthEventKey) => void;
</br>
start: () => void;
</br>
cancel: () => void;} | 新增 |
| ohos.userIAM.userAuth | 枚举 | ResultCodeV9 {
</br>
SUCCESS = 12500000,
</br>
FAIL = 12500001,
</br>
GENERAL_ERROR = 12500002,
</br>
CANCELED = 12500003,
</br>
TIMEOUT = 12500004,
</br>
TYPE_NOT_SUPPORT = 12500005,
</br>
TRUST_LEVEL_NOT_SUPPORT = 12500006,
</br>
BUSY = 12500007,
</br>
LOCKED = 12500009,
</br>
NOT_ENROLLED = 12500010,} | 新增 |
| ohos.userIAM.userAuth | function | getAuthInstance(challenge : Uint8Array, authType : UserAuthType, authTrustLevel : AuthTrustLevel) : AuthInstance | 新增 |
| ohos.userIAM.userAuth | function | getVersion() : number | 新增 |
| ohos.userIAM.userAuth | function | getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : void | 新增 |
| ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId : string) : ResultCode | 删除 |
| ohos.userIAM.faceAuth | 枚举 | ResultCode {
</br>
SUCCESS = 0,
</br>
FAIL = 1,} | 删除 |
| ohos.userIAM.faceAuth | FaceAuthManager | setSurfaceId(surfaceId: string) : void | 新增 |
**适配指导**
以getVersion接口为例,示例代码如下:
```
js
import
userIAM_userAuth
from
'
@ohos.userIAM.userAuth
'
;
try
{
let
version
=
userIAM_userAuth
.
getVersion
();
console
.
info
(
"
auth version =
"
+
version
);
}
catch
(
error
)
{
console
.
info
(
"
get version failed, error =
"
+
error
);
}
```
更多接口的示例代码可参考
[
用户认证API文档
](
../../../application-dev/reference/apis/js-apis-useriam-userauth.md
)
和
[
人脸认证API文档
](
../../../application-dev/reference/apis/js-apis-useriam-faceauth.md
)
。
## cl.useriam.2 接口调用权限变更
用户IAM部分接口只允许被系统应用调起,需要做系统应用运行时鉴权。从API9开始作以下变更:
人脸认证模块的setSurfaceId接口增加判别是否为系统应用的逻辑,非系统应用无法调用该接口。
**变更影响**
基于此版本以前开发的应用不受影响,以后的需要持有相应权限,否则无法正常调用接口。
**关键接口/组件变更**
setSurfaceId接口的实现中增加系统应用鉴权处理,非系统应用调用将返回202错误码。
**适配指导**
需要修改
[
应用签名
](
https://gitee.com/openharmony/developtools_hapsigner/tree/master/dist
)
相关文件UnsgnedReleasedProfileTemplate.json,其中的app-feature字段要改为"hos_system_app",才可保证签名所得到的应用是系统应用。
zh-cn/release-notes/changelogs/v3.2-beta4/changelogs-wantAgent.md
0 → 100644
浏览文件 @
c53b66ba
# wantAgent的JS API变更Changelog
OpenHarmony 3.2.9.1 sp8版本相较于OpenHarmony 3.2.8.1版本,wantAgent的API变更如下
## cl.url.1.trigger类接口变更
trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback
<CompleteData>
): void ;
因部分功能未实现,已对其进行删除,应用可调用下面接口进行替代:
trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback
<CompleteData>
): void
**变更影响**
影响已发布的JS接口,应用需要进行适配,才可以在新版本SDK环境正常编译通过。
**关键的接口/组件变更**
| OpenHarmony 3.2.8.1版本接口 | OpenHarmony 3.2.9.1 sp8版本接口 |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: Callback
<CompleteData>
): void ; | trigger(agent: WantAgent, triggerInfo: TriggerInfo, callback?: AsyncCallback
<CompleteData>
): void |
**适配指导**
应用中调用替代的trigger接口可参考下列代码
示例:
```
ts
import
WantAgent
from
'
@ohos.app.ability.wantAgent
'
;
//wantAgent对象
var
wantAgent
;
// triggerInfo
var
triggerInfo
=
{
code
:
0
}
//WantAgentInfo对象
var
wantAgentInfo
=
{
wants
:
[
{
deviceId
:
"
deviceId
"
,
bundleName
:
"
com.neu.setResultOnAbilityResultTest1
"
,
abilityName
:
"
com.example.test.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
parameters
:
{
mykey0
:
2222
,
mykey1
:
[
1
,
2
,
3
],
mykey2
:
"
[1, 2, 3]
"
,
mykey3
:
"
ssssssssssssssssssssssssss
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
qqqqq
"
,
"
wwwwww
"
,
"
aaaaaaaaaaaaaaaaa
"
],
mykey6
:
true
,
}
}
],
operationType
:
WantAgent
.
OperationType
.
START_ABILITIES
,
requestCode
:
0
,
wantAgentFlags
:[
WantAgent
.
WantAgentFlags
.
UPDATE_PRESENT_FLAG
]
}
//getWantAgent回调
function
getWantAgentCallback
(
err
,
data
)
{
if
(
err
==
undefined
)
{
wantAgent
=
data
;
}
else
{
console
.
info
(
'
getWantAgent failed
'
+
JSON
.
stringify
(
wantAgent
));
}
//getUid回调
function
triggerCallback
(
err
,
data
)
{
if
(
err
)
{
console
.
info
(
'
getUid failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
));
}
else
{
console
.
info
(
'
getUid ok!
'
+
JSON
.
stringify
(
data
));
}
}
try
{
WantAgent
.
trigger
(
wantAgent
,
triggerInfo
,
triggerCallback
);
}
catch
(
err
)
{
console
.
info
(
'
getUid failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
));
}
}
try
{
WantAgent
.
getWantAgent
(
wantAgentInfo
,
getWantAgentCallback
);
}
catch
(
err
){
console
.
info
(
'
getWantAgent failed!
'
+
JSON
.
stringify
(
err
.
code
)
+
JSON
.
stringify
(
err
.
message
));
}
```
zh-cn/release-notes/changelogs/v3.2-beta5/changelog-LocalStorage.md
0 → 100644
浏览文件 @
c53b66ba
# ArkUI子系统LocalStorage类接口ChangeLog
## cl.LocalStorage.1 get接口返回类型变更
**变更影响**
返回类型从get
<T>
(propName: string): T变更为get
<T>
(propName: string): T | undefined
应用不需要进行适配。
## cl.LocalStorage.2 setOrCreate参数newValue变成必选
**变更影响**
原接口声明:
```
js
setOrCreate
<
T
>
(
propName
:
string
,
newValue
?:
T
):
boolean
```
现接口声明:
```
js
setOrCreate
<
T
>
(
propName
:
string
,
newValue
:
T
):
boolean
```
第二个参数newValue变为必选。
如果应用调用这个接口没有指定newValue参数,在替换新的sdk后会编译不过,需要手动指定newValue。
**适配指导**
```
js
let
storage
=
new
LocalStorage
();
storage
.
setOrCreate
(
'
propA
'
,
'
hello
'
);
```
## cl.LocalStorage.3 link参数和返回类型变更
**变更影响**
原接口声明:
```
js
link
<
T
>
(
propName
:
string
,
linkUser
?:
T
,
subscribersName
?:
string
):
T
```
现接口声明:
```
js
link
<
T
>
(
propName
:
string
):
SubscribedAbstractProperty
<
T
>
```
1.
link第二三个参数为框架内部调用,不应对外开发,所以将接口变更为一个参数;
2.
返回类型T变更为SubscribedAbstractProperty;
**适配指导**
```
js
let
storage
=
new
LocalStorage
({
"
PropA
"
:
"
47
"
});
let
linA
=
storage
.
link
(
"
PropA
"
);
linA
.
set
(
50
);
```
## cl.LocalStorage.4 setAndLink参数和返回类型变更
**变更影响**
原接口声明:
```
js
setAndLink
<
T
>
(
propName
:
string
,
defaultValue
:
T
,
linkUser
?:
T
,
subscribersName
?:
string
):
T
```
现接口声明:
```
js
setAndLink
<
T
>
(
propName
:
string
,
defaultValue
:
T
):
SubscribedAbstractProperty
<
T
>
```
1.
setAndLink第三四个参数为框架内部调用,不应对外开发,所以将接口变更为2个参数;
2.
返回类型T变更为SubscribedAbstractProperty;
**适配指导**
```
js
let
storage
=
new
LocalStorage
({
"
PropA
"
:
"
47
"
});
let
linA
=
storage
.
setAndLink
(
"
PropA
"
,
"
48
"
)
linA
.
set
(
50
);
```
## cl.LocalStorage.5 prop参数和返回类型变更
**变更影响**
原接口声明:
```
js
prop
<
T
>
(
propName
:
string
,
propUser
?:
T
,
subscribersName
?:
string
):
T
```
现接口声明:
```
js
prop
<
S
>
(
propName
:
string
):
SubscribedAbstractProperty
<
S
>
```
1.
prop第二三个参数为框架内部调用,不应对外开发,所以将接口变更为1个参数;
2.
返回类型T变更为SubscribedAbstractProperty;
**适配指导**
```
js
let
storage
=
new
LocalStorage
({
"
PropA
"
:
"
47
"
});
let
propA
=
storage
.
prop
(
"
PropA
"
);
propA
.
set
(
51
);
// one-way sync
```
## cl.LocalStorage.6 setAndProp参数和返回类型变更
**变更影响**
原接口声明:
```
js
setAndProp
<
T
>
(
propName
:
string
,
defaultValue
:
T
,
propUser
?:
T
,
subscribersName
?:
string
):
T
```
现接口声明:
```
js
setAndProp
<
S
>
(
propName
:
string
,
defaultValue
:
S
):
SubscribedAbstractProperty
<
S
>
```
1.
setAndProp第三四个参数为框架内部调用,不应对外开发,所以将接口变更为2个参数;
2.
返回类型T变更为SubscribedAbstractProperty;
**适配指导**
```
js
let
storage
=
new
LocalStorage
({
"
PropA
"
:
"
47
"
});
let
propA
=
storage
.
setAndProp
(
"
PropA
"
,
"
48
"
);
propA
.
set
(
51
);
// one-way sync
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta5/changelog-resourceschedule.md
0 → 100644
浏览文件 @
c53b66ba
# 资源调度子系统ChangeLog
## cl.resourceschedule.backgroundTaskManager
对资源调度子系统backgroundTaskManager仓原有接口进行整改,原有@ohos.backgroundTaskManager.d.ts中的API9接口删除,需要使用@ohos.resourceschedule.backgroundTaskManager.d.ts中的API9新接口。新的API9接口符合错误码规范。
**变更影响**
基于OpenHarmony3.2.10.5及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
以下方法、属性、枚举和常量均从API9变更。@ohos.backgroundTaskManager.d.ts文件中的接口移植到@ohos.resourceschedule.backgroundTaskManager.d.ts文件。
| 类名 | 接口类型 | 接口声明 | 说明 |
| -- | -- | -- | -- |
| backgroundTaskManager | method | function resetAllEfficiencyResources(): void; | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager | method | function applyEfficiencyResources(request: EfficiencyResourcesRequest): bool; | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts,修改为function applyEfficiencyResources(request: EfficiencyResourcesRequest): void; |
| backgroundTaskManager.ResourceType | enum | export enum ResourceType | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | CPU = 1 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | COMMON_EVENT = 1 << 1 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | TIMER = 1 << 2 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | WORK_SCHEDULER = 1 << 3 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | BLUETOOTH = 1 << 4 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | GPS = 1 << 5 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.ResourceType | enum | AUDIO = 1 << 6 | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | interface | export interface EfficiencyResourcesRequest | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | reason: string | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | isProcess?: bool | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | isPersist?: bool | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | timeOut: number | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | isApply: bool | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
| backgroundTaskManager.EfficiencyResourcesRequest | field | resourceTypes: number | 接口API9删除,移植到ohos.resourceschedule.backgroundTaskManager.d.ts |
**适配指导**
<br>
导入backgroundTaskManager模块。
```
import bundle form '@ohos.resourceschedule.backgroundTaskManager'
```
此外还需要适配异常处理,具体参考
[
backgroundTaskManager接口文档
](
../../../application-dev/reference/apis/js-apis-resourceschedule-backgroundTaskManager.md
)
。
## c2.resourceschedule.workScheduler
对资源调度子系统workScheduler仓原有接口进行整改,原有@ohos.workScheduler.d.ts中的API9接口删除,需要使用@ohos.resourceschedule.workScheduler.d.ts中的API9新接口。新的API9接口符合错误码规范。
**变更影响**
基于OpenHarmony3.2.10.5及之后的SDK版本开发的应用,需适配API9的模块和接口,以及的API异常处理返回方式,否则会影响原有业务逻辑。
**关键接口/组件变更**
以下方法、属性、枚举和常量均从API9变更。删除@ohos.workScheduler.d.ts文件,相关接口变更至@ohos.resourceschedule.workScheduler.d.ts文件中。
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
| workScheduler | namespace | declare namespace workScheduler | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | interface | export interface WorkInfo | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | parameters?: {[key: string]: any} | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | idleWaitTime?: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | isDeepIdle?: boolean | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | repeatCount?: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | isRepeat?: boolean | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | repeatCycleTime?: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | storageRequest?: StorageRequest | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | batteryStatus?: BatteryStatus | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | batteryLevel?: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | chargerType?: ChargingType | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | isCharging?: boolean | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | networkType?: NetworkType | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | isPersisted?: boolean | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | abilityName: string | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | bundleName: string | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.WorkInfo | field | workId: number | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function isLastWorkTimeOut(workId: number): Promise; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function isLastWorkTimeOut(workId: number, callback: AsyncCallback
<void>
): boolean; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function stopAndClearWorks(): boolean; | 接口API8变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function stopAndClearWorks(): boolean; |
| workScheduler | method | function obtainAllWorks(): Promise
<Array
<
WorkInfo
>
>; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function obtainAllWorks(callback: AsyncCallback
<void>
): Array
<WorkInfo>
; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function getWorkStatus(workId: number): Promise
<WorkInfo>
; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function getWorkStatus(workId: number, callback: AsyncCallback
<WorkInfo>
): void; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler | method | function stopWork(work: WorkInfo, needCancel?: boolean): boolean; | 接口API8变更,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function stopWork(work: WorkInfo, needCancel?: boolean): void; |
| workScheduler | method | function startWork(work: WorkInfo): boolean; | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts,修改为function startWork(work: WorkInfo): void; |
| workScheduler.NetworkType | enum | export enum NetworkType | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_ANY = 0 | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_MOBILE | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_BLUETOOTH | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_WIFI_P2P | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.NetworkType | enum | NETWORK_TYPE_ETHERNET | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | export enum ChargingType | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_ANY = 0 | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_AC | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_USB | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.ChargingType | enum | CHARGING_PLUGGED_WIRELESS | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | export enum BatteryStatus | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW = 0 | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_OKAY | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | BATTERY_STATUS_LOW_OR_OKAY | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.StorageRequest | enum | export enum StorageRequest | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW = 0 | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_OKAY | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
| workScheduler.BatteryStatus | enum | STORAGE_LEVEL_LOW_OR_OKAY | 接口API9删除,移植到ohos.resourceschedule.workScheduler.d.ts |
**适配指导**
<br>
导入workScheduler模块。
```
import bundle form '@ohos.resourceschedule.workScheduler'
```
此外还需要适配异常处理,具体参考
[
workScheduler接口文档
](
../../../application-dev/reference/apis/js-apis-resourceschedule-workScheduler.md
)
。
zh-cn/release-notes/changelogs/v3.2-beta
4
/changelog-security.md
→
zh-cn/release-notes/changelogs/v3.2-beta
5
/changelog-security.md
浏览文件 @
c53b66ba
...
...
@@ -344,3 +344,132 @@ getTbsInfo() : DataBlob;
查看API参考中对应的接口适配指南:
[
证书-API参考
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cert.md
)
## cl.security.21 HUKS支持No-Hash的签名模式
变更之前,应用传递huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE,HUKS默认使用huks.HuksKeyDigest.HUKS_DIGEST_SHA256进行处理;变更之后,应用传递huks.HuksTag.HUKS_TAG_DIGEST = huks.HuksKeyDigest.HUKS_DIGEST_NONE时,HUKS默认不进行摘要处理,需要业务先对原始数据进行hash操作,再将hash后的摘要传入huks进行签名/验签处理。
**变更影响**
影响已发布的JS接口,接口行为发生变更。
应用需要进行适配,才可以使得变更前后的签名/验签结果通过。
**关键的接口/组件变更**
发布的JS接口不变, 传入接口的参数集合发生变更。
业务使用No-Hash的签名模式,需要先对原始数据进行hash处理,再将hash后的摘要传入huks签名/验签接口。同时huks.HuksTag.HUKS_TAG_DIGEST参数设置为huks.HuksKeyDigest.HUKS_DIGEST_NONE。
**适配指导**
以签名为例,示例代码如下:
```
js
import
huks
from
'
@ohos.security.huks
'
;
let
keyAlias
=
'
rsa_Key
'
;
/* sha256之后的摘要值 */
let
inDataAfterSha256
=
new
Uint8Array
(
0x4B
,
0x1E
,
0x22
,
0x64
,
0xA9
,
0x89
,
0x60
,
0x1D
,
0xEC
,
0x78
,
0xC0
,
0x5D
,
0xBE
,
0x46
,
0xAD
,
0xCF
,
0x1C
,
0x35
,
0x16
,
0x11
,
0x34
,
0x01
,
0x4E
,
0x9B
,
0x7C
,
0x00
,
0x66
,
0x0E
,
0xCA
,
0x09
,
0xC0
,
0xF3
,
);
/* 签名参数 */
let
signProperties
=
new
Array
();
signProperties
[
0
]
=
{
tag
:
huks
.
HuksTag
.
HUKS_TAG_ALGORITHM
,
value
:
huks
.
HuksKeyAlg
.
HUKS_ALG_RSA
,
}
signProperties
[
1
]
=
{
tag
:
huks
.
HuksTag
.
HUKS_TAG_PURPOSE
,
value
:
huks
.
HuksKeyPurpose
.
HUKS_KEY_PURPOSE_SIGN
}
signProperties
[
2
]
=
{
tag
:
huks
.
HuksTag
.
HUKS_TAG_KEY_SIZE
,
value
:
huks
.
HuksKeySize
.
HUKS_RSA_KEY_SIZE_2048
,
}
signProperties
[
3
]
=
{
tag
:
huks
.
HuksTag
.
HUKS_TAG_DIGEST
,
value
:
huks
.
HuksKeyDigest
.
HUKS_DIGEST_NONE
,
// 设置 digest-none
}
let
signOptions
=
{
properties
:
signProperties
,
inData
:
inDataAfterSha256
// 设置HASH后的值
}
huks
.
initSession
(
keyAlias
,
signOptions
);
```
更多接口的示例代码可参考
[
HUKS-guidelines
](
../../../application-dev/security/huks-guidelines.md
)
和
[
HUKS API
](
../../../application-dev/reference/apis/js-apis-huks.md
)
。
## cl.security.22 HUKS支持在密钥使用时指定密钥运算参数
变更之前,业务在生成密钥的时候,必须指定密钥运算的全部参数;变更之后,在生成密钥时,只需要包含必选参数即可,在密钥使用阶段再传入其他参数。业务使用会更加灵活。
**变更影响**
影响已发布的JS接口,接口行为发生变更。
允许应用在生成密钥阶段传入的参数中包含必选参数即可,在密钥使用阶段再传入其他可选参数。
**关键的接口/组件变更**
发布的JS接口不变, 传入接口的参数集合发生变更,将参数分为必选参数和可选参数,具体可参考
[
HUKS-guidelines
](
../../../application-dev/security/huks-guidelines.md
)
,涉及的接口有:
huks.generateKeyItem
huks.importKeyItem
huks.importWrappedKeyItem
huks.initSession
huks.updateSession
huks.finishSession
**适配指导**
以生成密钥为例,示例代码如下:
```
js
let
keyAlias
=
'
keyAlias
'
;
let
properties
=
new
Array
();
//必选参数
properties
[
0
]
=
{
tag
:
huks
.
HuksTag
.
HUKS_TAG_ALGORITHM
,
value
:
huks
.
HuksKeyAlg
.
HUKS_ALG_RSA
};
//必选参数
properties
[
1
]
=
{
tag
:
huks
.
HuksTag
.
HUKS_TAG_KEY_SIZE
,
value
:
huks
.
HuksKeySize
.
HUKS_RSA_KEY_SIZE_2048
};
//必选参数
properties
[
2
]
=
{
tag
:
huks
.
HuksTag
.
HUKS_TAG_PURPOSE
,
value
:
huks
.
HuksKeyPurpose
.
HUKS_KEY_PURPOSE_SIGN
|
huks
.
HuksKeyPurpose
.
HUKS_KEY_PURPOSE_VERIFY
};
//可选参数,如果在生成密钥阶段没有传入,则在使用密钥阶段必须传入。
properties
[
3
]
=
{
tag
:
huks
.
HuksTag
.
HUKS_TAG_DIGEST
,
value
:
huks
.
HuksKeyDigest
.
HUKS_DIGEST_SHA256
};
let
options
=
{
properties
:
properties
};
try
{
huks
.
generateKeyItem
(
keyAlias
,
options
,
function
(
error
,
data
)
{
if
(
error
)
{
console
.
error
(
`callback: generateKeyItem failed, code:
${
error
.
code
}
, msg:
${
error
.
message
}
`
);
}
else
{
console
.
info
(
`callback: generateKeyItem key success`
);
}
});
}
catch
(
error
)
{
console
.
error
(
`callback: generateKeyItem input arg invalid, code:
${
error
.
code
}
, msg:
${
error
.
message
}
`
);
}
```
更多接口的示例代码可参考
[
HUKS-guidelines
](
../../../application-dev/security/huks-guidelines.md
)
和
[
HUKS API
](
../../../application-dev/reference/apis/js-apis-huks.md
)
。
zh-cn/release-notes/changelogs/v3.2-beta5/changelog-x-x.md
0 → 100644
浏览文件 @
c53b66ba
# xxx子系统ChangeLog
相比最近一个发布版本(包括不限于LTS、Release、Beta、monthly版本)发生了影响契约兼容性(契约兼容:也称语义兼容,指版本演进后,开发者原有程序行为不发生变化)的变更(包括不限于接口名、参数、返回值、所需要的权限、调用顺序、枚举值、配置参数、路径等),则需要在ChangeLog中对变更进行阐述。
## cl.subsystemname.x xxx功能变更, 例:DeviceType属性变更、相机权限变更(尽量概括,不要超过15个字)
每个变更标题前需要附加编号:cl.subsystemname.x。cl为ChangeLog首字母缩写,subsystemname请填写子系统英文标准名称,x表示变更序号(从低到高逐位增加,起始为1)。
以功能维度对变更点进行概括描述。例如:xxx功能的xxx、xxx等发生了xxx变化,开发者需要根据以下说明对应用进行适配。
如果有此变更有对应的需求或设计文档,可以在描述中附上对应的设计文档编号。
**变更影响**
是否影响已发布的接口或者接口行为发生变更,影响的是JS接口还是Native接口。
是否影响在此前版本已开发的应用,即应用是否需要进行适配动才可以在新版本SDK环境正常编译通过。
**关键的接口/组件变更**
列举此功能变更涉及的接口/组件变更。
**适配指导(可选,不涉及则可以删除)**
提供指导,帮助开发者针对相关变更进行适配,使应用可以与新版本兼容。
例:
在xxx文件中将xxx参数修改为xxx。
```
sample code
```
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ability.md
0 → 100644
浏览文件 @
c53b66ba
# 元能力子系统JS API变更Changelog
OpenHarmony 3.2.10.1(Mr)版本相较于OpenHarmony 3.2.beta4版本,元能力子系统的API变更如下
## cl.ability.1 接口迁移
ability子系统UIAbilityContext的接口requestPermissionsFromUser迁移到security子系统:
之前权限弹窗应用是基于UIAbility实现的,需要借助于UIAbilityContext的startAbilityForResult接口把授权结果带回给调用方,故把requestPermissionsFromUser接口暂时放在UIAbilityContext中。现在权限弹窗应用切换为基于ServiceExtensionAbility实现,不再需要借助UIAbilityContext的startAbilityForResult接口,因此把requestPermissionsFromUser接口迁移到security子系统。
开发者需要根据以下说明对应用进行适配。
**变更影响**
影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array
<string>
, requestCallback: AsyncCallback
<PermissionRequestResult>
): void; | 删除 |
| application/UIAbilityContext | UIAbilityContext | requestPermissionsFromUser(permissions: Array
<string>
): Promise
<PermissionRequestResult>
; | 删除 |
| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array
<Permissions>
, requestCallback: AsyncCallback
<PermissionRequestResult>
) : void; | 新增 |
| @ohos.abilityAccessCtrl | AtManager | requestPermissionsFromUser(context: Context, permissions: Array
<Permissions>
) : Promise
<PermissionRequestResult>
; | 新增 |
**适配指导**
应用中调用requestPermissionsFromUser拉起权限弹窗应用可参考下列代码
Stage模型下的示例:
```
ts
import
abilityAccessCtrl
from
'
@ohos.abilityAccessCtrl.d.ts
'
;
//UIAbility的onWindowStageCreate生命周期
onWindowStageCreate
()
{
let
AtManager
=
abilityAccessCtrl
.
createAtManager
();
//requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗
AtManager
.
requestPermissionsFromUser
(
this
.
context
,
[
"
ohos.permission.MANAGE_DISPOSED_APP_STATUS
"
]).
then
((
data
)
=>
{
console
.
log
(
"
data type:
"
+
typeof
(
data
));
console
.
log
(
"
data:
"
+
data
);
console
.
log
(
"
data permissions:
"
+
data
.
permissions
);
console
.
log
(
"
data result:
"
+
data
.
authResults
);
}).
catch
((
err
)
=>
{
console
.
error
(
'
Failed to start ability
'
,
err
.
code
);
})
}
```
## cl.ability.2 删除标记为废弃的API9接口
[
元能力异常处理整改
](
../OpenHarmony_3.2.8.3/changelogs-ability.md
)
将部分API9接口标记为了废弃,根据OpenHarmony接口规范,需要删除标记为废弃的API9接口。
**变更影响**
基于此前版本开发的应用,需要将被删除的接口替换为新接口,否则会影响应用编译。
**关键接口/组件变更**
接口文件被删除:
| 被删除接口 | 新接口 |
| ----------------------------------------------- | ----------------------------------------------- |
| @ohos.application.Ability.d.ts | @ohos.app.ability.UIAbility.d.ts |
| @ohos.application.AbilityConstant.d.ts | @ohos.app.ability.AbilityConstant.d.ts |
| @ohos.application.AbilityLifecycleCallback.d.ts | @ohos.app.ability.AbilityLifecycleCallback.d.ts |
| @ohos.application.AbilityStage.d.ts | @ohos.app.ability.AbilityStage.d.ts |
| @ohos.application.EnvironmentCallback.d.ts | @ohos.app.ability.EnvironmentCallback.d.ts |
| @ohos.application.ExtensionAbility.d.ts | @ohos.app.ability.ExtensionAbility.d.ts |
| @ohos.application.FormExtension.d.ts | @ohos.app.form.FormExtensionAbility.d.ts |
| @ohos.application.ServiceExtensionAbility.d.ts | @ohos.app.ability.ServiceExtensionAbility.d.ts |
| @ohos.application.StartOptions.d.ts | @ohos.app.ability.StartOptions.d.ts |
| @ohos.application.context.d.ts | @ohos.app.ability.common.d.ts |
| @ohos.application.errorManager.d.ts | @ohos.app.ability.errorManager.d.ts |
接口、属性被删除:
-
@ohos.application.Configuration.d.ts
-
Configuration 的 direction、screenDensity、displayId、hasPointerDevice 被删除。可以使用 @ohos.app.ability.Configuration.d.ts 的 Configuration替换。
-
@ohos.application.ConfigurationConstant.d.ts
-
枚举 Direction 和 ScreenDensity 被删除。可以使用 @ohos.app.ability.ConfigurationConstant.d.ts 的枚举 Direction 和 ScreenDensity 替换。
-
@ohos.application.abilityManager.d.ts
-
方法 getExtensionRunningInfos 和 getTopAbility 被删除。可以使用 @ohos.app.ability.abilityManager.d.ts 的同名方法替换。
-
@ohos.application.appManager.d.ts
-
枚举 ApplicationState 和 ProcessState 被删除。可以使用 @ohos.app.ability.appManager.d.ts 的枚举 ApplicationState 和 ProcessState 替换。
-
方法 registerApplicationStateObserver 和 getProcessRunningInformation被删除。可以使用 @ohos.app.ability.appManager.d.ts 的同名方法替换。
-
@ohos.application.formHost.d.ts
-
方法 shareForm 和 notifyFormsPrivacyProtected 被删除。可以使用 @ohos.app.form.formHost.d.ts 的同名方法替换。
-
@ohos.application.formInfo.d.ts
-
枚举 FormType 的 eTS 被删除,可以使用 @ohos.app.form.formInfo.d.ts 的 FormType 中的 eTS 替换。
-
枚举 FormParam 的 IDENTITY_KEY、BUNDLE_NAME_KEY、ABILITY_NAME_KEY、DEVICE_ID_KEY 被删除,可以使用 @ohos.app.form.formInfo.d.ts 的 FormParam 中的同名枚举替换。
-
接口 FormInfoFilter 被删除。可以使用 @ohos.app.form.formInfo.d.ts 的 FormInfoFilter 替换。
-
枚举 FormDimension 被删除。可以使用 @ohos.app.form.formInfo.d.ts 的 FormDimension 替换。
-
枚举 VisibilityType 被删除。可以使用 @ohos.app.form.formInfo.d.ts 的 VisibilityType 替换。
-
@ohos.wantAgent.d.ts
-
方法 trigger 和 getOperationType 被删除。可以使用 @ohos.app.ability.wantAgent.d.ts 的同名方法替换。
-
application/ApplicationContext.d.ts
-
方法 registerAbilityLifecycleCallback、unregisterAbilityLifecycleCallback、registerEnvironmentCallback、unregisterEnvironmentCallback 被删除。可以使用 on、off 替换。
-
application/ServiceExtensionContext.d.ts
-
方法 connectAbility、connectAbilityWithAccount、disconnectAbility 被删除。可以使用 connectServiceExtensionAbility、connectServiceExtensionAbilityWithAccount、disconnectServiceExtensionAbility 替换。
-
@ohos.application.FormExtension.d.ts
-
生命周期onCreate、onCastToNormal、onUpdate、onVisibilityChange、onEvent、onDestroy、onAcquireFormState、onShare 被删除。可以使用@ohos.app.form.FormExtensionAbility.d.ts的onAddForm、onCastToNormalForm、onUpdateForm、onChangeFormVisibility、onFormEvent、onRemoveForm、onAcquireFormState、onShareForm
-
@ohos.application.abilityDelegatorRegistry.d.ts
-
导出类 AbilityDelegator、AbilityDelegatorArgs、AbilityMonitor、ShellCmdResult 被删除。可以使用@ohos.app.ability.abilityDelegatorRegistry.d.ts中的同名导出类替换。
-
@ohos.application.abilityManager.d.ts
-
导出类 AbilityRunningInfo、ExtensionRunningInfo 被删除。可以使用@ohos.app.ability.abilityManager.d.ts中的同名导出类替换。
-
@ohos.application.appManager.d.ts
-
导出类 AbilityStateData、AppStateData、ApplicationStateObserver、ProcessRunningInfo、ProcessRunningInformation 被删除。可以使用@ohos.app.ability.appManager.d.ts中的同名导出类替换。
-
@ohos.application.missionManager.d.ts
-
导出类 MissionInfo、MissionListener、MissionSnapshot 被删除。可以使用@ohos.app.ability.missionManager.d.ts中的同名导出类替换。
-
@ohos.wantAgent.d.ts
-
导出类 TriggerInfo、WantAgentInfo 被删除。可以使用@ohos.app.ability.wantAgent.d.ts中的同名导出类替换。
**适配指导**
如上所述,仅少数接口修改了接口名的如注册回调函数(registerAbilityLifecycleCallback、unregisterAbilityLifecycleCallback、registerEnvironmentCallback、unregisterEnvironmentCallback)和连接断开 ServiceExtensionAbility(connectAbility、connectAbilityWithAccount、disconnectAbility),卡片生命周期等需要替换成新的接口名。
绝大多数接口平移到了新的namespace中,所以可以通过修改import来解决适配问题:
如原先接口使用了@ohos.application.Ability
```
js
import
Ability
from
'
@ohos.application.Ability
'
;
```
可以通过直接修改import,来切换到新的namespace上:
```
js
import
Ability
from
'
@ohos.app.ability.UIAbility
'
;
```
此外还需要适配异常处理,具体参考新接口的接口文档。
## cl.ability.2 appRecovery接口中RestartFlag属性名称变更,删除了未支持的属性
appRecovery接口中RestartFlag枚举命名从特定故障发生后
**不重启**
改成了特定故障发生后
**重启**
。
删除了CPP_CRASH_NO_RESTART。
**变更影响**
3.
2.10.6版本之前使用CPP_CRASH_NO_RESTART/JS_CRASH_NO_RESTART/APP_FREEZE_NO_RESTART类型开发的应用,在3.2.10.6版本之后行为会发生变化。
**关键接口/组件变更**
**RestartFlag**
<sup>
9+
</sup>
变更前:
| 名称 | 值 | 说明 |
| --------------------- | ------ | -------------------------------- |
| ALWAYS_RESTART | 0 | 总是重启应用。 |
| CPP_CRASH_NO_RESTART | 0x0001 | 发生CPP_CRASH时
**不重启**
应用。 |
| JS_CRASH_NO_RESTART | 0x0002 | 发生JS_CRASH时
**不重启**
应用。 |
| APP_FREEZE_NO_RESTART | 0x0004 | 发生APP_FREEZE时
**不重启**
应用。 |
| NO_RESTART | 0xFFFF | 总是不重启应用。 |
变更后:
| 名称 | 值 | 说明 |
| ----------------------- | ------ | ------------------------------ |
| ALWAYS_RESTART | 0 | 总是重启应用。 |
| CPP_CRASH_NO_RESTART | NA |
**删除**
,不支持该场景的重启。 |
| RESTART_WHEN_JS_CRASH | 0x0001 | 发生JS_CRASH时
**重启**
应用。 |
| RESTART_WHEN_APP_FREEZE | 0x0002 | 发生APP_FREEZE时
**重启**
应用。 |
| NO_RESTART | 0xFFFF | 总是不重启应用。 |
**适配指导**
按新的语义进行适配。
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-account_os_account.md
0 → 100644
浏览文件 @
c53b66ba
# 帐号子系统changeLog
## cl.account_os_account.1 createOsAccountForDomain错误码变更
使用createOsAccountForDomain重复创建域帐号时,变更前返回的错误码为12300001,变更后返回的错误码为12300004。
错误信息由通用系统报错细化为帐号已存在报错。
**变更影响**
基于此前版本开发的应用,需适配变更后的错误码,否则会影响原有业务逻辑。
**关键接口/组件变更**
-
AccountManager
-
createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, callback: AsyncCallback
<
OsAccountInfo
>
);
-
createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Promise
<
OsAccountInfo
>
;
**适配指导**
重复创建域帐号的示例代码如下:
```
ts
import
account_osAccount
from
"
@ohos.account.osAccount
"
let
accountMgr
=
account_osAccount
.
getAccountManager
();
let
domainInfo
=
{
accountName
:
"
zhangsan
"
,
domain
:
"
china.example.com
"
};
try
{
await
accountMgr
.
createOsAccountForDomain
(
account_osAccount
.
OsAccountType
.
NORMAL
,
domainInfo
);
await
accountMgr
.
createOsAccountForDomain
(
account_osAccount
.
OsAccountType
.
NORMAL
,
domainInfo
);
}
catch
(
err
)
{
console
.
log
(
"
activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
// error.code = 12300004;
}
```
## cl.account_os_account.2 应用帐号getAllAccounts接口权限场景变更
应用使用getAllAccounts接口查询自己可访问的帐号列表时,不需要申请权限ohos.permission.GET_ALL_APP_ACCOUNTS。
**变更影响**
基于此后版本开发的应用,查询自己可访问的帐号列表时,无需申请权限。
**关键接口/组件变更**
-
AccountManager
-
getAllAccounts(callback: AsyncCallback
<
Array
<
AppAccountInfo
>>
): void;
-
getAllAccounts(): Promise
<
Array
<
AppAccountInfo
>>
;
**适配指导**
应用未申请ohos.permission.GET_ALL_APP_ACCOUNTS,查询自己可访问的帐号列表示例代码如下:
```
ts
import
account_appAccount
from
"
@ohos.account.appAccount
"
let
accountMgr
=
account_appAccount
.
createAppAccountManager
();
try
{
await
accountMgr
.
addAccount
(
"
accessibleAccount_promise_nopermission
"
);
var
data
=
await
accountMgr
.
getAllAccounts
();
if
(
data
[
0
].
name
==
"
accessibleAccount_promise_nopermission
"
)
{
console
.
log
(
"
getAllAccounts successfully
"
);
}
}
catch
(
err
)
{
console
.
log
(
"
getAllAccounts err:
"
+
JSON
.
stringify
(
err
));
}
```
## cl.account_os_account.3 应用帐号getAccountsByOwner接口权限场景变更
应用使用getAccountsByOwner接口查询可访问的指定应用的帐号列表时,不需要申请权限ohos.permission.GET_ALL_APP_ACCOUNTS。
**变更影响**
基于此后版本开发的应用,查询指定应用可访问的帐号列表时,无需申请权限。
**关键接口/组件变更**
-
AccountManager
-
getAccountsByOwner(owner: string, callback: AsyncCallback
<
Array
<
AppAccountInfo
>>
): void;
-
getAccountsByOwner(owner: string): Promise
<
Array
<
AppAccountInfo
>>
;
**适配指导**
应用未申请ohos.permission.GET_ALL_APP_ACCOUNTS,查询指定应用可访问的帐号列表示例代码如下:
```
ts
import
account_appAccount
from
"
@ohos.account.appAccount
"
let
accountMgr
=
account_appAccount
.
createAppAccountManager
();
try
{
var
ownerName
=
"
com.example.owner
"
;
var
data
=
await
accountMgr
.
getAllAccounts
(
ownerName
);
}
catch
(
err
)
{
console
.
log
(
"
getAllAccounts err:
"
+
JSON
.
stringify
(
err
));
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-bundlemanager.md
已删除
100644 → 0
浏览文件 @
bef315d6
# 包管理子系统ChangeLog
## cl.bundlemanager.1 API9的ApplicationInfo结构体字段变更,删除entryDir字段。
API9的ApplicationInfo结构体
[
[bundleManager/applicationInfo.d.ts
](
https://gitee.com/openharmony/interface_sdk-js/blob/monthly_20221018/api/bundleManager/applicationInfo.d.ts
)
]字段变更,删除entryDir字段。
**变更影响**
<br>
对使用API version 8及之前版本SDK的应用无影响,使用API version 9的应用需要适配新模块和新接口。
**关键的接口/组件变更**
<br>
ApplicationInfo结构体发生变化的字段内容如下表所示。
| 删除 | API9新增或变更 | 类型 |
| --- | --- | --- |
| entryDir | 无 | string |
**适配指导**
<br>
导入包管理查询的模块,在API9 version的ApplicationInfo结构体时,使用了entryDir需要进行修改,该字段属于多余字段。
## cl.bundlemanager.2 API9的HapModuleInfo结构体字段变更,删除moduleSourceDir字段。
API9的HapModuleInfo结构体
[
[bundleManager/hapModuleInfo.d.ts
](
https://gitee.com/openharmony/interface_sdk-js/blob/monthly_20221018/api/bundleManager/hapModuleInfo.d.ts
)
]字段变更,删除moduleSourceDir字段。
**变更影响**
<br>
对使用API version 8及之前版本SDK的应用无影响,使用API version 9的应用需要适配新模块和新接口。
**关键的接口/组件变更**
<br>
HapModuleInfo结构体发生变化的字段内容如下表所示。
| 删除 | API9新增或变更 | 类型 |
| --- | --- | --- |
| moduleSourceDir | 无 | string |
**适配指导**
<br>
导入包管理查询的模块,在API9 version的HapModuleInfo结构体时不能使用moduleSourceDir字段。使用了moduleSourceDir需要进行修改,该字段属于多余字段。
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-container.md
0 → 100644
浏览文件 @
c53b66ba
# commonlibrary子系统JS API变更Changelog
OpenHarmony 3.2.10.1(Mr)版本相较于OpenHarmony 3.2.beta4版本,container子系统的API变更如下
## cl.公共基础类库子系统.1 错误码及信息变更
公共基础类库子系统子系统中ArrayList、List、LinkedList、Stack、Queue、Deque、PlainArray、LightWeightMap、LightWeightSet、HashMap、HashSet、TreeMap、TreeSet类的接口抛出的错误码及信息变更:
变更后的错误码详细介绍请参见
[
语言基础类库错误码
](
../../../application-dev/reference/errorcodes/errorcode-utils.md
)
。
已使用相关接口开发的应用无需重新适配。
**关键的接口/组件变更**
各个类中的接口重新定义了错误码抛出的信息,并在对应模块的
`*.d.ts`
声明文件中通过'@throws'标签进行标示。
示例如下:
ArrayList类变更前:
constructor();
ArrayList类变更后:
@throws { BusinessError } 10200012 - The ArrayList's constructor cannot be directly invoked.
constructor();
**变更影响**
暂无影响。
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-distributeddatamgr.md
浏览文件 @
c53b66ba
...
...
@@ -66,11 +66,10 @@ try {
## cl.distributeddatamgr.2 function getRdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts
**变更影响**
getRdbStoreV9接口标记废弃,应用需要进行适配
。
应用需要进行适配,才可以在新版本SDK环境正常编译通过
。
**关键的接口/组件变更**
如下接口:
```
ts
function
getRdbStoreV9
(
context
:
Context
,
config
:
StoreConfigV9
,
version
:
number
,
callback
:
AsyncCallback
<
RdbStoreV9
>
):
void
;
function
getRdbStoreV9
(
context
:
Context
,
config
:
StoreConfigV9
,
version
:
number
):
Promise
<
RdbStoreV9
>
;
...
...
@@ -87,11 +86,10 @@ function getRdbStore(context: Context, config: StoreConfig): Promise<RdbStore>;
## cl.distributeddatamgr.3 function deleteRdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts
**变更影响**
deleteRdbStoreV9接口标记废弃,应用需要进行适配
。
应用需要进行适配,才可以在新版本SDK环境正常编译通过
。
**关键的接口/组件变更**
如下接口:
```
ts
function
deleteRdbStoreV9
(
context
:
Context
,
name
:
string
,
callback
:
AsyncCallback
<
void
>
):
void
;
function
deleteRdbStoreV9
(
context
:
Context
,
name
:
string
):
Promise
<
void
>
;
...
...
@@ -108,7 +106,7 @@ function deleteRdbStoreV9(context: Context, name: string): Promise<void>;
## cl.distributeddatamgr.4 interface StoreConfigV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts
**变更影响**
StoreConfigV9接口标记废弃,应用需要进行适配
。
应用需要进行适配,才可以在新版本SDK环境正常编译通过
。
**关键的接口/组件变更**
interface StoreConfigV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts 改名为interface StoreConfig。
...
...
@@ -119,7 +117,7 @@ interface StoreConfigV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalSto
## cl.distributeddatamgr.5 enum SecurityLevel 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts
**变更影响**
SecurityLevel接口标记废弃,应用需要进行适配
。
应用需要进行适配,才可以在新版本SDK环境正常编译通过
。
**关键的接口/组件变更**
enum SecurityLevel 从ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts。
...
...
@@ -130,7 +128,7 @@ enum SecurityLevel 从ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.t
## cl.distributeddatamgr.6 interface RdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts
**变更影响**
RdbStoreV9接口标记废弃,应用需要进行适配
。
应用需要进行适配,才可以在新版本SDK环境正常编译通过
。
**关键的接口/组件变更**
interface RdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts 改名为interface RdbStore。
...
...
@@ -141,7 +139,7 @@ interface RdbStoreV9 从@ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.
## cl.distributeddatamgr.7 class RdbPredicatesV9 从ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts
**变更影响**
RdbPredicatesV9接口标记废弃,应用需要进行适配
。
应用需要进行适配,才可以在新版本SDK环境正常编译通过
。
**关键的接口/组件变更**
class RdbPredicatesV9 从ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.d.ts 改名为interface RdbPredicates。
...
...
@@ -152,7 +150,7 @@ class RdbPredicatesV9 从ohos.data.rdb.d.ts 迁移至@ohos.data.relationalStore.
## cl.distributeddatamgr.8 interface ResultSetV9 从api/@ohos.data.relationalStore.d.ts 迁移至@ohos.data.relationalStore.d.ts
**变更影响**
ResultSetV9接口标记废弃,应用需要进行适配
。
应用需要进行适配,才可以在新版本SDK环境正常编译通过
。
**关键的接口/组件变更**
interface ResultSetV9 从api/data/rdb/resultSet.d.ts 迁移至@ohos.data.relationalStore.d.ts 改名为interface ResultSet。
...
...
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-filemanagement.md
0 → 100644
浏览文件 @
c53b66ba
# 文件管理子系统ChangeLog
## cl.filemanagement.1 environment模块变更
文件管理子系统d.ts归档整改,现统一整改到file一层目录下。environment模块支持错误码处理。
**变更影响**
基于此前版本开发的应用,需注意d.ts位置的变更及import模块名的变更。现environment模块支持错误码处理,需注意错误码处理的使用。
[
相关适配指导参考
](
../OpenHarmony_3.2.8.1/changelogs-filemanagement.md
)
**关键接口/组件变更**
原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模块支持错误码处理,需注意错误码处理的使用。
[
相关适配指导参考
](
../OpenHarmony_3.2.8.1/changelogs-filemanagement.md
)
**关键接口/组件变更**
原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模块支持错误码处理,需注意错误码处理的使用。
[
相关适配指导参考
](
../OpenHarmony_3.2.8.1/changelogs-filemanagement.md
)
**关键接口/组件变更**
原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模块支持错误码处理,需注意错误码处理的使用。
[
相关适配指导参考
](
../OpenHarmony_3.2.8.1/changelogs-filemanagement.md
)
**关键接口/组件变更**
原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模块支持错误码处理,需注意错误码处理的使用。
[
相关适配指导参考
](
../OpenHarmony_3.2.8.1/changelogs-filemanagement.md
)
**关键接口/组件变更**
原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模块支持错误码处理,需注意错误码处理的使用。
[
相关适配指导参考
](
../OpenHarmony_3.2.8.1/changelogs-filemanagement.md
)
**关键接口/组件变更**
原volumeManager使用的是@ohos.volumeManager,以以下方式import:
```
js
import
volumeManager
from
'
@ohos.volumeManager
'
;
```
现volumeManager使用的是@ohos.file.volumeManager,以以下方式import:
```
js
import
volumeManager
from
'
@ohos.file.volumeManager
'
;
```
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-inputmethod-framworks.md
0 → 100644
浏览文件 @
c53b66ba
# 输入法框架changeLog
## cl.inputmethod_frameworks.1 API文件名变更
下列模块不符合OpenHarmony接口文件名命名规范。在API9进行变更。
**变更影响**
修改后的SDK与先前已发布版本不兼容,影响在此前版本已开发的应用,应用需要进行适配改动才可以在新版本SDK环境正常编译通过。
**关键的接口/组件变更**
| 模块 | 变更前文件名 | 变更后文件名 |
|------|--------------|--------------|
| 输入法框架模块 | @ohos.inputmethod.d.ts |@ohos.inputMethod.d.ts |
| 输入法服务模块 |@ohos.inputmethodengine.d.ts | @ohos.inputMethodEngine.d.ts |
| 输入法ExtentionAbility模块 | @ohos.inputmethodextensionability.d.ts | @ohos.InputMethodExtensionAbility.d.ts |
| 输入法ExtentionContext模块 |@ohos.inputmethodextensioncontext.d.ts | @ohos.InputMethodExtensionContext.d.ts |
| 输入法子类型模块 | @ohos.inputMethodSubtype.d.ts | @ohos.InputMethodSubtype.d.ts |
**适配指导**
应用中对输入法框架d.ts文件的import后的文件名要写为变更后文件名,即小驼峰/大驼峰命名格式。
如:
```
js
import
inputMethodEngine
from
'
@ohos.inputMethodEngine
'
;
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-media.md
已删除
100644 → 0
浏览文件 @
bef315d6
# 媒体子系统ChangeLog
## cl.media.1 播放功能接口变更
新增音视频播放接口
[
AVPlayer
](
../../../application-dev/reference/apis/js-apis-media.md#avplayer9
)
<sup>
9+
</sup>
, 升级了状态机和错误码,推荐用户使用。旧版音频播放接口
[
AudioPlayer
](
../../../application-dev/reference/apis/js-apis-media.md#audioplayer
)
<sup>
6+
</sup>
和视频播放接口
[
VideoPlayer
](
../../../application-dev/reference/apis/js-apis-media.md#videoplayer
)
<sup>
8+
</sup>
停止维护。
**变更影响**
原有的接口暂时可继续使用,但是停止维护,建议使用新接口进行开发。
**关键的接口/组件变更**
新增接口如下:
| 类名 | 新增接口声明 |
| -------------- | ------------------------------------------------------------ |
| media | createAVPlayer(callback: AsyncCallback
\<
AVPlayer>): void |
| media | createAVPlayer() : Promise
\<
AVPlayer> |
| media.AVPlayer | interface AVPlayer |
| media.AVPlayer | videoScaleType ?: VideoScaleType |
| media.AVPlayer | url ?: string |
| media.AVPlayer | surfaceId ?: string |
| media.AVPlayer | stop(callback: AsyncCallback
\<
void>): void |
| media.AVPlayer | stop(): Promise
\<
void> |
| 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>): void |
| media.AVPlayer | reset(): Promise
\<
void> |
| media.AVPlayer | release(callback: AsyncCallback
\<
void>): void |
| media.AVPlayer | release(): Promise
\<
void> |
| 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>): void |
| media.AVPlayer | prepare(): Promise
\<
void> |
| media.AVPlayer | play(callback: AsyncCallback
\<
void>): void |
| media.AVPlayer | play(): Promise
\<
void> |
| media.AVPlayer | pause(callback: AsyncCallback
\<
void>): void |
| media.AVPlayer | pause(): Promise
\<
void> |
| media.AVPlayer | on(type: 'volumeChange', callback: Callback
\<
number>): void |
| media.AVPlayer | on(type: 'videoSizeChange', callback: (width: number, height: number) => void): void |
| media.AVPlayer | on(type: 'timeUpdate', callback: Callback
\<
number>): void |
| media.AVPlayer | on(type: 'stateChange', callback: (state: AVPlayerState, reason: StateChangeReason) => void): void |
| media.AVPlayer | on(type: 'startRenderFrame', callback: Callback
\<
void>): void |
| media.AVPlayer | on(type: 'speedDone', callback: Callback
\<
number>): void |
| media.AVPlayer | on(type: 'seekDone', callback: Callback
\<
number>): void |
| media.AVPlayer | on(type: 'error', callback: ErrorCallback): void |
| media.AVPlayer | on(type: 'endOfStream', callback: Callback
\<
void>): void |
| media.AVPlayer | on(type: 'durationUpdate', callback: Callback
\<
number>): void |
| media.AVPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void |
| media.AVPlayer | on(type: 'bitrateDone', callback: Callback
\<
number>): void |
| media.AVPlayer | on(type: 'availableBitrates', callback: (bitrates: Array
\<
number>) => 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
\<
Array
\<
MediaDescription>>): void |
| media.AVPlayer | getTrackDescription() : Promise
\<
Array
\<
MediaDescription>> |
| 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
\<
VideoPlayer>): void |
| media | createVideoPlayer() : Promise
\<
VideoPlayer> |
| 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
\<
Array
\<
MediaDescription>>): void |
| media.AudioPlayer | getTrackDescription() : Promise
\<
Array
\<
MediaDescription>> |
| 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
\<
number>): 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>): void |
| media.VideoPlayer | play(): Promise
\<
void> |
| media.VideoPlayer | prepare(callback: AsyncCallback
\<
void>): void |
| media.VideoPlayer | prepare(): Promise
\<
void> |
| media.VideoPlayer | release(callback: AsyncCallback
\<
void>): void |
| media.VideoPlayer | release(): Promise
\<
void> |
| media.VideoPlayer | audioInterruptMode ?: audio.InterruptMode |
| media.VideoPlayer | fdSrc: AVFileDescriptor |
| media.VideoPlayer | seek(timeMs: number, callback: AsyncCallback
\<
number>): void |
| media.VideoPlayer | seek(timeMs: number, mode:SeekMode, callback: AsyncCallback
\<
number>): void |
| media.VideoPlayer | seek(timeMs: number, mode?:SeekMode): Promise
\<
number> |
| media.VideoPlayer | readonly duration: number |
| media.VideoPlayer | loop: boolean |
| media.VideoPlayer | videoScaleType ?: VideoScaleType |
| media.VideoPlayer | readonly state: VideoPlayState |
| media.VideoPlayer | getTrackDescription(callback: AsyncCallback
\<
Array
\<
MediaDescription>>): void |
| media.VideoPlayer | getTrackDescription() : Promise
\<
Array
\<
MediaDescription>> |
| media.VideoPlayer | readonly height: number |
| media.VideoPlayer | on(type: 'playbackCompleted', callback: Callback
\<
void>): void |
| media.VideoPlayer | on(type: 'bufferingUpdate', callback: (infoType: BufferingInfoType, value: number) => void): void |
| media.VideoPlayer | on(type: 'startRenderFrame', callback: Callback
\<
void>): 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>): void |
| media.VideoPlayer | setDisplaySurface(surfaceId: string): Promise
\<
void> |
| media.VideoPlayer | setVolume(vol: number, callback: AsyncCallback
\<
void>): void |
| media.VideoPlayer | setVolume(vol: number): Promise
\<
void> |
| media.VideoPlayer | url: string |
| media.VideoPlayer | pause(callback: AsyncCallback
\<
void>): void |
| media.VideoPlayer | pause(): Promise
\<
void> |
| media.VideoPlayer | readonly currentTime: number |
| media.VideoPlayer | setSpeed(speed:number, callback: AsyncCallback
\<
number>): void |
| media.VideoPlayer | setSpeed(speed:number): Promise
\<
number> |
| media.VideoPlayer | stop(callback: AsyncCallback
\<
void>): void |
| media.VideoPlayer | stop(): Promise
\<
void> |
| media.VideoPlayer | readonly width: number |
| media.VideoPlayer | reset(callback: AsyncCallback
\<
void>): void |
| media.VideoPlayer | reset(): Promise
\<
void> |
| 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
)
<sup>
9+
</sup>
, 升级了状态机和错误码,推荐用户使用。旧版音频录制接口
[
AudioRecorder
](
../../../application-dev/reference/apis/js-apis-media.md#audiorecorder
)
<sup>
6+
</sup>
和视频录制接口
[
VideoRecorder
](
../../../application-dev/reference/apis/js-apis-media.md#videorecorder9
)
<sup>
9+
</sup>
停止维护。
新旧录制接口共用的
[
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
)
<sup>
6+
</sup>
和
[
VideoRecorder
](
../../../application-dev/reference/apis/js-apis-media.md#videorecorder9
)
<sup>
9+
</sup>
暂时可继续使用,但是停止维护,建议使用新接口进行开发
[
AVRecorder
](
../../../application-dev/reference/apis/js-apis-media.md#avrecorder9
)
<sup>
9+
</sup>
。
**关键的接口/组件变更**
新增接口如下:
| 类名 | 新增接口声明 |
| ----------------------- | ------------------------------------------------------------ |
| media | createAVRecorder(callback: AsyncCallback
\<
AVRecorder>): void |
| media | createAVRecorder() : Promise
\<
AVRecorder> |
| media.AVRecorder | interface AVRecorder |
| media.AVRecorder | prepare(config: AVRecorderConfig, callback: AsyncCallback
\<
void>): void |
| media.AVRecorder | prepare(config: AVRecorderConfig): Promise
\<
void> |
| media.AVRecorder | release(callback: AsyncCallback
\<
void>): void |
| media.AVRecorder | release(): Promise
\<
void> |
| 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>): void |
| media.AVRecorder | resume(): Promise
\<
void> |
| media.AVRecorder | start(callback: AsyncCallback
\<
void>): void |
| media.AVRecorder | start(): Promise
\<
void> |
| media.AVRecorder | off(type: 'stateChange'): void |
| media.AVRecorder | off(type: 'error'): void |
| media.AVRecorder | pause(callback: AsyncCallback
\<
void>): void |
| media.AVRecorder | pause(): Promise
\<
void> |
| media.AVRecorder | stop(callback: AsyncCallback
\<
void>): void |
| media.AVRecorder | stop(): Promise
\<
void> |
| media.AVRecorder | reset(callback: AsyncCallback
\<
void>): void |
| media.AVRecorder | reset(): Promise
\<
void> |
| media.AVRecorder | getInputSurface(callback: AsyncCallback
\<
string>): void |
| media.AVRecorder | getInputSurface(): Promise
\<
string> |
| 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
\<
VideoRecorder>): void |
| media | createVideoRecorder(): Promise
\<
VideoRecorder> |
| 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>): void |
| media.VideoRecorder | prepare(config: VideoRecorderConfig): Promise
\<
void> |
| media.VideoRecorder | release(callback: AsyncCallback
\<
void>): void |
| media.VideoRecorder | release(): Promise
\<
void> |
| media.VideoRecorder | readonly state: VideoRecordState |
| media.VideoRecorder | on(type: 'error', callback: ErrorCallback): void |
| media.VideoRecorder | resume(callback: AsyncCallback
\<
void>): void |
| media.VideoRecorder | resume(): Promise
\<
void> |
| media.VideoRecorder | start(callback: AsyncCallback
\<
void>): void |
| media.VideoRecorder | start(): Promise
\<
void> |
| media.VideoRecorder | pause(callback: AsyncCallback
\<
void>): void |
| media.VideoRecorder | pause(): Promise
\<
void> |
| media.VideoRecorder | stop(callback: AsyncCallback
\<
void>): void |
| media.VideoRecorder | stop(): Promise
\<
void> |
| media.VideoRecorder | reset(callback: AsyncCallback
\<
void>): void |
| media.VideoRecorder | reset(): Promise
\<
void> |
| media.VideoRecorder | getInputSurface(callback: AsyncCallback
\<
string>): void |
| media.VideoRecorder | getInputSurface(): Promise
\<
string> |
| 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
)
<sup>
9+
</sup>
替代原有错误枚举类型
[
MediaErrorCode
](
../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode
)
<sup>
8+
</sup>
。
**变更影响**
以往接口返回错误码枚举类型为
[
MediaErrorCode
](
../../../application-dev/reference/apis/js-apis-media.md#mediaerrorcode
)
<sup>
8+
</sup>
不变。新增接口错误码类型均采用
[
AVErrorCode9
](
../../../application-dev/reference/apis/js-apis-media.md#averrorcode
)
<sup>
9+
</sup>
。
**关键的接口/组件变更**
新增接口如下:
| 类名 | 新增错误码声明 |
| ----------------- | ------------------------------------------------------------ |
| 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
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-mediaLibrary.md
0 → 100644
浏览文件 @
c53b66ba
# 文件子系统ChangeLog
## cl.file.1 mediaLibrary相关接口变更
multimedia 部件 medialibrary 接口废弃原有相关接口,使用 FilePicker 替代。
**变更影响**
基于此前版本开发的应用,需注意废弃接口的迭代更新。替代的 FilePicker 应用是OpenHarmony中预置的系统应用,为用户提供文件选择及保存功能。
**关键接口/组件变更**
medialibrary 相关接口废弃,原接口位于 @ohos.multimedia.medialibrary;替代应用为 FilePicker,位于
[
@ohos.file.picker
](
https://gitee.com/openharmony/interface_sdk-js/blob/master/api/@ohos.file.picker.d.ts
)
| 模块名 | 方法/属性/枚举/常量 | 变更类型 |
| ------------------------- | ------------------------------------------------------------ | -------- |
| medialibrary |
**function**
getMediaLibrary(): MediaLibrary; | 废弃 |
| medialibrary |
**function**
getMediaLibrary(context: Context): MediaLibrary; | 废弃 |
| medialibrary |
**function**
getFileAssets(options: MediaFetchOptions, callback: AsyncCallback
\<
FetchFileResult
\>
): void | 废弃 |
| medialibrary |
**function**
getFileAssets(options: MediaFetchOptions): Promise
\<
FetchFileResult
\>
| 废弃 |
| medialibrary |
**function**
on(type: 'deviceChange'
\|
'albumChange'
\|
'imageChange'
\|
'audioChange'
\|
'videoChange'
\|
'fileChange'
\|
'remoteFileChange', callback: Callback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
off(type: 'deviceChange'
\|
'albumChange'
\|
'imageChange'
\|
'audioChange'
\|
'videoChange'
\|
'fileChange'
\|
'remoteFileChange', callback?: Callback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
createAsset(mediaType: MediaType, displayName: string, relativePath: string, callback: AsyncCallback
\<
FileAsset
\>
): void | 废弃 |
| medialibrary |
**function**
createAsset(mediaType: MediaType, displayName: string, relativePath: string): Promise
\<
FileAsset
\>
| 废弃 |
| medialibrary |
**function**
deleteAsset(uri: string): Promise
\<
void
\>
| 废弃 |
| medialibrary |
**function**
deleteAsset(uri: string, callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
getPublicDirectory(type: DirectoryType, callback: AsyncCallback
\<
string
\>
): void | 废弃 |
| medialibrary |
**function**
getPublicDirectory(type: DirectoryType): Promise
\<
string
\>
| 废弃 |
| medialibrary |
**function**
getAlbums(options: MediaFetchOptions, callback: AsyncCallback
\<
Array
\<
Album
\>\>
): void | 废弃 |
| medialibrary |
**function**
getAlbums(options: MediaFetchOptions): Promise
\<
Array
\<
Album
\>\>
| 废弃 |
| medialibrary |
**function**
release(callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
release(): Promise
\<
void
\>
| 废弃 |
| medialibrary |
**function**
storeMediaAsset(option: MediaAssetOption, callback: AsyncCallback
\<
string
\>
): void | 废弃 |
| medialibrary |
**function**
storeMediaAsset(option: MediaAssetOption): Promise
\<
string
\>
| 废弃 |
| medialibrary |
**function**
startImagePreview(images: Array
\<
string
\>
, index: number, callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
startImagePreview(images: Array
\<
string
\>
, callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
startImagePreview(images: Array
\<
string
\>
, index?: number): Promise
\<
void
\>
| 废弃 |
| medialibrary |
**function**
startMediaSelect(option: MediaSelectOption, callback: AsyncCallback
\<
Array
\<
string
\>\>
): void | 废弃 |
| medialibrary |
**function**
startMediaSelect(option: MediaSelectOption): Promise
\<
Array
\<
string
\>\>
| 废弃 |
| medialibrary |
**function**
getActivePeers(): Promise
\<
Array
\<
PeerInfo
\>\>
; | 废弃 |
| medialibrary |
**function**
getActivePeers(callback: AsyncCallback
\<
Array
\<
PeerInfo
\>\>
): void; | 废弃 |
| medialibrary |
**function**
getAllPeers(): Promise
\<
Array
\<
PeerInfo
\>\>
; | 废弃 |
| medialibrary |
**function**
FileAsset.isDirectory(callback: AsyncCallback
\<
boolean
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.isDirectory():Promise
\<
boolean
\>
| 废弃 |
| medialibrary |
**function**
FileAsset.commitModify(callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.commitModify(): Promise
\<
void
\>
| 废弃 |
| medialibrary |
**function**
FileAsset.open(mode: string, callback: AsyncCallback
\<
number
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.open(mode: string): Promise
\<
number
\>
| 废弃 |
| medialibrary |
**function**
FileAsset.close(fd: number, callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.close(fd: number): Promise
\<
void
\>
| 废弃 |
| medialibrary |
**function**
FileAsset.getThumbnail(callback: AsyncCallback
\<
image.PixelMap
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.getThumbnail(size: Size, callback: AsyncCallback
\<
image.PixelMap
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.getThumbnail(size?: Size): Promise
\<
image.PixelMap
\>
| 废弃 |
| medialibrary |
**function**
FileAsset.favorite(isFavorite: boolean, callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.favorite(isFavorite: boolean): Promise
\<
void
\>
| 废弃 |
| medialibrary |
**function**
FileAsset.isFavorite(callback: AsyncCallback
\<
boolean
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.isFavorite():Promise
\<
boolean
\>
| 废弃 |
| medialibrary |
**function**
FileAsset.trash(isTrash: boolean, callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.trash(isTrash: boolean): Promise
\<
void
\>
| 废弃 |
| medialibrary |
**function**
FileAsset.isTrash(callback: AsyncCallback
\<
boolean
\>
): void | 废弃 |
| medialibrary |
**function**
FileAsset.isTrash():Promise
\<
boolean
\>
| 废弃 |
| medialibrary |
**function**
FetchFileResult.getCount(): number | 废弃 |
| medialibrary |
**function**
FetchFileResult.isAfterLast(): boolean | 废弃 |
| medialibrary |
**function**
FetchFileResult.close(): void | 废弃 |
| medialibrary |
**function**
FetchFileResult.getFirstObject(callback: AsyncCallback
\<
FileAsset
\>
): void | 废弃 |
| medialibrary |
**function**
FetchFileResult.getFirstObject(): Promise
\<
FileAsset
\>
| 废弃 |
| medialibrary |
**function**
FetchFileResult.getNextObject(callback: AsyncCallback
\<
FileAsset
\>
): void | 废弃 |
| medialibrary |
**function**
FetchFileResult.getNextObject(): Promise
\<
FileAsset
\>
| 废弃 |
| medialibrary |
**function**
FetchFileResult.getLastObject(callback: AsyncCallback
\<
FileAsset
\>
): void | 废弃 |
| medialibrary |
**function**
FetchFileResult.getLastObject(): Promise
\<
FileAsset
\>
| 废弃 |
| medialibrary |
**function**
FetchFileResult.getPositionObject(index: number, callback: AsyncCallback
\<
FileAsset
\>
): void | 废弃 |
| medialibrary |
**function**
FetchFileResult.getPositionObject(index: number): Promise
\<
FileAsset
\>
| 废弃 |
| medialibrary |
**function**
FetchFileResult.getAllObject(callback: AsyncCallback
\<
Array
\<
FileAsset
\>\>
): void | 废弃 |
| medialibrary |
**function**
FetchFileResult.getAllObject(): Promise
\<
Array
\<
FileAsset
\>\>
| 废弃 |
| medialibrary |
**function**
Album.commitModify(callback: AsyncCallback
\<
void
\>
): void | 废弃 |
| medialibrary |
**function**
Album.commitModify(): Promise
\<
void
\>
| 废弃 |
| medialibrary |
**function**
Album.getFileAssets(options: MediaFetchOptions, callback: AsyncCallback
\<
FetchFileResult
\>
): void | 废弃 |
| medialibrary |
**function**
Album.getFileAssets(options?: MediaFetchOptions): Promise
\<
FetchFileResult
\>
| 废弃 |
| medialibrary |
**enum**
DeviceType | 废弃 |
| medialibrary |
**enum**
FileKey | 废弃 |
| medialibrary |
**enum**
DirectoryType | 废弃 |
| medialibrary |
**enum**
MediaType | 废弃 |
| medialibrary |
**interface**
PeerInfo | 废弃 |
| medialibrary |
**interface**
Size | 废弃 |
| medialibrary |
**interface**
MediaFetchOptions | 废弃 |
| medialibrary |
**interface**
MediaAssetOption | 废弃 |
| medialibrary |
**interface**
MediaSelectOption | 废弃 |
| medialibrary |
**interface**
FileAsset | 废弃 |
**适配指导**
以选取一张图片为例,在替代应用中如下方式进行调用:
```
js
import
picker
from
'
@ohos.file.picker
'
;
async
function
example
()
{
try
{
let
PhotoSelectOptions
=
new
picker
.
PhotoSelectOptions
();
PhotoSelectOptions
.
MIMEType
=
picker
.
PhotoViewMIMETypes
.
IMAGE_TYPE
;
PhotoSelectOptions
.
maxSelectNumber
=
1
;
let
photoPicker
=
new
picker
.
PhotoViewPicker
();
photoPicker
.
select
(
PhotoSelectOptions
).
then
((
PhotoSelectResult
)
=>
{
if
(
PhotoSelectResult
!==
undefined
)
{
console
.
info
(
"
PhotoViewPicker.select pass, PhotoSelectResult uri:
"
+
JSON
.
stringify
(
PhotoSelectResult
));
}
else
{
console
.
error
(
"
PhotoViewPicker.select PhotoSelectResult is undefined
"
);
}
}).
catch
((
err
)
=>
{
console
.
error
(
"
PhotoViewPicker.select fail, err:
"
+
err
);
});
}
catch
(
err
)
{
console
.
error
(
"
PhotoViewPicker fail, err:
"
+
err
);
}
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-nfc.md
0 → 100644
浏览文件 @
c53b66ba
# 公共通信子系统NFC JS API变更Changelog
OpenHarmony 3.2.10.2(Mr)版本相较于OpenHarmony 3.2.beta4版本,分布式数据管理子系统的API变更如下
## cl.nfc.1 接口变更
NFC部分API6到API8部分JS接口不支持抛出错误码,需要删除废弃,然后使用新的API9替换。
开发者需要根据以下说明对应用进行适配。
**变更影响**
影响部分API6到API8部分JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
| ------------------------- | ------------------- | ------------------------------------------------------------ | -------- |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | FeatureType | 废弃 |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | isSupported | 废弃 |
| api/@ohos.nfc.cardEmulation.d.ts | cardEmulation | hasHceCapability | 新增 |
| api/@ohos.nfc.controller.d.ts | nfcController | isNfcAvailable | 废弃 |
| api/@ohos.nfc.controller.d.ts | nfcController | openNfc | 废弃 |
| api/@ohos.nfc.controller.d.ts | nfcController | closeNfc | 废弃 |
| api/@ohos.nfc.controller.d.ts | nfcController | enableNfc | 新增 |
| api/@ohos.nfc.controller.d.ts | nfcController | disableNfc | 新增 |
| api/@ohos.nfc.tag.d.ts | tag | getNfcATag | 废弃 |
| api/@ohos.nfc.tag.d.ts | tag | getNfcBTag | 废弃 |
| api/@ohos.nfc.tag.d.ts | tag | getNfcFTag | 废弃 |
| api/@ohos.nfc.tag.d.ts | tag | getNfcVTag | 废弃 |
| api/@ohos.nfc.tag.d.ts | tag | getNfcA | 新增 |
| api/@ohos.nfc.tag.d.ts | tag | getNfcB | 新增 |
| api/@ohos.nfc.tag.d.ts | tag | getNfcF | 新增 |
| api/@ohos.nfc.tag.d.ts | tag | getNfcV | 新增 |
| api/tag/tagSession.d.ts | TagSession | getTagInfo | 废弃 |
| api/tag/tagSession.d.ts | TagSession | connectTag | 废弃 |
| api/tag/tagSession.d.ts | TagSession | reset | 废弃 |
| api/tag/tagSession.d.ts | TagSession | isTagConnected | 废弃 |
| api/tag/tagSession.d.ts | TagSession | setSendDataTimeout | 废弃 |
| api/tag/tagSession.d.ts | TagSession | getSendDataTimeout | 废弃 |
| api/tag/tagSession.d.ts | TagSession | sendData | 废弃 |
| api/tag/tagSession.d.ts | TagSession | getMaxSendLength | 废弃 |
| api/tag/tagSession.d.ts | TagSession | connect | 新增 |
| api/tag/tagSession.d.ts | TagSession | resetConnection | 新增 |
| api/tag/tagSession.d.ts | TagSession | isConnected | 新增 |
| api/tag/tagSession.d.ts | TagSession | setTimeout | 新增 |
| api/tag/tagSession.d.ts | TagSession | getTimeout | 新增 |
| api/tag/tagSession.d.ts | TagSession | transmit | 新增 |
| api/tag/tagSession.d.ts | TagSession | getMaxTransmitSize | 新增 |
**适配指导**
查看API开发指南:
[
cardEmulation-API参考
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-cardEmulation.md
)
[
nfcController-API参考
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-nfcController.md
)
[
tag-API参考
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-nfcTag.md
)
[
TagSession-API参考
](
https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-tagSession.md
)
```
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-notification.md
0 → 100644
浏览文件 @
c53b66ba
# 事件通知子系统ChangeLog
## cl.notification.1 删除标记为废弃的API9接口
[
事件通知异常处理整改
](
../OpenHarmony_3.2.8.3/changelogs-notification.md
)
将部分API9接口标记为了废弃,根据OpenHarmony接口规范,需要删除标记为废弃的API9接口。
**变更影响**
基于此前版本开发的应用,需要将被删除的接口替换为新接口,否则会影响应用编译。
**关键接口/组件变更**
原接口中标记为废弃的API9接口将被删除,可以使用新接口中的同名接口替换。
| 原接口 | 新接口 |
| ----------------------- | -------------------------------- |
| @ohos.commonEvent.d.ts | @ohos.commonEventManager.d.ts |
| @ohos.notification.d.ts | @ohos.notificationManager.d.ts |
| @ohos.notification.d.ts | @ohos.notificationSubscribe.d.ts |
接口、属性被删除:
-
@ohos.notification.d.ts
-
接口 publishAsBundle、cancelAsBundle、isNotificationSlotEnabled、setSyncNotificationEnabledWithoutApp、getSyncNotificationEnabledWithoutApp 被删除。可以使用 api/@ohos.notificationManager.d.ts 的同名接口替换。
-
接口 enableNotificationSlot 被删除。可以使用 api/@ohos.notificationManager.d.ts 的接口 setNotificationEnableSlot 替换。
-
导出类 NotificationActionButton、NotificationBasicContent、NotificationContent、NotificationLongTextContent、NotificationMultiLineContent、NotificationPictureContent、NotificationFlags、NotificationFlagStatus、NotificationRequest、DistributedOptions、NotificationSlot、NotificationSorting、NotificationTemplate、NotificationUserInput 被删除。可以使用 api/@ohos.notificationManager.d.ts 的同名导出类替换。
-
导出类 NotificationSubscribeInfo、NotificationSubscriber、SubscribeCallbackData、EnabledNotificationCallbackData 被删除。可以使用 api/@ohos.notificationSubscribe.d.ts 的同名导出类替换。
**适配指导**
如上所述,仅将老接口平移到了新的namespace中,所以可以通过修改import来解决适配问题:
如原先接口使用了@ohos.commonEvent
```
js
import
commonEvent
from
'
@ohos.commonEvent
'
;
```
可以通过直接修改import,来切换到新的namespace上:
```
js
import
commonEvent
from
'
@ohos.commonEventManager
'
;
```
@ohos.notification拆分成了两个namespace,需要根据接口情况选择需要的新namespace进行适配。
此外还需要适配异常处理,具体参考新接口的接口文档。
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geoLocationManager.md
0 → 100644
浏览文件 @
c53b66ba
# 位置服务子系统ChangeLog
## cl.location.1 @ohos.geolocation.d.ts接口迁移到新增的@ohos.geoLocationManager.d.ts
@ohos.geolocation.d.ts接口不支持抛出错误码,为了支持错误码功能,把@ohos.geolocation.d.ts中所有接口,迁移到新增的@ohos.geoLocationManager.d.ts中,并增加错误码描述。
后续需要import @ohos.geoLocationManager才能使用位置服务的接口:
import geoLocationManager from '@ohos.geoLocationManager';
**变更影响**
对位置服务所有接口的使用有影响,需要import @ohos.geoLocationManager才能使用位置服务接口:
import geoLocationManager from '@ohos.geoLocationManager';
**关键的接口/组件变更**
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
|geolocation| method | function on(type: 'locationChange', request: LocationRequest, callback: Callback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function off(type: 'locationChange', callback?: Callback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function on(type: 'locationServiceState', callback: Callback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'locationServiceState'更改为type: 'locationEnabledChange' |
|geolocation| method | function off(type: 'locationServiceState', callback?: Callback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'locationServiceState'更改为type: 'locationEnabledChange' |
|geolocation| method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback
<Array
<
Location
>
>): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'cachedGnssLocationsReporting'更改为type: 'cachedGnssLocationsChange' |
|geolocation| method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback
<Array
<
Location
>
>): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'cachedGnssLocationsReporting'更改为type: 'cachedGnssLocationsChange' |
|geolocation| method | function on(type: 'gnssStatusChange', callback: Callback
<SatelliteStatusInfo>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'gnssStatusChange'更改为type: 'satelliteStatusChange' |
|geolocation| method | function off(type: 'gnssStatusChange', callback?: Callback
<SatelliteStatusInfo>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'gnssStatusChange'更改为type: 'satelliteStatusChange' |
|geolocation| method | function on(type: 'nmeaMessageChange', callback: Callback
<string>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'nmeaMessageChange'更改为type: 'nmeaMessage' |
|geolocation| method | function off(type: 'nmeaMessageChange', callback?: Callback
<string>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'nmeaMessageChange'更改为type: 'nmeaMessage' |
|geolocation| method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'fenceStatusChange'更改为type: 'gnssFenceStatusChange' |
|geolocation| method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | 接口迁移到@ohos.geoLocationManager.d.ts,type: 'fenceStatusChange'更改为type: 'gnssFenceStatusChange' |
|geolocation| method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCurrentLocation(callback: AsyncCallback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCurrentLocation(request?: CurrentLocationRequest): Promise
<Location>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getLastLocation(callback: AsyncCallback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function getLastLocation(): Location; |
|geolocation| method | function getLastLocation(): Promise
<Location>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function getLastLocation(): Location; |
|geolocation| method | function isLocationEnabled(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isLocationEnabled(): boolean; |
|geolocation| method | function isLocationEnabled(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isLocationEnabled(): boolean; |
|geolocation| method | function requestEnableLocation(callback: AsyncCallback
<boolean>
): void; | 接口删除 |
|geolocation| method | function requestEnableLocation(): Promise
<boolean>
; | 接口删除 |
|geolocation| method | function enableLocation(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function enableLocation(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function disableLocation(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableLocation(): void; |
|geolocation| method | function disableLocation(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableLocation(): void; |
|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback
<Array
<
GeoAddress
>
>): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise
<Array
<
GeoAddress
>
>; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback
<Array
<
GeoAddress
>
>): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise
<Array
<
GeoAddress
>
>; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function isGeoServiceAvailable(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isGeocoderAvailable(): boolean; |
|geolocation| method | function isGeoServiceAvailable(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isGeocoderAvailable(): boolean; |
|geolocation| method | function getCachedGnssLocationsSize(callback: AsyncCallback
<number>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCachedGnssLocationsSize(): Promise
<number>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function flushCachedGnssLocations(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function flushCachedGnssLocations(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function sendCommand(command: LocationCommand, callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function sendCommand(command: LocationCommand): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function enableLocationMock(callback: AsyncCallback
<void>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function enableLocationMock(): void; |
|geolocation| method | function enableLocationMock(): Promise
<void>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function enableLocationMock(): void; |
|geolocation| method | function disableLocationMock(callback: AsyncCallback
<void>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableLocationMock(): void; |
|geolocation| method | function disableLocationMock(): Promise
<void>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableLocationMock(): void; |
|geolocation| method | function setMockedLocations(config: LocationMockConfig, callback: AsyncCallback
<void>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setMockedLocations(config: LocationMockConfig): void; |
|geolocation| method | function setMockedLocations(config: LocationMockConfig): Promise
<void>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setMockedLocations(config: LocationMockConfig): void; |
|geolocation| method | function enableReverseGeocodingMock(callback: AsyncCallback
<void>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function enableReverseGeocodingMock(): void; |
|geolocation| method | function enableReverseGeocodingMock(): Promise
<void>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function enableReverseGeocodingMock(): void; |
|geolocation| method | function disableReverseGeocodingMock(callback: AsyncCallback
<void>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableReverseGeocodingMock(): void; |
|geolocation| method | function disableReverseGeocodingMock(): Promise
<void>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function disableReverseGeocodingMock(): void; |
|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array
<ReverseGeocodingMockInfo>, callback: AsyncCallback<void>): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>
): void; |
|geolocation| method | function setReverseGeocodingMockInfo(mockInfos: Array
<ReverseGeocodingMockInfo>): Promise<void>; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setReverseGeocodingMockInfo(mockInfos: Array<ReverseGeocodingMockInfo>
): void; |
|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType, callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean; |
|geolocation| method | function isLocationPrivacyConfirmed(type: LocationPrivacyType,): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function isLocationPrivacyConfirmed(type: LocationPrivacyType): boolean; |
|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean, callback: AsyncCallback
<void>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void; |
|geolocation| method | function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): Promise
<void>
; | 接口迁移到@ohos.geoLocationManager.d.ts,更改为function setLocationPrivacyConfirmStatus(type: LocationPrivacyType, isConfirmed: boolean): void; |
|geolocation| interface | SatelliteStatusInfo | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | CachedGnssLocationsRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | GeofenceRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | Geofence | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | ReverseGeoCodeRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | GeoCodeRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | GeoAddress | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | LocationRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | CurrentLocationRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | Location | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| enum | LocationRequestPriority | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| enum | LocationRequestScenario | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| enum | GeoLocationErrorCode | 接口废弃 |
|geolocation| enum | LocationPrivacyType | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| enum | LocationCommand | 接口迁移到@ohos.geoLocationManager.d.ts |
**适配指导(可选,不涉及则可以删除)**
以enableLocation为例,在新版本上需要使用如下方式进行调用:
```
ts
import
geoLocationManager
from
'
@ohos.geoLocationManager
'
;
try
{
geoLocationManager
.
enableLocation
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
enableLocation: err=
'
+
JSON
.
stringify
(
err
));
}
});
}
catch
(
err
)
{
console
.
error
(
"
errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-ohos-geolocation.md
0 → 100644
浏览文件 @
c53b66ba
# 位置服务子系统ChangeLog
## cl.location.1 @ohos.geolocation.d.ts接口迁移到新增的@ohos.geoLocationManager.d.ts
@ohos.geolocation.d.ts接口不支持抛出错误码,为了支持错误码功能,把@ohos.geolocation.d.ts中所有接口,迁移到新增的@ohos.geoLocationManager.d.ts中,并增加错误码描述。
后续需要import @ohos.geoLocationManager才能使用位置服务的接口:
import geoLocationManager from '@ohos.geoLocationManager';
**变更影响**
对位置服务所有接口的使用有影响,需要import @ohos.geoLocationManager才能使用位置服务接口:
import geoLocationManager from '@ohos.geoLocationManager';
**关键的接口/组件变更**
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
|geolocation| namespace | declare namespace geolocation| 迁移到@ohos.geoLocationManager.d.ts,使用namespace geoLocationManager代替 |
|geolocation| method | function on(type: 'locationChange', request: LocationRequest, callback: Callback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function off(type: 'locationChange', callback?: Callback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function on(type: 'locationServiceState', callback: Callback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function off(type: 'locationServiceState', callback?: Callback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback
<Array
<
Location
>
>): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function off(type: 'cachedGnssLocationsReporting', callback?: Callback
<Array
<
Location
>
>): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function on(type: 'gnssStatusChange', callback: Callback
<SatelliteStatusInfo>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function off(type: 'gnssStatusChange', callback?: Callback
<SatelliteStatusInfo>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function on(type: 'nmeaMessageChange', callback: Callback
<string>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function off(type: 'nmeaMessageChange', callback?: Callback
<string>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCurrentLocation(callback: AsyncCallback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCurrentLocation(request?: CurrentLocationRequest): Promise
<Location>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getLastLocation(callback: AsyncCallback
<Location>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getLastLocation(): Promise
<Location>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function isLocationEnabled(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function isLocationEnabled(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function requestEnableLocation(callback: AsyncCallback
<boolean>
): void; | 接口删除 |
|geolocation| method | function requestEnableLocation(): Promise
<boolean>
; | 接口删除 |
|geolocation| method | function enableLocation(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function enableLocation(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function disableLocation(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function disableLocation(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback
<Array
<
GeoAddress
>
>): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getAddressesFromLocation(request: ReverseGeoCodeRequest): Promise
<Array
<
GeoAddress
>
>; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback
<Array
<
GeoAddress
>
>): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getAddressesFromLocationName(request: GeoCodeRequest): Promise
<Array
<
GeoAddress
>
>; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function isGeoServiceAvailable(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function isGeoServiceAvailable(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCachedGnssLocationsSize(callback: AsyncCallback
<number>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function getCachedGnssLocationsSize(): Promise
<number>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function flushCachedGnssLocations(callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function flushCachedGnssLocations(): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function sendCommand(command: LocationCommand, callback: AsyncCallback
<boolean>
): void; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| method | function sendCommand(command: LocationCommand): Promise
<boolean>
; | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | SatelliteStatusInfo | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | CachedGnssLocationsRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | GeofenceRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | Geofence | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | ReverseGeoCodeRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | GeoCodeRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | GeoAddress | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | LocationRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | CurrentLocationRequest | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| interface | Location | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| enum | LocationRequestPriority | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| enum | LocationRequestScenario | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| enum | GeoLocationErrorCode | 接口废弃 |
|geolocation| enum | LocationPrivacyType | 接口迁移到@ohos.geoLocationManager.d.ts |
|geolocation| enum | LocationCommand | 接口迁移到@ohos.geoLocationManager.d.ts |
**适配指导(可选,不涉及则可以删除)**
以enableLocation为例,在新版本上需要使用如下方式进行调用:
```
ts
import
geoLocationManager
from
'
@ohos.geoLocationManager
'
;
try
{
geoLocationManager
.
enableLocation
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
enableLocation: err=
'
+
JSON
.
stringify
(
err
));
}
});
}
catch
(
err
)
{
console
.
error
(
"
errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-request.md
0 → 100644
浏览文件 @
c53b66ba
# 上传下载子系统ChangeLog
## cl.request.2 request上传下载接口变更
-
删除API9-beta接口:
1.
function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback
<DownloadTask>
): void;
2.
function download(context: BaseContext, config: DownloadConfig): Promise
<DownloadTask>
;
3.
function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback
<UploadTask>
): void;
4.
function upload(context: BaseContext, config: UploadConfig): Promise
<UploadTask>
;
**变更影响**
基于此前版本使用Stage模式开发的应用,需适配变更后的接口,否则会影响原有业务逻辑。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
|--------------|--------------|-------------------------------------------------------------------------------------------------------------------|------|
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig, callback: AsyncCallback
<DownloadTask>
): void; | 删除 |
| ohos.request | request | function download(context: BaseContext, config: DownloadConfig): Promise
<DownloadTask>
; | 删除 |
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig, callback: AsyncCallback
<UploadTask>
): void; | 删除 |
| ohos.request | request | function upload(context: BaseContext, config: UploadConfig): Promise
<UploadTask>
; | 删除 |
**适配指导**
以download为例,在新版本上需要使用downloadFile, 如下方式进行调用:
```
ts
try
{
request
.
downloadFile
(
globalThis
.
abilityContext
,
{
url
:
'
https://xxxx/xxxxx.hap
'
,
filePath
:
'
xxx/xxxxx.hap
'
},
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
'
Failed to request the download. Cause:
'
+
JSON
.
stringify
(
err
));
return
;
}
});
}
catch
(
err
)
{
console
.
log
(
"
downloadFile callback fail.
"
+
"
errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-system-geolocation.md
0 → 100644
浏览文件 @
c53b66ba
# 位置服务子系统ChangeLog
## cl.location.1 @system.geolocation.d.ts接口迁移到新增的@ohos.geoLocationManager.d.ts
@system.geolocation.d.ts接口不支持抛出错误码,为了支持错误码功能,把@system.geolocation.d.ts中所有接口,迁移到新增的@ohos.geoLocationManager.d.ts中,并增加错误码描述。
后续需要import @ohos.geoLocationManager才能使用位置服务的接口:
import geoLocationManager from '@ohos.geoLocationManager';
**变更影响**
对位置服务所有接口的使用有影响,需要import @ohos.geoLocationManager才能使用位置服务接口:
import geoLocationManager from '@ohos.geoLocationManager';
**关键的接口/组件变更**
| 类名 | 接口类型 | 接口声明 | 变更类型 |
| -- | -- | -- | -- |
|Geolocation| class | Geolocation | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager代替 |
|Geolocation| interface | static getLocation(options?: GetLocationOption): void; | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.getCurrentLocation代替 |
|Geolocation| interface | static getLocationType(options?: GetLocationTypeOption): void; | 接口废弃 |
|Geolocation| interface | static subscribe(options: SubscribeLocationOption): void; | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.on#event:locationChange代替 |
|Geolocation| interface | static unsubscribe(): void; | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.off#event:locationChange代替 |
|Geolocation| interface | static getSupportedCoordTypes(): Array
<string>
; | 接口废弃 |
|| interface | GeolocationResponse| 迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.Location代替 |
|| interface | GetLocationOption | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.CurrentLocationRequest代替 |
|| interface | GetLocationTypeResponse | 接口废弃 |
|| interface | GetLocationTypeOption | 接口废弃 |
|| interface | SubscribeLocationOption | 接口迁移到@ohos.geoLocationManager.d.ts,使用ohos.geoLocationManager/geoLocationManager.LocationRequest代替 |
**适配指导(可选,不涉及则可以删除)**
以enableLocation为例,在新版本上需要使用如下方式进行调用:
```
ts
import
geoLocationManager
from
'
@ohos.geoLocationManager
'
;
try
{
geoLocationManager
.
enableLocation
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
enableLocation: err=
'
+
JSON
.
stringify
(
err
));
}
});
}
catch
(
err
)
{
console
.
error
(
"
errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
}
```
\ No newline at end of file
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-telephony.md
0 → 100644
浏览文件 @
c53b66ba
# 电话子系统ChangeLog
## cl.telephony.1 radio模块接口变更
### 电话子系统radio模块 `isNrSupported` 接口存在变更:
NR是专有名词,需要全部大写。
开发者需要根据以下说明对应用进行适配。
**变更影响**
基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。
**关键的接口/组件变更**
-
涉及接口
isNrSupported(): boolean;
isNrSupported(slotId: number): boolean;
-
变更前:
```
js
function
isNrSupported
():
boolean
;
function
isNrSupported
(
slotId
:
number
):
boolean
;
```
-
变更后:
```
js
function
isNRSupported
():
boolean
;
function
isNRSupported
(
slotId
:
number
):
boolean
;
```
**适配指导**
使用变更后的接口,示例代码如下:
```
js
let
result
=
radio
.
isNrSupported
();
console
.
log
(
"
Result:
"
+
result
);
```
```
js
let
slotId
=
0
;
let
result
=
radio
.
isNRSupported
(
slotId
);
console
.
log
(
"
Result:
"
+
result
);
```
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-time.md
0 → 100644
浏览文件 @
c53b66ba
# 时间时区子系统ChangeLog
## cl.time.1 接口异常抛出变更
时间时区子系统定时器接口异常抛出:202非系统应用异常和401参数无效异常。
**变更影响**
该接口变更前向兼容,基于此前版本开发的应用可继续使用接口,增加相应的异常处理,原有功能不受影响。
**关键接口/组件变更**
变更前:
-
接口异常抛出message,无错误码。
变更后:
-
接口异常抛出message和code,包括202非系统应用异常和401参数无效异常。
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
| ----------------- | ----------- | ------------------------------------------------------------ | -------- |
| @ohos.systemTimer | systemTimer | function createTimer(options: TimerOptions, callback: AsyncCallback<number>): void | 变更 |
| @ohos.systemTimer | systemTimer | function createTimer(options: TimerOptions): Promise<number> | 变更 |
| @ohos.systemTimer | systemTimer | function startTimer(timer: number, triggerTime: number, callback: AsyncCallback<void>): void | 变更 |
| @ohos.systemTimer | systemTimer | function startTimer(timer: number, triggerTime: number): Promise<void> | 变更 |
| @ohos.systemTimer | systemTimer | function stopTimer(timer: number, callback: AsyncCallback<void>): void | 变更 |
| @ohos.systemTimer | systemTimer | function stopTimer(timer: number): Promise<void> | 变更 |
| @ohos.systemTimer | systemTimer | function destroyTimer(timer: number, callback: AsyncCallback<void>): void | 变更 |
| @ohos.systemTimer | systemTimer | function destroyTimer(timer: number): Promise<void> | 变更 |
**适配指导**
应用中调用systemTimer所有接口可参考下列代码进行异常捕获
createTimer callback形式调用:
**示例:**
```
js
export
default
{
systemTimer
()
{
let
options
=
{
type
:
systemTimer
.
TIMER_TYPE_REALTIME
,
repeat
:
false
};
try
{
systemTimer
.
createTimer
(
options
,
(
error
,
timerId
)
=>
{
if
(
error
)
{
//捕获权限否定异常
console
.
info
(
`Failed to create timer. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
}
console
.
info
(
`Succeeded in creating timer. timerId:
${
timerId
}
`
);
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to create timer. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
}
}
```
createTimer promise形式调用:
**示例:**
```
js
export
default
{
systemTimer
()
{
let
options
=
{
type
:
systemTimer
.
TIMER_TYPE_REALTIME
,
repeat
:
false
};
try
{
systemTimer
.
createTimer
(
options
).
then
((
timerId
)
=>
{
console
.
info
(
`Succeeded in creating timer. timerId:
${
timerId
}
`
);
}).
catch
((
error
)
=>
{
//捕获权限否定异常
console
.
info
(
`Failed to create timer. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to create timer. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
}
}
```
startTimer callback形式调用:
**示例:**
```
js
export
default
{
async
systemTimer
()
{
let
options
=
{
type
:
systemTimer
.
TIMER_TYPE_REALTIME
,
repeat
:
false
}
let
timerId
=
await
systemTimer
.
createTimer
(
options
);
let
triggerTime
=
new
Date
().
getTime
();
triggerTime
+=
3000
;
try
{
systemTimer
.
startTimer
(
timerId
,
triggerTime
,
(
error
)
=>
{
if
(
error
)
{
//捕获权限否定异常
console
.
error
(
`Failed to start timer. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
}
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to start timer. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
}
}
```
startTimer promise形式调用:
**示例:**
```
js
export
default
{
async
systemTimer
(){
let
options
=
{
type
:
systemTimer
.
TIMER_TYPE_REALTIME
,
repeat
:
false
}
let
timerId
=
await
systemTimer
.
createTimer
(
options
);
let
triggerTime
=
new
Date
().
getTime
();
triggerTime
+=
3000
;
try
{
systemTimer
.
startTimer
(
timerId
,
triggerTime
).
then
((
data
)
=>
{
console
.
log
(
`Succeeded in startting timer. Data:`
+
data
);
}).
catch
((
error
)
=>
{
//捕获权限否定异常
console
.
info
(
`Failed to start timer. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to start timer. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
}
}
```
stopTimer callback形式调用:
**示例:**
```
js
export
default
{
async
systemTimer
()
{
let
options
=
{
type
:
systemTimer
.
TIMER_TYPE_REALTIME
,
repeat
:
false
}
let
timerId
=
await
systemTimer
.
createTimer
(
options
);
let
triggerTime
=
new
Date
().
getTime
();
triggerTime
+=
3000
;
systemTimer
.
startTimer
(
timerId
,
triggerTime
);
try
{
systemTimer
.
stopTimer
(
timerId
,
triggerTime
,
(
error
)
=>
{
if
(
error
)
{
//捕获权限否定异常
console
.
error
(
`Failed to stop timer. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
}
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to stop timer. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
}
}
git
```
stopTimer promise形式调用:
**示例:**
```
js
export
default
{
async
systemTimer
(){
let
options
=
{
type
:
systemTimer
.
TIMER_TYPE_REALTIME
,
repeat
:
false
}
let
timerId
=
await
systemTimer
.
createTimer
(
options
);
let
triggerTime
=
new
Date
().
getTime
();
triggerTime
+=
3000
;
systemTimer
.
startTimer
(
timerId
,
triggerTime
);
try
{
systemTimer
.
stopTimer
(
timerId
,
triggerTime
).
then
((
data
)
=>
{
console
.
log
(
`Succeeded in stop timer. Data:`
+
data
);
}).
catch
((
error
)
=>
{
//捕获权限否定异常
console
.
info
(
`Failed to stop timer. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to stop timer. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
}
}
```
destroyTimer callback形式调用:
**示例:**
```
js
export
default
{
async
systemTimer
()
{
let
options
=
{
type
:
systemTimer
.
TIMER_TYPE_REALTIME
,
repeat
:
false
}
let
timerId
=
await
systemTimer
.
createTimer
(
options
);
let
triggerTime
=
new
Date
().
getTime
();
triggerTime
+=
3000
;
systemTimer
.
startTimer
(
timerId
,
triggerTime
);
systemTimer
.
stopTimer
(
timerId
);
try
{
systemTimer
.
destroyTimer
(
timerId
,
triggerTime
,
(
error
)
=>
{
if
(
error
)
{
//捕获权限否定异常
console
.
error
(
`Failed to destroy timer. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
}
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to destroy timer. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
}
}
```
destroyTimer promise形式调用:
**示例:**
```
js
export
default
{
async
systemTimer
(){
let
options
=
{
type
:
systemTimer
.
TIMER_TYPE_REALTIME
,
repeat
:
false
}
let
timerId
=
await
systemTimer
.
createTimer
(
options
);
let
triggerTime
=
new
Date
().
getTime
();
triggerTime
+=
3000
;
systemTimer
.
startTimer
(
timerId
,
triggerTime
);
systemTimer
.
stopTimer
(
timerId
);
try
{
systemTimer
.
destroyTimer
(
timerId
,
triggerTime
).
then
((
data
)
=>
{
console
.
log
(
`Succeeded in destroy timer. Data:`
+
data
);
}).
catch
((
error
)
=>
{
//捕获权限否定异常
console
.
info
(
`Failed to destroy timer. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to destroy timer. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
}
}
```
## cl.time.2 接口异常抛出变更
时间时区子系统时间相关接口异常抛出:201权限否定异常、202非系统应用异常和401参数无效异常。
**变更影响**
基于此前版本开发的应用,继续使用无影响,使用新接口需要捕获并处理抛出的新异常。
**关键接口/组件变更**
变更前:
-
接口异常抛出message,错误码-1。
变更后:
-
接口异常抛出message和code,包括201权限否定异常、202非系统应用异常和401参数无效异常。
原接口中标记为废弃的接口,可以使用新接口中的同名接口替换
| 原接口 | 新接口 |
| ---------------- | -------------------- |
| @ohos.systemTime | @ohos.systemDateTime |
**适配指导**
应用中调用systemTime所有接口可参考下列代码进行异常捕获,以setTime接口为例,其他接口适配方法相同。
callback形式调用:
**示例:**
```
js
import
systemDateTime
from
@
ohos
.
systemDateTime
// time对应的时间为2021-01-20 02:36:25
let
time
=
1611081385000
;
try
{
systemDateTime
.
setTime
(
time
,
(
error
)
=>
{
//捕获权限否定异常和非系统应用异常
if
(
error
)
{
console
.
info
(
`Failed to setting time. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
return
;
}
console
.
info
(
`Succeeded in setting time.`
);
})
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to set time. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
```
promise形式调用:
**示例:**
```
js
import
systemDateTime
from
@
ohos
.
systemDateTime
// time对应的时间为2021-01-20 02:36:25
let
time
=
1611081385000
;
try
{
systemDateTime
.
setTime
(
time
).
then
(()
=>
{
console
.
info
(
`Succeeded in setting time.`
);
}).
catch
((
error
)
=>
{
//捕获权限否定异常和非系统应用异常
console
.
info
(
`Failed to setting time. message:
${
error
.
message
}
, code:
${
error
.
code
}
`
);
});
}
catch
(
e
)
{
//捕获参数校验失败异常
console
.
info
(
`Failed to set time. message:
${
e
.
message
}
, code:
${
e
.
code
}
`
);
}
```
zh-cn/release-notes/changelogs/v3.2-beta5/changelogs-url.md
0 → 100644
浏览文件 @
c53b66ba
# 公共基础类库子系统JS API变更Changelog
OpenHarmony 3.2.10.1(Mr)版本相较于OpenHarmony 3.2.beta4版本,url子系统的API变更如下
## cl.commonlibrary.1.URLParams类接口变更
公共基础类库子系统url模块URLParams类构造函数存在变更:
constructor(init?: string
[][]
| Record
<string
,
string
>
| string | URLSearchParams) 改为 constructor(init?: string
[][]
| Record
<string
,
string
>
| string | URLParams);参数类型为原来的URLSearchParams类改为URLParams类。
开发者需要根据以下说明对应用进行适配。
**变更影响**
影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.url | URLParams | constructor(string
[][]
\|
Record
<
string, string
>
\|
string
\|
URLSearchParams) | 删除 |
| @ohos.url | URLParams | constructor(string
[][]
\|
Record
<
string, string
>
\|
string
\|
URLParams)| 变更
**适配指导**
应用中创建URLParams对象实例可参考下列代码
示例:
```
ts
import
url
from
'
@ohos.url
'
try
{
let
params1
=
new
Url
.
URLParams
(
'
?user=abc&query=xyz
'
)
let
params2
=
new
Url
.
URLParams
(
params1
)
var
result
=
params2
.
toString
()
console
.
log
(
result
)
//"user=abc&query=xyz"
}
catch
(
err
)
{
console
.
error
(
`Fail to ceate URLParams.codeis
${
err
.
code
}
,message is
${
err
.
message
}
`
);
}
```
## cl.commonlibrary.2.URL类属性变更url子系统URLParams类构造函数存在变更:
公共基础类库子系统url模块URL类属性存在变更:
废弃searchParams: URLSearchParams属性,新增params: URLParams属性
开发者需要根据以下说明对应用进行适配。
**变更影响**
影响API9版本的JS接口,应用需要进行适配才可以在新版本SDK环境正常实现功能。
**关键的接口/组件变更**
| 模块名 | 类名 | 方法/属性/枚举/常量 | 变更类型 |
| :------------------------ | ------------------- | ------------------------------------------------------------ | -------- |
| @ohos.url | URL | searchParams: URLSearchParams; |废弃版本:9
<br>
|
| @ohos.url | URL | params: URLParams; | 新增 |
**适配指导**
应用中创建URLParams对象实例可参考下列代码
示例:
```
ts
import
url
from
'
@ohos.url
'
let
that
=
new
Url
.
URL
(
'
http://username:password@host:8080/directory/file?你好=china#qwer=da
'
)
let
params
=
that
.
URLParams
var
result
=
params
.
toString
()
console
.
log
(
result
)
//%E4%BD%A0%E5%A5%BD=china
```
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录