Lawrence Law
Lawrence Law

Reputation: 41

How we can make sure we are allowed to use REQUEST_IGNORE_BATTERY_OPTIMIZATIONS permission

Our app is a location app that will run in background and report user’s locations to server so that his members can track them. In Android 6, because of the Automatic Battery Optimisation (Doze mode), our app couldn’t report user’s location to server because the Data Connection was disconnected. We found out that an app can actually make use of the permission REQUEST_IGNORE_BATTERY_OPTIMIZATIONS so that it can be whitelisted for battery optimization without user’s interaction. However, we are not sure if we are allowed to use that permission because there’s no clear definition on what kind of app can use it, and 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.

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

Upvotes: 4

Views: 3839

Answers (1)

Tim
Tim

Reputation: 43314

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

There is, found 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.

True, it has been reported multiple times. Google seems reluctant to allow apps to use this action, and thus you should not use it even if you think your app should be allowed to use it. Snippet from the blog:

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?

The only way to be sure would be to contact Google and ask them to review your app or something. Maybe if you can make a strong enough case for your app, they might allow it. But probably not.


I want to point out that being on the whitelist does nothing more than allowing your app to

  • request wake locks and
  • use the internet

during doze mode.


Alternatively, you can use an intent that leads the user to the whitelist settings and have them manually put your app on the whitelist.

Upvotes: 3

Related Questions