Loading core/api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -8905,7 +8905,7 @@ package android.net.wifi.nl80211 { method @Nullable public android.net.wifi.nl80211.DeviceWiphyCapabilities getDeviceWiphyCapabilities(@NonNull String); method @NonNull public java.util.List<android.net.wifi.nl80211.NativeScanResult> getScanResults(@NonNull String, int); method @Nullable public android.net.wifi.nl80211.WifiNl80211Manager.TxPacketCounters getTxPacketCounters(@NonNull String); method public boolean notifyCountryCodeChanged(); method public void notifyCountryCodeChanged(@Nullable String); method @Nullable public static android.net.wifi.nl80211.WifiNl80211Manager.OemSecurityType parseOemSecurityTypeElement(int, int, @NonNull byte[]); method @Deprecated public boolean registerApCallback(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.SoftApCallback); method public boolean registerCountryCodeChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.CountryCodeChangedListener); wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java +10 −9 Original line number Diff line number Diff line Loading @@ -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; Log.i(TAG, "Receive country code change to " + newCountryCode); } catch (RemoteException re) { re.rethrowFromSystemServer(); } } catch (RemoteException e1) { Log.e(TAG, "Failed to notify country code changed due to remote exception"); } return false; } /** Loading wifi/tests/src/android/net/wifi/nl80211/WifiNl80211ManagerTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -1143,17 +1143,17 @@ public class WifiNl80211ManagerTest { @Test public void testNotifyCountryCodeChanged() throws Exception { doNothing().when(mWificond).notifyCountryCodeChanged(); assertTrue(mWificondControl.notifyCountryCodeChanged()); mWificondControl.notifyCountryCodeChanged(TEST_COUNTRY_CODE); verify(mWificond).notifyCountryCodeChanged(); } /** * Tests notifyCountryCodeChanged with RemoteException */ @Test @Test(expected = RuntimeException.class) public void testNotifyCountryCodeChangedRemoteException() throws Exception { doThrow(new RemoteException()).when(mWificond).notifyCountryCodeChanged(); assertFalse(mWificondControl.notifyCountryCodeChanged()); mWificondControl.notifyCountryCodeChanged(TEST_COUNTRY_CODE); verify(mWificond).notifyCountryCodeChanged(); } Loading Loading
core/api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -8905,7 +8905,7 @@ package android.net.wifi.nl80211 { method @Nullable public android.net.wifi.nl80211.DeviceWiphyCapabilities getDeviceWiphyCapabilities(@NonNull String); method @NonNull public java.util.List<android.net.wifi.nl80211.NativeScanResult> getScanResults(@NonNull String, int); method @Nullable public android.net.wifi.nl80211.WifiNl80211Manager.TxPacketCounters getTxPacketCounters(@NonNull String); method public boolean notifyCountryCodeChanged(); method public void notifyCountryCodeChanged(@Nullable String); method @Nullable public static android.net.wifi.nl80211.WifiNl80211Manager.OemSecurityType parseOemSecurityTypeElement(int, int, @NonNull byte[]); method @Deprecated public boolean registerApCallback(@NonNull String, @NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.SoftApCallback); method public boolean registerCountryCodeChangedListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.nl80211.WifiNl80211Manager.CountryCodeChangedListener);
wifi/java/src/android/net/wifi/nl80211/WifiNl80211Manager.java +10 −9 Original line number Diff line number Diff line Loading @@ -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; Log.i(TAG, "Receive country code change to " + newCountryCode); } catch (RemoteException re) { re.rethrowFromSystemServer(); } } catch (RemoteException e1) { Log.e(TAG, "Failed to notify country code changed due to remote exception"); } return false; } /** Loading
wifi/tests/src/android/net/wifi/nl80211/WifiNl80211ManagerTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -1143,17 +1143,17 @@ public class WifiNl80211ManagerTest { @Test public void testNotifyCountryCodeChanged() throws Exception { doNothing().when(mWificond).notifyCountryCodeChanged(); assertTrue(mWificondControl.notifyCountryCodeChanged()); mWificondControl.notifyCountryCodeChanged(TEST_COUNTRY_CODE); verify(mWificond).notifyCountryCodeChanged(); } /** * Tests notifyCountryCodeChanged with RemoteException */ @Test @Test(expected = RuntimeException.class) public void testNotifyCountryCodeChangedRemoteException() throws Exception { doThrow(new RemoteException()).when(mWificond).notifyCountryCodeChanged(); assertFalse(mWificondControl.notifyCountryCodeChanged()); mWificondControl.notifyCountryCodeChanged(TEST_COUNTRY_CODE); verify(mWificond).notifyCountryCodeChanged(); } Loading