Disabling or detecting the app specific power saving mode
Asked Answered
N

1

16

Samsung devices (well, at least some of them) add all installed apps to an "App Power Saving Mode" list which affects the background services listening to some crucial info for the app.

Some apps, somehow, disable this mode after installation without any extra steps. Comments on Programmatically disable app power saving mode on Samsung thread suggest that apps like Facebook and WhatsApp might be in the OS whitelist but I've seen apps that are not as popular doing the same. Any idea how to achieve this?

I've tried using ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS intent but no success. PowerManager#isIgnoringBatteryOptimizations starts returning true but neither App Power Saving Mode nor the thing in Battery Saver Settings is disabled for the app.

If you think the only way is to contact Samsung to whitelist the app, where's the best place to do so?

Also, if there's no way to disable App Power Saving Mode programmatically, is there a way to detect if it's enabled for the app so that I can open the app and ask the user to disable it?

Necrophobia answered 18/1, 2017 at 14:53 Comment(1)
Any news on this? We have the same problem...Fluorinate
P
0

Hi there are two power save modes:

  • the regular android Doze mode,

  • and the custom "Power save mode.

For doze mode the action:

Intent intent = new Intent(); intent.setAction((Settings.ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS); intent.setData(Uri.parse("package:" + packageName))

and start the intent.

But for custom power save modes (especially Huawei and some others) you have to start custom power save modes intents based on vendor. The list is here: https://mcmap.net/q/358885/-how-to-start-power-manager-of-all-android-manufactures-to-enable-background-and-push-notification

Pronghorn answered 13/2, 2018 at 9:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.