使用 ADB Shell 关闭应用程序的通知类别

发布于 2025-01-15 07:39:31 字数 897 浏览 0 评论 0 原文

我正在编写一个 shell 脚本,用于关闭特定应用程序的通知类别。某些内置应用程序不允许在没有root访问权限的情况下关闭某些通知。例如,com.google.android.dialer 不允许关闭 Google Play 服务可用性。我希望这可以通过 adb shell 来完成。

首先,我尝试了这个命令:

$ adb shell dumpsys notification | egrep Phone
  mDefaultPhoneApp=ComponentInfo{com.google.android.dialer/com.android.incallui.InCallServiceImpl}

如果我过滤phone

$ adb shell dumpsys notification | egrep phone
  NotificationChannel{mId='phone_ongoing_call', ...}
  NotificationChannel{mId='phone_incoming_call', ...}
  NotificationChannel{mId='phone_low_priority', ...}
  NotificationChannel{mId='phone_voicemail_account', ...}
  NotificationChannel{mId='phone_missed_call', ...}
  NotificationChannel{mId='phone_default', ...}

那么是否有任何命令可以通过adb shell禁用/启用应用程序的特定通知?

I'm writing a shell script that turns off a notification category from specific applications. some built-in apps doesn't allow to turn off some of their notification without root access. for example com.google.android.dialer doesn't allow to turn off Google Play service availability. I hope this can do via adb shell.

first, I tried this command:

$ adb shell dumpsys notification | egrep Phone
  mDefaultPhoneApp=ComponentInfo{com.google.android.dialer/com.android.incallui.InCallServiceImpl}

and if I filter phone:

$ adb shell dumpsys notification | egrep phone
  NotificationChannel{mId='phone_ongoing_call', ...}
  NotificationChannel{mId='phone_incoming_call', ...}
  NotificationChannel{mId='phone_low_priority', ...}
  NotificationChannel{mId='phone_voicemail_account', ...}
  NotificationChannel{mId='phone_missed_call', ...}
  NotificationChannel{mId='phone_default', ...}

So is there any command for disable/enable specific notification for a application via adb shell?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文