[Google Pixel 3a XL Guides, News, & Discussion] sic0048:
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 [MENTION=4125432]jellopuddingstick[/MENTION] for educating me on what the battery idle mode does and why it is beneficial to have it working!