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
8
9### 相关概念
10
11运行锁:该模块主要提供Runninglock锁相关操作的接口,包括创建、查询、持锁、释放锁等操作。
12
13### 相关权限
14
15运行锁权限:ohos.permission.RUNNING_LOCK
16
17### 使用说明
18
191.先点击**查询系统是否支持休眠锁**按钮,反馈系统支持的结果。
20
212.点击**5s后定时息屏**按钮,系统在5秒后可定时灭屏(黑色背景模拟)。
22
233.打开锁开关,系统被阻止进入休眠状态,点击**5s后定时息屏**按钮,5秒后将会一直亮屏(白色背景模拟)。
24
254.关闭锁开关,系统被禁止休眠状态解除,点击**5s后定时息屏**按钮,5秒后将会到点灭屏(黑色背景模拟)。
26
275.待灭屏后,点击屏幕任意一处即可亮屏(白色背景模拟)。
28
29### 约束与限制
30
311.本示例仅支持在标准系统上运行。
32
332.本示例需要使用DevEco Studio 3.0 Beta4 (Build Version: 3.0.0.992, built on July 14, 2022)才可编译运行。