Prevent my phone from being awake while charging - Android Software/Hacking General [Developers Only]

Hello everyone,
I have used so many times the XDA forums to find some answers and I have found mostly all the answers I needed on other threads. But for once, I might have a more complicated problem to submit to the experts on this forum.
My use case is to create the lightest app that can do a job (namely taking a picture) on a regular interval of time and consume the least battery possible to be able to run for the most time without external power source (that is to say, the phone plugged in a wall outlet).
From what I experienced so far, I managed to have my application run for about 10 straight days doing the job every 10 minutes on a rooted Moto G5 phone. To achieve this, I force the phone to go in Doze mode at the beggining, by calling :
Code:
dumpsys deviceidle force-idle
Doing that, I schedule my jobs using the AlarmManager with the "setExactAndAllowWhileIdle" method thus respecting the super-9 minutes window my alarms should respect in order to be triggered correctly while the phone gets in deep sleep (following the official documentation).
For the moment, this is working as expected, because when I make a bugreport and import it into the Battery Historian tool, I can see that the phone is awake only when my job is running (for around 1 minute) and all the rest of the time, the device is sleeping and even better when I look in logcat, the phone suspends the CPU's for most of the time, which is great to consume less battery when not needed.
Now comes my problem, in order to make the app run for a longer period of time without having a wall outlet nearby, AND without touching the phone, I want to extend my battery life by using an external power bank plugged into my phone. My problem is that I cannot manage to make the phone not be awake while charging the phone. I guess that the phone is keeping some kind of wakelock when charging, so the USB connection keeps the phone awake and make my phone consume 3x more than when it goes in deep sleep, suspending the CPUs and is not awake. I tried to put some flags in a lot of files in order to trick the phone to think nothing is connected to the USB port but it didn't work. I tried those files:
Code:
"echo 0 > /sys/class/power_supply/battery/charging_enabled"
"echo 0 > /sys/devices/virtual/android_usb/android0/enable"
"echo 0 > /sys/class/power_supply/usb/present"
"echo 0 > /sys/class/power_supply/usb/ch_present"
"echo 0 > /sys/class/power_supply/usb/online"
"echo 0 > /sys/class/android_usb/android0/enable"
"echo 0 > /sys/class/android_usb/android0/remote_wakeup"
The only thing that stops the charge is when I put a 0 in the following file:
Code:
"echo 0 > /sys/class/power_supply/battery/charging_enabled"
It effectively stops the charge but the CPUs are still in an "awake" state, meaning there is probably still a wakelock being kept.
Do you have any idea how can I do, only using software, other than what I tried to stop the phone from being awake while having a charger plugged in (even if not charging) ?
Thanks a lot in advance for your answers.

Hi,
I am Aurelien, a colleague of Rafouuuuuu. Some precisions:
We use a "always-on" battery.
Phone awake = cpu is not stopped.
According to the historian report, the wakeup reason is "unknown".
These lines:
Code:
"echo 0 > /sys/class/power_supply/usb/present"
"echo 0 > /sys/class/power_supply/usb/ch_present"
"echo 0 > /sys/class/power_supply/usb/online"
"echo 0 > /sys/class/android_usb/android0/enable"
disable usb connection and charge but the cpu is always on.
We try to stop adbd service (if adbd get a wakelock if usb plugged)
We try to disable developer option.

Related

[Q] Gallery hangs my Defy with CM7

