Android system battery drain - Android Q&A, Help & Troubleshooting

Hi admins
Why android system takes 52% of my battery? Is this normal?
Device: Samsung A10s running android 10 2/32
Thank you.

It's NOT Android OS itself that consumes this amount of battery charge.
My guess is that Android OS only takes ~10%.
The programs / services which run on top of Android OS are using device's CPU what is draining device's battery.
To get an idea what is actually running on your phone you use ADB and run the following commands
Code:
adb devices
adb shell top
or install & run BetterBatteryStats APK that allows users to monitor how the battery is being used by the operating system and apps.

go to the battery options and enable "adaptive power saving"
some of it surely is samsungs bloatware
you can remove them without root using adb commands
search for the apps that are most consuming
also enable developer options, and limit the background process to 2

jwoegerbauer said:
It's NOT Android OS itself that consumes this amount of battery charge.
My guess is that Android OS only takes ~10%.
The programs / services which run on top of Android OS are using device's CPU what is draining device's battery.
To get an idea what is actually running on your phone you use ADB and run the following commands
Code:
adb devices
adb shell top
or install & run BetterBatteryStats APK that allows users to monitor how the battery is being used by the operating system and apps.
Click to expand...
Click to collapse
How about adb codes to reduce battery drain or some diy tricks cuz i already ysed greenify and still the same, any helps will be appreciated thank you sir❤

ZodiacFam said:
How about adb codes to reduce battery drain or some diy tricks cuz i already ysed greenify and still the same, any helps will be appreciated thank you sir❤
Click to expand...
Click to collapse
greenify faitly useless...
battery drain also depends a lot on the device, some processors are more power hungry (even in idle) then others,
but some things help:
use 50% or less brightness, limit backgroud apps to 1 or 2 maximum, enable the adaptive battery mode
put all less frequent apps into sleep mode
debloat your device - and not only crap apps, use as little aps as you can
search for battery draining apps on your device that can be disabled or removed, for example the samsung "AASAservice"
and snapchat, tinder and other dating apps, any news app, facebook, streaming apps, microsoft apps etc. Use the website instead of the app whenever possible (this also fights telemetry)
widgets help draining battery, avoid using them as much as you can
disable bluetooth when you dont need it
and avoid getting your mobile phone hot - like leaving it on a cars dashboard, a place with direct sunlight, high temperature stresses the device, and drains more battery
cheers

Turn off all power management except screen/ power mode, set to optimize.
Android can manage it's self fine.
Clear Google Play Services clear its data as needed.
It can be disabled with a package blocker but is needed for gmail, Playstore; enable as needed.
Disable Google Backup Transport and Framework, clear their data as needed.
Disable all cloud stuff, carrier, Samsung, Google feedback.
Karma Firewall can be used to block the above system apks and reduce battery usage.

agonoize said:
some of it surely is samsungs bloatware
you can remove them without root using adb commands
Click to expand...
Click to collapse
This statement is wrong: On non-rooted devices you by means of ADB can only hide apps to user, but not remove them, hence they still last on storage memory.

WhatsApp is half the problem...

jwoegerbauer said:
This statement is wrong: On non-rooted devices you by means of ADB can only hide apps to user, but not remove them, hence they still last on storage memory.
Click to expand...
Click to collapse
i currently have a samsung A01, and my mobile is not rooted, yet i removed all apps i do not want, including system apps, all google apps aside from playstore, i do not recall the exact numbers but i did get more space afterwards
if i try the command to enable them it fails telling me the app does not exist, if i look trough adb shell pm list packages the ones i 'uninstalled' are not listed, the apps are really gone
so maybe it depends on the brand and model? on some it can be done, on others not?
although i tought it could be done on all of them

agonoize said:
i currently have a samsung A01, and my mobile is not rooted, yet i removed all apps i do not want, including system apps, all google apps aside from playstore, i do not recall the exact numbers but i did get more space afterwards
if i try the command to enable them it fails telling me the app does not exist, if i look trough adb shell pm list packages the ones i 'uninstalled' are not listed, the apps are really gone
so maybe it depends on the brand and model? on some it can be done, on others not?
although i tought it could be done on all of them
Click to expand...
Click to collapse
Code:
adb uninstall
internally runs
Code:
pm uninstall
So
Code:
adb uninstall --user 0 com.android.service
internally runs
Code:
pm uninstall --user 0 com.android.service
Bloatware housed in /system/priv-app obviously can get tracelessly removed, but surely not all that what is located in /system because essential apps in /system have FLAG_SYSTEM set. I'm pretty sure those apps can't get removed without root rights. But as always: I may err.

