Wifi: Allow configuration of the P2P ifname

ICS used the same wifi.interface as the regular wifi service.
Let's use wifi.p2pinterface here, since they _can_ be different

Change-Id: Iab68b245b33377271354c849bbe33725a26193f1

Conflicts:
	wifi/java/android/net/wifi/p2p/WifiP2pService.java
Wi-Fi: Ping the driver for wifi-only devices

Wifi-only devices are not capable to find APs with hidden SSID unless a DRIVER COUNTRY command
will send to wifi driver. This change has:

- Send DRIVER COUNTRY command to ping the driver (to correct the seek of hiddens SSIDs)
- Save mCountryCode as uppercase because the wifi_countrycode_values array is in uppercase.
  Otherwise the preference will not be found.

Patchset 7: Rebase
            Do not set mCountryCode if country is null

Change-Id: Ie0f838aef07eaf683b713f7f0e46ff3c751523ab

Conflicts:
	wifi/java/android/net/wifi/WifiNative.java
	wifi/java/android/net/wifi/WifiStateMachine.java
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)
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
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