Hi,
when I open Gallery my Defy hangs.
Looking CPU usage (via ADB) I see that the gallery process takes almost all the CPU.
So I tried with different gallery substitutes (ie Photo Gallery). Same behavior.
So I think it's not gallery fault, but something lower. Maybe some problem with the SD card or the codec for some media file.
I checked the Sd but everything seems fine (anyway I got the problem only when media directory is 'indexed').
I saw some work by szipinf.
Is there a way to trace (maybe via ADB) what is doing the hanging process?
Killing the process doesn't solve the problem (I saw that some system process where closed after sometime).
Same problem but also nowhere on solution.
Send from my gio .
just trying to get a workable flexible phone
I found a workaround!!!!
Connect your device with adb (I use adb over wifi) and verify that your CPU is normal.
Code:
adb connect 192.168.0.3:8000
adb shell
top
The "top" command prints cpu usage every 5 seconds or so.
Scroll up and take a look at the first line.
You should read low values for User and System % (mine is "User 0%, System 5%")
Start gallery on your device, now you should see the cpu usage very high, say over 90% for user.
The first process listed is the one hogging your cpu.
Code:
User 93%, System 5%, IOW 0%, IRQ 0%
User 292 + Nice 0 + Sys 16 + Idle 0 + IOW 0 + IRQ 3 + SIRQ 0 = 311
PID CPU% S #THR VSS RSS PCY UID Name
5243 93% S 12 122920K 31264K fg app_209 com.littlefatfish.photo
The name of the process could vary (say com.cooliris.media).
Write down the PID (in this case 5243).
Hit CTRL+C, adb exit.
Launch adb and take a look at the files held by this process, issuing
Code:
adb shell
ls -l /proc/5243/fd
In the list you should see only one media file, the one that is blocking the gallery!!!
In my case it was
/mnt/sdcard/DoveConviene_icons/[email protected]png
Now you have to remove this file (if is important for you, you should copy elsewhere).
rm /mnt/sdcard/DoveConviene_icons/[email protected]
My gallery now it's back to normality!!!!! (at least till another png will block it)

Battery Drain and Kernel Wakelocks

