Loading services/java/com/android/server/WifiService.java +9 −0 Original line number Diff line number Diff line Loading @@ -887,6 +887,15 @@ public class WifiService extends IWifiManager.Stub { mWifiStateMachine.setCountryCode(countryCode, persist); } /** * Get the operational country code */ public String getCountryCode() { enforceAccessPermission(); return mWifiStateMachine.getCountryCode(); } /** * Set the operational frequency band * @param band One of Loading wifi/java/android/net/wifi/IWifiManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ interface IWifiManager void setCountryCode(String country, boolean persist); String getCountryCode(); void setFrequencyBand(int band, boolean persist); int getFrequencyBand(); Loading wifi/java/android/net/wifi/WifiManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -809,6 +809,18 @@ public class WifiManager { } catch (RemoteException e) { } } /** * Get the operational country code. * @hide */ public String getCountryCode() { try { return mService.getCountryCode(); } catch (RemoteException e) { return null; } } /** * Set the operational frequency band. * @param band One of Loading wifi/java/android/net/wifi/WifiStateMachine.java +13 −1 Original line number Diff line number Diff line Loading @@ -209,6 +209,9 @@ public class WifiStateMachine extends StateMachine { /* Tracks current frequency mode */ private AtomicInteger mFrequencyBand = new AtomicInteger(WifiManager.WIFI_FREQUENCY_BAND_AUTO); /* Tracks current country code */ private String mCountryCode = "GB"; /* Tracks if we are filtering Multicast v4 packets. Default is to filter. */ private AtomicBoolean mFilteringMulticastV4Packets = new AtomicBoolean(true); Loading Loading @@ -1078,6 +1081,13 @@ public class WifiStateMachine extends StateMachine { sendMessage(obtainMessage(CMD_SET_COUNTRY_CODE, countryCode)); } /** * Returns the operational country code */ public String getCountryCode() { return mCountryCode; } /** * Set the operational frequency band * @param band Loading Loading @@ -2792,7 +2802,9 @@ public class WifiStateMachine extends StateMachine { case CMD_SET_COUNTRY_CODE: String country = (String) message.obj; if (DBG) log("set country code " + country); if (!mWifiNative.setCountryCode(country.toUpperCase())) { if (mWifiNative.setCountryCode(country.toUpperCase())) { mCountryCode = country; } else { loge("Failed to set country code " + country); } break; Loading Loading
services/java/com/android/server/WifiService.java +9 −0 Original line number Diff line number Diff line Loading @@ -887,6 +887,15 @@ public class WifiService extends IWifiManager.Stub { mWifiStateMachine.setCountryCode(countryCode, persist); } /** * Get the operational country code */ public String getCountryCode() { enforceAccessPermission(); return mWifiStateMachine.getCountryCode(); } /** * Set the operational frequency band * @param band One of Loading
wifi/java/android/net/wifi/IWifiManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,8 @@ interface IWifiManager void setCountryCode(String country, boolean persist); String getCountryCode(); void setFrequencyBand(int band, boolean persist); int getFrequencyBand(); Loading
wifi/java/android/net/wifi/WifiManager.java +12 −0 Original line number Diff line number Diff line Loading @@ -809,6 +809,18 @@ public class WifiManager { } catch (RemoteException e) { } } /** * Get the operational country code. * @hide */ public String getCountryCode() { try { return mService.getCountryCode(); } catch (RemoteException e) { return null; } } /** * Set the operational frequency band. * @param band One of Loading
wifi/java/android/net/wifi/WifiStateMachine.java +13 −1 Original line number Diff line number Diff line Loading @@ -209,6 +209,9 @@ public class WifiStateMachine extends StateMachine { /* Tracks current frequency mode */ private AtomicInteger mFrequencyBand = new AtomicInteger(WifiManager.WIFI_FREQUENCY_BAND_AUTO); /* Tracks current country code */ private String mCountryCode = "GB"; /* Tracks if we are filtering Multicast v4 packets. Default is to filter. */ private AtomicBoolean mFilteringMulticastV4Packets = new AtomicBoolean(true); Loading Loading @@ -1078,6 +1081,13 @@ public class WifiStateMachine extends StateMachine { sendMessage(obtainMessage(CMD_SET_COUNTRY_CODE, countryCode)); } /** * Returns the operational country code */ public String getCountryCode() { return mCountryCode; } /** * Set the operational frequency band * @param band Loading Loading @@ -2792,7 +2802,9 @@ public class WifiStateMachine extends StateMachine { case CMD_SET_COUNTRY_CODE: String country = (String) message.obj; if (DBG) log("set country code " + country); if (!mWifiNative.setCountryCode(country.toUpperCase())) { if (mWifiNative.setCountryCode(country.toUpperCase())) { mCountryCode = country; } else { loge("Failed to set country code " + country); } break; Loading