whatawurst / android_device_sony_yoshino-common

This is the Android device configuration for the yoshino platform
10 stars 47 forks source link

Charging current issue #3

Open shank03 opened 4 years ago

shank03 commented 4 years ago

Charging current mAh when charging device, seems to get gradually low as the battery percentage increases. This behavior is seemed to be same/similar as when battery care is enabled on stock.

This has been present since Android 10 (or maybe even before). This issue is confirmed by many people (including users from poplar and maple) and some have even known to report it as charging not properly.

What exactly is the issue ?

Taking Lilac as reference device:

STOCK The current on stock locks at 20xx mAh when normal charging and it doesn't fluctuate when using device while charging. When battery care is enabled, the charging current starts from 19xx mAh and gradually decrease with increase in percentage as it meant to work.

Custom ROM When the battery is low, the current goes up-to 19xx mAh and drops to 7xx mAh when using the device. However, as the battery reaches about 30% - 50%, the current become unstable, fluctuating between 19xx mAh - 7xx mAh and at about 50% - 60% it drops to 7xx mAh and gets lower as the percentage increase. Thus, this behavior seems (most probably is) same like battery care

My assumption

Seems like battery care is enabled by default in/sys/../.. path and maybe a service needs to be run to modify those values.

Logs doesn't say anything.

What is to be fixed

The current should be stable 19xx mAh when device is not in use or idle; throughout the charging session. The gradual decrease in current at higher battery percentage makes the device take more time to charge fully. However, the current drop of 7xx mAh seems to be battery friendly.

I hope this issue is small and easy to fix (not judging, just hope :P)

shank03 commented 4 years ago

Issue reopened from device_sony_yoshino

shank03 commented 4 years ago

Data provided by @hakkikaancaliskan

Battery percentage Charging current x/max(1915) current
0-60 1915mA 100%
60-65 1580mA ~80%
65-75 1080mA ~60%
75-80 780mA ~40%
80-85 680mA ~35%
85-87 580mA ~30%
87-89 480mA ~25%
89-100 380mA ~20%
linckandrea commented 3 years ago

i discovered something very interesting:

init.sony-device.rc on latest stock for maple has the following lines


# Set value in property to sysfs for LRC mode
on property:persist.vendor.battery.charge=0
    write /sys/class/power_supply/battery/lrc_enable 0
    write /sys/class/power_supply/battery/lrc_socmax 0
    write /sys/class/power_supply/battery/lrc_socmin 0

on property:persist.vendor.battery.charge=1
    write /sys/class/power_supply/battery/lrc_socmax 60
    write /sys/class/power_supply/battery/lrc_socmin 40
    write /sys/class/power_supply/battery/lrc_enable 1