This repository has been archived by the owner on Aug 29, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
smb5: report fast charging when a proprietary charger is attached
Android figures out if charging is "rapid" by checking POWER_SUPPLY_PROP_CURRENT_MAX and when the proprietary charger tech Xiaomi's using is active that value isn't always reported correctly. Work around that by reporting an arbitrary value that's high enough to qualify as "rapid" when a proprietary charger is attached and fully authenticated (by checking smblib_get_fastcharge_mode() which is a custom utility function added by Xiaomi). Other charger types (HVDCP/PD) still use standard smblib_get_prop_input_current_max(). Test: original 33W charger is reported as "rapid" immediately after plugging it in, a slow charger is still detected as "slow". Change-Id: I8cfce1f827602d53bbcb90abd76723074281d270 Signed-off-by: Kuba Wojciechowski <[email protected]> Signed-off-by: UtsavBalar1231 <[email protected]>
- Loading branch information