通过 shell (Android) 启用/禁用应用程序通知通道

问题描述 投票:0回答:0

我想在脚本/命令中为某些应用程序切换通知通道(不是通知访问)。搜索系统文件后,我找到了存储此设置的文件/data/system/notification_policy.xml。 文件看起来像

<channel id="ongoing_channel" name="Ongoing" desc="Low priority foreground service notifications" importance="0" sound="content://settings/system/notification_sound" usage="5" content_type="4" flags="0" locked="4" fgservice="true" />
<channel id="misc" name="Misc" desc="Miscellaneous" importance="3" sound="content://settings/system/notification_sound" usage="5" content_type="4" flags="0" show_badge="true" />
</package> ```

Tried to change value in file and after reboot it works, but command solution.
android shell settings android-notifications
© www.soinside.com 2019 - 2024. All rights reserved.