jwoegerbauer said:
Bloatware housed in /system/priv-app obviously can get tracelessly removed, but surely not all that what is located in /system because essential apps in /system have FLAG_SYSTEM set. I'm pretty sure those apps can't get removed without root rights. But as always: I may err.
Click to expand...
Click to collapse
well now i am really curious about this, is there some adb command to check? or an app? to verify if they are really gone?
i know for sure the unbloated uses 0.3 less ram and about 2gb less storage space
thanks

jwoegerbauer said:
Bloatware housed in /system/priv-app obviously can get tracelessly removed, but surely not all that what is located in /system because essential apps in /system have FLAG_SYSTEM set. I'm pretty sure those apps can't get removed without root rights. But as always: I may err.
Click to expand...
Click to collapse
well now i am really curious about this, is there some adb command to check? or an app? to verify if they are really gone?
i know for sure the unbloated uses 0.3 less ram and about 2gb less storage space
thanks

You use Android's package manager (pm) tool to perform actions and queries on app packages installed on the device.
Synthax:
Code:
adb shell "pm list packages [options] filter"

agonoize said:
well now i am really curious about this, is there some adb command to check? or an app? to verify if they are really gone?
Click to expand...
Click to collapse
Nothing will go away really. Root access is needed if making changes into the system. They are just hiding from the current user.

agonoize said:
greenify faitly useless...
battery drain also depends a lot on the device, some processors are more power hungry (even in idle) then others,
but some things help:
use 50% or less brightness, limit backgroud apps to 1 or 2 maximum, enable the adaptive battery mode
put all less frequent apps into sleep mode
debloat your device - and not only crap apps, use as little aps as you can
search for battery draining apps on your device that can be disabled or removed, for example the samsung "AASAservice"
and snapchat, tinder and other dating apps, any news app, facebook, streaming apps, microsoft apps etc. Use the website instead of the app whenever possible (this also fights telemetry)
widgets help draining battery, avoid using them as much as you can
disable bluetooth when you dont need it
and avoid getting your mobile phone hot - like leaving it on a cars dashboard, a place with direct sunlight, high temperature stresses the device, and drains more battery
cheers
Click to expand...
Click to collapse
Oh when you say "limit background apps to 1 or 2" what does it means and how would i do it?

ZodiacFam said:
Oh when you say "limit background apps to 1 or 2" what does it means and how would i do it?
Click to expand...
Click to collapse
You can do that in Developer Options. Or simple close apps out when done with them.
Some apps may refuse to do so and run in the background instead, connecting with the internet a few times a minute. Brave browser does this sometimes and force stopping it is the only thing that works. Swell.

blackhawk said:
Turn off all power management except screen/ power mode, set to optimize.
Android can manage it's self fine.
Clear Google Play Services clear its data as needed.
It can be disabled with a package blocker but is needed for gmail, Playstore; enable as needed.
Disable Google Backup Transport and Framework, clear their data as needed.
Disable all cloud stuff, carrier, Samsung, Google feedback.
Karma Firewall can be used to block the above system apks and reduce battery usage.
Click to expand...
Click to collapse
By carrier you mean carrier services? What is its function?

Related

which apps should i hibernate?

