fbpx

Akun optimointi

Huawei

Traditionally Huawei and their Android customization called EMUI belongs to the most troubled on the market with respect to non-standard background process limitations. There are no APIs and no documentation for those extensions. In default settings background processing simply does not work right and apps working in background will break.

In some of the EMUI versions (we know about EMUI 4 at and we have some reports about EMUI 5 too) no user accessible settings can prevent the system to break background processing longer than 60 minutes. This is done by an evil custom service called HwPFWService developed and bundled with EMUI by Huawei.



EMUI 6+ devices (and some EMUI 5 devices)

  • Phone settings > Advanced Settings > Battery manager > Power plan is set to Performance
  • Phone Settings > Advanced Settings > Battery Manager > Protected apps – check for your app as Protected
  • Phone Settings > Apps > Your app > Battery > Power-intensive prompt [x] and Keep running after screen off [x]
  • Phone settings > Apps > Advanced (At the bottom) > Ignore optimisations > Press Allowed > All apps > Find your app on the list and set to Allow

Huawei P9 Plus

  • Phone settings > Apps > Settings > Special access > Ignore battery optimisation > select allow for your app.

Huawei P20

  • Phone settings > Battery > App launch and then set your app to “Manage manually” and make sure everything is turned on.

Huawei Honor 9 Lite, Huawei Mate 9 Pro

  • Phone settings > Battery > Launch and then set your app to “Manage manually” and make sure everything is turned on. On EMUI 4 there is no way out, sorry, but you can ask developers of your apps to implement the workaround described in Developer section

Xiaomi

Traditionally Xiaomi and their Android customization called MIUI belongs to the most troubled on the market with respect to non-standard background process limitations and non-standard permissions. There are no APIs and no documentation for those extensions. In default settings background processing simply does not work right and apps using them will break.

NOTE: Android One devices by Xiaomi work much better than MIUI-based devices. So if you liek Xioam we definitely recommend to look for their Android One offering.



MIUI 10

To let your app run successfully in the background, make sure your settings look like the following (here for example is Sleep as Android):

Power management

Please enable:

  • Settings > Advanced Settings > Battery manager > Power plan is set to Performance
  • Device Settings > Advanced Settings > Battery Manager > Protected apps – your app needs to be Protected
  • Device Settings > Apps > your app > Battery > Power-intensive prompt and Keep running after screen off
  • Settings > Additional Settings > Battery & Performance > Manage apps’ battery usage and here:
    1. Switch Power Saving Modes to Off
    2. Choose the next options: Saving Power in The Background > Choose apps > select your app > Background Settings > No restrictions

App battery saver

Security > Battery > App Battery Saver > your app > No restriction

Autostart

