OpenHarmony 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.
The device must be equipped with a vibrator.
Hardware requirements:
Development board running the standard system, for example, the DAYU200 open source suite and connected to a vibrator
Environment requirements:
For details about the requirements on the Linux environment, see Quick Start.
The following uses the DAYU200 development board as an example to illustrate power-off vibration customization.
Write the custom power_vibrator.json
file by referring to the power_vibrator.json file in the default folder of battery vibrator configuration. For example:
{
"shutdown_diag": {
"enable": true,
"type": "haptic.long_press.heavy"
}
}
shutdown_diag: name of the vibration scenario, which cannot be changed.
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.
type: vibration type. The default value is haptic.long_press.heavy in the current mode.
Build the customized version by referring to Quick Start.
./build.sh --product-name rk3568 --ccache
Burn the customized version to the DAYU200 development board.
Press and hold the power button. The power-off dialog is displayed, and the device vibrates.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。