Skip to content

Conversation

JamiKettunen
Copy link
Contributor

Android 12+ / kernel v4.19+ modern MediaTek SoCs like MT6768/6789/6877 found on Volla devices do not provide a libwifi-hal.so but instead a libwifi-hal-mtk.so which provides the same functionality while the current fallback libhardware_legacy.so doesn't work.

There still seems to be some weirdness to do with the wlan1 interface magically becoming permanently managed (despite https://gitlab.com/ubports/porting/reference-device-ports/android11/volla-phone-22/volla-mimameid/-/blob/master/overlay/system/lib/udev/rules.d/99-mtk-wlan1-unmanaged.rules) after toggling hotspot even once and rebooting etc. Will see how this behavior seen on 24.04 with this PR fairs to what the status quo is on 20.04 but it's certainly odd..

Android 12+ / kernel v4.19+ modern MediaTek SoCs like MT6768/6789/6877
found on Volla devices do not provide a libwifi-hal.so but instead a
libwifi-hal-mtk.so which provides the same functionality while the
current fallback libhardware_legacy.so doesn't work.
@JamiKettunen JamiKettunen marked this pull request as draft October 8, 2025 20:25
@JamiKettunen
Copy link
Contributor Author

JamiKettunen commented Oct 9, 2025

Ok, so on UT 24.04 (but not 20.04) if you toggle it even once either as-is currently (with it failing) or with this patch already applied on a clean install you'll get wlan1 managed after reboot going forward despite the udev rule applying fine as per udevadm info /sys/class/net/wlan1 returning E: NM_UNMANAGED=1.. since that's possible to happen in the first place and the following seems to fix it I'll just migrate all affected Volla devices to use it instead and not think about what sort of weird state file mess is going on here:

$ /etc/NetworkManager/conf.d/unmanaged-wlan1.conf
[device-wlan1-unmanaged]
match-device=interface-name:wlan1
managed=0

@JamiKettunen JamiKettunen marked this pull request as ready for review October 9, 2025 15:21
@peat-psuwit
Copy link
Contributor

(Mirroring my comment from UT packaging MR: https://gitlab.com/ubports/development/core/packaging/mechanicd/-/merge_requests/3#note_2811084177)

I guess we can have this as a distro patch in UT, but not in the upstream repo itself. The reason is that this is SoC-specific private API which coincidentally have the same API as a legacy HAL API. Mechanicd should not to have vendor-specific stuffs in it.

The proper way to do this is probably using HAL over binder instead. This should work independent of vender, but would entail using libgbinder which is somewhat cumbersome I think.

As for UT, since it's a simple, non-invasive fix, we can have this as a backportable hotfix. Thank you for not adding it back to lomiri-indicator-network BTW.

@fredldotme
Copy link
Contributor

Since I created mechanicd, I might as well chime in. IMO it's perfectly fine to merge this change here, it's an isolated addition to what already exists. Now I agree we should probably add Binder support for other devices, but this is okay.

@fredldotme fredldotme merged commit de17582 into Halium:main Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants