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
Revert "SystemUI: fix hidden clock style after a reboot"

This reverts commit 28a5f8f4fc47e9623327caa5a4a642f8c17569b1.
Revert "SystemUI: allow for the clock to be centered (1 of 2)"

This reverts commit 36672e70e1d28d54c584f5e5ec978392381d0027.
Add en_RU language
Fix Wifi
[1/3] Base: Flip to Mute/Reject Call

Saving flip action value to settings container

Telephony: https://gerrit.omnirom.org/#/c/4670/
InCallUI: https://gerrit.omnirom.org/#/c/4669/

Change-Id: Ie72dda49d78b23b9bc7d8a886f6916f678c918d1

Conflicts:
	core/java/android/provider/Settings.java
[1/3] Base: Incoming Call in Background

Patch ported from 4.2 which was done by our lovely HCP. A
very popular one so we bring it back and adapt it to 4.4

Allows user to set that Incoming Call UI will remain in background
if screen is on. Instead, a notification is added to StatusBar, which
can be used to bring up the Incoming Call UI. Ringtone and vibration
still occur as per system settings.

This has the same effect as apps marked as "immersive". It prevents
the incoming call from backgrounding the current activity.

Change-Id: I1eb0ae6b10ba02c3f1df95265d26a6c61db74aab

Conflicts:
	core/java/android/provider/Settings.java
[1/2] Frameworks: Statusbar clock and date customizations

This commit add support for:

- Clock and date enable/disable
- Clock and date position
- AM/PM styles multilang support
- color
- Date format
- Date style

Change-Id: I73d854ed5cfb57fa19e4b5554bb10cb2e1ce9b65
Framework:  Fix Statusbar Center Clock
[1/2] SystemUI: Network speed indicator

Change-Id: I88e7cdfe20342c695a33383db36bf80bb4ffe009

Conflicts:
	core/java/android/provider/Settings.java

[1/2] SystemUI: Update network traffic indicator

Android measures the amount of data transferred in bytes,
however, by convention, data rates should be measured in bits
per second.

*Convert the change in total data and time to bits and seconds,
and then divide the amount transferred by the number of
seconds that have elapsed.

*Update the labels and have them use the correct SI prefixes.

*Factor out or add @hide to public methods and constructors

*Remove all Runnables and Messages from Handler queue when
disabled

*Minor formatting changes to stay consistent with Android's
code-style guidelines.
https://source.android.com/source/code-style.html

PS2: Set maximum digits to prevent it from filling the statusbar
PS3: Rebase
PS4: Add ability to display either bits or bytes

Change-Id: I9add610a8d14f5a48f2af0a82ced0c186224e282

Conflicts:
	core/java/android/provider/Settings.java

[1/2] Base: Upgrade network traffic meter

*Updated class name to be less ambiguous
*Replaced the multi-check in settings with a proper listview
*Added the ability to view up-stream, down-stream or both
*Added the option to change how often it refreshes
*Added a check before it updates the status bar to prevent it from
refreshing everything needlessly
*Added icons to show data direction
*Remove unused style attributes

Icon artwork is courtesy android design downloads
Some features were inspired by previous work done by 0xD34D

OmniGears: https://gerrit.omnirom.org/#/c/5130/

Change-Id: I9f86292a6adbc5e30967df76fae510be248fc38b

Conflicts:
	core/java/android/provider/Settings.java
	packages/SystemUI/res/values/custom_dimens.xml
	packages/SystemUI/res/values/custom_styles.xml
	packages/SystemUI/res/values/dimens.xml
	packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarTransitions.java