Skip to content

Commit

Permalink
Fix "ghost charging" issue
Browse files Browse the repository at this point in the history
  • Loading branch information
VR-25 committed Jul 28, 2021
1 parent 9570c66 commit 61a0768
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 24 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1206,3 +1206,8 @@ Release Notes
The results can be batch tested with `acc -t /path/to/list` or `acc -t file on off`.

- Upgrading to this version will reset config.txt.


**v2021.7.28.1 (202107281)**

- Fixed "ghost charging" issue.
22 changes: 0 additions & 22 deletions acc/accd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -326,28 +326,6 @@ if ! $init; then
}


sync_capacity() {
: isCharging:=false
local isCharging_=$isCharging
! $capacitySync || {
! $cooldown || isCharging=true
if $isCharging; then
cmd_batt set ac 1
cmd_batt set status $chgStatusCode
else
cmd_batt unplug
cmd_batt set status $dischgStatusCode
fi
isCharging=$isCharging_
if ! ${capacity[4]} \
|| { ${capacity[4]} && [ $(cat $batt/capacity) -ge 2 ]; }
then
cmd_batt set level $(cat $batt/capacity)
fi
}
}


# load generic functions
. $execDir/misc-functions.sh

Expand Down
22 changes: 22 additions & 0 deletions acc/misc-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,28 @@ run_xtimes() {
}


sync_capacity() {
isCharging=${isCharging:-false}
local isCharging_=$isCharging
! $capacitySync || {
! $cooldown || isCharging=true
if $isCharging; then
cmd_batt set ac 1
cmd_batt set status $chgStatusCode
else
cmd_batt unplug
cmd_batt set status $dischgStatusCode
fi
isCharging=$isCharging_
if ! ${capacity[4]} \
|| { ${capacity[4]} && [ $(cat $batt/capacity) -ge 2 ]; }
then
cmd_batt set level $(cat $batt/capacity)
fi
}
}


sleep_sd() {
local i
for i in 1 2 3 4; do
Expand Down
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id=acc
domain=vr25
name=Advanced Charging Controller (ACC)
version=v2021.7.28
versionCode=202107280
version=v2021.7.28.1
versionCode=202107281
author=VR25
description=Mainly intended for extending battery service life on Android devices. In a nutshell, this is achieved through limiting charging current, temperature and voltage. Any root solution is supported. The installation is always "system-less", whether or not the system is rooted with Magisk.

0 comments on commit 61a0768

Please sign in to comment.