Fix: FATAL exception during Autonomus group creation failure

Failure in forming an autonomus group causes FATAL IllegalArgumentException
exception as deviceAddress will be empty in mPeersLostDuringConnection.

Added check to verify if it is autonomus group before trying to remove
any peer or clear device list.

Change-Id: I486463782e85c7f0031b6f62ec5aaf8afb11b652
CRs-fixed:554767
(cherry picked from commit 55bb4f6dd9fc3e5c8aa7c8bc8ece01f0603e0a83)
(cherry picked from commit 3dbbf14276a403841e1d69cd2624dfad74d6f540)
(cherry picked from commit 8642fcd59686e54c1ea215016bfa7562d17b27c0)
p2p: Flush the p2p scan result on group remove event

Flush out p2p scan results on receiving group removal event.
p2p scan window will be updated on next p2p scan.

Change-Id: I3bcfed355574478bda2cac688b7df956c2701683
CRs-Fixed: 504022
(cherry picked from commit eaeecac20b125ffff8fea7a12b514999fff6bf5f)
(cherry picked from commit 3541e2cb0768865ecc312ead33f48c673e177ac3)
Wifi: Fix for connection failure between third client and GC.

When third device sends a connection request to the group client, the
existing connection is terminating and also the ongoing connection not
successful.Currently as there is  no use case where third device is
connecting to GC,and the existing onnection getting terminated.This
is addressed by ignoring the new connection request from third client
to GC and the existing connection is intact.
CRs-Fixed: 467049

Change-Id: I784c38b9a4ca0c60b188b9697e3b4af4d09053cc
Show PIN on Peer device on receiving PIN display request.

P2P provision discovery would request the peer to display a PIN.
The PIN is displayed handling the request, the PIN need to be
entered on keypad of requested peer device to achieve the
connection.

Change-Id: I8b6487681d78eb10c558983a08dec1ac8a8eee65
CRs-fixed: 382608
wifi: Fix for connection between GO and p2p device

When GO sends an invitation request to the p2p device without
persistent profile, GO gets an invitation result=8 which means
unknown group, when GO receives invitation result 8, its tries
to remove persistent profile of the client but it will not be able
find the profile so it does continue with sending the invitation
so the connection fails. To address this, ignore if there are no
persistent profiles found for the client and continue with sending
the Invitation request to the client to make connection succesful
connection. As GO has single profile saved unlike client which
saves multiple profiles of GO.

CRs-Fixed: 511282
Change-Id: I78f54d4bb2f0d603bc2170ec2c3ef55a91050236
p2p:Fix for discovery failure until STA is connected to AP.

The station when connecting to AP (wifi state is either
connecting or obtaining ip address) shall stop the already
issued p2p_find on the DHCP start and start the same after
the DHCP handshake. p2p service manager shall return a failure
for any p2p_find operation during these period resulting in a
discover failure.
Address this by deferring the p2p_find issued during this period
(set mDiscoveryPostponed to true) rather than returning a failure.

Change-Id: I40b2017bf126fd0d543ada8853223402cda63e9d
CRs-Fixed: 532138
P2P: Fix for GO inviting a p2p device.

A p2p device on an invitation request from the peer invokes
p2p_peer command to know if the peer is a p2p device / GO.
Due to the cached entries there would be a possibility of
not getting the updated information, ending up in the wrong
negotiation with the invited peer. Thus do not rely on
p2p_peer command, rather assume that the peer is a GO on an
invitation request, provided there is no persistent network
configured.

CRs-Fixed: 486437
Change-Id: Ifaeb6a8c5f9cddd7df96622056541e22aad74314
p2p: Display P2P peer MAC address if device name is empty.

Display MAC address of a P2P peer in an invitation prompt
message on receiving invitation request from the P2P peer
with empty device name.

Change-Id: Icabeb91d666437746eb5a733ec582849eb7295a5
CRs-Fixed: 506109