yashsingh1/xdaforums huggingface dataset:
[Magisk] BarrettBear:
I've been searching for ages now and hope someone can help me - does anybody know where custom profiles are located?

I know where the default one is, but I'm on a Pixel 6 Pro (Android 13) and cannot modify the file, as the system is force-locked to read-only.

I'm trying to find the location of the custom profiles so I can check the file itself and see if my settings look okay.

I'm getting an issue wherein the Pixel charging animation comes up every minute or so; I've tested with a variety of switches after trying acc --t, and the charging animation continues to pop up, even after restarting the Daemon between each switch test :'(

*****Edit*****

Please ignore above, I already solved this myself a short while ago on a prior device (Pixel 6, not Pro). Here's a link to the thread for anybody else encountering this issue.

https://xdaforums.com/t/how-to-limit-charging-on-pixel-6.4366601/page-4#post-87503949
[Magisk] Lada333:
Hey!

Did you achieve that by setting the max charge level to 80% and then simply just enabling 'prioritize battery idle mode'?

I'm trying to achieve a very similar setup where I slow charge the phone overnight but then it's at 80% (or as close as it can be, since the "unplugged" battery discharge nominal) when I unplug & start my day.
[Magisk] jakito:
Hey. Yeah, I just set ACC to prioritize idle mode. That was enough with my kernel. Your experience may be different
[Magisk] dzjin:
Isn't there somebody out there on the latest update on the Nothing Phone 1 with a working config file to share?
[Magisk] BarrettBear:
I've now come across a new issue; it appears that ACCA service is killed in the background.

Phone: Pixel 6 Pro, Android 13, TP1A.221105.002

Magisk: App & Root (v25.2 (25200) 33)

ACC Module: v2022.7.4-dev by VR25

ACC App: v1.0.35

The app seems to work fine when it's open and in the foreground, and for a short while after that, however about an hour or so after it is sent to the background (or swiped away), the daemon service must stop, because my limit of 80% on battery is ignored, and the phone will charge all the way up to 100%.

I don't believe this is a charger issue, as when the app is active in memory, it will happily bounce between 70% - 80%, and properly function.

I've set the app to be "Unrestricted" in its battery usage, so I'm unsure why it's being force-closed in the background.

Does anybody know how I can keep it in memory? Or has come across this before and solved it?
[Magisk] Lada333:
I've been reading the documentation for hours now, trying to find out where I went wrong, but I just can't seem to be able to.

I'm on a Pixel 6a, unofficial crDroid, Android 13, stock kernel.

On my previous devices, I've always used either AccA or ACC Settings, but none of them seem to function now for whatever reason. I want to set up ACC in a way that it limits the maximum charge level to 80% (which seems to be working fine the way I configured it using Termux) and to limit the maximum charge current to 1000mA.

I've tried:

Setting the charging switch to automatic

Setting the charging switch to whichever ACC deemed working (using acc --test)

Setting the max charge current to 1000 using both acc -s c 1000 and acc --set mcc 1000

None of these seem to be throttling the charging speed.

I saw in the documentation how it's recommend to limit the charging voltage instead, but then there's the fact that not all kernels support that feature.

Could anybody help me out here?

Thanks in advance

EDIT:

Okay so using acc --set mcv=4000 kinda does what I want it to do? It's around 1250-1300mA instead of 1000mA, however using any value below 4000mV just results in the phone constantly popping up the "just plugged in" screen? Like it charges for a second, then stops for a few, then charges again for a bit, and so on. (I am using the currentWorkaround thing).

EDIT 2:

Alright, so somehow setting any value as max charging voltage no longer works either (regardless of cw being true or false). I cannot seem to be able to limit the charging speed at all. Could that be a kernel issue?
[Magisk] vurtomatic:
Hi @mochamoo , can you share your config file? I'm new to ACC. I followed your steps of uninstalling ACC, the front-end, disabling Adaptive Battery. Then reinstalling ACC (stable) and ACC Settings.

I also installed Termux, and navigated to /data/adb/vr25/, but can't run any "acc" command.
[Magisk] Lada333:
You needn't navigate to any folders. After launching Termux, type "su," hit enter, then you can use all "acc" commands.
[Magisk] vurtomatic:
Thanks for the suggestion! I already ran "su" and couldn't run "acc". Termux is telling me it can't find the command. But ACC is installed, I know where the folder is, and I have Acc Settings installed too.
[Magisk] Lada333:
Have you rebooted since flashing the Magisk module?
[Magisk] vurtomatic:
Thanks for the suggestion! I already ran "su" and couldn't run "acc". Termux is telling me it can't find the command. But ACC is installed, I know where the folder is, and I have Acc Settings installed too

