Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
24bb8ec5
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,发现更多精彩内容 >>
未验证
提交
24bb8ec5
编写于
3月 14, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 14, 2023
浏览文件
操作
浏览文件
下载
差异文件
!15951 【主题框架子系统】api接口变更changelog
Merge pull request !15951 from wangdongqi/master
上级
49083293
674e65c0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
894 addition
and
0 deletion
+894
-0
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-screenlock.md
.../changelogs/OpenHarmony_3.2.10.12/changelog-screenlock.md
+155
-0
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-wallpaper.md
...s/changelogs/OpenHarmony_3.2.10.12/changelog-wallpaper.md
+292
-0
zh-cn/release-notes/changelogs/OpenHarmony_4.0.5.3/changelog-screenlock.md
...es/changelogs/OpenHarmony_4.0.5.3/changelog-screenlock.md
+155
-0
zh-cn/release-notes/changelogs/OpenHarmony_4.0.5.3/changelog-wallpaper.md
...tes/changelogs/OpenHarmony_4.0.5.3/changelog-wallpaper.md
+292
-0
未找到文件。
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-screenlock.md
0 → 100644
浏览文件 @
24bb8ec5
# 主题框架子系统-锁屏管理服务ChangeLog
## cl.screenlock.1 isLocked、unlock接口使用权限变更
从API9开始,变更为systemapi,停止对三方应用开放。
开发者需要根据以下说明对应用进行适配。
**变更影响**
基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。
-
涉及接口
```
js
function
isLocked
():
boolean
;
function
unlock
(
callback
:
AsyncCallback
<
boolean
>
):
void
;
function
unlock
():
Promise
<
boolean
>
;
```
-
变更前:
```
js
*
Checks
whether
the
screen
is
currently
locked
.
*
*
@
returns
Returns
{@
code
true
}
if
the
screen
is
currently
locked
;
returns
{@
code
false
}
otherwise
.
*
@
syscap
SystemCapability
.
MiscServices
.
ScreenLock
*
@
since
9
*
/
function
isLocked
():
boolean
;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function
unlock
(
callback
:
AsyncCallback
<
boolean
>
):
void
;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function
unlock
():
Promise
<
boolean
>
;
```
-
变更后:
```
js
*
Checks
whether
the
screen
is
currently
locked
.
*
*
@
returns
Returns
{@
code
true
}
if
the
screen
is
currently
locked
;
returns
{@
code
false
}
otherwise
.
*
@
throws
{
BusinessError
}
202
-
permission
verification
failed
,
application
which
is
not
a
system
application
uses
system
API
.
*
@
syscap
SystemCapability
.
MiscServices
.
ScreenLock
*
@
systemapi
Hide
this
for
inner
system
use
.
*
@
since
9
*
/
function
isLocked
():
boolean
;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function
unlock
(
callback
:
AsyncCallback
<
boolean
>
):
void
;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function
unlock
():
Promise
<
boolean
>
;
```
**适配指导**
该接口变更为系统应用后,三方应用已无法使用。
系统应用可正常使用。
示例代码如下:
```
js
try
{
let
ret
=
screenLock
.
isLocked
();
console
.
error
(
`Obtain whether the screen is locked successfully , ret is:
${
ret
}
`
);
}
catch
(
error
)
{
console
.
error
(
`Failed to obtain whether the screen is locked, error is :
${
error
.
code
}
,
${
error
.
message
}
`
);
}
```
```
js
screenlock
.
unlock
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to unlock the screen, because:
${
err
.
message
}
`
);
return
;
}
console
.
info
(
`unlock the screen successfully. result:
${
data
}
`
);
});
```
```
js
screenlock
.
unlock
().
then
((
data
)
=>
{
console
.
info
(
`unlock the screen successfully. result:
${
data
}
`
);
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to unlock the screen, because:
${
err
.
message
}
`
);
});
```
## cl.screenlock.2 isSecure接口废弃变更
从API9开始,废弃此接口。
开发者需要根据以下说明对应用进行适配。
**变更影响**
该接口删除无法再使用,请使用进行更新使用,否则会影响原有功能。
-
涉及接口
```
js
function
isSecure
():
boolean
;
```
-
变更前:
```
js
function
isSecure
():
boolean
;
```
-
变更后:删除接口,停止对外开放。
**适配指导**
该接口删除后无法再使用,请适配更新。
zh-cn/release-notes/changelogs/OpenHarmony_3.2.10.12/changelog-wallpaper.md
0 → 100644
浏览文件 @
24bb8ec5
# 主题框架子系统-壁纸管理服务ChangeLog
## cl.wallpaper.1 getColorsSync、getMinHeightSync、getMinWidthSync、restore、setImage接口使用权限变更
从API9开始,变更为systemapi,停止对三方应用开放。
开发者需要根据以下说明对应用进行适配。
**变更影响**
基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。
-
涉及接口
```
js
function
getColorsSync
(
wallpaperType
:
WallpaperType
):
Array
<
RgbaColor
>
;
function
getMinHeightSync
():
number
;
function
getMinWidthSync
():
number
;
function
restore
(
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
function
restore
(
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
```
-
变更前:
```
js
/**
* Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
* @param wallpaperType Indicates the wallpaper type.
* @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
getColorsSync
(
wallpaperType
:
WallpaperType
):
Array
<
RgbaColor
>
;
/**
* Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
getMinHeightSync
():
number
;
/**
* Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
getMinWidthSync
():
number
;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
restore
(
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
restore
(
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
```
-
变更后:
```
js
/**
* Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
* @param wallpaperType Indicates the wallpaper type.
* @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
* @throws {BusinessError} 401 - parameter error.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
getColorsSync
(
wallpaperType
:
WallpaperType
):
Array
<
RgbaColor
>
;
/**
* Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
getMinHeightSync
():
number
;
/**
* Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
getMinWidthSync
():
number
;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
restore
(
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
restore
(
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
```
**适配指导**
该接口变更为系统应用后,三方应用已无法使用。
系统应用可正常使用。
示例代码如下:
```
js
try
{
let
colors
=
wallpaper
.
getColorsSync
(
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
);
console
.
log
(
`success to getColorsSync:
${
JSON
.
stringify
(
colors
)}
`
);
}
catch
(
error
)
{
console
.
error
(
`failed to getColorsSync because:
${
JSON
.
stringify
(
error
)}
`
);
}
```
```
js
let
minHeight
=
wallpaper
.
getMinHeightSync
();
```
```
js
let
minWidth
=
wallpaper
.
getMinWidthSync
();
```
```
js
wallpaper
.
restore
(
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
,
(
error
)
=>
{
if
(
error
)
{
console
.
error
(
`failed to restore because:
${
JSON
.
stringify
(
error
)}
`
);
return
;
}
console
.
log
(
`success to restore.`
);
});
```
```
js
wallpaper
.
restore
(
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
).
then
(()
=>
{
console
.
log
(
`success to restore.`
);
}).
catch
((
error
)
=>
{
console
.
error
(
`failed to restore because:
${
JSON
.
stringify
(
error
)}
`
);
});
```
```
js
// source类型为string
let
wallpaperPath
=
"
/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg
"
;
wallpaper
.
setImage
(
wallpaperPath
,
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
,
(
error
)
=>
{
if
(
error
)
{
console
.
error
(
`failed to setImage because:
${
JSON
.
stringify
(
error
)}
`
);
return
;
}
console
.
log
(
`success to setImage.`
);
});
```
```
js
// source类型为string
let
wallpaperPath
=
"
/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg
"
;
wallpaper
.
setImage
(
wallpaperPath
,
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
).
then
(()
=>
{
console
.
log
(
`success to setImage.`
);
}).
catch
((
error
)
=>
{
console
.
error
(
`failed to setImage because:
${
JSON
.
stringify
(
error
)}
`
);
});
```
## cl.wallpaper.2 getIdSync、getFileSync、isChangeAllowed、isUserChangeAllowed、on、off接口废弃变更
从API9开始,废弃此接口。
开发者需要根据以下说明对应用进行适配。
**变更影响**
该接口删除无法再使用,请使用进行更新使用,否则会影响原有功能。
-
涉及接口
```
js
function
getIdSync
(
wallpaperType
:
WallpaperType
):
number
;
function
getFileSync
(
wallpaperType
:
WallpaperType
):
number
;
function
isChangeAllowed
():
boolean
;
function
isUserChangeAllowed
():
boolean
;
function
on
(
type
:
'
colorChange
'
,
callback
:
(
colors
:
Array
<
RgbaColor
>
,
wallpaperType
:
WallpaperType
)
=>
void
):
void
;
function
off
(
type
:
'
colorChange
'
,
callback
?:
(
colors
:
Array
<
RgbaColor
>
,
wallpaperType
:
WallpaperType
)
=>
void
):
void
;
```
-
变更前:
```
js
function
getIdSync
(
wallpaperType
:
WallpaperType
):
number
;
function
getFileSync
(
wallpaperType
:
WallpaperType
):
number
;
function
isChangeAllowed
():
boolean
;
function
isUserChangeAllowed
():
boolean
;
function
on
(
type
:
'
colorChange
'
,
callback
:
(
colors
:
Array
<
RgbaColor
>
,
wallpaperType
:
WallpaperType
)
=>
void
):
void
;
function
off
(
type
:
'
colorChange
'
,
callback
?:
(
colors
:
Array
<
RgbaColor
>
,
wallpaperType
:
WallpaperType
)
=>
void
):
void
;
```
-
变更后:删除接口,停止对外开放。
**适配指导**
该接口删除后无法再使用,请适配更新。
zh-cn/release-notes/changelogs/OpenHarmony_4.0.5.3/changelog-screenlock.md
0 → 100644
浏览文件 @
24bb8ec5
# 主题框架子系统-锁屏管理服务ChangeLog
## cl.screenlock.1 isLocked、unlock接口使用权限变更
从API9开始,变更为systemapi,停止对三方应用开放。
开发者需要根据以下说明对应用进行适配。
**变更影响**
基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。
-
涉及接口
```
js
function
isLocked
():
boolean
;
function
unlock
(
callback
:
AsyncCallback
<
boolean
>
):
void
;
function
unlock
():
Promise
<
boolean
>
;
```
-
变更前:
```
js
*
Checks
whether
the
screen
is
currently
locked
.
*
*
@
returns
Returns
{@
code
true
}
if
the
screen
is
currently
locked
;
returns
{@
code
false
}
otherwise
.
*
@
syscap
SystemCapability
.
MiscServices
.
ScreenLock
*
@
since
9
*
/
function
isLocked
():
boolean
;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function
unlock
(
callback
:
AsyncCallback
<
boolean
>
):
void
;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @systemapi Hide this for inner system use.
* @since 9
*/
function
unlock
():
Promise
<
boolean
>
;
```
-
变更后:
```
js
*
Checks
whether
the
screen
is
currently
locked
.
*
*
@
returns
Returns
{@
code
true
}
if
the
screen
is
currently
locked
;
returns
{@
code
false
}
otherwise
.
*
@
throws
{
BusinessError
}
202
-
permission
verification
failed
,
application
which
is
not
a
system
application
uses
system
API
.
*
@
syscap
SystemCapability
.
MiscServices
.
ScreenLock
*
@
systemapi
Hide
this
for
inner
system
use
.
*
@
since
9
*
/
function
isLocked
():
boolean
;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function
unlock
(
callback
:
AsyncCallback
<
boolean
>
):
void
;
/**
* Unlock the screen.
*
* @returns Returns {@code true} if the screen is unlocked successfully; returns {@code false} otherwise.
* @throws {BusinessError} 13200002 - the screenlock management service is abnormal.
* @syscap SystemCapability.MiscServices.ScreenLock
* @since 9
*/
function
unlock
():
Promise
<
boolean
>
;
```
**适配指导**
该接口变更为系统应用后,三方应用已无法使用。
系统应用可正常使用。
示例代码如下:
```
js
try
{
let
ret
=
screenLock
.
isLocked
();
console
.
error
(
`Obtain whether the screen is locked successfully , ret is:
${
ret
}
`
);
}
catch
(
error
)
{
console
.
error
(
`Failed to obtain whether the screen is locked, error is :
${
error
.
code
}
,
${
error
.
message
}
`
);
}
```
```
js
screenlock
.
unlock
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
`Failed to unlock the screen, because:
${
err
.
message
}
`
);
return
;
}
console
.
info
(
`unlock the screen successfully. result:
${
data
}
`
);
});
```
```
js
screenlock
.
unlock
().
then
((
data
)
=>
{
console
.
info
(
`unlock the screen successfully. result:
${
data
}
`
);
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to unlock the screen, because:
${
err
.
message
}
`
);
});
```
## cl.screenlock.2 isSecure接口废弃变更
从API9开始,废弃此接口。
开发者需要根据以下说明对应用进行适配。
**变更影响**
该接口删除无法再使用,请使用进行更新使用,否则会影响原有功能。
-
涉及接口
```
js
function
isSecure
():
boolean
;
```
-
变更前:
```
js
function
isSecure
():
boolean
;
```
-
变更后:删除接口,停止对外开放。
**适配指导**
该接口删除后无法再使用,请适配更新。
zh-cn/release-notes/changelogs/OpenHarmony_4.0.5.3/changelog-wallpaper.md
0 → 100644
浏览文件 @
24bb8ec5
# 主题框架子系统-壁纸管理服务ChangeLog
## cl.wallpaper.1 getColorsSync、getMinHeightSync、getMinWidthSync、restore、setImage接口使用权限变更
从API9开始,变更为systemapi,停止对三方应用开放。
开发者需要根据以下说明对应用进行适配。
**变更影响**
基于此前版本开发的应用,需适配变更的js接口,变更前的接口已经不能正常使用了,否则会影响原有功能。
-
涉及接口
```
js
function
getColorsSync
(
wallpaperType
:
WallpaperType
):
Array
<
RgbaColor
>
;
function
getMinHeightSync
():
number
;
function
getMinWidthSync
():
number
;
function
restore
(
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
function
restore
(
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
```
-
变更前:
```
js
/**
* Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
* @param wallpaperType Indicates the wallpaper type.
* @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
getColorsSync
(
wallpaperType
:
WallpaperType
):
Array
<
RgbaColor
>
;
/**
* Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
getMinHeightSync
():
number
;
/**
* Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
getMinWidthSync
():
number
;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
restore
(
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
restore
(
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 202 - permission verification failed, application which is not a system application uses system API.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @systemapi Hide this for inner system use.
* @since 9
*/
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
```
-
变更后:
```
js
/**
* Obtains the wallpaper colors for the wallpaper of the specified type. Returns rgbaColor type of array callback function.
* @param wallpaperType Indicates the wallpaper type.
* @returns { Array<RgbaColor> } the Array<RgbaColor> returned by the function.
* @throws {BusinessError} 401 - parameter error.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
getColorsSync
(
wallpaperType
:
WallpaperType
):
Array
<
RgbaColor
>
;
/**
* Obtains the minimum height of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
getMinHeightSync
():
number
;
/**
* Obtains the minimum width of the wallpaper. in pixels. returns 0 if no wallpaper has been set.
* @returns { number } the number returned by the function.
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
getMinWidthSync
():
number
;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
restore
(
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
/**
* Removes a wallpaper of the specified type and restores the default one.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
restore
(
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
,
callback
:
AsyncCallback
<
void
>
):
void
;
/**
* Sets a wallpaper of the specified type based on the uri path from a JPEG or PNG file or the pixel map of a PNG file.
* @param source Indicates the uri path from a JPEG or PNG file or the pixel map of the PNG file.
* @param wallpaperType Indicates the wallpaper type.
* @throws {BusinessError} 401 - parameter error.
* @throws {BusinessError} 201 - permission denied.
* @permission ohos.permission.SET_WALLPAPER
* @syscap SystemCapability.MiscServices.Wallpaper
* @since 9
*/
function
setImage
(
source
:
string
|
image
.
PixelMap
,
wallpaperType
:
WallpaperType
):
Promise
<
void
>
;
```
**适配指导**
该接口变更为系统应用后,三方应用已无法使用。
系统应用可正常使用。
示例代码如下:
```
js
try
{
let
colors
=
wallpaper
.
getColorsSync
(
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
);
console
.
log
(
`success to getColorsSync:
${
JSON
.
stringify
(
colors
)}
`
);
}
catch
(
error
)
{
console
.
error
(
`failed to getColorsSync because:
${
JSON
.
stringify
(
error
)}
`
);
}
```
```
js
let
minHeight
=
wallpaper
.
getMinHeightSync
();
```
```
js
let
minWidth
=
wallpaper
.
getMinWidthSync
();
```
```
js
wallpaper
.
restore
(
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
,
(
error
)
=>
{
if
(
error
)
{
console
.
error
(
`failed to restore because:
${
JSON
.
stringify
(
error
)}
`
);
return
;
}
console
.
log
(
`success to restore.`
);
});
```
```
js
wallpaper
.
restore
(
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
).
then
(()
=>
{
console
.
log
(
`success to restore.`
);
}).
catch
((
error
)
=>
{
console
.
error
(
`failed to restore because:
${
JSON
.
stringify
(
error
)}
`
);
});
```
```
js
// source类型为string
let
wallpaperPath
=
"
/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg
"
;
wallpaper
.
setImage
(
wallpaperPath
,
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
,
(
error
)
=>
{
if
(
error
)
{
console
.
error
(
`failed to setImage because:
${
JSON
.
stringify
(
error
)}
`
);
return
;
}
console
.
log
(
`success to setImage.`
);
});
```
```
js
// source类型为string
let
wallpaperPath
=
"
/data/data/ohos.acts.aafwk.plrdtest.form/files/Cup_ic.jpg
"
;
wallpaper
.
setImage
(
wallpaperPath
,
wallpaper
.
WallpaperType
.
WALLPAPER_SYSTEM
).
then
(()
=>
{
console
.
log
(
`success to setImage.`
);
}).
catch
((
error
)
=>
{
console
.
error
(
`failed to setImage because:
${
JSON
.
stringify
(
error
)}
`
);
});
```
## cl.wallpaper.2 getIdSync、getFileSync、isChangeAllowed、isUserChangeAllowed、on、off接口废弃变更
从API9开始,废弃此接口。
开发者需要根据以下说明对应用进行适配。
**变更影响**
该接口删除无法再使用,请使用进行更新使用,否则会影响原有功能。
-
涉及接口
```
js
function
getIdSync
(
wallpaperType
:
WallpaperType
):
number
;
function
getFileSync
(
wallpaperType
:
WallpaperType
):
number
;
function
isChangeAllowed
():
boolean
;
function
isUserChangeAllowed
():
boolean
;
function
on
(
type
:
'
colorChange
'
,
callback
:
(
colors
:
Array
<
RgbaColor
>
,
wallpaperType
:
WallpaperType
)
=>
void
):
void
;
function
off
(
type
:
'
colorChange
'
,
callback
?:
(
colors
:
Array
<
RgbaColor
>
,
wallpaperType
:
WallpaperType
)
=>
void
):
void
;
```
-
变更前:
```
js
function
getIdSync
(
wallpaperType
:
WallpaperType
):
number
;
function
getFileSync
(
wallpaperType
:
WallpaperType
):
number
;
function
isChangeAllowed
():
boolean
;
function
isUserChangeAllowed
():
boolean
;
function
on
(
type
:
'
colorChange
'
,
callback
:
(
colors
:
Array
<
RgbaColor
>
,
wallpaperType
:
WallpaperType
)
=>
void
):
void
;
function
off
(
type
:
'
colorChange
'
,
callback
?:
(
colors
:
Array
<
RgbaColor
>
,
wallpaperType
:
WallpaperType
)
=>
void
):
void
;
```
-
变更后:删除接口,停止对外开放。
**适配指导**
该接口删除后无法再使用,请适配更新。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录