i have this app but i dont know wich apps to hibernate, because people recommend to hibernate apps that you dont use but i kinda use a lot of apps , and if i use the magisk version can i hibernate apps without missing notifications?
THEwed123wet said:
i have this app but i dont know wich apps to hibernate, because people recommend to hibernate apps that you dont use but i kinda use a lot of apps , and if i use the magisk version can i hibernate apps without missing notifications?
Click to expand...
Click to collapse
The only apps that need to be hibernated are those that frequently start or run in the background *and* consume significant resources. This is an infrequent occurrence on Android 6+ as doze keeps most bad actors in check. If you can not identify misbehaving apps there is little benefit to using Greenify.
so not even boost mode with the magisk module will make a difference?
THEwed123wet said:
so not even boost mode with the magisk module will make a difference?
Click to expand...
Click to collapse
Just to add to @Davey126's true and clear statement: Most likely not.
As you're obviously using Greenify4Magisk, please allow me to partially quote its OP:
A very simple module just to make Greenify work as a rom-integrated (privileged) app systemlessly (also known as Boost Mode), ...
* Note: You won't get any xposed-side features, since magisk is NOT xposed!
Click to expand...
Click to collapse
To ensure not to miss any notification, Greenify needs to run as a Xposed module.
How can you tell that an app constantly restarts in background?
crittarr said:
How can you tell that an app constantly restarts in background?
Click to expand...
Click to collapse
Check to see if it (or related processes) are running and, more importantly, consuming excess resources. Built in tools are a starting point including the often ignored/maligned Android battery 'app' and the 'running processes' gadget usually located under developer options. Don't kill everything you see; just because it has a pulse doesn't mean it has to die (or be hibernated).
Can you name a third party root-free most reliable tool for telling how much energy apps drain?
I would be glad to know if apps are consuming excess resources but this is not told by the onboard android 7 tools I know of. If I go to battery more settings the most usage shows to be from android OS, bluetooth (headphones) and screen. Still making full (and probably excessive) use of tools like brevent or greenify does make the battery graph flatten noticeably.
crittarr said:
Can you name a third party root-free most reliable tool for telling how much energy apps drain?
I would be glad to know if apps are consuming excess resources but this is not told by the onboard android 7 tools I know of. If I go to battery more settings the most usage shows to be from android OS, bluetooth (headphones) and screen. Still making full (and probably excessive) use of tools like brevent or greenify does make the battery graph flatten noticeably.
Click to expand...
Click to collapse
Built in tools are more than adequate but if you prefer 3rd party give GSAM a whirl as I find it easier to use than BBS (Better Battery Stats). Some also like Accubattery; too much flash and dash for my tastes. Good luck.

Debloat, save battery and data and improve privacy while we wait for a custom Rom

Hi all, ok so ive done some reading on how to debloat this phone in order to improve the battery life, limit tracking and save data by removing the unneccesary software that runs in the background while we wait for a custom rom to be developed.
Have a look at the following:
Universal Android Debloater
XiaomiADBFastbootTools
Also have a look at F-Droid (and install Aurora Droid) and the Aurora Store if you care about your privacy and the tracking that comes with Playstore apps.
Netguard is also excellent in limiting internet connection to apps you decide (even system apps) in order to save data and to protect your privacy.
If ive missed anything please feel free to post here so all of us can help one another.
Thanks
How I remove system apps without root
Did you try Android GSI (see Phh-usson-GSI)? This is more AOSP ROM type of GSI
>How I remove system apps without root
With xiaomi adbfastboot tools. Working flawlessly
Surendra R sonawane said:
How I remove system apps without root
Click to expand...
Click to collapse
Using ADB. Google
janni0077 said:
Hi all, ok so ive done some reading on how to debloat this phone in order to improve the battery life, limit tracking and save data by removing the unneccesary software that runs in the background while we wait for a custom rom to be developed.
Have a look at the following:
Universal Android Debloater
XiaomiADBFastbootTools
Also have a look at F-Droid (and install Aurora Droid) and the Aurora Store if you care about your privacy and the tracking that comes with Playstore apps.
Netguard is also excellent in limiting internet connection to apps you decide (even system apps) in order to save data and to protect your privacy.
If ive missed anything please feel free to post here so all of us can help one another.
Thanks
Click to expand...
Click to collapse
What are the bloatwares you have removed so far? Did anything malfunction after that?
Which bloatware apps are necessary and should not be deleted?
after a mild debloating - the recorded videos don't play.
otherwise I have a feeling every phone has 90% unneeded garbage

What app to monitor which apps drain the battery?

