android - 我们如何确保我们被允许使用 REQUEST_IGNORE_BATTERY_OPTIMIZATIONS 权限

标签 android permissions

我们的应用程序是一个定位应用程序,它将在后台运行并向服务器报告用户的位置,以便他的成员可以跟踪他们。 在 Android 6 中,由于自动电池优化(打盹模式),我们的应用无法将用户位置报告给服务器,因为数据连接已断开。 我们发现应用程序实际上可以利用权限 REQUEST_IGNORE_BATTERY_OPTIMIZATIONS,这样它就可以在没有用户交互的情况下被列入电池优化白名单。 然而,我们不确定我们是否被允许使用该权限,因为对于什么样的应用程序可以使用它没有明确的定义,并且在开发者论坛中,我们看到一些开发者发帖说他们的应用程序已从 Play Store 中删除,因为谷歌认为他们应用没有资格使用该权限。

我们如何确保我们被允许使用此权限?

最佳答案

there’s no clear definition on what kind of app can use it

有,找到here .

in developer forum, we read some developers posting that their apps got removed from Play Store because Google thinks their app are not eligible to use the permission.

是的,它已被多次报告。 Google seems reluctant to allow apps to use this action ,因此即使您认为应该允许您的应用程序使用它,您也不应该使用它。 博客 fragment :

However, it is Google’s opinion of what “the core function of the app” is that matters. Not the user. Not the developer. Google. The user and developer might be in perfect harmony over what adding the app to the whitelist means, but if Google thinks that it is not warranted, Google sets themselves up as being more important than the user and bans the app.


How can we make sure we are allowed to use this permission?

唯一可以确定的方法是联系 Google 并请他们审核您的应用或其他内容。也许如果您可以为您的应用程序提供足够强大的案例,他们可能会允许。但可能不会。


我想指出的是,列入白名单只不过是允许您的应用

  • 请求唤醒锁和
  • 使用互联网

在打瞌睡模式期间。


或者,您可以使用将用户引导至白名单设置的 Intent ,并让他们手动将您的应用放入白名单。

关于android - 我们如何确保我们被允许使用 REQUEST_IGNORE_BATTERY_OPTIMIZATIONS 权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39787886/

相关文章:

apache - 授予 ubuntu 访问 www-data 的权限

android - 安装下载的 apk

android - java.lang.SecurityException : Permission Denial: opening provider com. estrongs.android.pop.app.FileContentProvider 问题

android - 如何为无法选择的微调器设置标题..?

permissions - 开 Jest mock Expo TypeError : Cannot read property 'askAsync' of undefined的权限

java - RxJava - 检查条件并仅在条件为真时重复一次

android - 减少android中gridlayout的行/列数

python - Conda 软件包安装 [Errno 13] 安装 conda-forge::protobuf-3.8.0 时权限被拒绝

android - 如何在 fragment 中保存状态

android - Qt5安卓应用