• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[Guide]Using the Advanced Charging Controller (ACC) Magisk Module with Pixel 3a/XL

Search This thread

lpcysmi

Member
Feb 17, 2020
5
0
Sony Xperia 5 II
Hello:

If Using Android auto, would it still work after reaching the 80% (or whatever value you chose) or if the charging stops android auto stops?

I haven't been able to try it, but was legitimately wondering. I don't want to do a long trip and get my google maps deactivated halfway trip

Regards
 

ktmom

Retired Forum Moderator
Apr 22, 2015
5,186
3,380
Deep Space Station K7
Hello:

If Using Android auto, would it still work after reaching the 80% (or whatever value you chose) or if the charging stops android auto stops?

I haven't been able to try it, but was legitimately wondering. I don't want to do a long trip and get my google maps deactivated halfway trip

Regards
When I am using maps on long trips, I have the device stay at about 42%. Using some Tasker scripting, when I'm about an hour out from my destination, it charges back to 80%. Since I don't use Android Auto, I don't have personal experience, but I would be surprised if it closed on charge pause.
 
  • Like
Reactions: Skittles9823

sic0048

Senior Member
Jun 25, 2010
969
510
Google Pixel 6
When I am using maps on long trips, I have the device stay at about 42%. Using some Tasker scripting, when I'm about an hour out from my destination, it charges back to 80%. Since I don't use Android Auto, I don't have personal experience, but I would be surprised if it closed on charge pause.

Any particular reason you do this?

The Pixel 3a devices support "Battery Idle" mode which basically says anytime the phone has reach a "full" charge and is still plugged into a power source, the phone will bypass the battery and draw power directly from the power source. So whether you tell the phone that a full charge is 42% or 80% or 100%, once it hits that number it bypasses the battery completely. There is no harm is letting the battery charge to 80% and then leaving it plugged in for extended periods of time.

Phones that don't support "Battery Idle" mode will draw power from the battery while also charging the battery - even when the battery is fully changed. So I can see the benefit of your method with those phones.

Phones that support "Battery Idle" mode at full charge and still plugged in:
Power supply --> Phone​
Phones that don't support "Battery Idle" mode at full charge and still plugged in:
Power Supply --> Battery --> Phone​
 
Last edited:

ktmom

Retired Forum Moderator
Apr 22, 2015
5,186
3,380
Deep Space Station K7
Any particular reason you do this?

The Pixel 3a devices support "Battery Idle" mode which basically says anytime the phone has reach a "full" charge and is still plugged into a power source, the phone will bypass the battery and draw power directly from the power source. So whether you tell the phone that a full charge is 42% or 80%, once it hits that number it bypasses the battery completely. There is no harm is letting the battery charge to 80% and then leaving it plugged in for extended periods of time.

Phones that don't support "Battery Idle" mode will draw power from the battery while also charging the battery - even when the battery is fully changed.

Phones that support "Battery Idle" mode at full charge and still plugged in:
Power supply --> Phone​
Phones that don't support "Battery Idle" mode at full charge and still plugged in:
Power Supply --> Battery --> Phone​
Fair question [emoji846]

There are two reasons. I've had my Tasker setup since ~2015. The P3XL (not P3aXL) is the first device I've owned that supported battery idle mode. I'm too lazy to tweak a working Tasker project. Additionally, the battery is happiest at ~42% and the extended days I have when driving allows the battery to live there. Obviously, it's not practical if the device can not be plugged in all day.

Also, when I post here, I try to keep in mind that there many different devices. Many do not support battery idle mode and especially in those cases, I believe the battery is better served to be cycled at ~42% if plugged in for extended periods.

(Even though this is a device specific forum, it will be read by many people without the device)
 
Last edited:

Skittles9823

Recognized Contributor
Jan 9, 2015
1,813
2,079
23
Sydney
Google Pixel 3a XL
Fair question [emoji846]

There are two reasons. I've had my Tasker setup since ~2015. The P3XL (not P3aXL) is the first device I've owned that supported battery idle mode. I'm too lazy to tweak a working Tasker project. Additionally, the battery is happiest at ~42% and the extended days I have when driving allows the battery to live there. Obviously, it's not practical if the device can not be plugged in all day.

