diff options
author | Irfan Sheriff <isheriff@google.com> | 2012-08-28 16:05:43 -0700 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2012-08-28 16:05:43 -0700 |
commit | 4bbb13976e54f6325cb013882891c02adea61ec5 (patch) | |
tree | 2648d33e0811dde89f9aaa96f19b13ec7f551faa /wifi | |
parent | a3b63c001cfd04121708e2bd67af5c8eb855baa1 (diff) | |
download | frameworks_base-4bbb13976e54f6325cb013882891c02adea61ec5.zip frameworks_base-4bbb13976e54f6325cb013882891c02adea61ec5.tar.gz frameworks_base-4bbb13976e54f6325cb013882891c02adea61ec5.tar.bz2 |
Fix join scenario with provision discovery
Bug: 7072467
Change-Id: I8aafd5cee1055463aeda26ad313071cfe4e335c6
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/p2p/WifiP2pService.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/wifi/java/android/net/wifi/p2p/WifiP2pService.java b/wifi/java/android/net/wifi/p2p/WifiP2pService.java index f269f22..8b8077ec 100644 --- a/wifi/java/android/net/wifi/p2p/WifiP2pService.java +++ b/wifi/java/android/net/wifi/p2p/WifiP2pService.java @@ -1120,7 +1120,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub { if (mSavedPeerConfig.wps.setup == WpsInfo.PBC) { if (DBG) logd("Found a match " + mSavedPeerConfig); - mWifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP); + p2pConnectWithPinDisplay(mSavedPeerConfig); transitionTo(mGroupNegotiationState); } break; @@ -1133,7 +1133,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub { if (DBG) logd("Found a match " + mSavedPeerConfig); /* we already have the pin */ if (!TextUtils.isEmpty(mSavedPeerConfig.wps.pin)) { - mWifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP); + p2pConnectWithPinDisplay(mSavedPeerConfig); transitionTo(mGroupNegotiationState); } else { mJoinExistingGroup = false; @@ -1152,7 +1152,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub { if (mSavedPeerConfig.wps.setup == WpsInfo.DISPLAY) { if (DBG) logd("Found a match " + mSavedPeerConfig); mSavedPeerConfig.wps.pin = provDisc.pin; - mWifiNative.p2pConnect(mSavedPeerConfig, FORM_GROUP); + p2pConnectWithPinDisplay(mSavedPeerConfig); if (!sendShowPinReqToFrontApp(provDisc.pin)) { notifyInvitationSent(provDisc.pin, device.deviceAddress); } @@ -1862,7 +1862,7 @@ public class WifiP2pService extends IWifiP2pManager.Stub { return NEEDS_PROVISION_REQ; } - p2pConnectWithPinDisplay(config, join); + p2pConnectWithPinDisplay(config); return CONNECT_SUCCESS; } @@ -1969,8 +1969,14 @@ public class WifiP2pService extends IWifiP2pManager.Stub { return deviceAddress; } - private void p2pConnectWithPinDisplay(WifiP2pConfig config, boolean join) { - String pin = mWifiNative.p2pConnect(config, join); + private void p2pConnectWithPinDisplay(WifiP2pConfig config) { + WifiP2pDevice dev = mPeers.get(config.deviceAddress); + if (dev == null) { + loge("target device is not found " + config.deviceAddress); + return; + } + + String pin = mWifiNative.p2pConnect(config, dev.isGroupOwner()); try { Integer.parseInt(pin); if (!sendShowPinReqToFrontApp(pin)) { |