如何知道应用程序的后台服务何时被android中的其他超级访问应用程序阻止

时间:2016-10-25 12:28:39

标签: android service background-process

我的应用程序在后台data synchronization中执行service,这是应用程序的严重任务,以便正常工作。现在,应用程序运行良好&预期在一些具有纯Android或接近纯Android ROM的设备中。例如 Google Nexus Android One & 摩托罗拉设备。但是,某些设备(如 Redmi MIUI )内置了阻止应用程序后台进程的选项。这导致我的应用程序工作不正常。所以,我想知道"有没有办法找出我的后台进程被阻止?这样我就可以通知用户取消阻止它。"

here's一个有点相关的问题

这里有一些与此相关的截图。

enter image description here enter image description here

欢迎任何建议或帮助。

提前致谢

1 个答案:

答案 0 :(得分:1)

据我所知,应用无法获取有关是否在白名单中的信息,但您可以通过以下方式通知用户: Intent intent = new Intent(); intent.setAction(" miui.intent.action.OP_AUTO_START&#34); intent.addCategory(Intent.CATEGORY_DEFAULT);