From 1a8877f52f2d5511c3fef8ad0f916cb4299c386c Mon Sep 17 00:00:00 2001 From: Les Lee Date: Tue, 11 Jan 2022 12:07:57 +0800 Subject: wifi: Add new API to notify wificond of CC have changed When device doesn't support NL80211_CMD_REG_CHANGED, the wificond has no way to know the CC(country code) have changed. Add a new API to allow the wifi frameworks notify wificond daemon of country code have changed. Bug: 211573255 Bug: 212554181 Bug: 207426796 Test: atest WifiNl80211ManagerTest Test: Maunal Test with log check. Change-Id: I1e2c980062e66e6dcf007c0e2a4f1e9b203536ac --- .../android/net/wifi/nl80211/WifiNl80211Manager.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'wifi/java') diff --git a/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java index 3b7566051fae..459696e81ee4 100644 --- a/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java +++ b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java @@ -1261,6 +1261,26 @@ public class WifiNl80211Manager { mWificondEventHandler.unregisterCountryCodeChangedListener(listener); } + /** + * Notifies the wificond daemon that the WiFi framework has successfully updated the Country + * Code of the driver. The wificond daemon needs this notification if the device does not + * support the NL80211_CMD_REG_CHANGED (otherwise it will find out on its own). The wificond + * updates in internal state in response to this Country Code update. + * + * @return true on success, false otherwise. + */ + public boolean notifyCountryCodeChanged() { + try { + if (mWificond != null) { + mWificond.notifyCountryCodeChanged(); + return true; + } + } catch (RemoteException e1) { + Log.e(TAG, "Failed to notify country code changed due to remote exception"); + } + return false; + } + /** * Register the provided callback handler for SoftAp events. The interface must first be created * using {@link #setupInterfaceForSoftApMode(String)}. The callback registration is valid until -- cgit v1.2.3-59-g8ed1b