HACK: Set “Mains” type for charge_pump_master's “Nothing attached“
Attempting to treat SMB1398_V2
(charge_pump_master
) as a battery in
UPower is useless because it reports horrendously wrong details about
both the battery charging status and battery percentage, making Ubuntu
Touch think the battery is empty while plugged in and having already
reached 100% charging state.
Note that this still makes the battery show up as not charging at 100% (which I think is fair enough) due to the still reported online: no
status from the charge_pump_master
device.
Fixes https://gitlab.com/ubports/porting/community-ports/android11/fairphone-4/fairphone-fp4/-/issues/13.
Before:
Device: /org/freedesktop/UPower/devices/battery_charge_pump_master
native-path: charge_pump_master
model: SMB1398_V2
power supply: yes
updated: Tue 10 Jan 2023 01:50:07 AM EET (85 seconds ago)
has history: yes
has statistics: yes
battery
present: yes
rechargeable: yes
state: empty
warning-level: none
energy: 0 Wh
energy-empty: 0 Wh
energy-full: 0 Wh
energy-full-design: 0 Wh
energy-rate: 0 W
percentage: 0%
capacity: 100%
icon-name: 'battery-empty-symbolic'
After:
Device: /org/freedesktop/UPower/devices/line_power_charge_pump_master
native-path: charge_pump_master
power supply: yes
updated: Tue 10 Jan 2023 02:14:29 AM EET (290 seconds ago)
has history: no
has statistics: no
line-power
warning-level: none
online: no
icon-name: 'ac-adapter-symbolic'