Well this is weird. It worked. I'd rebooted the phone previously but literally following your suggestion and rebooting it one more time and "acc" worked from Termux. TYSM. I'm going down the rabbit hole with the command suggestions here for P7P.
[Magisk] BarrettBear:
I had this yesterday (Still have an issue where it will charge past my max), but installing the following magisk module stopped the screen flashing. I used that package on my current Android 13 and it works okay.

https://xdaforums.com/t/how-to-limit-charging-on-pixel-6.4366601/page-4#post-87503949
[Magisk] vurtomatic:
Hi @Lada333 , I'd like to experiment with setting this as suggested in the previous post:

(gcpm/constant_charge_current_max 1866420 0)

I'm looking through the readme and "acc -s" looks like the command to set variables. Do I do something like:

acc -s (gcpm/constant_charge_current_max 1866420 0)

?
[Magisk] Uluru25:
I realized it via the acc-settings frontend (see screenshots attached). In this example I reduce the charging current to 1500 mA (you could enter for sure a different value). Then the phone is charged with this 1500 mA until my cooldown charging value of 60 % is reached. At 60 % charging it further reduces the charging current to 500 mA (as a cooldown cycle: 600 s charging with 500 mA and 1 s at the 1500 mA) until the phone is charged to either 80 % or the max voltage of 4150 mV. Good luck!
[Magisk] mochamoo:
close... it's acc -ss. But if you are in termux I'd test the charging switches first by using the acc wizard or acc -t. Your charger/cable might give it a different current reading.
[Magisk] vurtomatic:
Thank you! I don't know ANYTHING about these switches at all. It's been a lot of googling and reading XDA.

I found a post from VR25 that said to use "acc -t" to see which switches work on our phones. It looks like we're picking any switches that have the green checkmark, and changing their values until something works?

And you're saying the value should reflect the chargers we have? Is this value the amperage the chargers are giving out? I'm trying to figure out the guidance for these values otherwise it feels very arbitrary.

Step 1: Run "acc -t" to look for switches that work. (While connected to a charger.)

