@@ -70,26 +72,6 @@ Checks whether the screen is locked.
letisLocked=screenlock.isLocked();
```
## screenlock.isSecure<sup>9+</sup>
isSecure(): boolean
Checks whether the device is in secure mode. When the device is in secure mode, its screen requires a password, unlock pattern, or other user credentials to unlock.
| parameter | number | Yes | Result.<br>- **0**: The operation is successful. For example, the screen is locked or unlocked successfully.<br>- **1**, the operation fails. For example, screen locking or unlocking fails.<br>- **2**: The operation is canceled. For example, screen locking or unlocking is canceled.|
**Return value**
...
...
@@ -302,7 +288,7 @@ Checks whether the screen is locked. This API uses an asynchronous callback to r
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [screenlock.isLocked<sup>9+</sup>](#screenlockislocked9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -332,7 +318,7 @@ Checks whether the screen is locked. This API uses a promise to return the resul
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [screenlock.isLocked<sup>9+</sup>](#screenlockislocked9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -360,7 +346,7 @@ Checks whether the device is in secure mode. When the device is in secure mode,
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [screenlock.isSecure<sup>9+</sup>](#screenlockissecure9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -390,7 +376,7 @@ Checks whether the device is in secure mode. When the device is in secure mode,
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [screenlock.isSecure<sup>9+</sup>](#screenlockissecure9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -417,7 +403,7 @@ Unlocks the screen. This API uses an asynchronous callback to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [screenlock.unlock<sup>9+</sup>](#screenlockunlock9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -447,7 +433,7 @@ Unlocks the screen. This API uses a promise to return the result.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [screenlock.unlock<sup>9+</sup>](#screenlockunlock9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
The **wallpaper** module is a system service module in OpenHarmony that provides the wallpaper management service. You can use the APIs of this module to show, set, and switch between wallpapers.
...
...
@@ -14,7 +14,7 @@ The **wallpaper** module is a system service module in OpenHarmony that provides
importwallpaperfrom'@ohos.wallpaper';
```
## WallpaperType
## WallpaperType<sup>7+</sup>
Enumerates the wallpaper types.
...
...
@@ -26,12 +26,14 @@ Enumerates the wallpaper types.
| number | ID of the wallpaper. If this type of wallpaper is configured, a number greater than or equal to **0** is returned. Otherwise, **-1** is returned. The value ranges from -1 to (2^31-1).|
| boolean | Whether to allow the application to change the wallpaper for the current user. The value **true** means that the operation is allowed, and **false** means the opposite.|
**Example**
```js
letisChangeAllowed=wallpaper.isChangeAllowed();
```
## wallpaper.isUserChangeAllowed<sup>9+</sup>
isUserChangeAllowed(): boolean
Checks whether the user is allowed to set wallpapers.
| number | Promise used to return the result. If the operation is successful, the file descriptor ID to the wallpaper is returned. Otherwise, error information is returned.|
@@ -527,7 +447,7 @@ Obtains the main color information of the wallpaper of the specified type. This
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getColorsSync<sup>9+</sup>](#wallpapergetcolorssync9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -558,7 +478,7 @@ Obtains the main color information of the wallpaper of the specified type. This
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getColorsSync<sup>9+</sup>](#wallpapergetcolorssync9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -592,7 +512,7 @@ Obtains the ID of the wallpaper of the specified type. This API uses an asynchro
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getIdSync<sup>9+</sup>](#wallpapergetidsync9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -623,7 +543,7 @@ Obtains the ID of the wallpaper of the specified type. This API uses a promise t
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getIdSync<sup>9+</sup>](#wallpapergetidsync9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -657,7 +577,7 @@ Obtains the minimum height of this wallpaper. This API uses an asynchronous call
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getMinHeightSync<sup>9+</sup>](#wallpapergetminheightsync9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -687,7 +607,7 @@ Obtains the minimum height of this wallpaper. This API uses a promise to return
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getMinHeightSync<sup>9+</sup>](#wallpapergetminheightsync9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -715,7 +635,7 @@ Obtains the minimum width of this wallpaper. This API uses an asynchronous callb
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getMinWidthSync<sup>9+</sup>](#wallpapergetminwidthsync9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -745,7 +665,7 @@ Obtains the minimum width of this wallpaper. This API uses a promise to return t
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getMinWidthSync<sup>9+</sup>](#wallpapergetminwidthsync9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -773,7 +693,7 @@ Checks whether to allow the application to change the wallpaper for the current
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.isChangeAllowed<sup>9+</sup>](#wallpaperischangeallowed9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -803,7 +723,7 @@ Checks whether to allow the application to change the wallpaper for the current
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.isChangeAllowed<sup>9+</sup>](#wallpaperischangeallowed9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -831,7 +751,7 @@ Checks whether the user is allowed to set wallpapers. This API uses an asynchron
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.isUserChangeAllowed<sup>9+</sup>](#wallpaperisuserchangeallowed9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -861,7 +781,7 @@ Checks whether the user is allowed to set wallpapers. This API uses a promise to
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.isUserChangeAllowed<sup>9+</sup>](#wallpaperisuserchangeallowed9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -889,7 +809,7 @@ Resets the wallpaper of the specified type to the default wallpaper. This API us
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.restore<sup>9+</sup>](#wallpaperrestore9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -922,7 +842,7 @@ Resets the wallpaper of the specified type to the default wallpaper. This API us
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.restore<sup>9+</sup>](#wallpaperrestore9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -958,7 +878,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses an a
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.setImage<sup>9+</sup>](#wallpapersetimage9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -1015,7 +935,7 @@ Sets a specified source as the wallpaper of a specified type. This API uses a pr
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.setImage<sup>9+</sup>](#wallpapersetimage9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -1074,7 +994,7 @@ Obtains the wallpaper of the specified type. This API uses an asynchronous callb
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [wallpaper.getFileSync<sup>9+</sup>](#wallpapergetfilesync9) instead.
> This API is supported since API version 8 and deprecated since API version 9.
@@ -1107,7 +1027,7 @@ Obtains the wallpaper of the specified type. This API uses a promise to return t
> **NOTE**
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [wallpaper.getFileSync<sup>9+</sup>](#wallpapergetfilesync9) instead.
> This API is supported since API version 8 and deprecated since API version 9.
@@ -1143,7 +1063,7 @@ Obtains the pixel map for the wallpaper of the specified type. This API uses an
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getImage<sup>9+</sup>](#wallpapergetimage9) instead.
> This API is supported since API version 7 and deprecated since API version 9.
@@ -1178,7 +1098,7 @@ Obtains the pixel map for the wallpaper of the specified type. This API uses a p
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [wallpaper.getImage<sup>9+</sup>](#wallpapergetimage9) instead.
> This API is supported since API version 7 and deprecated since API version 9.