OSDN Git Service

DO NOT MERGE - Use Samoa country code to satisfy wifi regulatory concerns
authorVinit Deshapnde <vinitd@google.com>
Wed, 19 Mar 2014 22:04:49 +0000 (15:04 -0700)
committerVinit Deshapnde <vinitd@google.com>
Wed, 19 Mar 2014 22:04:49 +0000 (15:04 -0700)
This helps in reducing overt scans when cell network is unavailable; and
in turn helps alleviate some regulatory concerns.

BUG: 11062898

Change-Id: I2d860f2d1acfdafba427504247a54b81482b0f5b

core/res/res/values/config.xml
core/res/res/values/symbols.xml
wifi/java/android/net/wifi/WifiStateMachine.java

index 50b3a35..a3b8132 100644 (file)
     <!-- Wifi driver supports batched scan -->
     <bool translatable="false" name="config_wifi_batched_scan_supported">false</bool>
 
+    <!-- Wifi driver's fallback country code; WS is ISO-Alpha2 code for Samoa which
+         has restrictions on can be scanned; which may satisfy quite a few regulatory issues. -->
+    <string translatable="false" name="config_wifi_unknown_country_code">WS</string>
+
     <!-- Flag indicating whether the we should enable the automatic brightness in Settings.
          Software implementation will be used if config_hardware_auto_brightness_available is not set -->
     <bool name="config_automatic_brightness_available">false</bool>
index 4171355..1200276 100644 (file)
   <java-symbol type="string" name="config_ntpServer" />
   <java-symbol type="string" name="config_tether_apndata" />
   <java-symbol type="string" name="config_useragentprofile_url" />
+  <java-symbol type="string" name="config_wifi_unknown_country_code" />
   <java-symbol type="string" name="config_wifi_p2p_device_type" />
   <java-symbol type="string" name="contentServiceSync" />
   <java-symbol type="string" name="contentServiceSyncNotificationTitle" />
index 3dda56a..463a3a6 100644 (file)
@@ -1542,8 +1542,11 @@ public class WifiStateMachine extends StateMachine {
         // If it's empty, delay it in case it's a momentary dropout
         int countryCodeSequence = mCountryCodeSequence.incrementAndGet();
         if (TextUtils.isEmpty(countryCode)) {
+            String defaultCountryCode = mContext.getResources().getString(
+                    R.string.config_wifi_unknown_country_code);
+
             sendMessageDelayed(CMD_SET_COUNTRY_CODE, countryCodeSequence, persist ? 1 : 0,
-                    countryCode, COUNTRY_CODE_DELAY_MS);
+                    defaultCountryCode, COUNTRY_CODE_DELAY_MS);
         } else {
             sendMessage(CMD_SET_COUNTRY_CODE, countryCodeSequence, persist ? 1 : 0, countryCode);
         }