mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
wifi: Update active iface when bridged AP instance down
The active interface need to be updated when any of interface changecd. Also fix the local cache bridged_ap_instances value incorrect when erasing. Bug: 191625124 Test: Manual check property "wifi.active.interface" after wlan2 down Test: Manual test with command "halutil -sar enable 0" after wlan2 down Change-Id: I40150c231313505ca355228e711c2448088f41ad
This commit is contained in:
@@ -1059,7 +1059,8 @@ WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal(
|
||||
// Requires to remove one of the instance in bridge mode
|
||||
for (auto const& it : br_ifaces_ap_instances_) {
|
||||
if (it.first == ifname) {
|
||||
for (auto const& iface : it.second) {
|
||||
std::vector<std::string> ap_instances = it.second;
|
||||
for (auto const& iface : ap_instances) {
|
||||
if (iface == ifInstanceName) {
|
||||
if (!iface_util_->removeIfaceFromBridge(it.first, iface)) {
|
||||
LOG(ERROR)
|
||||
@@ -1075,13 +1076,20 @@ WifiStatus WifiChip::removeIfaceInstanceFromBridgedApIfaceInternal(
|
||||
<< " " << legacyErrorToString(legacy_status);
|
||||
return createWifiStatusFromLegacyError(legacy_status);
|
||||
}
|
||||
ap_instances.erase(
|
||||
std::remove(ap_instances.begin(), ap_instances.end(),
|
||||
ifInstanceName),
|
||||
ap_instances.end());
|
||||
br_ifaces_ap_instances_[ifname] = ap_instances;
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
br_ifaces_ap_instances_.erase(ifInstanceName);
|
||||
iface->removeInstance(ifInstanceName);
|
||||
setActiveWlanIfaceNameProperty(getFirstActiveWlanIfaceName());
|
||||
|
||||
return createWifiStatus(WifiStatusCode::SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user