Merge "Fixed typo and space."

This commit is contained in:
Irfan Sheriff
2012-11-27 10:39:26 -08:00
committed by Gerrit Code Review
2 changed files with 52 additions and 52 deletions

View File

@@ -127,7 +127,7 @@ public class WifiStateMachine extends StateMachine {
private final boolean mBackgroundScanSupported; private final boolean mBackgroundScanSupported;
private String mInterfaceName; private String mInterfaceName;
/* Tethering interface could be seperate from wlan interface */ /* Tethering interface could be separate from wlan interface */
private String mTetherInterfaceName; private String mTetherInterfaceName;
private int mLastSignalLevel = -1; private int mLastSignalLevel = -1;
@@ -248,7 +248,7 @@ public class WifiStateMachine extends StateMachine {
static final int CMD_START_DRIVER = BASE + 13; static final int CMD_START_DRIVER = BASE + 13;
/* Stop the driver */ /* Stop the driver */
static final int CMD_STOP_DRIVER = BASE + 14; static final int CMD_STOP_DRIVER = BASE + 14;
/* Indicates Static IP succeded */ /* Indicates Static IP succeeded */
static final int CMD_STATIC_IP_SUCCESS = BASE + 15; static final int CMD_STATIC_IP_SUCCESS = BASE + 15;
/* Indicates Static IP failed */ /* Indicates Static IP failed */
static final int CMD_STATIC_IP_FAILURE = BASE + 16; static final int CMD_STATIC_IP_FAILURE = BASE + 16;
@@ -263,7 +263,7 @@ public class WifiStateMachine extends StateMachine {
/* Start the soft access point */ /* Start the soft access point */
static final int CMD_START_AP = BASE + 21; static final int CMD_START_AP = BASE + 21;
/* Indicates soft ap start succeded */ /* Indicates soft ap start succeeded */
static final int CMD_START_AP_SUCCESS = BASE + 22; static final int CMD_START_AP_SUCCESS = BASE + 22;
/* Indicates soft ap start failed */ /* Indicates soft ap start failed */
static final int CMD_START_AP_FAILURE = BASE + 23; static final int CMD_START_AP_FAILURE = BASE + 23;
@@ -883,22 +883,22 @@ public class WifiStateMachine extends StateMachine {
* TODO: doc * TODO: doc
*/ */
public void setScanOnlyMode(boolean enable) { public void setScanOnlyMode(boolean enable) {
if (enable) { if (enable) {
sendMessage(obtainMessage(CMD_SET_SCAN_MODE, SCAN_ONLY_MODE, 0)); sendMessage(obtainMessage(CMD_SET_SCAN_MODE, SCAN_ONLY_MODE, 0));
} else { } else {
sendMessage(obtainMessage(CMD_SET_SCAN_MODE, CONNECT_MODE, 0)); sendMessage(obtainMessage(CMD_SET_SCAN_MODE, CONNECT_MODE, 0));
} }
} }
/** /**
* TODO: doc * TODO: doc
*/ */
public void setScanType(boolean active) { public void setScanType(boolean active) {
if (active) { if (active) {
sendMessage(obtainMessage(CMD_SET_SCAN_TYPE, SCAN_ACTIVE, 0)); sendMessage(obtainMessage(CMD_SET_SCAN_TYPE, SCAN_ACTIVE, 0));
} else { } else {
sendMessage(obtainMessage(CMD_SET_SCAN_TYPE, SCAN_PASSIVE, 0)); sendMessage(obtainMessage(CMD_SET_SCAN_TYPE, SCAN_PASSIVE, 0));
} }
} }
/** /**

View File

@@ -165,11 +165,11 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
/* Commands to the WifiStateMachine */ /* Commands to the WifiStateMachine */
public static final int P2P_CONNECTION_CHANGED = BASE + 11; public static final int P2P_CONNECTION_CHANGED = BASE + 11;
/* These commands are used to tempoarily disconnect wifi when we detect /* These commands are used to temporarily disconnect wifi when we detect
* a frequency conflict which would make it impossible to have with p2p * a frequency conflict which would make it impossible to have with p2p
* and wifi active at the same time. * and wifi active at the same time.
* *
* If the user chooses to disable wifi tempoarily, we keep wifi disconnected * If the user chooses to disable wifi temporarily, we keep wifi disconnected
* until the p2p connection is done and terminated at which point we will * until the p2p connection is done and terminated at which point we will
* bring back wifi up * bring back wifi up
* *
@@ -389,7 +389,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
* not get latest updates about the device without being in discovery state. * not get latest updates about the device without being in discovery state.
* *
* From the framework perspective, the device is still there since we are connecting or * From the framework perspective, the device is still there since we are connecting or
* connected to it. so we keep these devices in a seperate list, so that they are removed * connected to it. so we keep these devices in a separate list, so that they are removed
* when connection is cancelled or lost * when connection is cancelled or lost
*/ */
private final WifiP2pDeviceList mPeersLostDuringConnection = new WifiP2pDeviceList(); private final WifiP2pDeviceList mPeersLostDuringConnection = new WifiP2pDeviceList();
@@ -1055,48 +1055,48 @@ public class WifiP2pService extends IWifiP2pManager.Stub {
//and wait instead for the GO_NEGOTIATION_REQUEST_EVENT. //and wait instead for the GO_NEGOTIATION_REQUEST_EVENT.
//Handling provision discovery and issuing a p2p_connect before //Handling provision discovery and issuing a p2p_connect before
//group negotiation comes through causes issues //group negotiation comes through causes issues
break; break;
case WifiP2pManager.CREATE_GROUP: case WifiP2pManager.CREATE_GROUP:
mAutonomousGroup = true; mAutonomousGroup = true;
int netId = message.arg1; int netId = message.arg1;
boolean ret = false; boolean ret = false;
if (netId == WifiP2pGroup.PERSISTENT_NET_ID) { if (netId == WifiP2pGroup.PERSISTENT_NET_ID) {
// check if the go persistent group is present. // check if the go persistent group is present.
netId = mGroups.getNetworkId(mThisDevice.deviceAddress); netId = mGroups.getNetworkId(mThisDevice.deviceAddress);
if (netId != -1) { if (netId != -1) {
ret = mWifiNative.p2pGroupAdd(netId); ret = mWifiNative.p2pGroupAdd(netId);
} else { } else {
ret = mWifiNative.p2pGroupAdd(true); ret = mWifiNative.p2pGroupAdd(true);
} }
} else { } else {
ret = mWifiNative.p2pGroupAdd(false); ret = mWifiNative.p2pGroupAdd(false);
} }
if (ret) { if (ret) {
replyToMessage(message, WifiP2pManager.CREATE_GROUP_SUCCEEDED); replyToMessage(message, WifiP2pManager.CREATE_GROUP_SUCCEEDED);
transitionTo(mGroupNegotiationState); transitionTo(mGroupNegotiationState);
} else { } else {
replyToMessage(message, WifiP2pManager.CREATE_GROUP_FAILED, replyToMessage(message, WifiP2pManager.CREATE_GROUP_FAILED,
WifiP2pManager.ERROR); WifiP2pManager.ERROR);
// remain at this state. // remain at this state.
} }
break; break;
case WifiMonitor.P2P_GROUP_STARTED_EVENT: case WifiMonitor.P2P_GROUP_STARTED_EVENT:
mGroup = (WifiP2pGroup) message.obj; mGroup = (WifiP2pGroup) message.obj;
if (DBG) logd(getName() + " group started"); if (DBG) logd(getName() + " group started");
// We hit this scenario when a persistent group is reinvoked // We hit this scenario when a persistent group is reinvoked
if (mGroup.getNetworkId() == WifiP2pGroup.PERSISTENT_NET_ID) { if (mGroup.getNetworkId() == WifiP2pGroup.PERSISTENT_NET_ID) {
mAutonomousGroup = false; mAutonomousGroup = false;
deferMessage(message); deferMessage(message);
transitionTo(mGroupNegotiationState); transitionTo(mGroupNegotiationState);
} else { } else {
loge("Unexpected group creation, remove " + mGroup); loge("Unexpected group creation, remove " + mGroup);
mWifiNative.p2pGroupRemove(mGroup.getInterface()); mWifiNative.p2pGroupRemove(mGroup.getInterface());
} }
break; break;
default: default:
return NOT_HANDLED; return NOT_HANDLED;
} }
return HANDLED; return HANDLED;
} }