Send SUBSYSTEM=power_supply NETLINK events to an addtional group

Our Android Emulator runs on x86 and the defconfig includes
CONFIG_X86_CPUID. This driver calls device_destroy in
the teardown callback (from cpuhp_setup_state).

During suspending, the kernel destroys cpus and broadcasts
NETLINK events about it to nl_groups=1 (as all other events).

healthd listens for all NETLINK messages (to filter only
SUBSYSTEM=power_supply ones) with EPOLLWAKEUP to react urgently
for battery issues.

Since the suspending process produces cpu shutdown events,
healthd always prevents our system from suspending.

This change should be matched with a healthd change to stop
listening for nl_groups=1.

Bug: 139203596
Test: CtsVerifier, SENSORS/Device Suspend Test
Change-Id: Ia2463cbc83f65c54e1f2d50864b3e103d83418d8
Signed-off-by: Roman Kiryanov <rkir@google.com>
1 file changed