diff options
author | daisuke niwa <daisuke.x.niwa@sonymobile.com> | 2015-02-27 09:27:20 +0100 |
---|---|---|
committer | Paul Stewart <pstew@google.com> | 2016-06-20 09:39:54 -0700 |
commit | a90ff1f02fc6820fde13d2c76738c7ae75a503e1 (patch) | |
tree | d38c0d4a511187f715d68889b6298f4e1d732b62 /service | |
parent | 895b3e2186362770b46d318cc011a0e502e1c961 (diff) |
Fix invitation request from persistent GC
When the device received the second invitation request
from GC of the same PersistentGroup, the wifi framework
processes "sa" as mOwner of WifiP2pGroup. At this point,
if an invited group is persistent group, WifiP2pGroup can't
know whether "sa" is GC or GO yet. So the framework shouldn't
process mOwner in the constructor.
BUG=28715251
Change-Id: Ie7065da0d6c978c3747ecbd6f728de87d9567009
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java index ae75a370e..c1d9445b0 100644 --- a/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java +++ b/service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java @@ -1359,8 +1359,20 @@ public class WifiP2pServiceImpl extends IWifiP2pManager.Stub { WifiP2pDevice owner = group.getOwner(); if (owner == null) { - loge("Ignored invitation from null owner"); - break; + int id = group.getNetworkId(); + if (id < 0) { + loge("Ignored invitation from null owner"); + break; + } + + String addr = mGroups.getOwnerAddr(id); + if (addr != null) { + group.setOwner(new WifiP2pDevice(addr)); + owner = group.getOwner(); + } else { + loge("Ignored invitation from null owner"); + break; + } } config = new WifiP2pConfig(); |