• Home
Name Date Size #Lines LOC

..--

AppScope/12-May-2024-3633

entry/12-May-2024-1,030932

screenshots/device/12-May-2024-

.gitignoreD12-May-2024143 1211

README.mdD12-May-2024899 2211

README_zh.mdD12-May-20241.2 KiB3321

build-profile.json5D12-May-20241 KiB4341

hvigorfile.tsD12-May-2024158 21

package.jsonD12-May-2024374 1818

README.md

1# eTS Running Lock
2
3### Introduction
4
5This sample shows how to test the running lock that prevents the system from entering sleep mode. It uses the black and white wallpapers to simulate the screen-off and screen-on states.
6
7### Usage
8
91. Touch **Query support** to check whether the system supports the running lock.
10
112. Touch **Timing out screen 5s after**. The screen is turned off 5s later (simulated with a black wallpaper).
12
132. Enable the running lock. The system will be blocked from entering sleep mode. Five seconds after the setting, the screen will always on (simulated with a white wallpaper).
14
153. Disable the running lock. After 5 seconds, the screen turns off (simulated with a black wallpaper).
16
174. After the screen is turned off, touch any area on the screen to turn it on (simulated with a white wallpaper).
18
19### Constraints
20
21This sample can only be run on standard-system devices.
22

README_zh.md

1# 运行锁
2
3### 介绍
4
5本示例展示了阻止系统休眠的运行锁功能,通过黑白色壁纸模拟息屏、亮屏状态,来展示系统的休眠状态,从而对运行锁的功能进行测试,使得该运行锁在打开后可以阻止系统休眠。
6
7使用说明:
81. 先点击**查询系统是否支持休眠锁**按钮,反馈系统支持的结果。
92. 点击**5s后定时息屏**按钮,系统在5秒后可定时灭屏(黑色背景模拟)。
103. 打开锁开关,系统被阻止进入休眠状态,点击**5s后定时息屏**按钮,5秒后将会一直亮屏(白色背景模拟)。
114. 关闭锁开关,系统被禁止休眠状态解除,点击**5s后定时息屏**按钮,5秒后将会到点灭屏(黑色背景模拟)。
125. 待灭屏后,点击屏幕任意一处即可亮屏(白色背景模拟)。
13
14### 效果预览
15
16|主页|
17|----------|
18|![](screenshots/device/lockturn.png)|
19
20
21### 相关权限
22
23运行锁权限:ohos.permission.RUNNING_LOCK
24
25### 依赖
26
27不涉及。
28
29### 约束与限制
30
311.本示例仅支持在标准系统上运行;
322.本示例仅支持API9版本SDK,版本号:3.2.10.6;
333.本示例需要使用DevEco Studio 3.1 Canary1 (Build Version: 3.1.0.100)及以上才可编译运行。