Can someone recommend an app to see how apps are using the battery? Non-root. Thanks.
corvus.corax said:
Can someone recommend an app to see how apps are using the battery? Non-root. Thanks.
Click to expand...
Click to collapse
You already have that in your phone: Device Care. >> battery>hit the graph...it's all there
Finding the battery hogs on Pie was hard.
With Q and above it's much harder unless you give a 3rd party app the permissions it needs with ADB. Logging won't function with Karma Firewall in Q either.
In Devive Care Android Services are all bunch together and are the various Google apks listed correctly? Galaxy Labs Battery Tracker works better but not compatible with Q, of course.
GSM Battery Monitor. Long time best. Yes, to get details you need ADB commands to change permissions. But this app has been around forever.
We use 3 Android phones with CCleaner 5.4.0 > Apps > Drainers > Battery
On all but one (out of three), Google Play Store uses 44% of battery
xdafly said:
We use 3 Android phones with CCleaner 5.4.0 > Apps > Drainers > Battery
On all but one (out of three), Google Play Store uses 44% of battery
Click to expand...
Click to collapse
Isn't CCleaner for the phone to intrusive? I mean, for the phone - I use CCleaner on my desktop to clear the daily backlog (had a few things disabled in the program to limit feedback to them) but personally, I wouldn't want tthat on my phone. Adguard dns and frequent clearing all the 'recents' imo keeps my phone pretty safe.
xdafly said:
We use 3 Android phones with CCleaner 5.4.0 > Apps > Drainers > Battery
On all but one (out of three), Google Play Store uses 44% of battery
Click to expand...
Click to collapse
Watch Ccleaner it can and will delete things you don't want it too. SD Maid is better.
Use Karma Firewall to block Google backup Transport, Framework and Goggle Play Services*.
Package block
https://www.packagedisabler.com/ the former 2 and delete data of all 3 as needed.
Firewall block Playstore and Android Services.
Disable all cloud apks and all feedback, carrier, Samsung and Google.
*disable all autosync except SMS. Firewall enable Google Play Services for Gmail and Playstore.
A reboot needed for Playstore.
blackhawk said:
Watch Ccleaner it can and will delete things you don't want it too. SD Maid is better.
Use Karma Firewall
Click to expand...
Click to collapse
CCleaner for Android does not delete anything in just junk cleaning mode.
We use Glasswire Elite on all our phones & tablets
And I setup ADB AppControl 1.6.0 Extended edition for app disable, delete, install
mzsquared said:
Isn't CCleaner for the phone to intrusive? I mean, for the phone
Click to expand...
Click to collapse
We use the Pro version, full license. Same on all our laptops. It is surprisingly good on our phones & tablets
GSAM battery monitor. Need a couple adb commands but it's non root and is a great app.
xdafly said:
We use the Pro version, full license. Same on all our laptops. It is surprisingly good on our phones & tablets
Click to expand...
Click to collapse
Who's we ?
GSAM battery monitor

Battery information missing on my S7+ (I think I removed it with adb)

