[Magisk] morpheus67:
Hello,

I have anissue with your application and MSM Xtended rom on OnePlus 5 : charge doesn't stop at 80%.

It is like the charge is stopped (battery indicator staty at 80%, charging led is off) but in fact it's not.

Once I reboot the phone I see that battery % is higher than 80%

Here are the config file an the logs :

- Config :

# Magic Charging Switch (MCS) Config
# /data/media/mcs*/config.txt

# Default current values are expressed in uA (micro Amps or Ampere * 1000000).

# Default Temperature values are expressed in Celsius * 10.

# MCS relies on two charging control mechanisms: <charger ON/OFF switch> (primary) and <current_max control> (secondary, fallback). The first manipulates charging state by toggling the device's built-in charging switch ON/OFF. The second controls charging through the manipulation of max input current values. If your device isn't supported, but you happen to know its charging control file, add it to </sbin/.core/img/mcs_beta/switches.txt>. Add also the respective <ON/OFF> values to </sbin/.core/img/mcs_beta/keys.txt> (if those aren't already there).

# $maxCurrent and $lowCurrent only apply to the secondary (fallback) charging controller.

# $coolDownRatio is used only by the primary charging control mechanism.

#maxCurrent=1500000 # Leave untouched to use device's default.

lowCurrent=500000 # For slow charging...

maxCapacity=80 # Halt charging when $capacity% is greater or equal to $maxCapacity%.

coolDownCapacity=60 # Restrict charging frequency/speed when battery $capacity% is between $coolDownCapacity% and $maxCapacity% to keep its voltage and temperature within less stressful thresholds.

coolDownRatio=30/20 # When $temp°C*10 is between $fairTemp°C*10 and $maxTemp°C*10 AND/OR $capacity% is between $coolDownCapacity% and $maxCapacity%, restrict charging time to every #/ second(s) for /# second(s) to keep battery temperature and voltage within less stressful thresholds.

coolDownUSB=false # Apply coolDownRatio policy to USB charging as well. Usually, this is only necessary when USB fast charging is enabled. In general, battery charges fairly slow on USB. Most devices, by default, limit USB charging current to ~500 mA max. Such a low current doesn't raise battery temperature/voltage as dramatically nor as fast as regular charging current (~1A+) does.

resumeCapacity=70 # Resume charging when $capacity% is less or equal to $resumeCapacity%.

shutdownCapacity=5 # Auto-shutdown when $capacity% is less or equal to $shutdownCapacity%.

maxTemp=450 # Halt charging when $temp°C*10 is greater or equal to $maxTempC*10.

fairTemp=400 # Restrict charging frequency/speed when $temp°C*10 is between $fairTemp°C*10 and $maxTemp°C*10.

loopDelay=10 # This applies to all loops. The value is expressed in seconds.

verbose=true # If true, comprehensive diagnostic data is generated. Else, only basic debugging info is logged. The log path is </data/media/mcs*/mcs.log*>.

maxLogSize=10 # Whenever the log file exceeds this size (in Megabytes), it's automatically zero'd out.

- Logs when battery charge should be stopped :

sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ dumpsys battery
+ sed -n 's/...*.powered..//p'
+ batt level
+ dumpsys battery
+ sed -n s/..level..//p
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /data/media/mcs_beta/logs/mcs_beta.log ]
+ '[' -f /dev/mcs_beta/running ]
+ du -m /data/media/mcs_beta/logs/mcs_beta.log
+ awk '{print $1}'
+ get_value maxLogSize
+ sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ dumpsys battery
+ sed -n 's/...*.powered..//p'
+ batt level
+ dumpsys battery
+ sed -n s/..level..//p
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /data/media/mcs_beta/logs/mcs_beta.log ]
+ '[' -f /dev/mcs_beta/running ]
+ du -m /data/media/mcs_beta/logs/mcs_beta.log
+ awk '{print $1}'
+ get_value maxLogSize
+ sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ sed 's/#.*//'
+ head -n 1
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ dumpsys battery
+ sed -n 's/...*.powered..//p'
+ batt level
+ dumpsys battery
+ sed -n s/..level..//p
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /data/media/mcs_beta/logs/mcs_beta.log ]
+ '[' -f /dev/mcs_beta/running ]
+ du -m /data/media/mcs_beta/logs/mcs_beta.log
+ awk '{print $1}'
+ get_value maxLogSize
+ sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ dumpsys battery
+ sed -n 's/...*.powered..//p'
+ batt level
+ dumpsys battery
+ sed -n s/..level..//p
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /data/media/mcs_beta/logs/mcs_beta.log ]
+ '[' -f /dev/mcs_beta/running ]
+ du -m /data/media/mcs_beta/logs/mcs_beta.log
+ awk '{print $1}'
+ get_value maxLogSize
+ sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ dumpsys battery
+ sed -n 's/...*.powered..//p'
+ batt level
+ sed -n s/..level..//p
+ dumpsys battery
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /data/media/mcs_beta/logs/mcs_beta.log ]
+ '[' -f /dev/mcs_beta/running ]
+ du -m /data/media/mcs_beta/logs/mcs_beta.log
+ awk '{print $1}'
+ get_value maxLogSize
+ sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ + dumpsys batterysed -n 's/...*.powered..//p'

+ batt level
+ dumpsys battery
+ sed -n s/..level..//p
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /data/media/mcs_beta/logs/mcs_beta.log ]
+ '[' -f /dev/mcs_beta/running ]
+ du -m /data/media/mcs_beta/logs/mcs_beta.log
+ awk '{print $1}'
+ get_value maxLogSize
+ sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ dumpsys battery
+ sed -n 's/...*.powered..//p'
+ batt level
+ dumpsys battery
+ sed -n s/..level..//p
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /data/media/mcs_beta/logs/mcs_beta.log ]
+ '[' -f /dev/mcs_beta/running ]
+ du -m /data/media/mcs_beta/logs/mcs_beta.log
+ awk '{print $1}'
+ get_value maxLogSize
+ sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ dumpsys battery
+ sed -n 's/...*.powered..//p'
+ batt level
+ dumpsys battery
+ sed -n s/..level..//p
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /data/media/mcs_beta/logs/mcs_beta.log ]
+ '[' -f /dev/mcs_beta/running ]
+ du -m /data/media/mcs_beta/logs/mcs_beta.log
+ awk '{print $1}'
+ get_value maxLogSize
+ sed -n 's:^maxLogSize=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 1 -ge 10 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10
+ '[' -f /dev/mcs_beta/running ]
+ batt '.*.powered'
+ grep -q true
+ dumpsys battery
+ sed -n 's/...*.powered..//p'
+ batt level
+ dumpsys battery
+ sed -n s/..level..//p
+ get_value shutdownCapacity
+ sed -n 's:^shutdownCapacity=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ '[' 82 -le 5 ]
+ get_value loopDelay
+ sed -n 's:^loopDelay=::p' /data/media/mcs_beta/config.txt
+ head -n 1
+ sed 's/#.*//'
+ sleep 10

Can someone help me ? :)

Thanks