am 3957b3c1
: Merge "scan only when wifi is enabled" into froyo
Merge commit '3957b3c147673d631feef2df49f1177289e08d41' into kraken * commit '3957b3c147673d631feef2df49f1177289e08d41': scan only when wifi is enabled
This commit is contained in:
@@ -169,7 +169,9 @@ public class WifiSettings extends PreferenceActivity implements DialogInterface.
|
|||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
switch (item.getItemId()) {
|
switch (item.getItemId()) {
|
||||||
case MENU_ID_SCAN:
|
case MENU_ID_SCAN:
|
||||||
|
if (mWifiManager.isWifiEnabled()) {
|
||||||
mScanner.resume();
|
mScanner.resume();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
case MENU_ID_ADVANCED:
|
case MENU_ID_ADVANCED:
|
||||||
startActivity(new Intent(this, AdvancedSettings.class));
|
startActivity(new Intent(this, AdvancedSettings.class));
|
||||||
@@ -428,6 +430,10 @@ public class WifiSettings extends PreferenceActivity implements DialogInterface.
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateConnectionState(DetailedState state) {
|
private void updateConnectionState(DetailedState state) {
|
||||||
|
/* sticky broadcasts can call this when wifi is disabled */
|
||||||
|
if (!mWifiManager.isWifiEnabled())
|
||||||
|
return;
|
||||||
|
|
||||||
if (state == DetailedState.OBTAINING_IPADDR) {
|
if (state == DetailedState.OBTAINING_IPADDR) {
|
||||||
mScanner.pause();
|
mScanner.pause();
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user