am 45e74676: Merge "Don\'t reset country code once it is persisted" into klp-dev
* commit '45e746766676681e4e191d0b7e521b8b3f6c284c': Don't reset country code once it is persisted
This commit is contained in:
@@ -352,10 +352,6 @@
|
|||||||
<!-- Wifi driver supports batched scan -->
|
<!-- Wifi driver supports batched scan -->
|
||||||
<bool translatable="false" name="config_wifi_batched_scan_supported">false</bool>
|
<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.
|
<!-- 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 -->
|
Software implementation will be used if config_hardware_auto_brightness_available is not set -->
|
||||||
<bool name="config_automatic_brightness_available">false</bool>
|
<bool name="config_automatic_brightness_available">false</bool>
|
||||||
|
|||||||
@@ -478,7 +478,6 @@
|
|||||||
<java-symbol type="string" name="config_ntpServer" />
|
<java-symbol type="string" name="config_ntpServer" />
|
||||||
<java-symbol type="string" name="config_tether_apndata" />
|
<java-symbol type="string" name="config_tether_apndata" />
|
||||||
<java-symbol type="string" name="config_useragentprofile_url" />
|
<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="config_wifi_p2p_device_type" />
|
||||||
<java-symbol type="string" name="contentServiceSync" />
|
<java-symbol type="string" name="contentServiceSync" />
|
||||||
<java-symbol type="string" name="contentServiceSyncNotificationTitle" />
|
<java-symbol type="string" name="contentServiceSyncNotificationTitle" />
|
||||||
|
|||||||
@@ -233,8 +233,6 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
private DhcpStateMachine mDhcpStateMachine;
|
private DhcpStateMachine mDhcpStateMachine;
|
||||||
private boolean mDhcpActive = false;
|
private boolean mDhcpActive = false;
|
||||||
|
|
||||||
// Delay in switching to null country code (non-null has no delay)
|
|
||||||
private final int COUNTRY_CODE_DELAY_MS = 15000;
|
|
||||||
private final AtomicInteger mCountryCodeSequence = new AtomicInteger();
|
private final AtomicInteger mCountryCodeSequence = new AtomicInteger();
|
||||||
|
|
||||||
private class InterfaceObserver extends BaseNetworkObserver {
|
private class InterfaceObserver extends BaseNetworkObserver {
|
||||||
@@ -1538,15 +1536,13 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
* @param persist {@code true} if the setting should be remembered.
|
* @param persist {@code true} if the setting should be remembered.
|
||||||
*/
|
*/
|
||||||
public void setCountryCode(String countryCode, boolean persist) {
|
public void setCountryCode(String countryCode, boolean persist) {
|
||||||
// If it's a country code, apply immediately,
|
// If it's a good country code, apply after the current
|
||||||
// If it's empty, delay it in case it's a momentary dropout
|
// wifi connection is terminated; ignore resetting of code
|
||||||
|
// for now (it is unclear what the chipset should do when
|
||||||
|
// country code is reset)
|
||||||
int countryCodeSequence = mCountryCodeSequence.incrementAndGet();
|
int countryCodeSequence = mCountryCodeSequence.incrementAndGet();
|
||||||
if (TextUtils.isEmpty(countryCode)) {
|
if (TextUtils.isEmpty(countryCode)) {
|
||||||
String defaultCountryCode = mContext.getResources().getString(
|
log("Ignoring resetting of country code");
|
||||||
R.string.config_wifi_unknown_country_code);
|
|
||||||
|
|
||||||
sendMessageDelayed(CMD_SET_COUNTRY_CODE, countryCodeSequence, persist ? 1 : 0,
|
|
||||||
defaultCountryCode, COUNTRY_CODE_DELAY_MS);
|
|
||||||
} else {
|
} else {
|
||||||
sendMessage(CMD_SET_COUNTRY_CODE, countryCodeSequence, persist ? 1 : 0, countryCode);
|
sendMessage(CMD_SET_COUNTRY_CODE, countryCodeSequence, persist ? 1 : 0, countryCode);
|
||||||
}
|
}
|
||||||
@@ -1661,6 +1657,8 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
pw.println("mSuspendOptNeedsDisabled " + mSuspendOptNeedsDisabled);
|
pw.println("mSuspendOptNeedsDisabled " + mSuspendOptNeedsDisabled);
|
||||||
pw.println("Supplicant status " + mWifiNative.status());
|
pw.println("Supplicant status " + mWifiNative.status());
|
||||||
pw.println("mEnableBackgroundScan " + mEnableBackgroundScan);
|
pw.println("mEnableBackgroundScan " + mEnableBackgroundScan);
|
||||||
|
pw.println("mLastSetCountryCode " + mLastSetCountryCode);
|
||||||
|
pw.println("mPersistedCountryCode " + mPersistedCountryCode);
|
||||||
pw.println();
|
pw.println();
|
||||||
mWifiConfigStore.dump(fd, pw, args);
|
mWifiConfigStore.dump(fd, pw, args);
|
||||||
}
|
}
|
||||||
@@ -3679,6 +3677,9 @@ public class WifiStateMachine extends StateMachine {
|
|||||||
deferMessage(message);
|
deferMessage(message);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case CMD_SET_COUNTRY_CODE:
|
||||||
|
deferMessage(message);
|
||||||
|
break;
|
||||||
case CMD_START_SCAN:
|
case CMD_START_SCAN:
|
||||||
/* Do not attempt to connect when we are already connected */
|
/* Do not attempt to connect when we are already connected */
|
||||||
noteScanStart(message.arg1, (WorkSource) message.obj);
|
noteScanStart(message.arg1, (WorkSource) message.obj);
|
||||||
|
|||||||
Reference in New Issue
Block a user