Samsung

Story

UPDATE 04/2021: Is Samsung now killing even foreground services? Could this be real, or is it a chimera?
[Here you can read more details](https://github.com/urbandroid-team/dont-kill-my-app/issues/307#issuecomment-827649020)

Even disabling the system battery restrictions does not save the app from being killed. Let's find out, if it is a bug or a feature...
UPDATE 2021: Despite Android team promise to enforce OEMs to be transparent about non-standard app killing, in Android 11 Samsung has introduced a new severe (default ON) restriction. Apps can no longer hold wake lock in foreground services. This breaks many use-cases, for instance health apps are now unable to gather sensoric data for their users. See details here and read below for workarounds.

We record significantly increased number of app killing on Samsung’s Android Pie flavor. The hints show adaptive battery being much more eager than in stock Android.
After 3 days any unused app will not be able to start from background (e.g. alarms will not work anymore). Imagine, you won’t use your alarm clock for a the weekend +1 day and bang! no alarms any more and you miss work! We strongly suggest to turn off Adaptive battery and Put apps to sleep options per instructions below.

Important: The latest feedback suggests even when those options get disabled, Samsung may re-enable them later after a firmware update!

Yes, Samsung - a dominant vendor in the Android market - is now using one of the nastiest battery saving techniques in the industry. They kill background processes and render alarm clocks and other apps which rely on background processing useless. See below for workarounds.

Solution for users

  1. Summary
  2. Android 11
  3. Galaxy S10
  4. Galaxy S9
  5. Galaxy S8 and later
  6. Other Samsung phones

What optimization apps does Samsung have?

  • Android 11: Battery optimization, Auto-optimize, Adaptive battery, Background restrictions, lists of Sleeping apps, Unused apps, Deep sleeping apps, Never sleeping apps
  • Android Pie and higher: Device care, lists of Sleeping apps, Unused apps, Auto-disable unused apps
  • Android Oreo or Nougat: Device maintenance
  • Android Marshmallow or below: Smart manager

Android 11

On Android 11 Samsung will prevent apps work in background by default unless you exclude apps from battery optimizations. This is a severe divergence from standard Android process management policies. To keep your apps working properly make sure you enable:
Settings > Apps > Your App > Battery > Battery optimization > All apps > Your app > Don’t optimize.
Yes, this is a long way to go! Devs cannot ask for it automatically as they risk being kicked out from Play Store due to policy violations.

Settings -> Apps, then select Your app
Your app -> Battery
Battery -> Battery optimization
Settings -> Switch to All apps listing
Find Your app
switch off the battery optimization

Galaxy S10

Battery optimization is turned on by default. At some unclear moments (maybe on app update, OS update?), the settings also do revert back to the defaults, forcing you to turn them off again and again.

Sleeping apps

Sleeping apps menu is the sniper’s nest for Samsung’s app killing policies. Make sure to follow the instructions very carefully to prevent the apps from being killed.

Checklist:

  • List of apps in System settings > Device care > Battery > (⁝) menu > Settings:
    1. Disable Put unused apps to sleep
    2. Disable Auto-disable unused apps
    3. Remove your app from the list of Sleeping apps
    4. Disable background restrictions for your app
1. Start Device care
from phone settings
2. Tap Battery
3. Tap the 3-dot menu > Settings
4. Disable all toggles
(except Notifications)
5. Tap "Sleeping apps"
6. Wake up all the apps
using the trashcan icon
Warning: Make sure Put unused apps to sleep and Auto-disable unused apps is disabled. Otherwise, Samsung will put your apps back to sleep after a few days (3 by default) even if you have woken them up manually!

On some phones, the same lists are placed in Battery > Background usage limits.

1. Open Battery > Background usage limits.
2. Check the lists.

New options after update on Android 11

Apart from the various lists of apps, Android 11 on S10 has some new restrictions added:

  • Optimize battery usage in Settings > Apps > (⁝) menu > Special Access > Optimize battery usage
  • Adaptive Battery in Battery > More battery settings
  • Adaptive power saving in Battery > (⁝) menu > Automation
  • Auto-optimize daily in Battery > (⁝) menu > Automation
  • Auto start at set times in Battery > (⁝) menu > Automation

Optimize battery usage

1. Open Apps section.
2. Tap on the (⁝) menu.
3. Choose Special Access.
4. Open Optimiza battery usage.
5. Expand the list to All apps.
6. Toggle the apps.

Adaptive battery

1. Open Battery > (⁝) menu.
2. Choose Automation.

Automation

1. Open Battery > (⁝) menu.
2. Choose Automation.
3. Adjust.

Galaxy S9

Battery optimizations are turned on by default. It is possible the disabled restrictions might get revert after OS update or reboot.

Checklist:

  • Disable Put unused apps to sleep
  • Remove your app from the list of Sleeping apps - list of apps not allowed to run on the background
  • Remove your app from the list of Deep sleeping apps - list of apps that can only work when you open them
  • Add your app to the list of Apps that won’t be put to sleep
  • Disable Auto-optimization
1. Start Device care
from phone settings.
2. Tap Battery.
3. Open App power management.
4. Disable the option
Put unused apps to Sleep .
5. Remove your app from
the lists in Sleeping apps
and Deep sleeping apps.
6. Add you app to the list
in Apps that won't be put to sleep.
7. Go back to Device care
and tap the 3-dot menu.
8. Tap on Advanced.
9. Disable Auto-optimization.
Warning: Make sure Put unused apps to sleep is disabled. Otherwise, Samsung will put your apps back to sleep after a few days (3 by default) even if you have woken them up manually!

Galaxy S8 and later

With the introduction of their flagship Galaxy S8 (and with some earlier experiments), Samsung has introduced a flawed attempt at prolonging battery life called App power monitor.

For your apps to work correctly, please whitelist them in App power monitor.

How to do it:

Open the Settings > Device maintenance > Battery, and at the bottom you’ll see a list of your most frequently used apps. You can manage apps individually or in a group by selecting them then tapping the big Save power button. Apps that are sleeping will appear in the Sleeping apps list at the bottom (tap it to expand the list). Scrolling further — all the way to the very bottom — and you’ll find Unmonitored apps. These are apps that you specifically want to exclude (whitelist) from App power monitor evil reach.

When inside the Unmonitored apps menu, you can tap the 3-dot menu to add or delete apps from the list. Rather than bothering with any of that, you can just turn off the App power monitor feature completely as it has little-to-no impact on battery life and only serves to handicap the normal functioning of your Galaxy device.

It’s excessive and in some cases downright misleading, using scare tactics to keep you reliant on Samsung’s software when other Android devices get by just fine without it.

Other Samsung phones

On other Samsung phones, the path may look like this:
Phone settings > Applications > select three dot menu (top right corner) > Special Access > Optimize Battery usage > Find your app on the list and make sure that it is not selected.

Note: If you enable “Edge Lighting” for your app, the app will not be able to wake up your screen. To allow your app to wake up your screen, please remove it from the Edge Lighting applications list.

Solution for devs

No known solution on dev end

Badge

Copy embed code to clipboard