Don Box
Don Box

Reputation: 3336

After calling ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS app is still optimized

I am calling the Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS intent as described in https://commonsware.com/blog/2015/11/11/google-anti-trust-issues.html

The dialog is fired and I choose YES. But if I go to "Battery optimization" setting, the app is not in the list, it doesn't seem that the battery optimization was disabled for the app (the list displays by default the "Not optimized" apps):

enter image description here

And if I choose "All apps" from the drop-down, I can see the app in the list and it has "Optimizing battery use".

I am confused. After choosing "YES" in the dialog showed by Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS shouldn't the battery optimization be disabled for the app?

I am on Android 6, Samsung Galaxy A5 (2016).

Also, what's strange is that the isIgnoringBatteryOptimizations is returning true. How come this returns true but the app is not the "Not optimized" list?

Upvotes: 1

Views: 620

Answers (1)

Don Box
Don Box

Reputation: 3336

Per's @CommonsWare answer (isn't he awesome?) in the comments, it actually looks like Settings app has a refresh issue. It doesn't refresh the status accordingly. I must swipe app off screen and restart it to see updated status.

Upvotes: 1

Related Questions