summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorTomoharu Hatano <Tomoharu.Hatano@sonymobile.com>2017-06-08 12:23:17 +0900
committerGlen Kuhne <kuh@google.com>2017-07-11 10:11:26 -0700
commitfc2a6d71179e969bde3011e1a0601757c081af40 (patch)
treedb5b79a6ff05b5f164f4e8795c8d5ba6f7a693ee /service
parentd72d2f4c0feb70c5f088e3109c2d940c05482d06 (diff)
Set correct P2P device address of GO
A peer device receives invitation request with 00:00:00:00:00:00 as go_dev_addr from GO. As a result, invitation is rejected. That's because wpa_supplicant doesn't set go_dev_addr for onGroupStarted when device becomes GO, so correct P2P device address of GO needs to be set. Bug: 62009675 Change-Id: If3d717ea5f1ddc527e9719c931f063ab293beba9 Singed-off-by Daisuke Niwa <daisuke.x.niwa@sonymobile.com>
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
index a10e75af0..d70ce416d 100644
--- a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
+++ b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
@@ -231,6 +231,9 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
// the ranges defined in Tethering.java
private static final String SERVER_ADDRESS = "192.168.49.1";
+ // The empty device address set by wpa_supplicant.
+ private static final String EMPTY_DEVICE_ADDRESS = "00:00:00:00:00:00";
+
/**
* Error code definition.
* see the Table.8 in the WiFi Direct specification for the detail.
@@ -1590,7 +1593,11 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
}
mGroup = (WifiP2pGroup) message.obj;
if (DBG) logd(getName() + " group started");
-
+ if (mGroup.isGroupOwner()
+ && EMPTY_DEVICE_ADDRESS.equals(mGroup.getOwner().deviceAddress)) {
+ // wpa_supplicant doesn't set own device address to go_dev_addr.
+ mGroup.getOwner().deviceAddress = mThisDevice.deviceAddress;
+ }
// We hit this scenario when a persistent group is reinvoked
if (mGroup.getNetworkId() == WifiP2pGroup.PERSISTENT_NET_ID) {
mAutonomousGroup = false;
@@ -1923,6 +1930,11 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub {
}
mGroup = (WifiP2pGroup) message.obj;
if (DBG) logd(getName() + " group started");
+ if (mGroup.isGroupOwner()
+ && EMPTY_DEVICE_ADDRESS.equals(mGroup.getOwner().deviceAddress)) {
+ // wpa_supplicant doesn't set own device address to go_dev_addr.
+ mGroup.getOwner().deviceAddress = mThisDevice.deviceAddress;
+ }
if (mGroup.getNetworkId() == WifiP2pGroup.PERSISTENT_NET_ID) {
// update cache information and set network id to mGroup.
updatePersistentNetworks(RELOAD);