diff options
author | Les Lee <lesl@google.com> | 2022-05-05 13:09:48 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2022-05-05 13:09:48 +0000 |
commit | 1686f456a9e463486ef9948574936a5471cc40b3 (patch) | |
tree | 42c64d3716743fa3cba4581baa8407c6cde30f0a | |
parent | 408e235ff65522f4babf8e7cb6a0b2ddeb232072 (diff) | |
parent | fa78442ca958269054291c789b3270afd4be73fc (diff) | |
download | wificond-1686f456a9e463486ef9948574936a5471cc40b3.tar.gz |
wifi: Handle world mode country code change am: fa78442ca9
Original change: https://googleplex-android-review.googlesource.com/c/platform/system/connectivity/wificond/+/17892632
Change-Id: I223987484f30f9484819001de20ac941bb4e32c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | server.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -488,12 +488,19 @@ bool Server::SetupInterface(const std::string& iface_name, } void Server::OnRegDomainChanged(uint32_t wiphy_index, std::string& country_code) { + string current_country_code; if (country_code.empty()) { - LOG(INFO) << "Regulatory domain changed"; + LOG(DEBUG) << "Regulatory domain changed with empty country code (world mode?)"; + if (!netlink_utils_->GetCountryCode(¤t_country_code)) { + LOG(ERROR) << "Fail to get country code on wiphy_index:" << wiphy_index; + } } else { - LOG(INFO) << "Regulatory domain changed to country: " << country_code - << " on wiphy_index: " << wiphy_index; - BroadcastRegDomainChanged(country_code); + current_country_code = country_code; + } + if (!current_country_code.empty()) { + LOG(INFO) << "Regulatory domain changed to country: " << current_country_code + << " on wiphy_index: " << wiphy_index; + BroadcastRegDomainChanged(current_country_code); } // Sometimes lower layer sends stale wiphy index when there are no // interfaces. So update band - wiphy index mapping only if an |