1# Power Vibrator Customization
2
3## Overview
4
5### Introduction
6
7OpenHarmony provides the vibrator customization function for the power service. Specifically, you can modify the vibrator configuration file of the power service so that vibration is triggered when the dialog for device power-off is displayed.
8
9### Basic Concepts
10
11### Constraints
12
13The device must be equipped with a vibrator.
14
15## How to Develop
16
17### Setting Up the Environment
18
19**Hardware requirements:**
20
21Development board running the standard system, for example, the DAYU200 open source suite and connected to a vibrator
22
23**Environment requirements:**
24
25For details about the requirements on the Linux environment, see [Quick Start](../quick-start/quickstart-overview.md).
26
27### Getting Started with Development
28
29The following uses the DAYU200 development board as an example to illustrate power-off vibration customization.
30
311. Write the custom `power_vibrator.json` file by referring to the [power_vibrator.json](https://gitee.com/openharmony/powermgr_power_manager/blob/master/services/native/profile/power_vibrator.json) file in the default folder of battery vibrator configuration. For example:
32
33    ```json
34    {
35    "shutdown_diag": {
36        "enable": true,
37        "type": "haptic.long_press.heavy"
38        }
39    }
40    ```
41    - **shutdown_diag**: name of the vibration scenario, which cannot be changed.
42
43    - **enable**: whether to enable vibration. The value **true** indicates that vibration is enabled, and the value **false** indicates the opposite. The default value is **false**.
44
45    - **type**: vibration type. The default value is **haptic.long_press.heavy** in the current mode.
46
472. Build the customized version by referring to [Quick Start](../quick-start/quickstart-overview.md).
48
49    ```shell
50    ./build.sh --product-name rk3568 --ccache
51    ```
52
533. Burn the customized version to the DAYU200 development board.
54
55### Commissioning and Verification
56
57Press and hold the power button. The power-off dialog is displayed, and the device vibrates.
58
59## Reference
60
61[Default Power-off Vibration Configuration](https://gitee.com/openharmony/powermgr_power_manager/blob/master/services/native/profile/power_vibrator.json)
62