I've had this phone for a few days now and I notice some mean battery drain that happens from time to time. I dumped a Bug Report via developer options, and used Google's Battery Historian after leaving my phone unplugged and idle overnight after a full charge and reboot. The tool seems to show that the following kernel wakeup reason seems to be the problem and holding the phone awake for over 1.5 hours:
Code:
Ranking Name Duration/Hr Count/Hr Total Duration Total Count
0 Abort:Wakeup IRQ -1111803216 (null) pending 10m8s737ms 779.87 1h34m13.62s 7243
The only thing that looks remotely relevant is that on the tool WiFi signal strength became weaker when the above wakeup events started.
Has anyone else had similar issues with random battery drains like this and/or happen to know any workarounds?
Mine seems like it is always awake. Android OS has been keeping it awake for 8-9 while I'm at work.
I tried setting wifi to stay on when sleeping when plugged in, after a full idle overnight, I used my phone in the morning and the same issue came up. The ID above was different, but generally the same problem (IRQ with no description pending). Again, it looks to be wifi related based on the battery stats in Historian. I've rebooted, charged up and turned off wifi to see if the problem goes away.
ru_ready said:
Mine seems like it is always awake. Android OS has been keeping it awake for 8-9 while I'm at work.
Click to expand...
Click to collapse
You might want to try enabling developer options and getting a bugreport generated (which has battery stats), and then visualizing it in Google's Battery Historian to see if it is the same problem. Kind of convoluted, I know, but without root, I don't know of any better way to analyze kernel wakelocks (it isn't a partial wakelock issue on my device).
Last night I left my phone idle with wifi off and WLAN Scanning and Bluetooth Scanning off under Location Settings. The battery ran down only 2% over 9 hours and the Wakeup IRQ pending problem did not keep the phone awake!
I am going to try turning wifi back on today but keep the scanning off and see if that keeps this problem at bay. If not, I may use Tasker to force wifi off when the screen is not on and not plugged in.
The wakelocks seem to happen randomly no matter what my wifi settings are. Though I do think it is related to location settings trying to use wifi scanning.
I give up, there is no reason why a phone I just bought should be like this.
Maybe there are some apk wake up the system
@kumodog Maybe there are some apk wake up the system, you can reboot the system and kill all of application programs when you test it in night with wifi on.
After test, you can also use : "adb dumpsys alarm" in command line to find Top Alarms. it will tell you which alarm make system wakeup.

[Script] Raspberry 3 Image that stops charging your phone after it reaches xx percent

Hi Forum!
I have recently installed AccuBattery and faced the problem of overnight charging and stopping at 80% without a rooted phone. After some tinkering, I figured out that on a Raspberry Pi 3 I can turn off the USB power and I can also query the battery percentage via adb. Combining both, I was able to put together a script that reads the percentage every minute and stops charging for 30 minutes as soon as 80% is reached.
The script itself is quite simple
Code:
#!/bin/bash
THRESHOLD=80
PAUSE=30
LEVEL=`adb shell dumpsys battery | grep " level" | rev | cut -d" " -f1 | rev`
if [ $LEVEL -gt $THRESHOLD ]; then
shutdown -r $PAUSE
echo '1-1' | tee /sys/bus/usb/drivers/usb/unbind
fi
Now, I can only test that with the phones I have available and it works nicely with my Oneplus 6 and satisfacotry with my Moto G5. A full howto and a shortcut (just a sd card image) are available here:
https://metabubble.net/android/how-...roid-when-a-certain-battery-level-is-reached/
I would love to hear your comments about that. Is there a better solution for non-root users? (Did I even waste a lot of time because something like that existed?) Please let me know.

Improve idle drain by tweaking Android Doze parameters

Hey xda-Community!
I recently wanted to reduce my idle drain and searched for ways to edit Android Doze settings, because I remembered seeing a tutorial that said you can change deviceidle-constants, that dictate how Doze works (how fast it kicks in, how long it kicks in, light/deep doze).
I tried all those old tutorials, but I quickly realized the old ways to change the parameters are deprecated, so I asked people on android.stackexchange.com and someone actually gave me the answer (thanks Andrew) (https://android.stackexchange.com/questions/247680/is-device-idle-constants-deprecated-in-android-12).
This works from Android 12 on and is achieved using a shell.
Commands:
Note: When using an adb shell, you have to put "adb shell" before those commands. I'll just put the bare commands here, you add what you have to add.
Checking the settings:
You can check your current Doze settings (and statistics) with "dumpsys deviceidle".
Changing a setting;
Every parameter has to be set individually. It's not that bad tho, as you only have to do this once.
Syntax is: "device_config put device_idle [KEY] [VALUE]".
One example: "device_config put device_idle light_after_inactive_to 30000"
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Spoiler: My recommended settings
First; reset parameters with: "device_config reset trusted_defaults device_idle"
light_after_inactive_to 30000
light_pre_idle_to 120000
light_idle_to 300000
light_idle_factor 2
light_max_idle_to 900000
light_idle_maintenance_min_budget 30000
light_idle_maintenance_max_budget 180000
inactive_to 900000
sensing_to 0
locating_to 0
motion_inactive_to 0
idle_after_inactive_to 900000
idle_pending_to 60000
max_idle_pending_to 120000
idle_pending_factor 2
idle_to 900000
max_idle_to 21600000
idle_factor 2
wait_for_unlock true
I also wrote a windows batch script (works via adb, you have to rename the .txt file to .bat) and a bash file that changes the parameters to my recommendations. See attachments.
will these settings persists even after a reboot? or upgrading rom?
maxs8007 said:
will these settings persists even after a reboot? or upgrading rom?
Click to expand...
Click to collapse
yes, these will stick after a reboot. Not sure about upgrading, but I would guess that it'll stay, because we don't actually modify anything on the system partition
@Doomkopf for me those settings won't stick.
For testing purpose I just applied those yesterday morning:
adb shell device_config put device_idle motion_inactive_to 300000
adb shell device_config put device_idle light_after_inactive_to 180000
This morning they are back to stock values. Any ideas? :S
Utini said:
@Doomkopf for me those settings won't stick.
For testing purpose I just applied those yesterday morning:
adb shell device_config put device_idle motion_inactive_to 300000
adb shell device_config put device_idle light_after_inactive_to 180000
This morning they are back to stock values. Any ideas? :S
Click to expand...
Click to collapse
I set mine like 6 weeks ago, it's still set. I miss many information, what phone do you use, what ROM, how you check if it's still set etc
Doomkopf said:
I set mine like 6 weeks ago, it's still set. I miss many information, what phone do you use, what ROM, how you check if it's still set etc
Click to expand...
Click to collapse
Hi, oh well here are some more infos:
Pixel 6 Pro
Latest Android 13 Stock ROM
Kirisakura Kernel
I check via "adb shell dumpsys deviceidle".
I set it all your settings on friday and today (monday) there are back to stock values.
Previously I tried settings my own settings on wednesday morning and had stock values on the next day already as well :S
Utini said:
Hi, oh well here are some more infos:
Pixel 6 Pro
Latest Android 13 Stock ROM
Kirisakura Kernel
I check via "adb shell dumpsys deviceidle".
I set it all your settings on friday and today (monday) there are back to stock values.
Previously I tried settings my own settings on wednesday morning and had stock values on the next day already as well :S
Click to expand...
Click to collapse
That doesn't sound good I'd check right after setting it, so you can see if it was changed at all (which I assume). If it indeed gets set and unset again, you could check this github repo (https://github.com/easz/doze-tweak) at "Caveat".
Those values got reset in the past already, but as it didn't happen to me, I thought Google stopped doing that. Maybe that old workaround still works Otherwise, you'll have to flash a custom rom I guess xD
EDIT: I also recommend looking at values easy to distinguish. For example, "sensing_to" and "locating_to" were nonzero before, now they are zero (for me), so these values are easy to compare for me. The values you need to look at are at the most upper part of the output, but I guess you already knew that
Doomkopf said:
That doesn't sound good
Click to expand...
Click to collapse
Did you ever mess with any other settings using device_config before? Like the number phantom processes, empty or cached processes, ActivityManager tweaks or anything else? Because I assume you did (and using Android 10 or higher) and disabled the settings sync back to the defauls.
Did you ever use the below command?
device_config set_sync_disabled_for_tests persistent
What does the below commands says?
device_config is_sync_disabled_for_tests
Perhaps it says true? If yes that's why your settings aren't changing.
crok.bic said:
Did you ever mess with any other settings using device_config before? Like the number phantom processes, empty or cached processes, ActivityManager tweaks or anything else? Because I assume you did (and using Android 10 or higher) and disabled the settings sync back to the defauls.
Did you ever use the below command?
device_config set_sync_disabled_for_tests persistent
What does the below commands says?
device_config is_sync_disabled_for_tests
Perhaps it says true? If yes that's why your settings aren't changing.
Click to expand...
Click to collapse
You quoted the wrong man
@Utini How'd it work out? If my last response doesn't help, maybe this one helps u
Doomkopf said:
You quoted the wrong man
@Utini How'd it work out? If my last response doesn't help, maybe this one helps u
Click to expand...
Click to collapse
No, logically I quoted the correct man Just wanted to indirectly tell others about the above trick / setting
Doomkopf said:
Hey xda-Community!
I recently wanted to reduce my idle drain and searched for ways to edit Android Doze settings, because I remembered seeing a tutorial that said you can change deviceidle-constants, that dictate how Doze works (how fast it kicks in, how long it kicks in, light/deep doze).
I tried all those old tutorials, but I quickly realized the old ways to change the parameters are deprecated, so I asked people on android.stackexchange.com and someone actually gave me the answer (thanks Andrew) (https://android.stackexchange.com/questions/247680/is-device-idle-constants-deprecated-in-android-12).
This works from Android 12 on and is achieved using a shell.
Commands:
Note: When using an adb shell, you have to put "adb shell" before those commands. I'll just put the bare commands here, you add what you have to add.
Checking the settings:
You can check your current Doze settings (and statistics) with "dumpsys deviceidle".
Changing a setting;
Every parameter has to be set individually. It's not that bad tho, as you only have to do this once.
Syntax is: "device_config put device_idle [KEY] [VALUE]".
One example: "device_config put device_idle light_after_inactive_to 30000"
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Spoiler: My recommended settings
First; reset parameters with: "device_config reset trusted_defaults device_idle"
light_after_inactive_to 30000
light_pre_idle_to 120000
light_idle_to 300000
light_idle_factor 2
light_max_idle_to 900000
light_idle_maintenance_min_budget 30000
light_idle_maintenance_max_budget 180000
inactive_to 900000
sensing_to 0
locating_to 0
motion_inactive_to 0
idle_after_inactive_to 900000
idle_pending_to 60000
max_idle_pending_to 120000
idle_pending_factor 2
idle_to 900000
max_idle_to 21600000
idle_factor 2
wait_for_unlock true
I also wrote a windows batch script (works via adb, you have to rename the .txt file to .bat) and a bash file that changes the parameters to my recommendations. See attachments.
Click to expand...
Click to collapse
Hi, currently I am using Naptime by Franco with ADB permissions. I'm not sure, but it should work by using the following options (maybe not only these, but I don't know well if there are other places where Doze options are stored):
inactive_to=2592000000,
motion_inactive_to=2592000000,
light_after_inactive_to=0,
light_pre_idle_to=30000,
light_max_idle_to=86400000,
light_idle_to=43200000,
light_idle_maintenance_max_budget=30000,
light_idle_maintenance_min_budget=10000,
min_time_to_alarm=60000,
min_light_maintenance_time=10000,
wait_for_unlock=0,
quick_doze_delay_to=86400000
It's working very well (I get 2% drain in 8 hours of sleep), but I wanted to try and improve it further, because the App tells you when and how much Doze is enforced and when maintenances are performed.
In my case, from my understanding, I don't need maintanances so often, or maybe I don't need it at all, because all the apps of which I need notifications are in non-optimized battery mode.
For reference, during night it performs 4-6 maintenances circa.
Coming to the point, I wanted to ask you I can use you settings even if they have further options like:
sensing_to 0
locating_to 0
and if I can make your settings even more extreme on some values.
For further reference, I have disabled through adb the "motion_engine", any system gesture and I have the Location always disabled (through UI shortcut, not ADB or advanced options).
NovaProspekt70 said:
Hi, currently I am using Naptime by Franco with ADB permissions. I'm not sure, but it should work by using the following options (maybe not only these, but I don't know well if there are other places where Doze options are stored):
inactive_to=2592000000,
motion_inactive_to=2592000000,
light_after_inactive_to=0,
light_pre_idle_to=30000,
light_max_idle_to=86400000,
light_idle_to=43200000,
light_idle_maintenance_max_budget=30000,
light_idle_maintenance_min_budget=10000,
min_time_to_alarm=60000,
min_light_maintenance_time=10000,
wait_for_unlock=0,
quick_doze_delay_to=86400000
It's working very well (I get 2% drain in 8 hours of sleep), but I wanted to try and improve it further, because the App tells you when and how much Doze is enforced and when maintenances are performed.
In my case, from my understanding, I don't need maintanances so often, or maybe I don't need it at all, because all the apps of which I need notifications are in non-optimized battery mode.
For reference, during night it performs 4-6 maintenances circa.
Coming to the point, I wanted to ask you I can use you settings even if they have further options like:
sensing_to 0
locating_to 0
and if I can make your settings even more extreme on some values.
For further reference, I have disabled through adb the "motion_engine", any system gesture and I have the Location always disabled (through UI shortcut, not ADB or advanced options).
Click to expand...
Click to collapse
Hey; please don't quote the whole post, it doesn't really tell me anything
I don't really understand: What do you want to know from me/what is your question? ^^
Yes, you can make some values more extreme, but you said you already did (less maintenance, more idle)
Doomkopf said:
Hey; please don't quote the whole post, it doesn't really tell me anything
I don't really understand: What do you want to know from me/what is your question? ^^
Yes, you can make some values more extreme, but you said you already did (less maintenance, more idle)
Click to expand...
Click to collapse
Hey, I'm really sorry, I'm new on XDA.
I wanted to know why you have some options valued that I don't, like for example:
light_idle_factor 2
sensing_to 0
locating_to 0
and if using them might improve even more my doze.
Also, even if I have Naptime installed, which already improved things by a lot, I wanted to know if some of my values could be improved further to avoid useless maintenances (like I said I have between 4 and 6 maintenances during night, but I barely need 1).
NovaProspekt70 said:
Hey, I'm really sorry, I'm new on XDA.
I wanted to know why you have some options valued that I don't, like for example:
light_idle_factor 2
sensing_to 0
locating_to 0
and if using them might improve even more my doze.
Also, even if I have Naptime installed, which already improved things by a lot, I wanted to know if some of my values could be improved further to avoid useless maintenances (like I said I have between 4 and 6 maintenances during night, but I barely need 1).
Click to expand...
Click to collapse
Doomkopf said:
You can check "dumpsys deviceidle" to see what keys there even are. To help you out, here's an explanation of what each key actually sets. You can also get a visual sense of how the light mode and the deep mode work (not my work, thanks to easz from github).
Click to expand...
Click to collapse
I linked a xda post that explains every value in detail (first link in second quote/my post);
locating_to and sensing_to: By the pictures (also in second quote/my post), you can see how deep doze works; before going into IDLE mode of deep doze, it goes through a sensing phase (motion detection starts) and locating phasing. Default behavior of doze is to not go sleep when you move the device. This skips this phase (time for detecting motion with sensor is 0). Same with locating; when android notices that you move the device (train, car, ...) via gps (or wifi triangulation, etc) it doesn't go to sleep. This also skips that phase
light_idle_factor 2: This multiplies light_idle_to with 2 everytime if goes thorugh a idle/maintenance cycle until it reaches light_max_idle_to. So this basically doubles your light idle time every cycle until it reaches a max duration (which you can set, I also did in my recommended settings)
In that overview you could also think about how to tweak your values so you get less maintenances during night, as you wanted. Basically you have to make both (deep and light) idle_to's longer. I recommend to increase light idle_to first (more light idle, less maintenance), before going too deep on deep sleep - sometimes your phone needs to do backups at night, etc. Dont be afraid to set a "too large" maintenance window, your phone won't suddenly start to draw much power for nothing. You just have a few seconds/minutes less deep sleep (which is ok, little percentage). Give it something like 2 minutes per night, if you're afraid a backup will take longer, you can even go for 3-4 minutes per night.
Doomkopf said:
I linked a xda post that explains every value in detail (first link in second quote/my post);
locating_to and sensing_to: By the pictures (also in second quote/my post), you can see how deep doze works; before going into IDLE mode of deep doze, it goes through a sensing phase (motion detection starts) and locating phasing. Default behavior of doze is to not go sleep when you move the device. This skips this phase (time for detecting motion with sensor is 0). Same with locating; when android notices that you move the device (train, car, ...) via gps (or wifi triangulation, etc) it doesn't go to sleep. This also skips that phase
light_idle_factor 2: This multiplies light_idle_to with 2 everytime if goes thorugh a idle/maintenance cycle until it reaches light_max_idle_to. So this basically doubles your light idle time every cycle until it reaches a max duration (which you can set, I also did in my recommended settings)
In that overview you could also think about how to tweak your values so you get less maintenances during night, as you wanted. Basically you have to make both (deep and light) idle_to's longer. I recommend to increase light idle_to first (more light idle, less maintenance), before going too deep on deep sleep - sometimes your phone needs to do backups at night, etc. Dont be afraid to set a "too large" maintenance window, your phone won't suddenly start to draw much power for nothing. You just have a few seconds/minutes less deep sleep (which is ok, little percentage). Give it something like 2 minutes per night, if you're afraid a backup will take longer, you can even go for 3-4 minutes per night.
Click to expand...
Click to collapse
Thank you very much, very helpuful!!
Based on your information, I think I understand better how Naptime works. It increases the parameters of Light Doze making them similar to those of Deep Doze, and also increases the duration.
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
tfn said:
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
Click to expand...
Click to collapse
I do use Samsung Routines to Enable Offline Mode and Battery Saving at night, which along with Naptime gives me 2% used battery in 8 hours over night, but during the day I can't find a good usage for it.
tfn said:
Wouldnt it be easier to just create a routine or mode ?
Like when I am around my work place I have set it to turn wifi off so it dont keep scanning for wifi and stuff.
I personally feel with Samsung most things can be controlled within their phone and developer settings and not to mention their add on apps like Good Guardian and Good lock.
Click to expand...
Click to collapse
I don't know what it would be easier as; this method?
This basically just configures doze to better fit your needs. It already had values in it before and it was activated before. You can (and should) do all this and still create a routine or mode additionally.
Doze is android's main internal battery saving feature, so tweaking it goes a long way.

Running phone without battery

Hi,
I have a question about runnig my old Samsung (XCover 3 - SM-G388F) without battery.
I have connected wires (usb cable connected to charger) dierctly to pins under cover and it works fine. The problem is that system counts the battery load percentage down and when it reaches 0% the phone is shutting down. When I boot it up system shows again 100% and counts down.
Is there a way to bypass this (phone is rooted if it helps)? I need it runnig 24/7.
ok, my mistake
I was trying to serach an answear before I posted and didn't find anything.
But when I posted this question I got "suggested" thread with answear
"Here's how to fix the battery percentage going down:
-You have to be rooted
-Use the terminal emulator app
-Type SU (switches from $ to #)
-Type this command to keep the phone at 100%
dumpsys battery set level 100
-Type this command to tell the phone that the charger is plugged in
dumpsys battery set usb 1
Everytime you reboot it reverts to stock settings. So I use a tasker script that runs the above commands on every boot."
I leave it here for other
Chears
wouldnt it be possible to keep the battery in and just prevent it from charging ?
I tried that with an app called "Battery Charge Limit" but from time to time the phone was shutting down.

Categories

Resources