Wi-Fi : Abort setWifiEnabled if WifiController not ready

While executing setWifiEnabled, it send commands to WifiController.
If WifiController is not started by this time, StateMachine reports
crash which creates device reboot.
Thus, check if WiFiController is started before invoking any
command to the same. Indicate a failure in such an instance

CRs-Fixed: 742857

Change-Id: Ic40eb82522b67f7e606d4739c41da3b8ba2f3590
Wifi: Get the network mask info

Get the network mask info in the function getDhcpInfo().

Change-Id: I218827501a382a28c860875587243d9509d67a60
CRs-Fixed: 750982
Wifi:Fix issue in connection in WPS mode when STA_AUTOCONNECT is disabled

Autojoin is enabled in framework by default and this disables
connection retry feature in supplicant. For WPS failure cases
framework needs to retry connection.
This change is for framework handling connection retry logic in case
of WPS Connection failures with reason code other than 3.
Reason code 3 is generated by supplicant and in that case framework ignores
retry.

Change-Id: I5d59b578aac339f4018c93c5e0f11ef45203d056
CRs-Fixed: 759641
Wifi: Reduce auto join scans when p2p is connected

When p2p is connected, change alarm source originated scan interval
to 5 minutes. Add below configuration parameter in autojoinconfig.txt
file to modify this scan interval:
AUTO_JOIN_SCAN_INTERVAL_WHEN_P2P_CONNECTED:   <milliseconds>

Change-Id: I8e8eb635981129d43cca88db6392c9a2b1e25a10
CRs-Fixed: 758935
Wifi: Enable supplicant's auto reconnect ability if auto join is disabled

Auto Join capability in the framework shall take the control of WiFi
network management and thus does not allow the supplicant to auto
reconnect to the configured profiles. However,to ensure automatic
connection to the networks happen when auto join functionality is
disabled in the framework,supplicant needs to be configured with auto
reconnect capability.
This commit ensures the same.

Change-Id: I08119f459b9c4cc7a022f6c3e0b881b1542c671c
CRs-Fixed: 759411
Regional: Customize wifi hotspot and wifi name

-Set WLAN hotspot's default security type to none.
-Customize hotspot ssid and pass.
-Customize wifi direct name for carrier.

Change-Id: If1613a8556908f372a70fbd859fa35e9315f9613
wifi: update to blacklisting mechanism

Disable or Enable Auto Join for an Access Point blacklisted or
unblacklisted by WQE if wqe feature is enabled.

Change-Id: I6a655c9d0a6b21963c13f36e25ab7f74f98e97cc
CRs-Fixed: 728066
Wifi: Fix ap list issue while wifi turns on

Decrease the sleep time to resolve the synchronization issue
which happens between wpa_supplicant and Wifimonitor thread
when wifi turns on.

Change-Id: I4e2414301ace26a26351b6c1345e1ff6e7ab49a9
CRs-Fixed: 673012
P2P: Change supplicant scan intervel during WFD session

During WFD session supplicant scan intervel is one minute. If
there are some saved profiles, then supplicant will issue a scan
for every one minute, this is causing some ping latency in WFD.
    Hence supplicant scan intervel should change to five minutes
to improve ping latency in WFD session only.

Change-Id: If827bab6f186ebeaac90f297935bc8b987eb4d09
CRs-Fixed: 669404
wlan: Honour regular scan in case Preferred Network Offload scan fails

In suspend mode STA fails to connect to an AP if preferred network
offload configuration is failed to configure the saved profile.

Framework sets a scan alarm if the PNO configuration fails. This
scan alarm apparently fails to issue a scan for mCurrentScanAlarmMs
set to 0 . Thus, set this parameter to mDisconnectedScanPeriodMs for
the cases when PNO trigger fails.

Change-Id: Iaa793642fe3c9dd307b199438368baa26a33bd61
CRs-Fixed: 753999
wifi: Do a periodic scan for a PNO failure only on non zero sta profiles

The current framework shall ensure to do a periodic scan for the case
where the configured profiles are 0 but does not address the case of
PNO trigger failure.Hence,do a periodic scan for a failure in PNO
trigger on non zero configured profiles.

Change-Id: I4f5ce511baf0ae8695c52adf63bce13e7790117e
CRs-Fixed: 756529
wifi: Address the improper scan behavior on PNO failure

This commit takes care of the following behavior on a PNO fail.

Trigger a periodic scan on a PNO failure when p2p session is active
and there are no configured profiles.

There is no point to continue the periodic scan triggered on a PNO fail
when p2p session is active.Thus, stall further attempts after a p2p
disconnections.

Change-Id: I7844dca7fe9dd45b99e71ef04beb19ea2ae5343e
CRs-Fixed: 759618
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