Also, when I post here, I try to keep in mind that there many different devices. Many do not support battery idle mode and especially in those cases, I believe the battery is better served to be cycled at ~42% if plugged in for extended periods.

(Even though this is a device specific forum, it will be read by many people without the device)
Huh. I didn't know about battery idle mode, thats great to know tbh.

Sent from my Pixel 3a XL using XDA Labs
 

abialic

Member
Apr 26, 2020
20
5
Dordrecht
Current/voltage limits not working.

Hello.
I have set current and voltage limits but AccA shows same values when accd is running or not.
Looks like those limits have not effect.
Does it mean that my kernel is not supporting it?

Device: Samsung Galaxy A51

Regards.
 

Uzephi

Recognized Contributor
Apr 20, 2012
3,439
1,891
Phoenix
Google Pixel 3a
Hello.
I have set current and voltage limits but AccA shows same values when accd is running or not.
Looks like those limits have not effect.
Does it mean that my kernel is not supporting it?

Device: Samsung Galaxy A51

Regards.
Limits work on my Pixel 3a, so it might be kernel related or something else. This section is for the 3a. The main app thread is here: https://forum.xda-developers.com/apps/magisk/module-magic-charging-switch-cs-v2017-9-t3668427

You might get a better answer there.
 

mzeigler1

Senior Member
Jun 27, 2013
92
2
Screenshot_20210313-105821.png
 

Attachments

  • Screenshot_20210313-105817.png
    Screenshot_20210313-105817.png
    176 KB · Views: 10

sic0048

Senior Member
Jun 25, 2010
969
510
Google Pixel 6
So why are my options different from what you have in the guide? @sic0048


I should also state I am on Pixel 5...
This guide was written nearly two years ago. That meant we were on Android Pie (9) back then. A lot has change in the two major OS versions that have since been released and it's not surprising that the switches might have changed. Plus, being a different phone may mean your switches are different too.
 
  • Like
Reactions: mzeigler1

