summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLes Lee <lesl@google.com>2022-05-05 13:09:48 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-05-05 13:09:48 +0000
commit1686f456a9e463486ef9948574936a5471cc40b3 (patch)
tree42c64d3716743fa3cba4581baa8407c6cde30f0a
parent408e235ff65522f4babf8e7cb6a0b2ddeb232072 (diff)
parentfa78442ca958269054291c789b3270afd4be73fc (diff)
downloadwificond-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.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/server.cpp b/server.cpp
index 1c40185..1fd10dd 100644
--- a/server.cpp
+++ b/server.cpp
@@ -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(&current_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