summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/wifi
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/settings/wifi')
-rw-r--r--src/com/android/settings/wifi/AdvancedSettings.java112
-rw-r--r--src/com/android/settings/wifi/AdvancedWifiSettings.java174
-rw-r--r--src/com/android/settings/wifi/WifiConfigController.java26
-rw-r--r--src/com/android/settings/wifi/WifiEnabler.java103
-rw-r--r--src/com/android/settings/wifi/WifiSettings.java251
-rw-r--r--src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java64
6 files changed, 390 insertions, 340 deletions
diff --git a/src/com/android/settings/wifi/AdvancedSettings.java b/src/com/android/settings/wifi/AdvancedSettings.java
deleted file mode 100644
index faea9f2..0000000
--- a/src/com/android/settings/wifi/AdvancedSettings.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.settings.wifi;
-
-import com.android.settings.R;
-import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.Utils;
-
-import android.app.Activity;
-import android.content.Context;
-import android.net.wifi.WifiInfo;
-import android.net.wifi.WifiManager;
-import android.os.Bundle;
-import android.os.SystemProperties;
-import android.preference.ListPreference;
-import android.preference.Preference;
-import android.text.TextUtils;
-import android.widget.Toast;
-import android.util.Log;
-
-public class AdvancedSettings extends SettingsPreferenceFragment
- implements Preference.OnPreferenceChangeListener {
-
- private static final String TAG = "AdvancedSettings";
- private static final String KEY_MAC_ADDRESS = "mac_address";
- private static final String KEY_CURRENT_IP_ADDRESS = "current_ip_address";
- private static final String KEY_FREQUENCY_BAND = "frequency_band";
-
- private WifiManager mWifiManager;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- addPreferencesFromResource(R.xml.wifi_advanced_settings);
- }
-
- @Override
- public void onActivityCreated(Bundle savedInstanceState) {
- super.onActivityCreated(savedInstanceState);
- mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
- }
-
- @Override
- public void onResume() {
- super.onResume();
- initPreferences();
- refreshWifiInfo();
- }
-
- private void initPreferences() {
-
- ListPreference pref = (ListPreference) findPreference(KEY_FREQUENCY_BAND);
-
- if (mWifiManager.isDualBandSupported()) {
- pref.setOnPreferenceChangeListener(this);
- int value = mWifiManager.getFrequencyBand();
- if (value != -1) {
- pref.setValue(String.valueOf(value));
- } else {
- Log.e(TAG, "Failed to fetch frequency band");
- }
- } else {
- getPreferenceScreen().removePreference(pref);
- }
- }
-
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- String key = preference.getKey();
- if (key == null) return true;
-
- if (key.equals(KEY_FREQUENCY_BAND)) {
- try {
- mWifiManager.setFrequencyBand(Integer.parseInt(((String) newValue)), true);
- } catch (NumberFormatException e) {
- Toast.makeText(getActivity(), R.string.wifi_setting_frequency_band_error,
- Toast.LENGTH_SHORT).show();
- return false;
- }
- }
-
- return true;
- }
-
- private void refreshWifiInfo() {
- WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
-
- Preference wifiMacAddressPref = findPreference(KEY_MAC_ADDRESS);
- String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
- wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
- : getActivity().getString(R.string.status_unavailable));
-
- Preference wifiIpAddressPref = findPreference(KEY_CURRENT_IP_ADDRESS);
- String ipAddress = Utils.getWifiIpAddresses(getActivity());
- wifiIpAddressPref.setSummary(ipAddress == null ?
- getActivity().getString(R.string.status_unavailable) : ipAddress);
- }
-
-}
diff --git a/src/com/android/settings/wifi/AdvancedWifiSettings.java b/src/com/android/settings/wifi/AdvancedWifiSettings.java
new file mode 100644
index 0000000..6c983fd
--- /dev/null
+++ b/src/com/android/settings/wifi/AdvancedWifiSettings.java
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.wifi;
+
+import android.content.Context;
+import android.net.wifi.WifiInfo;
+import android.net.wifi.WifiManager;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.PreferenceScreen;
+import android.provider.Settings;
+import android.provider.Settings.Secure;
+import android.text.TextUtils;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.android.settings.R;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.Utils;
+
+public class AdvancedWifiSettings extends SettingsPreferenceFragment
+ implements Preference.OnPreferenceChangeListener {
+
+ private static final String TAG = "AdvancedWifiSettings";
+ private static final String KEY_MAC_ADDRESS = "mac_address";
+ private static final String KEY_CURRENT_IP_ADDRESS = "current_ip_address";
+ private static final String KEY_FREQUENCY_BAND = "frequency_band";
+ private static final String KEY_NOTIFY_OPEN_NETWORKS = "notify_open_networks";
+ private static final String KEY_SLEEP_POLICY = "sleep_policy";
+ private static final String KEY_ENABLE_WIFI_WATCHDOG = "wifi_enable_watchdog_service";
+
+ private WifiManager mWifiManager;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.wifi_advanced_settings);
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ super.onActivityCreated(savedInstanceState);
+ mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ initPreferences();
+ refreshWifiInfo();
+ }
+
+ private void initPreferences() {
+ CheckBoxPreference notifyOpenNetworks =
+ (CheckBoxPreference) findPreference(KEY_NOTIFY_OPEN_NETWORKS);
+ notifyOpenNetworks.setChecked(Secure.getInt(getContentResolver(),
+ Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0) == 1);
+ notifyOpenNetworks.setEnabled(mWifiManager.isWifiEnabled());
+
+ CheckBoxPreference watchdogEnabled =
+ (CheckBoxPreference) findPreference(KEY_ENABLE_WIFI_WATCHDOG);
+ watchdogEnabled.setChecked(Secure.getInt(getContentResolver(),
+ Secure.WIFI_WATCHDOG_ON, 1) == 1);
+
+ watchdogEnabled.setEnabled(mWifiManager.isWifiEnabled());
+
+ ListPreference frequencyPref = (ListPreference) findPreference(KEY_FREQUENCY_BAND);
+
+ if (mWifiManager.isDualBandSupported()) {
+ frequencyPref.setOnPreferenceChangeListener(this);
+ int value = mWifiManager.getFrequencyBand();
+ if (value != -1) {
+ frequencyPref.setValue(String.valueOf(value));
+ } else {
+ Log.e(TAG, "Failed to fetch frequency band");
+ }
+ } else {
+ if (frequencyPref != null) {
+ // null if it has already been removed before resume
+ getPreferenceScreen().removePreference(frequencyPref);
+ }
+ }
+
+ ListPreference sleepPolicyPref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
+ if (sleepPolicyPref != null) {
+ if (Utils.isWifiOnly()) {
+ sleepPolicyPref.setEntries(R.array.wifi_sleep_policy_entries_wifi_only);
+ sleepPolicyPref.setSummary(R.string.wifi_setting_sleep_policy_summary_wifi_only);
+ }
+ sleepPolicyPref.setOnPreferenceChangeListener(this);
+ int value = Settings.System.getInt(getContentResolver(),
+ Settings.System.WIFI_SLEEP_POLICY,
+ Settings.System.WIFI_SLEEP_POLICY_NEVER);
+ sleepPolicyPref.setValue(String.valueOf(value));
+ }
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) {
+ String key = preference.getKey();
+
+ if (KEY_NOTIFY_OPEN_NETWORKS.equals(key)) {
+ Secure.putInt(getContentResolver(),
+ Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
+ ((CheckBoxPreference) preference).isChecked() ? 1 : 0);
+ } else if (KEY_ENABLE_WIFI_WATCHDOG.equals(key)) {
+ Secure.putInt(getContentResolver(),
+ Secure.WIFI_WATCHDOG_ON,
+ ((CheckBoxPreference) preference).isChecked() ? 1 : 0);
+ } else {
+ return super.onPreferenceTreeClick(screen, preference);
+ }
+ return true;
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ String key = preference.getKey();
+
+ if (KEY_FREQUENCY_BAND.equals(key)) {
+ try {
+ mWifiManager.setFrequencyBand(Integer.parseInt(((String) newValue)), true);
+ } catch (NumberFormatException e) {
+ Toast.makeText(getActivity(), R.string.wifi_setting_frequency_band_error,
+ Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ }
+
+ if (KEY_SLEEP_POLICY.equals(key)) {
+ try {
+ Settings.System.putInt(getContentResolver(),
+ Settings.System.WIFI_SLEEP_POLICY, Integer.parseInt(((String) newValue)));
+ } catch (NumberFormatException e) {
+ Toast.makeText(getActivity(), R.string.wifi_setting_sleep_policy_error,
+ Toast.LENGTH_SHORT).show();
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ private void refreshWifiInfo() {
+ WifiInfo wifiInfo = mWifiManager.getConnectionInfo();
+
+ Preference wifiMacAddressPref = findPreference(KEY_MAC_ADDRESS);
+ String macAddress = wifiInfo == null ? null : wifiInfo.getMacAddress();
+ wifiMacAddressPref.setSummary(!TextUtils.isEmpty(macAddress) ? macAddress
+ : getActivity().getString(R.string.status_unavailable));
+
+ Preference wifiIpAddressPref = findPreference(KEY_CURRENT_IP_ADDRESS);
+ String ipAddress = Utils.getWifiIpAddresses(getActivity());
+ wifiIpAddressPref.setSummary(ipAddress == null ?
+ getActivity().getString(R.string.status_unavailable) : ipAddress);
+ }
+
+}
diff --git a/src/com/android/settings/wifi/WifiConfigController.java b/src/com/android/settings/wifi/WifiConfigController.java
index 91f4110..a8ce94f 100644
--- a/src/com/android/settings/wifi/WifiConfigController.java
+++ b/src/com/android/settings/wifi/WifiConfigController.java
@@ -16,33 +16,29 @@
package com.android.settings.wifi;
+import static android.net.wifi.WifiConfiguration.INVALID_NETWORK_ID;
+
import android.content.Context;
-import android.content.DialogInterface;
import android.content.res.Resources;
-import android.net.DhcpInfo;
import android.net.LinkAddress;
import android.net.LinkProperties;
import android.net.NetworkInfo.DetailedState;
import android.net.NetworkUtils;
-import android.net.Proxy;
import android.net.ProxyProperties;
import android.net.RouteInfo;
import android.net.wifi.WifiConfiguration;
-import android.net.wifi.WifiConfiguration.IpAssignment;
import android.net.wifi.WifiConfiguration.AuthAlgorithm;
+import android.net.wifi.WifiConfiguration.IpAssignment;
import android.net.wifi.WifiConfiguration.KeyMgmt;
-import android.net.wifi.WpsConfiguration;
-import android.net.wifi.WpsConfiguration.Setup;
-
-import static android.net.wifi.WifiConfiguration.INVALID_NETWORK_ID;
import android.net.wifi.WifiConfiguration.ProxySettings;
import android.net.wifi.WifiInfo;
+import android.net.wifi.WpsConfiguration;
+import android.net.wifi.WpsConfiguration.Setup;
import android.security.Credentials;
import android.security.KeyStore;
import android.text.Editable;
import android.text.InputType;
import android.text.TextWatcher;
-import android.text.format.Formatter;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
@@ -57,12 +53,10 @@ import com.android.settings.ProxySelector;
import com.android.settings.R;
import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
import java.util.Iterator;
/**
- * The class for allowing UIs like {@link WifiDialog} and {@link WifiConfigPreference} to
+ * The class for allowing UIs like {@link WifiDialog} and {@link WifiConfigUiBase} to
* share the logic for controlling buttons, text fields, etc.
*/
public class WifiConfigController implements TextWatcher,
@@ -429,7 +423,9 @@ public class WifiConfigController implements TextWatcher,
int networkPrefixLength = -1;
try {
networkPrefixLength = Integer.parseInt(mNetworkPrefixLengthView.getText().toString());
- } catch (NumberFormatException e) { }
+ } catch (NumberFormatException e) {
+ // Use -1
+ }
if (networkPrefixLength < 0 || networkPrefixLength > 32) {
return R.string.wifi_ip_settings_invalid_network_prefix_length;
}
@@ -698,6 +694,7 @@ public class WifiConfigController implements TextWatcher,
private void setSelection(Spinner spinner, String value) {
if (value != null) {
+ @SuppressWarnings("unchecked")
ArrayAdapter<String> adapter = (ArrayAdapter<String>) spinner.getAdapter();
for (int i = adapter.getCount() - 1; i >= 0; --i) {
if (value.equals(adapter.getItem(i))) {
@@ -719,10 +716,12 @@ public class WifiConfigController implements TextWatcher,
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+ // work done in afterTextChanged
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
+ // work done in afterTextChanged
}
@Override
@@ -750,5 +749,6 @@ public class WifiConfigController implements TextWatcher,
@Override
public void onNothingSelected(AdapterView<?> parent) {
+ //
}
}
diff --git a/src/com/android/settings/wifi/WifiEnabler.java b/src/com/android/settings/wifi/WifiEnabler.java
index 7f1221e..223022d 100644
--- a/src/com/android/settings/wifi/WifiEnabler.java
+++ b/src/com/android/settings/wifi/WifiEnabler.java
@@ -16,9 +16,6 @@
package com.android.settings.wifi;
-import com.android.settings.R;
-import com.android.settings.WirelessSettings;
-
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -27,19 +24,19 @@ import android.net.NetworkInfo;
import android.net.wifi.SupplicantState;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
-import android.preference.Preference;
-import android.preference.CheckBoxPreference;
import android.provider.Settings;
-import android.text.TextUtils;
+import android.widget.CompoundButton;
+import android.widget.Switch;
import android.widget.Toast;
+import com.android.settings.R;
+import com.android.settings.WirelessSettings;
+
import java.util.concurrent.atomic.AtomicBoolean;
-public class WifiEnabler implements Preference.OnPreferenceChangeListener {
+public class WifiEnabler implements CompoundButton.OnCheckedChangeListener {
private final Context mContext;
- private final CheckBoxPreference mCheckBox;
- private final CharSequence mOriginalSummary;
-
+ private Switch mSwitch;
private AtomicBoolean mConnected = new AtomicBoolean(false);
private final WifiManager mWifiManager;
@@ -65,11 +62,9 @@ public class WifiEnabler implements Preference.OnPreferenceChangeListener {
}
};
- public WifiEnabler(Context context, CheckBoxPreference checkBox) {
+ public WifiEnabler(Context context, Switch switch_) {
mContext = context;
- mCheckBox = checkBox;
- mOriginalSummary = checkBox.getSummary();
- checkBox.setPersistent(false);
+ mSwitch = switch_;
mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
mIntentFilter = new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION);
@@ -81,78 +76,86 @@ public class WifiEnabler implements Preference.OnPreferenceChangeListener {
public void resume() {
// Wi-Fi state is sticky, so just let the receiver update UI
mContext.registerReceiver(mReceiver, mIntentFilter);
- mCheckBox.setOnPreferenceChangeListener(this);
+ mSwitch.setOnCheckedChangeListener(this);
}
public void pause() {
mContext.unregisterReceiver(mReceiver);
- mCheckBox.setOnPreferenceChangeListener(null);
+ mSwitch.setOnCheckedChangeListener(null);
}
- public boolean onPreferenceChange(Preference preference, Object value) {
- boolean enable = (Boolean) value;
+ public void setSwitch(Switch switch_) {
+ if (mSwitch == switch_) return;
+ mSwitch.setOnCheckedChangeListener(null);
+ mSwitch = switch_;
+ mSwitch.setOnCheckedChangeListener(this);
+
+ final int wifiState = mWifiManager.getWifiState();
+ boolean isEnabled = wifiState == WifiManager.WIFI_STATE_ENABLED;
+ boolean isDisabled = wifiState == WifiManager.WIFI_STATE_DISABLED;
+ mSwitch.setChecked(isEnabled);
+ mSwitch.setEnabled(isEnabled || isDisabled);
+ }
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
// Show toast message if Wi-Fi is not allowed in airplane mode
- if (enable && !WirelessSettings
- .isRadioAllowed(mContext, Settings.System.RADIO_WIFI)) {
- Toast.makeText(mContext, R.string.wifi_in_airplane_mode,
- Toast.LENGTH_SHORT).show();
- return false;
+ if (isChecked && !WirelessSettings.isRadioAllowed(mContext, Settings.System.RADIO_WIFI)) {
+ Toast.makeText(mContext, R.string.wifi_in_airplane_mode, Toast.LENGTH_SHORT).show();
+ // Reset switch to off. No infinite check/listenenr loop.
+ buttonView.setChecked(false);
}
- /**
- * Disable tethering if enabling Wifi
- */
+ // Disable tethering if enabling Wifi
int wifiApState = mWifiManager.getWifiApState();
- if (enable && ((wifiApState == WifiManager.WIFI_AP_STATE_ENABLING) ||
+ if (isChecked && ((wifiApState == WifiManager.WIFI_AP_STATE_ENABLING) ||
(wifiApState == WifiManager.WIFI_AP_STATE_ENABLED))) {
mWifiManager.setWifiApEnabled(null, false);
}
- if (mWifiManager.setWifiEnabled(enable)) {
- mCheckBox.setEnabled(false);
+
+ if (mWifiManager.setWifiEnabled(isChecked)) {
+ // Intent has been taken into account, disable until new state is active
+ mSwitch.setEnabled(false);
} else {
- mCheckBox.setSummary(R.string.wifi_error);
+ // Error
+ Toast.makeText(mContext, R.string.wifi_error, Toast.LENGTH_SHORT).show();
}
-
- // Don't update UI to opposite state until we're sure
- return false;
}
private void handleWifiStateChanged(int state) {
switch (state) {
case WifiManager.WIFI_STATE_ENABLING:
- mCheckBox.setSummary(R.string.wifi_starting);
- mCheckBox.setEnabled(false);
+ mSwitch.setEnabled(false);
break;
case WifiManager.WIFI_STATE_ENABLED:
- mCheckBox.setChecked(true);
- mCheckBox.setSummary(null);
- mCheckBox.setEnabled(true);
+ mSwitch.setChecked(true);
+ mSwitch.setEnabled(true);
break;
case WifiManager.WIFI_STATE_DISABLING:
- mCheckBox.setSummary(R.string.wifi_stopping);
- mCheckBox.setEnabled(false);
+ mSwitch.setEnabled(false);
break;
case WifiManager.WIFI_STATE_DISABLED:
- mCheckBox.setChecked(false);
- mCheckBox.setSummary(mOriginalSummary);
- mCheckBox.setEnabled(true);
+ mSwitch.setChecked(false);
+ mSwitch.setEnabled(true);
break;
default:
- mCheckBox.setChecked(false);
- mCheckBox.setSummary(R.string.wifi_error);
- mCheckBox.setEnabled(true);
+ mSwitch.setChecked(false);
+ mSwitch.setEnabled(true);
}
}
- private void handleStateChanged(NetworkInfo.DetailedState state) {
+ private void handleStateChanged(@SuppressWarnings("unused") NetworkInfo.DetailedState state) {
+ // After the refactoring from a CheckBoxPreference to a Switch, this method is useless since
+ // there is nowhere to display a summary.
+ // This code is kept in case a future change re-introduces an associated text.
+ /*
// WifiInfo is valid if and only if Wi-Fi is enabled.
- // Here we use the state of the check box as an optimization.
- if (state != null && mCheckBox.isChecked()) {
+ // Here we use the state of the switch as an optimization.
+ if (state != null && mSwitch.isChecked()) {
WifiInfo info = mWifiManager.getConnectionInfo();
if (info != null) {
- mCheckBox.setSummary(Summary.get(mContext, info.getSSID(), state));
+ //setSummary(Summary.get(mContext, info.getSSID(), state));
}
}
+ */
}
}
diff --git a/src/com/android/settings/wifi/WifiSettings.java b/src/com/android/settings/wifi/WifiSettings.java
index ab5e686..74400d4 100644
--- a/src/com/android/settings/wifi/WifiSettings.java
+++ b/src/com/android/settings/wifi/WifiSettings.java
@@ -18,6 +18,7 @@ package com.android.settings.wifi;
import static android.net.wifi.WifiConfiguration.INVALID_NETWORK_ID;
+import android.app.ActionBar;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.BroadcastReceiver;
@@ -31,40 +32,36 @@ import android.net.NetworkInfo.DetailedState;
import android.net.wifi.ScanResult;
import android.net.wifi.SupplicantState;
import android.net.wifi.WifiConfiguration;
+import android.net.wifi.WifiConfiguration.KeyMgmt;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.net.wifi.WpsResult;
-import android.net.wifi.WifiConfiguration.KeyMgmt;
-import android.net.wifi.WpsConfiguration;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
-import android.preference.CheckBoxPreference;
import android.preference.Preference;
-import android.preference.ListPreference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
-import android.provider.Settings.Secure;
-import android.provider.Settings;
import android.security.Credentials;
import android.security.KeyStore;
import android.util.Log;
import android.view.ContextMenu;
+import android.view.ContextMenu.ContextMenuInfo;
+import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
-import android.view.ContextMenu.ContextMenuInfo;
-import android.widget.Toast;
import android.widget.AdapterView.AdapterContextMenuInfo;
+import android.widget.Switch;
+import android.widget.TextView;
+import android.widget.Toast;
import com.android.internal.util.AsyncChannel;
-import com.android.settings.ProgressCategoryBase;
import com.android.settings.R;
import com.android.settings.SettingsPreferenceFragment;
-import com.android.settings.Utils;
import java.util.ArrayList;
import java.util.Collection;
@@ -83,14 +80,14 @@ import java.util.concurrent.atomic.AtomicBoolean;
* other decorations specific to that screen.
*/
public class WifiSettings extends SettingsPreferenceFragment
- implements DialogInterface.OnClickListener, Preference.OnPreferenceChangeListener {
+ implements DialogInterface.OnClickListener {
private static final String TAG = "WifiSettings";
private static final int MENU_ID_SCAN = Menu.FIRST;
- private static final int MENU_ID_ADVANCED = Menu.FIRST + 1;
- private static final int MENU_ID_CONNECT = Menu.FIRST + 2;
- private static final int MENU_ID_FORGET = Menu.FIRST + 3;
- private static final int MENU_ID_MODIFY = Menu.FIRST + 4;
- private static final String KEY_SLEEP_POLICY = "sleep_policy";
+ private static final int MENU_ID_ADD_NETWORK = Menu.FIRST + 1;
+ private static final int MENU_ID_ADVANCED = Menu.FIRST + 2;
+ private static final int MENU_ID_CONNECT = Menu.FIRST + 3;
+ private static final int MENU_ID_FORGET = Menu.FIRST + 4;
+ private static final int MENU_ID_MODIFY = Menu.FIRST + 5;
private final IntentFilter mFilter;
private final BroadcastReceiver mReceiver;
@@ -98,12 +95,8 @@ public class WifiSettings extends SettingsPreferenceFragment
private WifiManager mWifiManager;
private WifiEnabler mWifiEnabler;
- private CheckBoxPreference mNotifyOpenNetworks;
- private ProgressCategoryBase mAccessPoints;
- private Preference mAddNetwork;
// An access point being editted is stored here.
private AccessPoint mSelectedAccessPoint;
- private boolean mEdit;
private DetailedState mLastState;
private WifiInfo mLastInfo;
@@ -114,6 +107,9 @@ public class WifiSettings extends SettingsPreferenceFragment
private WifiDialog mDialog;
+ private View mView;
+ private TextView mEmptyView;
+
/* Used in Wifi Setup context */
// this boolean extra specifies whether to disable the Next button when not connected
@@ -157,11 +153,8 @@ public class WifiSettings extends SettingsPreferenceFragment
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- if (mInXlSetupWizard) {
- return inflater.inflate(R.layout.custom_preference_list_fragment, container, false);
- } else {
- return super.onCreateView(inflater, container, savedInstanceState);
- }
+ mView = inflater.inflate(R.layout.custom_preference_list_fragment, container, false);
+ return mView;
}
@Override
@@ -180,60 +173,51 @@ public class WifiSettings extends SettingsPreferenceFragment
// state, start it off in the right state
mEnableNextOnConnection = intent.getBooleanExtra(EXTRA_ENABLE_NEXT_ON_CONNECT, false);
- // Avoid re-adding on returning from an overlapping activity/fragment.
- if (getPreferenceScreen() == null || getPreferenceScreen().getPreferenceCount() < 2) {
- if (mEnableNextOnConnection) {
- if (hasNextButton()) {
- final ConnectivityManager connectivity = (ConnectivityManager)
- getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
- if (connectivity != null) {
- NetworkInfo info = connectivity.getNetworkInfo(
- ConnectivityManager.TYPE_WIFI);
- changeNextButtonState(info.isConnected());
- }
+ if (mEnableNextOnConnection) {
+ if (hasNextButton()) {
+ final ConnectivityManager connectivity = (ConnectivityManager)
+ getActivity().getSystemService(Context.CONNECTIVITY_SERVICE);
+ if (connectivity != null) {
+ NetworkInfo info = connectivity.getNetworkInfo(
+ ConnectivityManager.TYPE_WIFI);
+ changeNextButtonState(info.isConnected());
}
}
+ }
- if (mInXlSetupWizard) {
- addPreferencesFromResource(R.xml.wifi_access_points_for_wifi_setup_xl);
- } else if (intent.getBooleanExtra("only_access_points", false)) {
- addPreferencesFromResource(R.xml.wifi_access_points);
- } else {
- addPreferencesFromResource(R.xml.wifi_settings);
- mWifiEnabler = new WifiEnabler(activity,
- (CheckBoxPreference) findPreference("enable_wifi"));
- mNotifyOpenNetworks =
- (CheckBoxPreference) findPreference("notify_open_networks");
- mNotifyOpenNetworks.setChecked(Secure.getInt(getContentResolver(),
- Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0) == 1);
- }
- // This may be either ProgressCategory or AccessPointCategoryForXL.
- final ProgressCategoryBase preference =
- (ProgressCategoryBase) findPreference("access_points");
- mAccessPoints = preference;
- mAccessPoints.setOrderingAsAdded(false);
- mAddNetwork = findPreference("add_network");
-
- ListPreference pref = (ListPreference) findPreference(KEY_SLEEP_POLICY);
- if (pref != null) {
- if (Utils.isWifiOnly()) {
- pref.setEntries(R.array.wifi_sleep_policy_entries_wifi_only);
- pref.setSummary(R.string.wifi_setting_sleep_policy_summary_wifi_only);
+ if (mInXlSetupWizard) {
+ addPreferencesFromResource(R.xml.wifi_access_points_for_wifi_setup_xl);
+ } else {
+ addPreferencesFromResource(R.xml.wifi_settings);
+
+ Switch actionBarSwitch = new Switch(activity);
+
+ if (activity instanceof PreferenceActivity) {
+ PreferenceActivity preferenceActivity = (PreferenceActivity) activity;
+ if (preferenceActivity.onIsHidingHeaders() || !preferenceActivity.onIsMultiPane()) {
+ final int padding = activity.getResources().getDimensionPixelSize(
+ R.dimen.action_bar_switch_padding);
+ actionBarSwitch.setPadding(0, 0, padding, 0);
+ activity.getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM,
+ ActionBar.DISPLAY_SHOW_CUSTOM);
+ activity.getActionBar().setCustomView(actionBarSwitch, new ActionBar.LayoutParams(
+ ActionBar.LayoutParams.WRAP_CONTENT,
+ ActionBar.LayoutParams.WRAP_CONTENT,
+ Gravity.CENTER_VERTICAL | Gravity.RIGHT));
}
- pref.setOnPreferenceChangeListener(this);
- int value = Settings.System.getInt(getContentResolver(),
- Settings.System.WIFI_SLEEP_POLICY,
- Settings.System.WIFI_SLEEP_POLICY_NEVER);
- pref.setValue(String.valueOf(value));
}
- registerForContextMenu(getListView());
- setHasOptionsMenu(true);
+ mWifiEnabler = new WifiEnabler(activity, actionBarSwitch);
}
+ mEmptyView = (TextView) mView.findViewById(R.id.empty);
+ getListView().setEmptyView(mEmptyView);
+
+ registerForContextMenu(getListView());
+ setHasOptionsMenu(true);
+
// After confirming PreferenceScreen is available, we call super.
super.onActivityCreated(savedInstanceState);
-
}
@Override
@@ -245,10 +229,11 @@ public class WifiSettings extends SettingsPreferenceFragment
getActivity().registerReceiver(mReceiver, mFilter);
if (mKeyStoreNetworkId != INVALID_NETWORK_ID &&
- KeyStore.getInstance().test() == KeyStore.NO_ERROR) {
+ KeyStore.getInstance().state() == KeyStore.State.UNLOCKED) {
mWifiManager.connectNetwork(mKeyStoreNetworkId);
}
mKeyStoreNetworkId = INVALID_NETWORK_ID;
+
updateAccessPoints();
}
@@ -270,10 +255,18 @@ public class WifiSettings extends SettingsPreferenceFragment
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
// We don't want menus in Setup Wizard XL.
if (!mInXlSetupWizard) {
+ final boolean wifiIsEnabled = mWifiManager.isWifiEnabled();
menu.add(Menu.NONE, MENU_ID_SCAN, 0, R.string.wifi_menu_scan)
- .setIcon(R.drawable.ic_menu_scan_network);
+ //.setIcon(R.drawable.ic_menu_scan_network)
+ .setEnabled(wifiIsEnabled)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
+ menu.add(Menu.NONE, MENU_ID_ADD_NETWORK, 0, R.string.wifi_add_network)
+ //.setIcon(android.R.drawable.ic_menu_add)
+ .setEnabled(wifiIsEnabled)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
menu.add(Menu.NONE, MENU_ID_ADVANCED, 0, R.string.wifi_menu_advanced)
- .setIcon(android.R.drawable.ic_menu_manage);
+ //.setIcon(android.R.drawable.ic_menu_manage)
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
}
super.onCreateOptionsMenu(menu, inflater);
}
@@ -286,15 +279,20 @@ public class WifiSettings extends SettingsPreferenceFragment
mScanner.forceScan();
}
return true;
+ case MENU_ID_ADD_NETWORK:
+ if (mWifiManager.isWifiEnabled()) {
+ onAddNetworkPressed();
+ }
+ return true;
case MENU_ID_ADVANCED:
if (getActivity() instanceof PreferenceActivity) {
((PreferenceActivity) getActivity()).startPreferencePanel(
- AdvancedSettings.class.getCanonicalName(),
+ AdvancedWifiSettings.class.getCanonicalName(),
null,
R.string.wifi_advanced_titlebar, null,
this, 0);
} else {
- startFragment(this, AdvancedSettings.class.getCanonicalName(), -1, null);
+ startFragment(this, AdvancedWifiSettings.class.getCanonicalName(), -1, null);
}
return true;
}
@@ -363,43 +361,17 @@ public class WifiSettings extends SettingsPreferenceFragment
if (preference instanceof AccessPoint) {
mSelectedAccessPoint = (AccessPoint) preference;
showConfigUi(mSelectedAccessPoint, false);
- } else if (preference == mAddNetwork) {
- onAddNetworkPressed();
- } else if (preference == mNotifyOpenNetworks) {
- Secure.putInt(getContentResolver(),
- Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON,
- mNotifyOpenNetworks.isChecked() ? 1 : 0);
} else {
return super.onPreferenceTreeClick(screen, preference);
}
return true;
}
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- String key = preference.getKey();
- if (key == null) return true;
-
- if (key.equals(KEY_SLEEP_POLICY)) {
- try {
- Settings.System.putInt(getContentResolver(),
- Settings.System.WIFI_SLEEP_POLICY, Integer.parseInt(((String) newValue)));
- } catch (NumberFormatException e) {
- Toast.makeText(getActivity(), R.string.wifi_setting_sleep_policy_error,
- Toast.LENGTH_SHORT).show();
- return false;
- }
- }
-
- return true;
- }
-
-
/**
* Shows an appropriate Wifi configuration component.
* Called when a user clicks "Add network" preference or one of available networks is selected.
*/
private void showConfigUi(AccessPoint accessPoint, boolean edit) {
- mEdit = edit;
if (mInXlSetupWizard) {
((WifiSettingsForSetupWizardXL)getActivity()).showConfigUi(accessPoint, edit);
} else {
@@ -417,7 +389,7 @@ public class WifiSettings extends SettingsPreferenceFragment
private boolean requireKeyStore(WifiConfiguration config) {
if (WifiConfigController.requireKeyStore(config) &&
- KeyStore.getInstance().test() != KeyStore.NO_ERROR) {
+ KeyStore.getInstance().state() != KeyStore.State.UNLOCKED) {
mKeyStoreNetworkId = config.networkId;
Credentials.getInstance().unlock(getActivity());
return true;
@@ -430,20 +402,42 @@ public class WifiSettings extends SettingsPreferenceFragment
* the strength of network and the security for it.
*/
private void updateAccessPoints() {
- mAccessPoints.removeAll();
+ final int wifiState = mWifiManager.getWifiState();
+
+ switch (wifiState) {
+ case WifiManager.WIFI_STATE_ENABLED:
+ getPreferenceScreen().removeAll();
+ // AccessPoints are automatically sorted with TreeSet.
+ final Collection<AccessPoint> accessPoints = constructAccessPoints();
+ if (mInXlSetupWizard) {
+ ((WifiSettingsForSetupWizardXL)getActivity()).onAccessPointsUpdated(
+ getPreferenceScreen(), accessPoints);
+ } else {
+ for (AccessPoint accessPoint : accessPoints) {
+ getPreferenceScreen().addPreference(accessPoint);
+ }
+ }
+ break;
- // AccessPoints are automatically sorted with TreeSet.
- final Collection<AccessPoint> accessPoints = constructAccessPoints();
- if (mInXlSetupWizard) {
- ((WifiSettingsForSetupWizardXL)getActivity()).onAccessPointsUpdated(
- mAccessPoints, accessPoints);
- } else {
- for (AccessPoint accessPoint : accessPoints) {
- mAccessPoints.addPreference(accessPoint);
- }
+ case WifiManager.WIFI_STATE_ENABLING:
+ getPreferenceScreen().removeAll();
+ break;
+
+ case WifiManager.WIFI_STATE_DISABLING:
+ addMessagePreference(R.string.wifi_stopping);
+ break;
+
+ case WifiManager.WIFI_STATE_DISABLED:
+ addMessagePreference(R.string.wifi_empty_list_wifi_off);
+ break;
}
}
+ private void addMessagePreference(int messageId) {
+ if (mEmptyView != null) mEmptyView.setText(messageId);
+ getPreferenceScreen().removeAll();
+ }
+
private Collection<AccessPoint> constructAccessPoints() {
Collection<AccessPoint> accessPoints = new ArrayList<AccessPoint>();
@@ -542,9 +536,9 @@ public class WifiSettings extends SettingsPreferenceFragment
mLastState = state;
}
- for (int i = mAccessPoints.getPreferenceCount() - 1; i >= 0; --i) {
+ for (int i = getPreferenceScreen().getPreferenceCount() - 1; i >= 0; --i) {
// Maybe there's a WifiConfigPreference
- Preference preference = mAccessPoints.getPreference(i);
+ Preference preference = getPreferenceScreen().getPreference(i);
if (preference instanceof AccessPoint) {
final AccessPoint accessPoint = (AccessPoint) preference;
accessPoint.update(mLastInfo, mLastState);
@@ -557,12 +551,23 @@ public class WifiSettings extends SettingsPreferenceFragment
}
private void updateWifiState(int state) {
- if (state == WifiManager.WIFI_STATE_ENABLED) {
- mScanner.resume();
- } else {
- mScanner.pause();
- mAccessPoints.removeAll();
+ getActivity().invalidateOptionsMenu();
+
+ switch (state) {
+ case WifiManager.WIFI_STATE_ENABLED:
+ mScanner.resume();
+ return; // not break, to avoid the call to pause() below
+
+ case WifiManager.WIFI_STATE_ENABLING:
+ addMessagePreference(R.string.wifi_starting);
+ break;
+
+ case WifiManager.WIFI_STATE_DISABLED:
+ addMessagePreference(R.string.wifi_empty_list_wifi_off);
+ break;
}
+
+ mScanner.pause();
}
private class Scanner extends Handler {
@@ -580,7 +585,6 @@ public class WifiSettings extends SettingsPreferenceFragment
void pause() {
mRetry = 0;
- mAccessPoints.setProgress(false);
removeMessages(0);
}
@@ -594,7 +598,6 @@ public class WifiSettings extends SettingsPreferenceFragment
Toast.LENGTH_LONG).show();
return;
}
- mAccessPoints.setProgress(mRetry != 0);
// Combo scans can take 5-6s to complete. Increase interval to 10s.
sendEmptyMessageDelayed(0, 10000);
}
@@ -636,6 +639,7 @@ public class WifiSettings extends SettingsPreferenceFragment
}
break;
}
+ break;
//TODO: more connectivity feedback
default:
//Ignore
@@ -740,7 +744,7 @@ public class WifiSettings extends SettingsPreferenceFragment
mScanner.resume();
}
- mAccessPoints.removeAll();
+ getPreferenceScreen().removeAll();
}
/**
@@ -753,8 +757,9 @@ public class WifiSettings extends SettingsPreferenceFragment
}
/* package */ int getAccessPointsCount() {
- if (mAccessPoints != null) {
- return mAccessPoints.getPreferenceCount();
+ final boolean wifiIsEnabled = mWifiManager.isWifiEnabled();
+ if (wifiIsEnabled) {
+ return getPreferenceScreen().getPreferenceCount();
} else {
return 0;
}
diff --git a/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java b/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java
index a73f96c..a3f1764 100644
--- a/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java
+++ b/src/com/android/settings/wifi/WifiSettingsForSetupWizardXL.java
@@ -16,8 +16,6 @@
package com.android.settings.wifi;
-import com.android.settings.R;
-
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
@@ -28,11 +26,9 @@ import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
-import android.preference.PreferenceCategory;
+import android.preference.PreferenceScreen;
import android.text.TextUtils;
import android.util.Log;
-import android.view.ContextMenu;
-import android.view.ContextMenu.ContextMenuInfo;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
@@ -43,6 +39,7 @@ import android.widget.ProgressBar;
import android.widget.TextView;
import com.android.internal.util.AsyncChannel;
+import com.android.settings.R;
import java.util.Collection;
import java.util.EnumMap;
@@ -75,12 +72,6 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
sNetworkStateMap.put(DetailedState.FAILED, DetailedState.FAILED);
}
- /**
- * Used with {@link Button#setTag(Object)} to remember "Connect" button is pressed in
- * with "add network" flow.
- */
- private static final int CONNECT_BUTTON_TAG_ADD_NETWORK = 1;
-
private WifiSettings mWifiSettings;
private WifiManager mWifiManager;
@@ -166,7 +157,7 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
// At first, Wifi module doesn't return SCANNING state (it's too early), so we manually
// show it.
- showScanningProgressBar();
+ showScanningState();
}
private void initViews() {
@@ -291,17 +282,16 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
switch (state) {
case SCANNING: {
- // Let users know the device is working correctly though currently there's
- // no visible network on the list.
- if (mWifiSettings.getAccessPointsCount() == 0) {
- showScanningState();
- } else {
- // Users already see available networks.
- showDisconnectedProgressBar();
- if (mScreenState == SCREEN_STATE_DISCONNECTED) {
+ if (mScreenState == SCREEN_STATE_DISCONNECTED) {
+ if (mWifiSettings.getAccessPointsCount() == 0) {
+ showScanningState();
+ } else {
+ showDisconnectedProgressBar();
mWifiSettingsFragmentLayout.setVisibility(View.VISIBLE);
mBottomPadding.setVisibility(View.GONE);
}
+ } else {
+ showDisconnectedProgressBar();
}
break;
}
@@ -316,7 +306,8 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
break;
}
default: // DISCONNECTED, FAILED
- if (mScreenState != SCREEN_STATE_CONNECTED) {
+ if (mScreenState != SCREEN_STATE_CONNECTED &&
+ mWifiSettings.getAccessPointsCount() > 0) {
showDisconnectedState(Summary.get(this, state));
}
break;
@@ -326,7 +317,8 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
private void showDisconnectedState(String stateString) {
showDisconnectedProgressBar();
- if (mScreenState == SCREEN_STATE_DISCONNECTED) {
+ if (mScreenState == SCREEN_STATE_DISCONNECTED &&
+ mWifiSettings.getAccessPointsCount() > 0) {
mWifiSettingsFragmentLayout.setVisibility(View.VISIBLE);
mBottomPadding.setVisibility(View.GONE);
}
@@ -474,13 +466,11 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
parent.removeAllViews();
mWifiConfig = new WifiConfigUiForSetupWizardXL(this, parent, selectedAccessPoint, edit);
- // Tag will be updated in this method when needed.
- mConnectButton.setTag(null);
if (selectedAccessPoint == null) { // "Add network" flow
showAddNetworkTitle();
mConnectButton.setVisibility(View.VISIBLE);
- mConnectButton.setTag(CONNECT_BUTTON_TAG_ADD_NETWORK);
+ showDisconnectedProgressBar();
showEditingButtonState();
} else if (selectedAccessPoint.security == AccessPoint.SECURITY_NONE) {
mNetworkName = selectedAccessPoint.getTitle().toString();
@@ -490,6 +480,7 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
} else {
mNetworkName = selectedAccessPoint.getTitle().toString();
showEditingTitle();
+ showDisconnectedProgressBar();
showEditingButtonState();
if (selectedAccessPoint.security == AccessPoint.SECURITY_EAP) {
onEapNetworkSelected();
@@ -645,8 +636,9 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
mAddNetworkButton.setEnabled(true);
mRefreshButton.setEnabled(true);
mSkipOrNextButton.setEnabled(true);
- mWifiSettingsFragmentLayout.setVisibility(View.VISIBLE);
showDisconnectedProgressBar();
+ mWifiSettingsFragmentLayout.setVisibility(View.VISIBLE);
+ mBottomPadding.setVisibility(View.GONE);
}
setPaddingVisibility(View.VISIBLE);
@@ -671,9 +663,10 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
/**
* Called when the list of AccessPoints are modified and this Activity needs to refresh
* the list.
+ * @param preferenceScreen
*/
/* package */ void onAccessPointsUpdated(
- PreferenceCategory holder, Collection<AccessPoint> accessPoints) {
+ PreferenceScreen preferenceScreen, Collection<AccessPoint> accessPoints) {
// If we already show some of access points but the bar still shows "scanning" state, it
// should be stopped.
if (mProgressBar.isIndeterminate() && accessPoints.size() > 0) {
@@ -688,20 +681,12 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
for (AccessPoint accessPoint : accessPoints) {
accessPoint.setLayoutResource(R.layout.custom_preference);
- holder.addPreference(accessPoint);
+ preferenceScreen.addPreference(accessPoint);
}
}
private void refreshAccessPoints(boolean disconnectNetwork) {
- final Object tag = mConnectButton.getTag();
- if (tag != null && (tag instanceof Integer) &&
- ((Integer)tag == CONNECT_BUTTON_TAG_ADD_NETWORK)) {
- // In "Add network" flow, we won't get DetaledState available for changing ProgressBar
- // state. Instead we manually show previous status here.
- showDisconnectedState(Summary.get(this, mPreviousNetworkState));
- } else {
- showScanningState();
- }
+ showScanningState();
if (disconnectNetwork) {
mWifiManager.disconnect();
@@ -801,11 +786,6 @@ public class WifiSettingsForSetupWizardXL extends Activity implements OnClickLis
mWifiManager.connectNetwork(config);
}
- @Override
- public void onCreateContextMenu(ContextMenu menu, View view, ContextMenuInfo menuInfo) {
- super.onCreateContextMenu(menu, view, menuInfo);
- }
-
/**
* Replace the current background with a new background whose id is resId if needed.
*/