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