Step 2: Pick one of those switches. (These switches will show the value while the phone is charging? But I have many different chargers so if these values reflect the chargers, I'll have all sorts of different numbers.)

Step 3: Run "acc -ss" on one of the swtiches and set the value that was shown when the phone was charging?

Step 4: Repeat with any of the switches until the phone will automatically stop charging at the max charge we want?
[Magisk] Zaxx32:
I'm another novice who doesn't understand a lot about how to set

them up correctly.

Phone is a Google 6a.

Ran acc -t and it returned the following. I moved the good ones to the bottom.

/sys/kernel/fast_charge/force_fast_charge 1 0

curr=-932500,-928750 off=true status=Charging

curr=-932500,-927187 off=true status=Charging

curr=-932500,-926875 off=true status=Charging

curr=-932500,-934062 off=true status=Charging

curr=-932500,-918125 off=true status=Charging

Switch doesn't work ❌

battery/bd_trickle_cnt 0 1

curr=-931250,-918125 off=true status=Charging

curr=-931250,-906250 off=true status=Charging

curr=-931250,-924687 off=true status=Charging

curr=-931250,-927187 off=true status=Charging

curr=-931250,-920312 off=true status=Charging

Switch doesn't work ❌

maxfg/offmode_charger 0 1

curr=-931250,-932500 off=true status=Charging

curr=-931250,-929062 off=true status=Charging

curr=-931250,-939687 off=true status=Charging

curr=-931250,-929687 off=true status=Charging

curr=-931250,-918125 off=true status=Charging

Switch doesn't work ❌

dc/current_max 687500 0

curr=-929062,-940937 off=true status=Charging

curr=-929062,-924687 off=true status=Charging

curr=-929062,-923125 off=true status=Charging

curr=-929062,-930625 off=true status=Charging

curr=-929062,-940937 off=true status=Charging

Switch doesn't work ❌

tcpm-source-psy-i2c-max77759tcpc/current_max 2200000 0

curr=-940625,-940625 off=true status=Charging

curr=-940625,-931250 off=true status=Charging

curr=-940625,-923437 off=true status=Charging

curr=-940625,-2452187 off=true status=Charging

curr=-940625,-2453125 off=true status=Charging

Switch doesn't work ❌

main-charger/current_max 2200000 0

curr=-938437,178125 off=true status=Discharging

curr=-938437,-940625 off=false status=Charging

Switch works ✅

idleMode=false

usb/current_max 2200000 0

curr=-2453125,498437 off=true status=Discharging

curr=-2453125,-2450312 off=false status=Charging

Switch works ✅

idleMode=false

main-charger/voltage_max 4350000 voltage_now

curr=-2450312,513125 off=true status=Discharging

curr=-2450312,-2444687 off=false status=Charging

Switch works ✅

idleMode=true

In the past I've seen some 'google' switches listed...but none now, does that even matter?

Think I need a 'guide for idiots' the shows how/what to key in. Just want to stop at 90% and learn how to use the good idle mode I found. No idea how to make them happen. smh...
[Magisk] VanGray:
HHello,

Hello, plug the charger, go to a terminal and type

su

acc -ss

Choose the number according to this switch

main-charger/voltage_max 4350000 voltage_now curr=-2450312,513125 off=true status=Discharging curr=-2450312,-2444687 off=false status=Charging Switch works ✅ idleMode=true

Then type

acc -d

to enter idle mode and if it's working fine and you need to exit it, type

accd

to exit it

When you're charging, you should check the current. If it's ~0 MAh, the idle mode is working fine
[Magisk] User_McUserface:
Pixel 4a running rooted stock A13.

Installed zip from magisk, installed AccA front-end. Everything seems to be working except the charging never stops.

Tried to test switches from terminal.

I get:

Am I missing something?
[Magisk] vurtomatic:
Maybe try a reboot? I had a similar experience. Eventually I uninstalled everything including AccA. Then did a fresh install of acc, and installed Acc Settings. Rebooted the phone, and acc command worked.
[Magisk] User_McUserface:
Yeah, I tried a few reboots and the command did show up, but it wasn't much help.

I think neither of the switches work, because while connected and battery at 92% (stop set as 90%) front-end shows status as discharging, but the battery is clearly charging.
[Magisk] Zaxx32:
That's awesome!! Thank you so very much...easier then I realized! (y)
[Magisk] Lada333:
Yeah, I did try to limit the current as well, but it just doesn't seem to have any effect. Only thing I can sort of limit is the voltage, but even that only in 100mV increments. No matter if I choose the charging switch manually or leave it to auto, whatever mA I set as charging current, it just gets disregarded.
[Magisk] Lada333:
Yeah, I'm actually on this latest version of ACC as well. I managed to get rid of the screen flashing.. somehow, but I still can't set a custom charging current :(
[Magisk] Lada333:
Okay, so, one of the working charging switches is "main-charger/current_max 2000000 0." Enabling it does throttle the charging voltage to around 2.0A. Me setting a custom max charging voltage doesn't influence anything.

I guess this is better than nothing, I just still don't understand why I cannot set a truly custom value.
[Magisk] eried1:
Does this app still work? I just downloaded it and set the thresholds to "acc 80 40" respectively. My phone still charges between 80 and 40.

Have only the module installed.

Any solution?
[Magisk] Lada333:
That's what it's supposed to do?

It charges up to 80%, then stops charging, then when it drops below 40%, it charges till it reaches 80% again.
[Magisk] eried1:
No. It starts charging already between 40 and 80, not only below 40. The lower threshold is not working.
[Magisk] eried1:
And neither is the higher - the pause threshold.

I have a profile in Tasker which is configured specifically for my device, Lenovo P2. Independent of ACC. Would like to use this module for setting a slow charging current, but don't have the time to troubleshoot.
[Magisk] Lada333:
Probably shouldn't get into Android modding then
[Magisk] eried1:
I'm already into it. Haven't done it in five years, give or take.

I have my own tailored Tasker battery limit script which have served my flawlessly ever since I got my phone back in 2017. The only thing I'd like to add is slow charge. I don't think my old kernel supports it though. Can be solved quickly by using another charger.
[Magisk] VR25:
Is that persistent until you reboot?

Does it happen if you run "su -c dumpsys batterystats --reset?"
[Magisk] Droid_JD:
Persistent until reboot.

I'll try that command in about 7-8% and report back....

I assume I enter this command once it becomes laggy?
[Magisk] VR25:
No, I would like to know whether the command is the culprit. So, you have to run it and see if that triggers the lagginess.
[Magisk] Droid_JD:
Well, of course NOW it's not acting all laggy.

I did the command from $ and received back, "Error dumping service info: (unknown error -2147483646) batterystats"

I did the command from # and received back, "sh: batterystats: not found"

Hope that helps
[Magisk] wilberfan:
This would seem the crux of my issue? If I *manually* edit that file, charging stops or starts. Why would cs not be able to change it?

[edit] Tried turning off the service, still went past 80% limit--even with terminal left open.
[Magisk] Hastaloego:
what about battery stats reset when charging reached the PAUSED level? has it been included by now?
[Magisk] bestunameever:
Unsupported device Elephone P9000. As I am new to the forum, I am not allowed to upload the debug file?
[Magisk] roottree:
After the latest update, my phone gets extremely laggy. The lagginess is so terrible that the phone is completely unusable. Even after reboot, the lagginess comes back. I own a Huawei P9 running 7.0, hope this helps?

Anyway, like this mod a lot! Keep it up! :)
[Magisk] Nordblum:
I'm experiencing extreme memory leaks too.

Steps to reproduce:

Boot, don't even open the terminal, don't even plug in the charger, just use normally. After about 10-30 minutes, 95% of RAM is filled, system becomes so unresposive that it's impossible to call the shutdown dialog to appear, so holding the power button untill force shutdown is the only option.

Disabling the module using Magisk Manager For Recovery Mode fixed the memory leak. Please, invesigate ASAP. At least the battery stats reset properly now.
[Magisk] Droid_JD:
That is EXACTLY what happens to me!
[Magisk] VR25:
Those experiencing lag/memory leaks, stop cs service by removing /data/media/cs/auto_run or by running cs -a. Next, go to Magisk Manager and disable it. You don't need to disable the module itself.

Now, could one of you confirm whether the problem existed prior to the current version? -- Thanks

P.S., I'm not experiencing it, BTW.

Edit: A hell lotta logs (Logcat, Magisk) would be great! Also, please specify your Magisk version. -- Thanks

Still investigating. Looks like I'll have to dive deeper into this.

Yes

You can upload it to somewhere else (i.e., Google Drive) and post the link here.
[Magisk] Nordblum:
The problem only appeared in the latest version. The previous one worked fine.
[Magisk] VR25:
Try cs-2017.11.25-1-debug.zip.

[MENTION=7270236]DeeZaster[/MENTION], does running "su -c setenforce 0" "solve" the "PIE" issue?
[Magisk] Stibit:
I support the guys! Also, the system becomes stupefied. It helps reboot. Removed, staged version of 11.19. Phone Nexus 5x.
[Magisk] Droid_JD:
The problem definitely affected me in earlier versions, but I can't recall exactly when it started to happen - I think 2-3 days ago (23-24).

Please let me know what I can do to help you figure this out.
[Magisk] Hastaloego:
how is the "cs -r" command triggered? manual only? or can it be triggered automatically once battery reached the %PAUSED level?
[Magisk] DeeZaster:
Thanks for getting back to me VR25. Something isn't working properly here:

$ su
n2awifi:/data/data/com.termux/files/home # su -c setenforce 0
setenforce: Couldn't set enforcing status to '0': Invalid argument
1|n2awifi:/data/data/com.termux/files/home # su -c setenforce
usage: setenforce [enforcing|permissive|1|0]

Sets whether SELinux is enforcing (1) or permissive (0).

setenforce: Needs 1 argument
1|n2awifi:/data/data/com.termux/files/home #

Also when I used the source switch you gave me to try before, I receive that the service is indeed running, even after a reboot. The charging doesn't start or stop with any values I've set, its like its not even installed. I'm assuming this is probably due to this PIE and permissions but I'm not very familar with linux to know exactly what to check.
[Magisk] Jaymin.0.1910:
Hey VR25, I saw you hardcoded the module "/magisk", which is not good with the latest beta 14.5... Is it possible to make the module future-proof by adding code to find the mount point and use it instead of hardcoding /magisk ?? And also, I think the below code can do the trick ( not sure, I'm a noob ):::

#code starts#

for mount_point in $(cat /proc/mounts | grep /dev/block/loop0 | awk '{print $2}');

do

[[ $mount_point != /system* ]] && break

done

[[ $? -eq 0 ]] || exit 1

#code finished#
[Magisk] VR25:
Have you "tried cs-2017-11-25-1-debug.zip" yet?

cs automatically clears battery stats on pause%. The "-r" option is meant for doing that manually/on demand/at any time. Did you read the OP? :rolleyes:

The PIE issue is related to your system itself, not cs. That's a security policy, and it is unrelated to standard permissions.

By performing a search on the forums, you might find a solution. If I come across it first, I'll let you know.

I did that for 2 reasons:

1. Forgot /magisk shouldn't be hardcoded

2. Forgot the second :D

Will fix that.

Keep this in mind, though: I don't generally support Magisk beta builds, as these may introduce issues not related to cs -- and such might be interpreted otherwise. That slows down cs debugging process significantly.
[Magisk] datsoy:
that version fixes lag for me. thanks!
[Magisk] eried1:
So it seems I finally got the module working.

TO ALL NEWCOMERS: Start by find a good switch; that is to say, run the test in a terminal, look at the output and configure accordingly.
[Magisk] Uluru25:
When you write "find a good switch": I only saw working and not working switches. Some of them stating: "idleMode=true".

Thus, how to find among the working ones a good (or even the best switch)?
[Magisk] rei20:
Can you share your setrings? I'm having trouble getting it to work on my 3T, also LOS 18.1
[Magisk] Lada333:
A "good switch" is definitely one that works :D

If a switch is reported not working/doesn't have a tick emoji coming up, it cannot be used for setting custom values.

idleMode=true only means whether or not you can have native battery idle mode (pbim) enabled. Some devices/kernels don't support this feature anyway, so no worries if all switches say idleMode=false.

Other than that, you can run

acc --test

2 or 3 times to make sure there are no false positives.

From this point on, it's all up for you to experiment with the working switches to find out which ones grant you access to all features you'd like to use.
[Magisk] Uluru25:
Thx, that's what I do. I hoped there might be a smarter way (than trial&error) to find the best one. 😁
[Magisk] Lada333:
Based on the documentation, you can leave chargingSwitch at default/automatic, so then you'll (in theory) always have a working switch.

There's only need to fiddle with this option if something doesn't work as you desired.
[Magisk] AnonVendetta:
What command does acc run when it disables charging? I've noticed that I can leave the device plugged in, yet acc can and does switch off charging when battery % gets to a certain level. I'm figuring it must be using some command to do that. And now I have a use for it (or want to test, at least) in another scenario.

I can use a dumpsys command to simulate disabling charging, and android will think it's not charging. But it doesnt really stop charging.
[Magisk] Lada333:
Can't you call acc -d with this other app or whatever that you're trying to use?
[Magisk] AnonVendetta:
No. It's not an app. I simply want to call the same command that acc uses to switch charging off. In a terminal, in a script I can trigger with a widget, whatever works.
[Magisk] AnonVendetta:
It's this:

https://www.amazon.com/ZEROLEMON-ZeroLemon-Portable-Power-Banks/dp/B071S38JWD/ref=mp_s_a_1_3?crid=2PBRFRRFUCOZT&keywords=zerolemon+note+20+ultra&qid=1671053055&sprefix=zerolemon+note+%2Caps%2C216&sr=8-3&ufe=app_do%3Aamzn1.fos.fa474cd8-6dfc-4bad-a280-890f5a4e2f90

So you see now, a battery case for my phone. It features pass through charging to the phone. The goal here is to switch off charging for the phone's internal battery, while allowing the battery case to charge (which has a separate battery of its' own).
[Magisk] AnonVendetta:
It seems that acc has a disable command. However, this also stops the daemon. Is there a way to just disable charging, while leaving the daemon running?

I still feel that knowing the actual command acc uses would be useful. I'm sure it just change some value in /sys/*, but I'm not sure which one. I thought it would be something like charging_now (in /sys), since the value in that file changes to 0 when unplugged, and 1 when plugged in. However, trying to echo 0 into that file just results in a permission denied, even while running the terminal app with root.
[Magisk] Lada333:
acc -d stops both the charging and the daemon, but then you can re-enable charging (and the daemon, I assume) with acc -e.

Can't you use some logging app to see what happens when the daemon stops the charging? I don't know what acc might be doing in the background, for all I know, you can't simply disable/enable charging without using acc (because it's not as simple as changing a 1 to a 0 somewhere). Maybe look at the output of acc --test, and see what charging switches it finds and look for those somewhere within the system files?
[Magisk] AnonVendetta:
Any suggestions for a logging app? I'm sure there are quite a few things that write to /sys/*, besides acc.

For now, it seems that disabling charging with acc is enough to achieve what I want. The phone's internal battery stops charging, but the battery case's battery continues charging. It does seem that charging the case alone isn't natively supported (without physically removing it and charging it separately), not without 3rd party software like acc.
[Magisk] Lada333:
So the way it works is that you plug your "phone" in to the charger, then it first charges your phone to 100%, and only when it's full is when it starts charging the case? Interesting.

I've used this logging app before, however I don't know if it can do what you're looking for.