(according to Xiaomi:

Open Security app > Permissions > Auto-start

Enable Autostart for desired apps.

Search for Your app and tap to enable
### App pinning When you open recent apps tray, drag your app downwards – it will be locked. So even if you clear recent apps it will not clear from the background. Drag downwards again to clear your app from the background.

OnePlus

OnePlus and their Oxygen OS Android modification is known as maximizing the stock Android experience. This may be true on the UX front but the exact opposite is valid for background process limits.

When releasing their 1+5 and 1+6 phones, OnePlus introduced one of the most severe background limits on the market to date, dwarfing even those performed by Xiaomi or Huawei. Not only did users need to enable extra settings to make their apps work properly, but those settings even get reset with firmware update so that apps break again and users are required to re-enable those settings on a regular basis.



Turn off System Settings > Apps > Gear Icon > Special Access > Battery Optimization.

WARNING: Recently OnePlus phones started reverting this setting randomly for random apps. So if you set it to be not optimized, the next day it may be back to optimized. There is no workaround and you may have to check system settings every once in a while.
See a bug report filed to OnePlus.
To avoid the system to automatically revert the not optimized setting, you must also lock the app into the ‘Recent App’ list. (solution described here)
Start the app you want to ‘Protect’. Press the phone Recent app button. Toggle the Lock button on the upper right corner of the app. This will avoid the app to be killed in background and the Battery optimisation setting to be reverted.

On some OnePlus phones there is also a thing called App Auto-Launch which essentially prevents apps from working in the background. Please disable it for your app.

Also try: Phone settings > Battery > Battery optimization and switch to the All apps list (Top menu) > Your app > Don’t optimize

NOTE: Some of our users indicated that you need to disable Doze mode in Developer options in 1+3 and earlier. Also disable Settings > Battery > Battery optimization > (three dots) > Enhanced optimization. This option may also be called Advanced optimisation.

Recent app clear behaviour manager is also a likely culprit:


Nokia

UPDATE: With the Pie update to Nokia Android One devices, Nokia started to roll out a whitelist policy based task killer app internationally. This caused unprecedented background processing issues. Now it seems they realized the mistake and Nokia is slowly rolling out fixes to use a blacklist approach instead for the western world market, where Chinese releases still use the whitelist approach. We are still monitoring this and are happy for any feedback. For the time being we did improve the crap score of Nokia by one and we hope this issue will be completely resolved. For details on this please see here.

It seems HMD Global finally found the killer app, but unfortunately it is killing other apps!

There are confirmed reports of three different app killing mechanisms:

  • com.evenwell.powersaving.g3 on Android Pie for most Nokia phones
  • com.evenwell.emm on Android Go (Oreo?) for Nokia 1
  • DuraSpeed on Android Pie (build 00WW_3_180) for the US Nokia 3.1 (TA-1049, TA-1063) and Nokia 5.1

Most Nokia phones (Power saver AKA com.evenwell.powersaving.g3)

Note: In Feb/March 2019, apparently on a few models distributed in Europe and US, the Evenwell Power Saver has been reworked to not kill the apps as aggressively, which largely resolves all issues for those models.

Nokia on Android O and P kills any background process including sleep tracking (or any other sport tracking) after 20 minutes if the screen is off. Also when killed all alarms are stopped which renders for example any alarm clock apps useless.

We have investigated this issue in details. We did even purchase a Nokia 6.1 to be able to reproduce the issue. The problem only occurs on Nokia devices with Android Pie. Nokia started to bundle a toxic app (package: com.evenwell.powersaving.g3 or com.evenwell.emm, name: Power saver) with their devices by some 3rd party company Evenwell. This app kills apps in the most brutal way we have seen so far among Android vendors.

Whitelisting apps from battery optimizations does not help! Evenwell kills even whitelisted apps.

What this non-standard app does is every process gets killed after 20 minutes regardless it is actually supposed to be running and doing a useful job for the user. Also alarms are not triggered. The aim is apparently to save your battery by rendering tracking apps and other apps that use background processing useless.

Moreover even 3rd party user visible alarms (alarm clock alarms) are not triggering properly on Nokia as foreground services cannot be started from background on Nokia. This is a serious issue unparalleled to any other vendor. We did not yet find a workaround for this :(. 3rd party alarms clock / calendars etc… won’t be realiable on Nokia.

You can read more on this issue here: https://community.phones.nokia.com/discussion/3428/background-service-killed-even-when-whitelisted

For fun investigative read about Evenwell, check out Who is Nokia?

Nokia 1 (com.evenwell.emm)

On Nokia 1 there is an alternative package that works very similar to what the com.evenwell.powersaving.g3 package is doing on the higher end models.

Nokia 3.1 and 5.1 (DuraSpeed)

HMD Global included Mediatek’s DuraSpeed task killer as a system service. Since DuraSpeed is not packaged as an app, it cannot simply be uninstalled, but it does have a secret settings switch that will enable or disable the service.



Most Nokia phones (Power saver AKA com.evenwell.powersaving.g3)

To fix this issue, please do the following:

  • Go to Phone settings > Apps > See all apps.
  • Tap on the right top corner menu > Show system.
  • Find Power saver app in the list, select it and Force close. It will remain stopped for a while, but will restart itself eventually.

From now on, background apps should work normally and use the standard Android battery optimizations.

Still 3rd party alarm clocks or any task scheduling of foreground tasks at a particular time won’t work. We do not have any solution for this at the moment UPDATE: in our preliminary tests it seems that force stopping or uninstalling the Power saver app also fixes alarms and starting of foreground services, until the Power saver restarts.

Alternative solution for tech-savvy users:

Most Nokia models

Disable the com.evenwell.powersaving.g3 package via the following adb commands:

adb shell
pm disable-user com.evenwell.powersaving.g3

Nokia 1 (Android Go)

Disable the com.evenwell.emm package via the following adb commands:

adb shell
pm disable-user com.evenwell.emm

Nokia 3.1 and 5.1

DuraSpeed is not packaged as an app, it cannot simply be uninstalled, but it does have a secret settings switch that will enable or disable the service. The flag is not exposed in the Settings app; it can only be manipulated through adb.

adb shell settings put global setting.duraspeed.enabled 0

Toggling it will produce immediate logcat feedback.

04-15 21:13:57.544 1063 1089 D DuraSpeed/DuraSpeedService: onChange, checked: false

Background apps and notifications should be now running without any restrictions - even after a factory reset and enabling all of HMD’s evenwell apps (including com.evenwell.powersaving.g3).


Meizu

Meizu is probably on par with Huawei and Xiaomi in their approach to background process limitations, but they get a better rank probably just because those devices are not that common on the market and thus do not cause such a pain to the developers as the aforementioned.



Adjust your settings:

  • Device Settings > Advanced Settings > Battery manager > Power plan set to Performance
  • Device Settings > Advanced Settings > Battery Manager > Protected apps – check your app as Protected
  • Enable Device Settings > Apps > your app > Battery > Power-intensive prompt and Keep running after screen off

Nokia

UPDATE: With the Pie update to Nokia Android One devices, Nokia started to roll out a whitelist policy based task killer app internationally. This caused unprecedented background processing issues. Now it seems they realized the mistake and Nokia is slowly rolling out fixes to use a blacklist approach instead for the western world market, where Chinese releases still use the whitelist approach. We are still monitoring this and are happy for any feedback. For the time being we did improve the crap score of Nokia by one and we hope this issue will be completely resolved. For details on this please see here.

It seems HMD Global finally found the killer app, but unfortunately it is killing other apps!

There are confirmed reports of three different app killing mechanisms:

  • com.evenwell.powersaving.g3 on Android Pie for most Nokia phones
  • com.evenwell.emm on Android Go (Oreo?) for Nokia 1
  • DuraSpeed on Android Pie (build 00WW_3_180) for the US Nokia 3.1 (TA-1049, TA-1063) and Nokia 5.1

Most Nokia phones (Power saver AKA com.evenwell.powersaving.g3)

Note: In Feb/March 2019, apparently on a few models distributed in Europe and US, the Evenwell Power Saver has been reworked to not kill the apps as aggressively, which largely resolves all issues for those models.

Nokia on Android O and P kills any background process including sleep tracking (or any other sport tracking) after 20 minutes if the screen is off. Also when killed all alarms are stopped which renders for example any alarm clock apps useless.

We have investigated this issue in details. We did even purchase a Nokia 6.1 to be able to reproduce the issue. The problem only occurs on Nokia devices with Android Pie. Nokia started to bundle a toxic app (package: com.evenwell.powersaving.g3 or com.evenwell.emm, name: Power saver) with their devices by some 3rd party company Evenwell. This app kills apps in the most brutal way we have seen so far among Android vendors.

Whitelisting apps from battery optimizations does not help! Evenwell kills even whitelisted apps.

What this non-standard app does is every process gets killed after 20 minutes regardless it is actually supposed to be running and doing a useful job for the user. Also alarms are not triggered. The aim is apparently to save your battery by rendering tracking apps and other apps that use background processing useless.

Moreover even 3rd party user visible alarms (alarm clock alarms) are not triggering properly on Nokia as foreground services cannot be started from background on Nokia. This is a serious issue unparalleled to any other vendor. We did not yet find a workaround for this :(. 3rd party alarms clock / calendars etc… won’t be realiable on Nokia.

You can read more on this issue here: https://community.phones.nokia.com/discussion/3428/background-service-killed-even-when-whitelisted

For fun investigative read about Evenwell, check out Who is Nokia?

Nokia 1 (com.evenwell.emm)

On Nokia 1 there is an alternative package that works very similar to what the com.evenwell.powersaving.g3 package is doing on the higher end models.

Nokia 3.1 and 5.1 (DuraSpeed)

HMD Global included Mediatek’s DuraSpeed task killer as a system service. Since DuraSpeed is not packaged as an app, it cannot simply be uninstalled, but it does have a secret settings switch that will enable or disable the service.



Most Nokia phones (Power saver AKA com.evenwell.powersaving.g3)

To fix this issue, please do the following:

  • Go to Phone settings > Apps > See all apps.
  • Tap on the right top corner menu > Show system.
  • Find Power saver app in the list, select it and Force close. It will remain stopped for a while, but will restart itself eventually.

From now on, background apps should work normally and use the standard Android battery optimizations.

Still 3rd party alarm clocks or any task scheduling of foreground tasks at a particular time won’t work. We do not have any solution for this at the moment UPDATE: in our preliminary tests it seems that force stopping or uninstalling the Power saver app also fixes alarms and starting of foreground services, until the Power saver restarts.

Alternative solution for tech-savvy users:

Most Nokia models

Disable the com.evenwell.powersaving.g3 package via the following adb commands:

adb shell
pm disable-user com.evenwell.powersaving.g3

Nokia 1 (Android Go)

Disable the com.evenwell.emm package via the following adb commands:

adb shell
pm disable-user com.evenwell.emm

Nokia 3.1 and 5.1

DuraSpeed is not packaged as an app, it cannot simply be uninstalled, but it does have a secret settings switch that will enable or disable the service. The flag is not exposed in the Settings app; it can only be manipulated through adb.

adb shell settings put global setting.duraspeed.enabled 0

Toggling it will produce immediate logcat feedback.

04-15 21:13:57.544 1063 1089 D DuraSpeed/DuraSpeedService: onChange, checked: false

Background apps and notifications should be now running without any restrictions - even after a factory reset and enabling all of HMD’s evenwell apps (including com.evenwell.powersaving.g3).


Asus

We are still collection feedback on Asus device so the following may not be a exhaustive list of issues.

On Asus devices there seems to be an optimization app called Power Master pre-installed with some modifications made by default, eg. blocking apps from starting and killing background tasks when your screen turns off.

However, if you know how, you can easily disable these. “ user_solution: “ The evil app on Asus is called Power Master. See the screens below. To make sure apps background processing works please make sure the following is set properly.

Power Manager > Mobile Manager > Settings > Uncheck: Clean up in suspend and Auto-deny apps from auto starting. See below for screenshots.




Samsung

Yes, even Samsung - a dominant vendor in the Android market - is using nasty battery saving technique which may kill background processes and render alarm clocks useless. See below for workarounds.



Galaxy S9 / 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. Below are walkthrough screenshots for Galaxy S10. Please let us know your feedback about whether it works for S9 (or others) as well. Thanks!

Sleeping apps

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

Galaxy S8 (j6ltedx) 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 (white list) 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 phone.

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.

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, then 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.


Oppo

We have currently only information for Oppo F1S, but on other models the situation may well be similar.



Oppo F1S

Background services are being killed (including accessibility services, which then need re-enabling) every time you turn the screen off. So far, a workaround for this is:

  • pin your app to the recent apps screen
  • enable your app in the app list inside the security app’s “startup manager” and “floating app list” (com.coloros.safecenter / com.coloros.safecenter.permission.Permission)
  • turn off battery optimizations
  • give the service a persistent notification to remain in the foreground

All four of those need to be done before the app would function. Here are links to some other resources verifying that some of the above steps work on other Oppo devices:


Lenovo

We’re still gathering more information on battery saving features on Lenovo phones.



Lenovo P2

Lenovo P2 has a very good battery life, but at a cost.

For an app to work in the background:

  • enable the padlock icon at an app in the right top corner in the overview of running apps. It’s only then actually running as a foreground process. If you swipe it away, its background process will be killed mercilessly.

It does not matter if the battery/power optimization is on or off in Settings -> Apps -> Your app -> Battery.


Sony

Sony gets a high rank in our listing of toxic Android vendors as historically it was Sony who introduced the first very effective non-standard background process optimization and opened the Pandora’s box.

It is called Stamina mode and it instantly breaks all background processes and all alarms if enabled.



Never use Stamina mode if you want your phone to do something useful when you are not actively using it.

Try to make your app not battery optimized in Phone settings > Battery > Three dots in the top right corner > Battery optimisation > Apps > your app.


AOSP (Pixel, Nexus...)

We are giving AOSP or stock Android a zero crap score. Even if it’s not perfect and you can still expect issues with background processing (see below) on devices with Android 6+, it is still the best we have :(. The truth is, if OEMs would stop adding battery saving features on top of AOSP, Android would be a much better place for users and app developers.

So even stock Android may kill your app when doing tasks valuable to the user. Especially if users enable Background restrictions for a particular app.

Moreover, in Android 6.0 Google did dramatically restrict background processing with their Doze mode https://developer.android.com/training/monitoring-device-state/doze-standby.

This attempt to unify various battery saving features across the Android ecosystem fell flat. It wasn’t only that Doze mode did not keep various vendors from implementing their own battery saving. Doze mode made some background processing scenarios impossible on Android or paradoxically more battery consuming e.g. gathering sensor data through sensor batching (see Solution for developers).

A serious bug in doze mode in Android 6.0 even prevented foreground services to do their job (see Solution for devs for workaround), but luckily this was fixed in 7.0.



Android P

There’s a special option in Settings > Apps > Your app > Advanced > Battery > Background restrictions. If users accidentally enable this option it will break their apps. And users do enable that option!

Pie and pre-Pie

If you see background processing issues, overall it is a good idea to make your app not battery optimized to ensure it gets the freedom it needs to perform in the background.

For that:

  1. Go to Settings > Apps > Your app > Advanced > Battery > Battery optimization
  2. Change view to All apps
  3. Search for your app
  4. Choose Not optimized

Android O

Make sure Settings > Apps > Your app > Advanced > Battery > Background limitations is not enabled. If the app is not yet optimized for Oreo API level it will break their background processing.

If all fails

If all fails you can turn doze mode completely off in Settings > Developer options. (If you don’t know how to enable developer options, Google should help.)


HTC

When you have connections such as Wi‍-Fi on while the phone is in sleep mode, some apps may still continue to use the battery. Starting from Android 6.0, battery optimization is enabled for all apps by default which helps prolong battery standby time when you’re not using the phone. The phone needs to be sitting idle for an extended period of time before battery optimization takes effect.



If there are apps that you don’t want battery optimization enabled, you can turn the feature off in those apps.

  • Open up Phone Settings.
  • Tap Power.
  • Tap Battery optimization.
  • Tap Not optimized > All apps to see the complete list of apps.
  • To turn off battery optimization in an app, tap the app name, and then tap Don’t optimize > Done. Repeat this process to turn off optimization in other apps. To filter the list and see which apps have battery optimization disabled, tap All apps > Not optimized.

AOSP (Pixel, Nexus...)

We are giving AOSP or stock Android a zero crap score. Even if it’s not perfect and you can still expect issues with background processing (see below) on devices with Android 6+, it is still the best we have :(. The truth is, if OEMs would stop adding battery saving features on top of AOSP, Android would be a much better place for users and app developers.

So even stock Android may kill your app when doing tasks valuable to the user. Especially if users enable Background restrictions for a particular app.

Moreover, in Android 6.0 Google did dramatically restrict background processing with their Doze mode https://developer.android.com/training/monitoring-device-state/doze-standby.

This attempt to unify various battery saving features across the Android ecosystem fell flat. It wasn’t only that Doze mode did not keep various vendors from implementing their own battery saving. Doze mode made some background processing scenarios impossible on Android or paradoxically more battery consuming e.g. gathering sensor data through sensor batching (see Solution for developers).

A serious bug in doze mode in Android 6.0 even prevented foreground services to do their job (see Solution for devs for workaround), but luckily this was fixed in 7.0.



Android P

There’s a special option in Settings > Apps > Your app > Advanced > Battery > Background restrictions. If users accidentally enable this option it will break their apps. And users do enable that option!

Pie and pre-Pie

If you see background processing issues, overall it is a good idea to make your app not battery optimized to ensure it gets the freedom it needs to perform in the background.

For that:

  1. Go to Settings > Apps > Your app > Advanced > Battery > Battery optimization
  2. Change view to All apps
  3. Search for your app
  4. Choose Not optimized

Android O

Make sure Settings > Apps > Your app > Advanced > Battery > Background limitations is not enabled. If the app is not yet optimized for Oreo API level it will break their background processing.

If all fails

If all fails you can turn doze mode completely off in Settings > Developer options. (If you don’t know how to enable developer options, Google should help.)


Other vendors

Whatever device you are using, don’t blame the developers as the first thing when something goes wrong. First check your phone settings whether some background processing is not restricted on your device.

See below for general solutions that apply for various vendors.



Look for any vendor-specific battery saver on your device and ideally uninstall if possible, disable if possible.

If not, you are left with the option to root your device or uninstall it though adb (requires some expert skills though):

adb shell

pm uninstall --user 0 com.useless.piece.of.trash

Look through the vendor-specific phone settings and search for anything related to battery optimization or background processing. If you find it try to disable it.

Android 6+

Always check the following setting Phone settings > Battery & power saving > Battery usage > Ignore optimizations > Turn on to ignore battery optimization for your app.

Android 8+

Check if Phone settings > Apps & Notifications > Your app > Background restrictions or Background limits are not enabled for the app.

If all fails you can turn Doze mode off completely.

Turn off doze on Android 6.0 and earlier

In Settings > Developer options. (If you don’t know how to enable developer options, Google should help.)

Turn off doze on Android 7+

Requires expert skills

dumpsys deviceidle disable


fiFinnish
en_USEnglish fiFinnish