diff options
author | Purushottam Kushwaha <quic_pkushwah@quicinc.com> | 2023-10-03 11:50:20 +0530 |
---|---|---|
committer | Sunil Ravi <sunilravi@google.com> | 2023-10-03 17:52:11 +0000 |
commit | caad3d4137e8c1cb503dde6da2854001ab61829f (patch) | |
tree | 81826cb9e0efd308e8a386b03f1972e16d60f6fb | |
parent | 563d85f4a58cbf4b317b2944d81dcc88ecc1a3db (diff) | |
download | wificond-caad3d4137e8c1cb503dde6da2854001ab61829f.tar.gz |
Read kernel country code during registerWificondEventCallback()
During registerWificondEventCallback(), country code may be null or
empty. When last known country code is not available, try to read
the country code from kernel before updating to userspace.
Bug: 296552605
Test: Manual - start Wifi and Softap in 5GHz and trigger system_server
crash (adb shell stop && adb shell pkill wificond && adb shell
start). start SoftAp in 5GHz. Observe country code notification
from wificond is received and SoftAp is able to start without delay.
Change-Id: Ica6faefec3a4491f2826a6678e20188ccb0bda4c
Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
-rw-r--r-- | server.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -78,6 +78,10 @@ Status Server::registerWificondEventCallback(const sp<IWificondEventCallback>& c LOG(INFO) << "New wificond event callback registered"; wificond_event_callbacks_.push_back(callback); + if (current_country_code_.empty() && + !netlink_utils_->GetCountryCode(¤t_country_code_)) { + LOG(ERROR) << "Fail to get country code"; + } // Inform immediately about current country code if (!current_country_code_.empty()) callback->OnRegDomainChanged(current_country_code_); |