I've been removing bloatware that I see using `adb shell pm uninstall -k --user 0 com.the.app`. I think I may have removed "the wrong thing" because now I don't see the Battery setting in the settings list. I also don't see battery saver in the notification menu. There was a useful battery statistics page that showed what apps are using what percentage of the battery. I'd like to get that back.
Can anyone confirm what the package is that provides this functionality? I'll look at how to restore it (since I used the -k option I should be able to get it back).
Thank you.
There are dependencies. Can't recall all for that.
Maybe:
com.sec.android.sdhms
com.google.android.apps.turbo
You really need to know what you're uninstalling before you do it.
It's easier to use a Package Disabler if you want to experiment. It's possible to boot loop the device though if you go too nuts. Some of the "bloatware" just sits there using no resources until you need it and is in fact operationally useful.
blackhawk said:
There are dependencies. Can't recall all for that.
Maybe:
com.sec.android.sdhms
com.google.android.apps.turbo
You really need to know what you're uninstalling before you do it.
It's easier to use a Package Disabler if you want to experiment. It's possible to boot loop the device though if you go too nuts. Some of the "bloatware" just sits there using no resources until you need it and is in fact operationally useful.
Click to expand...
Click to collapse
It's been difficult to find a guide that specifically lists the operationally useful ones to keep. I can only judge them by name and remove based on that. I try to be conservative. But lack of reliable guidance is frustrating.
Googling leads to a ton of different lists of "bloatware", all of them completely wrong. So there's no way for me to know what to trust. I think it would be fantastic if you could provide a list.
I did `cmd package install-existing PACKAGE_NAME` for each of the 2 packages you listed, and it didn't install anything, I think. `pm list` doesn't show them after I run the commands.
Here is something that should be a little more helpful. I generated two lists:
pm list packages -u
pm list packages
I diffed the two and here are the packages that were in the first list but not the second (should represent packages I uninstalled via `adb shell pm uninstall`:
Code:
package:com.samsung.android.fmm
package:com.samsung.android.service.livedrawing
package:com.samsung.android.visionintelligence
package:com.samsung.android.app.clockpack
package:com.samsung.android.app.reminder
package:com.samsung.android.bixbyvision.framework
package:com.samsung.android.app.galaxyfinder
package:com.sec.android.app.samsungapps
package:com.samsung.android.app.notes.addons
package:com.samsung.android.forest
package:com.samsung.android.lool
package:com.samsung.android.app.contacts
package:com.samsung.android.game.gametools
package:com.sec.android.app.myfiles
package:com.samsung.android.bixby.agent.dummy
package:com.samsung.android.app.watchmanagerstub
package:com.sec.android.gallery3d
package:com.sec.android.app.clockpackage
package:com.samsung.android.messaging
package:com.samsung.systemui.bixby2
package:com.samsung.android.authfw
package:com.sec.android.daemonapp
package:com.samsung.android.scloud
package:com.samsung.android.app.dressroom
package:com.samsung.android.beaconmanager
package:com.samsung.android.aremoji
package:com.samsung.android.app.routines
package:com.samsung.storyservice
package:com.samsung.android.bixby.service
package:com.sec.android.mimage.avatarstickers
package:com.samsung.android.arzone
package:com.samsung.android.allshare.service.mediashare
package:com.samsung.android.samsungpassautofill
package:com.samsung.android.ardrawing
package:com.samsung.android.allshare.service.fileshare
package:com.samsung.android.bixby.wakeup
package:com.samsung.android.game.gamehome
package:com.samsung.android.samsungpass
package:com.samsung.android.bixby.agent
package:com.samsung.safetyinformation
package:com.samsung.android.video
package:com.samsung.android.sdk.handwriting
package:com.samsung.android.app.spage
package:com.samsung.android.svoiceime
package:com.samsung.android.calendar
package:com.samsung.app.highlightplayer
package:com.samsung.android.homemode
package:com.samsung.android.app.settings.bixby
package:com.sec.android.easyMover.Agent
If there's anything in here that should be restored (especially if they are related to this battery app issue), please let me know. Thanks again.
Nothing that stands out.
The names can be quit different from their actual function. Worse there can be seemingly unrelated dependencies that will fail if it's needed associated apk is disabled.
Many times the trail/error method is needed to figure out what all a apk or service does.
It takes some time. Each device and user needs are different so each device needs to be customized by the user to work right. One list does not fit all.
I have about 86 packages disabled, about 6 are available immediately by using a PD's interactive widget on/off toggle.
Google play Services and Playstore are normally disabled except when because they're such troublemakers.
Google backup Transport, Framework, Firebase are always disabled.
I also use Karma Firewall to lock down a bunch of apks/services.
My stock N10+/Pie gets 7-11%@hr SOT now. At night using tap on AOD with phone, texting and internet enabled it uses >.5% battery per hour.
Current OS load is over a year old, still fast and very stable with little maintenance needed.
Took over a year for me to fully optimize it.
It's a learning process, but well worth it.
Could you provide some information on how you disable the items in your list? For example I google for disabling Firebase but nothing comes up.
I'm looking at adb logcat to see if something jumps out at me but so far most of it seems useless.
Google Firebase is under Settings, Google account. It collects all kinds of your usage data ie music, playlists, vids etc on your dime, allegedly for faster indexing.
This Disabler works:
Home - Package Disabler
The only NON-root solution that let’s you disable any unwanted packages that come pre-installed / installed with your phone / tablet.
www.packagedisabler.com
blackhawk said:
Google Firebase is under Settings, Google account. It collects all kinds of your usage data ie music, playlists, vids etc on your dime, allegedly for faster indexing.
This Disabler works:
Home - Package Disabler
The only NON-root solution that let’s you disable any unwanted packages that come pre-installed / installed with your phone / tablet.
www.packagedisabler.com
Click to expand...
Click to collapse
Thank you! How reliable is the disable bloat feature in the dashboard for Package Disabler?
Android.Addiction said:
Thank you! How reliable is the disable bloat feature in the dashboard for Package Disabler?
Click to expand...
Click to collapse
What do you mean exactly?
It disables most.
I tried generating a current list but I'm having problems similar to yours
I need to play with it a bit.
Ok I made some progress on this issue. The app that I removed that caused this is:
Code:
com.samsung.android.lool
This is listed in this repo: https://github.com/khlam/debloat-samsung-android
The repository has this to say about the "Device Care" app:
The Device Care app will be disabled and will not appear in settings. This includes Samsung's app sleeper and battery monitor. There is evidence the Device Care app created by the Chinese company Qihoo 360 sends data to China domains over HTTP.
Click to expand...
Click to collapse
Is there any other app I can use to analyze battery usage of applications on my tablet?
Android.Addiction said:
Ok I made some progress on this issue. The app that I removed that caused this is:
Code:
com.samsung.android.lool
This is listed in this repo: https://github.com/khlam/debloat-samsung-android
The repository has this to say about the "Device Care" app:
Is there any other app I can use to analyze battery usage of applications on my tablet?
Click to expand...
Click to collapse
Device Care is a useful app. I use the original factory load version that came with my 10+.
It uses the suspected CCP spyware 360° cleaning app, which actually does a very good job. I simply firewall block it's untrustworthy a$$
Latter Device Care versions aren't as useful but still have needed settings toggles. After you set them you can disable it. I recommend you not use battery optimization or and of those toggles, only toggle on fast charging. This app doesn't use a lot of power as best I can tell as long as the battery optimizing toggles aren't enabled.
blackhawk said:
Device Care is a useful app. I use the original factory load version that came with my 10+.
It uses the suspected CCP spyware 360° cleaning app, which actually does a very good job. I simply firewall block it's untrustworthy a$$
Latter Device Care versions aren't as useful but still have needed settings toggles. After you set them you can disable it. I recommend you not use battery optimization or and of those toggles, only toggle on fast charging. This app doesn't use a lot of power as best I can tell as long as the battery optimizing toggles aren't enabled.
Click to expand...
Click to collapse
I instead went with a separate app, AccuBattery, to monitor app battery usage. That way I'm not relying on potential malware from Samsung
Android.Addiction said:
I instead went with a separate app, AccuBattery, to monitor app battery usage. That way I'm not relying on potential malware from Samsung
Click to expand...
Click to collapse
Accubattery can't do what Device Care does.
I use Accubattery too.
The newer versions dropped 360° so it's gone.
360° deep cleaning actually works very well and is probably no threat when firewall blocked. Which is why I still run the factory load version.
blackhawk said:
Accubattery can't do what Device Care does.
I use Accubattery too.
The newer versions dropped 360° so it's gone.
360° deep cleaning actually works very well and is probably no threat when firewall blocked. Which is why I still run the factory load version.
Click to expand...
Click to collapse
What is 360?
Android.Addiction said:
What is 360?
Click to expand...
Click to collapse
I still don't know what it actually is.
Android.Addiction said:
I still don't know what it actually is.
Click to expand...
Click to collapse
It's a cleaning app Samsung use to license to use in Device Care. Unfortunately the Chinese company that owned it was data mining user data so Samsung ditched them.
So I just firewall block it... it works well otherwise.
blackhawk said:
Accubattery can't do what Device Care does.
Click to expand...
Click to collapse
What exactly does Device Care (or 360) do that Accubattery doesn't? I'm trying to decide if I want to re-enable it, and any details you provide here will help me understand a bit better to make that decision. Thanks for everything so far.
Android.Addiction said:
What exactly does Device Care (or 360) do that Accubattery doesn't? I'm trying to decide if I want to re-enable it, and any details you provide here will help me understand a bit better to make that decision. Thanks for everything so far.
Click to expand...
Click to collapse
The old Device Care with 360° effectively cleans system logs files and other hidden caches.
Cleans some things SD Maid doesn't seem to touch. If you load the old version simply block it with Karma Firewall which uses almost no battery, ad free.
Battery stats are much more detailed in Device Care. It also has easy power mode settings... play with it. No harm, no foul.

General [WORKAROUND] Delayed/missing notifications on some GSI images

Hey everyone, today i want to share a not so pretty but working workaround about an issue that seems to be happening on some GSI images on this device (and its predecessor as well, the Note 10S which i used to own!), and i also want to collect some data from some more knowledgeable people about this so we could get a proper solution.
The issue is that when the device is left locked and idle for around 5 minutes, apps lose network connectivity so not only you get issues like Spotify not playing anything anymore after the last played song before the phone lost connectivity, but most importantly app notifications can be delayed by a few minutes, sometimes even an hour or more, or just never get to you until you unlock the phone and either wait a bit or open that app yourself. After the device enters Doze, and after it is unlocked to exit it, it takes a bit but not too long before your notifications all come in again. This does NOT happen when the device is connected to a power source.
If you have this issue, a not-so-pretty solution i found at least for now is running the following ADB command from a computer:
adb shell dumpsys deviceidle disable
Click to expand...
Click to collapse
This disables Doze entirely until the next reboot (after every reboot you need to run this again or Doze will kick back in).
Now your device will never enter Doze for your current Android session, battery life doesn't seem to be impacted much if at all, but it's better to have less battery life than not getting important messages.
EDIT: At first i was blaming Doze being broken directly, but this seems to be related to a BPF bug in the MediaTek kernel, and it depends on the device manufacturer if they have merged the fix or not. I tested the same GSI on A12 MIUI, and it still has the bug (along with many other bugs which is why everyone tells you to flash A11 before you flash any GSI), so Xiaomi did not fix it yet.
This bug causes mostly networking issues, some ROMs like LineageOS 20 not having network due to Restricted Network Mode causing no network like that post says (workaround for that too there), Battery Saver completely killing the network and probably this issue. After some thinking, Doze actually is working fine (Spotify only stops playing when it tries to get a new song from the network, the song it already got keeps playing even on Doze), it's just the network in apps while on Doze that dies. I tried the same exact GSI on a SD device, and there are zero issues there. There also were no issues on A11 and A12 GSIs on my old Redmi Note 10s, which is also affected by the same sleep bug on A13!
For this particular issue, you can use that adb command, but be aware that other networking issues like the above might exist.
There are some other workarounds like unlocking the phone ever so often before it exceeds 5 minutes staying locked, which is just painful, or leaving it always connected to a power source which isn't always viable, so those are out of the question.
If anyone with more knowledge knows the cause of this and/or a less "bandaid" fix, feel free to reply here, it would be much appreciated both for me and other users with the same issue!
U are my man. i thought its a problem like that, but i dont figured out how to prevent.
i will test this and report if its working.
isnt it possible to run it as bootscript?
lurchiii said:
U are my man. i thought its a problem like that, but i dont figured out how to prevent.
i will test this and report if its working.
isnt it possible to run it as bootscript?
Click to expand...
Click to collapse
I think it's possible to run it as bootscript but i think it requires root and i don't know how to do either of these yet, sorry. Hopefully someone more experienced can help us
I tried this using termux(with su) and It works for now, I'll write in a few days if it still works
i tried to make a magisk-bootscript and it will be executed (according on magisk log) but when i checked with "adb shell dumpsys deviceidle enabled" it shows "1" but when i executed it manually with termux it shows "0". Idk why it dont worked on boot.
lurchiii said:
i tried to make a magisk-bootscript and it will be executed (according on magisk log) but when i checked with "adb shell dumpsys deviceidle enabled" it shows "1" but when i executed it manually with termux it shows "0". Idk why it dont worked on boot.
Click to expand...
Click to collapse
Hm that is weird, i have no idea. I never tried running the command from the phone itself, i usually just used adb on a computer. The output i got from the command was something along the lines of
"Light idle mode disabled
Deep idle mode disabled"
(may not be exact message but you get the point)
Try running the command from a computer and see if it works, should work fine there.
from pc or from termux its np but from a bootscript it wont work. i think dumsys command can only be executed after boot or something?
it seems im not alone on the whole wide world:
Execute a script at boot
Hello, I'd like to execute a easy script at every boot of the phone so basically I've placed the script in the folder /sbin/.magisk/img/.core/service.d/doze.disable.sh I've tried also putting it in...
forum.xda-developers.com
but i found these interesting commands + module:
Universal GMS Doze - Magisk
Systemlessly prevent unnecessary GMS running in the background, optimized and adjusted with additional modified services.
themagisk.com
lurchiii said:
it seems im not alone on the whole wide world:
Execute a script at boot
Hello, I'd like to execute a easy script at every boot of the phone so basically I've placed the script in the folder /sbin/.magisk/img/.core/service.d/doze.disable.sh I've tried also putting it in...
forum.xda-developers.com
but i found these interesting commands + module:
Universal GMS Doze - Magisk
Systemlessly prevent unnecessary GMS running in the background, optimized and adjusted with additional modified services.
themagisk.com
Click to expand...
Click to collapse
Hm, that module actually looks like it limits some apps in the background, which is what exactly triggers this issue. Basically whenever the OS tries to limit network for some apps, it's bugged due to the kernel and instead of limiting it only for some apps it limits it on all apps and it happens on Doze, battery saver and restrictive network mode. About trying to run it as boot script, i haven't tried, but yeah it probably needs to be ran once the OS is fully booted.
SuperLolMine said:
Hm, that module actually looks like it limits some apps in the background, which is what exactly triggers this issue. Basically whenever the OS tries to limit network for some apps, it's bugged due to the kernel and instead of limiting it only for some apps it limits it on all apps and it happens on Doze, battery saver and restrictive network mode. About trying to run it as boot script, i haven't tried, but yeah it probably needs to be ran once the OS is fully booted.
Click to expand...
Click to collapse
i mean that command under "Troubleshooting"
lurchiii said:
i mean that command under "Troubleshooting"
Click to expand...
Click to collapse
Oh yeah, that still controls doze, but basically the issue with BPF bug is that the OS can't restrict network for only some apps because then all apps lose network connectivity. I'm not sure if adding an app to the Doze whitelist may work, and even if it did you'd have to do it for every app you want notifications for. At least adding to the whitelist is permanent instead of the disable command which is temporary, but i'm not sure it will work, i think the best thing for now is trying to find a way to run the command at boot or at least from the phone itself without needing a computer.
Thanks for the idea though, sadly i can't test the whitelist right now as i'm back on MIUI (probably going back to PE soon)
SuperLolMine said:
Oh yeah, that still controls doze, but basically the issue with BPF bug is that the OS can't restrict network for only some apps because then all apps lose network connectivity. I'm not sure if adding an app to the Doze whitelist may work, and even if it did you'd have to do it for every app you want notifications for. At least adding to the whitelist is permanent instead of the disable command which is temporary, but i'm not sure it will work, i think the best thing for now is trying to find a way to run the command at boot or at least from the phone itself without needing a computer.
Thanks for the idea though, sadly i can't test the whitelist right now as i'm back on MIUI (probably going back to PE soon)
Click to expand...
Click to collapse
to run the command without PC and without repeatedly typing it, i use Script Manager:
Script Manager | F-Droid - Free and Open Source Android App Repository
An application to manage shell scripts!
f-droid.org
Add a new Script and type:
#!/system/bin/sh
dumpsys deviceidle disable
Hit save and apply.. done
lurchiii said:
to run the command without PC and without repeatedly typing it, i use Script Manager:
Script Manager | F-Droid - Free and Open Source Android App Repository
An application to manage shell scripts!
f-droid.org
Add a new Script and type:
#!/system/bin/sh
dumpsys deviceidle disable
Hit save and apply.. done
Click to expand...
Click to collapse
Oh, i didn't know about this application, thank you! I usually had to use a pc when i reboot my phone for whatever reason so it's nice to at least be able to do it from the phone. I wonder if a boot script can be made with maybe another app that runs a little bit after startup
i tried with :"sleep xx" but it wont help.

Categories

Resources