Improve responsiveness of toggling wifi and refactor user restriction logic.
Moved logic for handling wifi state changes into correct listener method. Changed logic for handling isUiRestricted. This should streamline toggling flow for WiFi both when Wifi Scanning is on and off, and in guest mode. Bug: 36724409 Bug: 36711085 Bug: 36398321 Test: make, test cases in tracking bug Change-Id: I69fe07369db192c94f81dd678087ac4e8c35197b
This commit is contained in:
@@ -57,8 +57,7 @@ public class WifiEnabler implements SwitchWidgetController.OnSwitchChangeListene
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (WifiManager.WIFI_STATE_CHANGED_ACTION.equals(action)) {
|
||||
handleWifiStateChanged(intent.getIntExtra(
|
||||
WifiManager.EXTRA_WIFI_STATE, WifiManager.WIFI_STATE_UNKNOWN));
|
||||
handleWifiStateChanged(mWifiManager.getWifiState());
|
||||
} else if (WifiManager.SUPPLICANT_STATE_CHANGED_ACTION.equals(action)) {
|
||||
if (!mConnected.get()) {
|
||||
handleStateChanged(WifiInfo.getDetailedStateOf((SupplicantState)
|
||||
|
Reference in New Issue
Block a user