P2P:initiate provisioning on persistant group removed.

The initiator, on a response from the peer with unknown group during
the persistent reinvocation has to transit to the provisioning state
to handle all the config methods (PIN and PBC).
This commit ensures the same.

Change-Id: Iafd8e14681628c002f613172ad36a1da7efb5369
CRs-fixed: 653078
Wifi: Add a feature to control wifi auto connect.

If wifi connection type and gsm to wifi connection type is auto connect,
auto connect wifi.
CRs-Fixed: 507965

Change-Id: Icbfc58c93f13e97a2b6c6526d154153031e4b77c
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
WiFi: Fix data2Wifi caused not enableAllNetworks.

Use shouldAutoConnect() to judge if Wi-Fi networks have to get
enabled.
Ensure that the Wi-Fi networks are enabled in all the conditions
where the requirement for Auto Connection meet.
Thus, if there is no active Mobile Network, enable all the
Wi-Fi networks, though isDataToWifiAutoConn policy is not TRUE.

Change-Id: I082d0797347593ea6f878181908fea4bb64ca158
CRs-Fixed: 683197
WIFI: FIX wifi not auto-connect issue.

If the active network type is wifi, wifi connection type is auto,
auto connect to wifi.

This allows Wifi to auto-connect while wifi disconnected
for unexpected reason.

CRs-Fixed: 633648

Change-Id: I9f7f125cd7ffba18cbf5052e683cb31c6f71c573
Wifi: wifi not connecting, once the APN gets disabled state

APNs are disabled on select network and they are enabled on
receiving connected event.
But forgetting an APN before the connected event is received,
will result all the remaining APN to be in disabled state and
they never connect.
So, Enabling all the disabled APN on forget network will help
to connect automatically to a saved APN.

Change-Id: I6ac5e9856d6ec0b72c089b159206abd2de98e6a3
CRs-fixed: 496165
Wifi: fix auto connect policy for forgetNetwork

Use shouldAutoConnect() to judge if Wi-Fi networks have to get
enabled.
Thus, after forget network, if shouldAutoConnect() is false,
do not enable other saved networks to prevent auto connect.

Change-Id: I05b00bba54876f2d0d928e0faa9476b8d51b84b4
CRs-Fixed: 684684
P2P: Disable 5GHz channels in 2.4 GHz only mode

When P2P device is configured in 2.4GHz only mode supplicant
should not advertize 5GHz channels in its go negotiation frames.
  Hence disable 5GHz band channels when 2.4 GHz band only mode
selected in Wi-Fi advanced settings.

Change-Id: Ice8c9de34b19587c7e8432842a79551cc0e2333a
CRs-Fixed: 682823
Wi-Fi: Set BTCOEXMODE_DISABLED irrespective of BT's connection state

BTCOEXMODE_DISABLE has to be triggered during the DHCP phase even
on an active BT connection to ensure that Wi-Fi is given
preference over the BT.
This commit ensures the same
CRs-Fixed: 695307

Change-Id: I1eb979f03696831cb8f9e3a14b8a62f724347b64
Wifi: Handle P2P-REMOVE-AND-REFORM-GROUP event in GroupNegotiationState

Framework does not handle P2P-REMOVE-AND-REFORM-GROUP event
if it is in GroupNegotiationState and p2p-GO will continue to operate
in unsafe channel till it gets next P2P-REMOVE-AND-REFORM-GROUP event.

This commit adds handling of above event in GroupNegotiationState.

Change-Id: I956bbcd0200ddc3acde8b989a6e0950bdeca269e
CRs-fixed: 714368
wlan: Modify sequence of events sent during DHCP phase.

Modify sequence of events sent to driver during DHCP phase, to
make sure WLAN can enter into power save only after DHCP is done.

Change-Id: Idf7ed8d6e1c011bd3b7af9f5ca9d4db46de55fb0
CRs-Fixed: 719573
APP2SD: rebased framework changes to support app moving

Change-Id: I4653023278a4ade68c6d4dec5c5da235baa0ae8e
Squashed FML changes.

Fix aliasing violation.

frameworks/base: Fix build in ISO C++11 mode

Fix various incompatibilities with ISO C++11:
- Assumption that char16_t is defined to uint16_t
- constexpr usage
- macro constructs that could be interpreted as string literals
- enum typesafety

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

Conflicts:
	core/jni/android_os_FileUtils.cpp

base: Fix build after Parcel ABI fix in Binder

Adapt code to the fact that writeString16's first parameter
is now an uint16_t* to match the old ABI

Change-Id: I138af645c877f343f0490152b9702698b7d36582
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

frameworks/base: Fix compile errors

Fix ISO C++11 incompatibility in TextLayoutCache and
aliasing violation in FontRenderer

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

frameworks/base: Fix build in ISO C++11 mode

Change-Id: I5d3ba44cc9faa5826a5a0a6b37c8f0eb2872e1ac
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>

hwui: Fix build in ISO C++11 mode

Make sure log calls can't be confused with C++11 string literals

Change-Id: I1d458e92e690f6f2b922a05494db8c01da54e460
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>

More C++11 fixings.

More C++11 fixes. More.

Fix confusion about whether or not output() should be const

It probably should be const, but it isn't on master - let's try to
be closer to next upstream

Change-Id: Id26bf19d94a36d83b57488e8bd8d86fa21e784b2
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Make our own SkRect so skia doesn't need to know what an android::Rect is

Credit to David96 for the inspiration for the fix

Change-Id: I14fd8a707b2fe940f44b3a8bf2edfee8160f8463
set transition speeds to .5