summaryrefslogtreecommitdiff
path: root/wifi/java
diff options
context:
space:
mode:
author Les Lee <lesl@google.com> 2022-02-09 15:15:59 +0800
committer Les Lee <lesl@google.com> 2022-02-10 15:28:39 +0800
commit49c0582b47737d4022a24b16b43fd909413d7bb8 (patch)
treeb936555d00e419aa113e22e041f1ac5b5e985a82 /wifi/java
parent9c29783be8d0367014ea2ef3638bb400fe1ce5a5 (diff)
wifi: refine API: notifyCountryCodeChanged
Feedback from API council: 1. Change to return void 2. Rethrow exception instead of logging 3. Consider passing and notifying the new value for country code Bug: 216637965 Test: atest -c WifiNl80211ManagerTest Trst: atest -c FrameworksWifiTests Change-Id: If40f9434e20fd960a65de37c341d8bd6f57ed9d9
Diffstat (limited to 'wifi/java')
-rw-r--r--wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
index d3eb8e03c7aa..960447504d15 100644
--- a/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
+++ b/wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java
@@ -1269,18 +1269,19 @@ public class WifiNl80211Manager {
* 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.
+ * @param newCountryCode new country code. An ISO-3166-alpha2 country code which is 2-Character
+ * alphanumeric.
*/
- public boolean notifyCountryCodeChanged() {
+ public void notifyCountryCodeChanged(@Nullable String newCountryCode) {
+ if (mWificond == null) {
+ new RemoteException("Wificond service doesn't exist!").rethrowFromSystemServer();
+ }
try {
- if (mWificond != null) {
- mWificond.notifyCountryCodeChanged();
- return true;
- }
- } catch (RemoteException e1) {
- Log.e(TAG, "Failed to notify country code changed due to remote exception");
+ mWificond.notifyCountryCodeChanged();
+ Log.i(TAG, "Receive country code change to " + newCountryCode);
+ } catch (RemoteException re) {
+ re.rethrowFromSystemServer();
}
- return false;
}
/**