Merge ~ghadi-rahme/ubuntu/+source/powermgmt-base:ubuntu/devel into ubuntu/+source/powermgmt-base:ubuntu/devel
| Status: | Needs review |
|---|---|
| Proposed branch: | ~ghadi-rahme/ubuntu/+source/powermgmt-base:ubuntu/devel |
| Merge into: | ubuntu/+source/powermgmt-base:ubuntu/devel |
| Diff against target: |
62 lines (+36/-1) 2 files modified
debian/changelog (+7/-0) on_ac_power (+29/-1) |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Simon Chopin (community) | Needs Fixing | ||
| Ubuntu Sponsors | Pending | ||
| git-ubuntu import | Pending | ||
|
Review via email:
|
|||
Commit message
on_ac_power: Fix incorrect AC state on some machines with USB type-C ports (LP: #1980991)
Description of the change
On some machines, on_ac_power will incorrectly report the power state due to USB-C ports.
The current implementation of on_ac_power only checks if the USB-C port is in the connected state without checking first if any of the ports are running in sink or source mode.
With this patch, on_ac_power will first make sure that there is at least a USB port operating in sink mode before considering the USB* type as a possible power supply source.
If no source mode USB-C devices are found assume that there are USB-C ports in sink mode.
This implementation mimics what is already present in systemd with the systemd-ac-power command, where if a USB-C port in source mode is found, USB-C ports are ignored when determining the current power state.
The source code for the systemd implementation can be found here: https:/

Hi Ghadi,
Thanks a lot for taking this on.
It looks pretty solid, but I do have some questions and minor issues. /github. com/canonical/ ubuntu- maintainers- handbook/ blob/main/ PackageMerging. md
In addition to the diff comments, would you be OK splitting the changes to debian/changelog into its own commit? It makes it easier to maintain the delta further down the line when using git-ubuntu, see https:/
Cheers,
Simon