[Magisk] VR25:
**2018.11.22-beta (201811220)**

- Automatically evaluate available charging switches and pick one for use.

- General optimizations and cosmetic changes

- Introduced misc() -- miscellaneous settings, check details below or in config.txt.

- The charging switch can be changed at any time with <mcs -s/--set s/switch> (select from a list) or <mcs -s/--set switch "[path] [onValue] [offValue]"> (custom).

- Updated documentation

___

misc=./usb/device/razer_charge_limit_enable:1 ./usb/device/razer_charge_limit_max:80 ./usb/device/razer_charge_limit_dropdown:70 # This can even be used for setting ./battery/voltage_max (max charging voltage), CPU Governor, CPU scaling frequencies and pretty much anything else tweakable through the /sys interface. Note that the default working path is </sys/class/power_supply/>; hence, <./> is also valid. These settings are applied on boot, after main() and before other function are called.

[MENTION=9504656]room312[/MENTION] and other Razer phone users, you can benefit from this feature, but please upload </data/media/mcs/mcs-debug-$deviceName.log> for me to see what's in there.

Thanks

___

[MENTION=4575578]Da-BOSS[/MENTION], I look forward to seeing your report on this one.

Nice pic, btw!

___

More details on coolDown...

First, it's even more flexible now. It can be set to work based on temperature, capacity or both. It can also be disabled entirely.

This feature reduces voltage and temperature induced stress by limiting charging frequency (time) -- charge/pause ratio, in seconds (default 50/10).

It gets in action only when battery temperature is between the min and max values set OR capacity is between coolDown and max.

If min temperature is not set (i.e., temp=-450_90 as opposed to temp=400-450_90), it works with coolDown capacity only. Likewise, if coolDown capacity is 100 or not set (i.e., capacity=5,100,70-80 or capacity=5,,70-80), the cooling engine works with temperature only.

No, none of this damages the battery. In fact, it's the other way around. Battery "relaxes" and its temperature no longer raises above <maxTemp>.

The most interesting thing to note here is voltage. A Lithium-ion battery really hates having its voltage high for long periods of time. If your battery charges from say 0-100% non-stop, its voltage will remains high for a loOong while. In contrast, if you pause charging at certain intervals, the voltage settles down much faster to where it's supposed to be for a given capacity.

Essentially, the pausing strategy greatly limits voltage's parasitic behavior and keeps battery temperature within user-acceptable thresholds.

How often battery charges and discharges is negligible in contrast to the depth of discharges and how long it charges uninterrupted.

Another layer of love can be added by limiting charging voltage. This can be done with the new feature (miscellaneous settings). Unfortunately, not all kernels allow users to modify </sys/class/power_supply/battery/voltage_max>. That's precisely why I came up with this "coolDown" strategy in the first place. Yeah, modifying kernel drivers to allow voltage_max changes could potentially work... but just think about how many kernels I'd have to modify and compile... let that sink in for a bit... exactly, not very manageable.

P.S., I wrote this relatively fast, but hopefully it clears most doubts.

Thanks