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

Conflicts:
	core/res/res/values/symbols.xml
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
Screen Recorder: increase max screen recording time to 1 hour
quiethours: fix vibration logic

While QuietHours have different modes for haptic feedback and vibration, indeed
both uses the underlying VibratorService. This change adds some basic logic to
detect what quiethours mode should be applied to block access to vibrate calls
during quiethours.

This patch assumes:

1.- Single pattern vibrate calls are treated as haptic feedback if milliseconds
vibration is lower than 70 milliseconds
2.- Multiple pattern vibrate calls are treated as haptic feedback if the total
duration of the pattern is lower than 70 milliseconds and they doesn't need to
be repeated.

JIRA: NIGHTLIES-175
https://jira.cyanogenmod.org/browse/NIGHTLIES-175
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

Change-Id: I0d090ca1189a5d132bf6a835e9921cf41e02d1fb

Conflicts:
	services/java/com/android/server/VibratorService.java
base: display live wallpaper settings instead of wallpaper picker

If the livewallpaper service declares and supports a settings activity, display it
instead of the wallparper picker in runnings apps details settings activity
(settings button)

Change-Id: I8db800cec4151ee5e6edddcea7a1bb5fb0528816
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
AudioService: Reduce volume to safe level when headset is connected (2/2)

This is a safety feature for users who opt to raise volume above the designated
safe level while using a headset.

Currently when a user does this they are provided with no protection against
dangerously high volume levels until the next time the headset volume warning
is displayed.

This patch adds an optional feature to ensure volume is no higher than the safe
level every time a headset is connected.

Change-Id: Idaa9cc9549bc3c6278e1e44490433c5366c29c16
Base: update Japanese translations
Base: update French translations
[1/2] Base: add support Tinted System bar

thanks to ChameleonOs and Thinking Bridge for the base code
also thanks to @MuhammadAG for Actionbar implementation (Xposed-Tinted-Status-Bar)

this allow statusbar an navigationbar background to follow color from Top and Bottom of application

see https://plus.google.com/107971916147063794392/posts/Eaqn5UAvKDt

as bonus, we can call blurbackground from here too :)

PS.6 :
   performance increase
   fix stability
   fix tinted statusbar cant turn off
   fix activity loading

PS.7 :
   improve performance
   smooth color change
   add more option xD

PS.8 :
   more stability
   improve color animation

PS.9 :
   fix FC some apps

PS.10 :
   stay away from broadcast
   make new API for communication with statusbar
   make color extractor more faster
   fix some bugs if disabled

PS.11 :
   remove gradient option this not working always
   fix where color not change if parent view has actionbar

PS.12 :
   fix white space xD

Change-Id: I40f533dd404a02e10a85fed78123c60ffd51f387

Conflicts:
	core/java/android/provider/Settings.java
base: fix init handling of tinted system bar

force same behaviour like after changing setting

PS. 2 :
   fix initial background color

PS. 3 :
   make sure initial gradient is 0

Change-Id: I87eddcaa5223c1af15fa8c089f22ed9cb4774f7b
Base: fix logic tinted system bar

1. fix action bar make statusbar icon changes with same color action bar text
       if current action bar background is null
2. move log into each bartransition so we can track what is changes
3. make process not changing system bar color
      if current screen color is same with before (less draw)
4. always reset system bar color when launching new apps
5. fix color changes using 3rd party app keyboard

Change-Id: If53178e24caae7dff30636eda440d0e618702e3e