Android 广播接收器会消耗电池寿命吗?

发布于 2024-10-09 15:44:57 字数 163 浏览 0 评论 0原文

我有两个接收器正在侦听 android.intent.action.BOOT_COMPLETEDandroid.intent.action.PACKAGE_REPLACED。我想知道它们导致我的手机消耗多少电池寿命,因为它们导致我的应用程序现在不断运行。

I have two receivers that are listening for android.intent.action.BOOT_COMPLETED and android.intent.action.PACKAGE_REPLACED. I was wondering how much battery life they are causing my phone to consume since they cause my app to constantly run now.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

写给空气的情书 2024-10-16 15:44:58

广播接收器本身不会直接消耗太多电池寿命。 BOOT_COMPLETED 发生一次; PACKAGE_REPLACED 仅在应用程序升级时发生。这些可能平均每天发生一次事件。

现在,如果这些广播接收器执行其他操作,例如启动服务,可能会对电池产生重大影响......但这是您的服务的问题,而不是接收器本身的问题。

The broadcast receivers themselves will not directly consume much battery life. BOOT_COMPLETED happens once; PACKAGE_REPLACED happens only on an application upgrade. Those probably average one event per day.

Now, if those broadcast receivers do other stuff, such as starting services, that may have significant battery implications...but that is a problem with your services, not with the receivers themselves.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文