Top Liked Posts

  • There are no posts matching your filters.
  • 20
    While I've had many Android phones, this is the first phone that I decided to use a battery charging controller to regulate how my battery is charged. I just wanted to share my journey with others and encourage others to try this out if you are not already.

    Although there are several different battery charging controllers out there (and more than one named "ACC" which makes it even more confusing) I decided to use the Advanced Charging Controller module developed by VR25. I choose this module because I felt it provided the most customization.

    Step 1 - Installation
    Installing the module is easy. It is listed in the Magisk repository. Simply browse the available modules and find the one titled, "Advanced Charging Controller (acc) created by VR25 @ XDA-developers". There are several ACC modules, so make sure you install the one by VR25 to follow this thread.

    Magisk will flash the module and start it automatically. You don't even need to reboot, although it is the only way to clear the Magisk notification that the module will be started at the next reboot.

    Step 2 - Changing the Charging Switch Setting
    I found that the default charging switch setting (auto) does not work reliably with our phones. Therefore I would suggest changing it using the commands below. Personally I have choose option 2 (battery/charge_disable 0 1) but I listed all the options with the quirks that I have found with each one.

    Step 2.1 - open your preferred command line app - I use Terminal Emulator.
    Step 2.2 - type "su" and hit enter to gain root
    Step 2.3 - type "acc -s s" and hit enter - this is the command that allows us to select another charging switch
    Step 2.4 - type what number of the charging switch you want to use.

    Here are the available charging switches and the issues I have found with them:
    1) Automatic - this switch tries to cycle through the available switches until if find one that "works".
    - Passes the ACC switch test (type "acc -t"): Yes
    - Charges and discharges according to the cooldownratio: No - I found that the phone would charge anytime it was plugged in and below the Pause threshold. It did not seem to wait until the battery level was below the Resume threshold.
    - Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): Yes
    - Begins charging when phone reaches Resume threshold: Yes
    - Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: ???
    - Suffers from wakelock issues when phone is plugged in but not charging: It does have a "overheat_mitigation" wakelock when on the battery idle mode, but because the phone is not using the battery power, it doesn't effect battery life and therefore I don't concern myself with this issue.
    - Other issues:​

    2) battery/charge_disable 0 1 :
    - Passes the ACC switch test (type "acc -t"): Yes
    - Charges and discharges according to the cooldownratio: Yes
    - Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): Yes
    - Begins charging when phone reaches Resume threshold: Yes
    - Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: ???
    - Suffers from wakelock issues when phone is plugged in but not charging: It does have a "overheat_mitigation" wakelock when on the battery idle mode, but because the phone is not using the battery power, it doesn't effect battery life and therefore I don't concern myself with this issue.
    - Other issues:
    3) battery/input_suspend 0 1:
    - Passes the ACC switch test (type "acc -t"): Yes
    - Charges and discharges according to the cooldownratio: Yes
    - Works with battery idle mode (the phone will pull power from the AC power and not the battery when the battery reaches the Pause threshold): No - phone begins discharging from battery when Pause threshold is reached but the phone is still plugged in
    - Begins charging when phone reaches Resume threshold: Yes
    - Charging "chime" and battery icons correctly reflect if the phone is charging or discharging: No - may show charging icon when phone is really discharging, especially during cooldownratio times and the chime doesn't always ring when charging resumes.
    - Suffers from wakelock issues when phone is plugged in but not charging: No
    - Other issues: The phone seems to follow the cooldown charge/discharge times even before reaching the cooldown threshold. I find the phone pausing for 10 seconds (my cool down ratio) when the batter level might be a 50% - long before the 60% cooldown threshold I have set in the config file.
    4) dc/input_suspend 0 1:
    - Passes the ACC switch test (type "acc -t"): NO, so this switch doesn't work with ACC
    - Charges and discharges according to the cooldownratio:
    - Starts discharging when the phone reaches the Pause threshold:
    - Begins charging when phone reaches Resume threshold:
    - Charging "chime" and battery icons correctly reflect if the phone is charging or discharging:
    - Suffers from wakelock issues when phone is plugged in but not charging:
    - Other issues:
    5) battery/charge_control_limit 0 1:
    - Passes the ACC switch test (type "acc -t"): NO, so this switch doesn't work with ACC
    - Charges and discharges according to the cooldownratio:
    - Starts discharging when the phone reaches the Pause threshold:
    - Begins charging when phone reaches Resume threshold:
    - Charging "chime" and battery icons correctly reflect if the phone is charging or discharging:
    - Suffers from wakelock issues when phone is plugged in but not charging:
    - Other issues:

    Step 3 - Configuration
    You can configure the ACC controller using a couple of different methods. You can do everything using command lines, you can use the beta ACC app (see note below), or you can edit a config file that ACC creates when it is installed. Personally I found that editing the config file was the quickest and easiest method to make general changes.

    The ACC config file is found at /storage/emulated/0/acc The file is named "config.txt" You can open the file with a text editor. I personally use the app Root Explorer. I long click on the file name, and then press the three dot button in the upper right hand corner. Choose "Open in Text Editor" and the config file will open and allow changes to be made. Saving the file will automatically push the changes to ACC, you do not need to reboot or restart the ACC daemon for changes to take effect.

    I won't go into a lot of detail about all of the different configuration options here as the developer's xda thread is the best place to get that type of information. But I will talk about the most basic setting - the "capacity" setting. It is the second setting listed in the config file and it should look something like "capacity=0, 60, 70-80". Here is a break down of what those numbers mean:
    - The First Number (0): is battery level were the phone will shut off. The default setting of 0 means the phone will turn off when the battery level hits 0. Personally I don't want my battery completely draining, so I have it set at 5.
    - The Second Number (60): is the battery level where the module starts it's "cool down" functionality. Cool down (listed as coolDownRatio in the config file) is where the phone will stop charging briefly and then restart charging. The default "cool down" setting is coolDownRatio=50/10 which means the phone will charge for 50 seconds, and then stop charging for 10 seconds before charging again for 50 seconds, etc, etc, etc. This is designed to keep the battery temps low. A battery with a charge level less than this number (60 in this example) will charge without pausing, but when the battery level gets to this number or above, the phone will charge and pause based on the coolDownRatio.
    - The Third Number (70): is the "resume" value. If the phone's battery level is below this resume value, the phone will charge. If the battery level is at or above this resume value, the phone will not charge even while plugged in.
    - The Fourth Number (80): is the "pause" value. This is the battery level where the phone will stop charging and should not charge above this value.​

    The default settings are set this way because research has shown that a phone's battery will last the longest with the least amount of battery capacity loss if it is charged to a max of 80% of the battery's capacity, and allowed to discharge just a small amount (10%) before being charged again. I realize this goes against the old "wives tale" that our phone's batteries have a very limited number of charges and it is best to limit the number of charges by only charging the phone when it gets to a low level. This is not true in actual battery performance however and if you charge like this, you are actually decreasing your battery's life expectancy and performance.

    Obviously the default settings may not be the best setting for you. The default settings are probably only practical for a device that is plugged in 100% of the time. Personally I have changed my capacity setting to capacity=5, 60, 70-90. This means my phone will turn off when the battery level reaches 5% (something it has never dropped to yet), it is charged to a max of 90% and will discharge to 70% before charging again, and the cooldown charging cycling starts when the battery is 60% or higher. Obviously I'm not on my charger all the time, so it is very common for my battery to drop below 70%. However, if the battery is below 70% and I have a charger at my disposal, I am going to charge the phone back to 90% rather than let it the battery levels continue to fall.


    Final Notes and Misc Thoughts
    There are lots of other options and commands you can use in ACC. Feel free to share any changes you like to make, or post if you are having problems getting the module to work as expected on the 3a. I hope this helps some people feel give the module a try.

    There is an ACC app that is available now that allows you to control some of the settings from a nice GUI. I personally did not like using it as I found it would overwrite settings in the config file that I was not intending to be changed.

    There is an ACC telegram group if you want to join and have direct communication with the developer and others.

    Thanks to @jellopuddingstick for educating me on what the battery idle mode does and why it is beneficial to have it working!
    3
    if you want to extend your batteries life, one of the best ways is to not fast charge it. fast charging not only degrades it a bit faster because of the amount of current, but it also tends to heat the battery up more which makes it degrade even faster too. heat is the main reason i tell people not to use wireless charging.
    2
    Any particular reason you do this?

    The Pixel 3a devices support "Battery Idle" mode which basically says anytime the phone has reach a "full" charge and is still plugged into a power source, the phone will bypass the battery and draw power directly from the power source. So whether you tell the phone that a full charge is 42% or 80%, once it hits that number it bypasses the battery completely. There is no harm is letting the battery charge to 80% and then leaving it plugged in for extended periods of time.

    Phones that don't support "Battery Idle" mode will draw power from the battery while also charging the battery - even when the battery is fully changed.

    Phones that support "Battery Idle" mode at full charge and still plugged in:
    Power supply --> Phone​
    Phones that don't support "Battery Idle" mode at full charge and still plugged in:
    Power Supply --> Battery --> Phone​
    Fair question [emoji846]

    There are two reasons. I've had my Tasker setup since ~2015. The P3XL (not P3aXL) is the first device I've owned that supported battery idle mode. I'm too lazy to tweak a working Tasker project. Additionally, the battery is happiest at ~42% and the extended days I have when driving allows the battery to live there. Obviously, it's not practical if the device can not be plugged in all day.

    Also, when I post here, I try to keep in mind that there many different devices. Many do not support battery idle mode and especially in those cases, I believe the battery is better served to be cycled at ~42% if plugged in for extended periods.

    (Even though this is a device specific forum, it will be read by many people without the device)
    2
    There's a bit of misinformation / misunderstanding going on here, I think. The best control file for our devices is battery/charge_disable. The "maintenance charge" (ACC refers to it as "idle mode") you're referring to is a good thing! This is explained both in the ACC readme [1] and by the developer of Battery Charge Limit [2][3]. The ping-ponging between the upper and lower thresholds is a fallback, it's not the desired mechanism. Hope this clears things up!

    [1] "Charging switches that support battery idle mode take precedence", https://github.com/VR-25/acc/blob/master/README.md
    [2] https://forum.xda-developers.com/showpost.php?p=76523599&postcount=1834
    [3] https://android.stackexchange.com/a/200037
    1
    So why are my options different from what you have in the guide? @sic0048


    I should also state I am on Pixel 5...
    This guide was written nearly two years ago. That meant we were on Android Pie (9) back then. A lot has change in the two major OS versions that have since been released and it's not surprising that the switches might have changed. Plus, being a different phone may mean your switches are different too.