FWBase - Adding old-school (JB like) battery percents style due to its better visibility [1/2]

Also added "No battery" style.
    Added percents visibility while charging and
    colorizing percents while charging
    One selector made obvious
    Removing unnecessary code
    Setting green color for text 90+% charged
    Now bolt color means color of circle battery, not percents
    Fixing percentage color while charging for "text only" style
    Fixing percentage color for JB style
    Adding green percents color when charging and >90% for circles with
    percents too
    Including Juba's changes regarding battery tile with no battery in
    statusbar
    and styles order
    How does it look like:

https://dl.dropboxusercontent.com/u/66673431/BattModPercentScreen1.jpg

https://dl.dropboxusercontent.com/u/66673431/BattModPercentScreen2.jpg
    Settings change: https://gerrit.slimroms.net/#/c/5755/

Change-Id: Iade87d171e876492fa4b04eb13d8f795081d72e9
Signed-off-by: Stefano Mura [STELIX] <ssspinni@gmail.com>
Add the calling package name to requestRouteToHost

The calling package name will be used to check if an application is a
system application when deciding if a route should be exempt from VPN
routing rules...

Bug: 12937545
Change-Id: I2c09c875fe9bb9685871a0a801ddcbb32fc17405
Only allow System apps to make VPN exempt routes

requestRouteToHost will only allow system applications to make routes
exempt from the VPN's routing rules.

If a VPN is currently running and a non-system app requests a route it
will only succeed if that host is currently covered by a VPN exempt
routing rule. Otherwise it will fail.

For example, if a VPN is running and the MMS network is brought online
those routes will be added as VPN exempt. If an application then tries
to request a route to a MMS endpoint it will succeed because the routes
already exist. If an application tries to request a route to a host
covered by the VPN the call will fail.

Bug: 12937545
Change-Id: If7bcec91bbb96c62c8fb69748c975847e6c00b6f
Update LinkProperties with MTU value

Use the MTU provided by network as part of Data Call Response.
If it is not present, use the static value from config file

Change-Id: I9d03cc9b355d09a93883fbf4ddc93fae0077641c
CRs-Fixed: 634747
Connectivity: Set TCP delayed ACK and User Configuration Flag

Provide a Mechanism to set tcp delayed ack settings from
Connectivity Service. The tcp_use_userconfig flag is set to
override the default tcp delayed ack configuration in tcp stack.
tcp_use_userconfig flag is reset when the TCP stack is required
to use default delayed ack settings. Currently the delayed ack
settings are overridden for Wifi and LTE networks only. Other
network types continue to use default delayed ack settings

Change-Id: I282ef0f6b6278b6efcef3870242974f7ee93e508
CRs-Fixed: 628139
services: change default sampling interval to -1

Change default sampling interval to -1 to avoid sampling to resolve
power consumption issue. Original implement will keep UE wake up every
12 minutes, which will cause issue when doing power standby test.

Change-Id: I018e22a44259e94bce87ceaf04ff523f035183f8
[1/2] Slims Hardware Key Rebinding

First thanks to CM team for the 2 years where we used their approach for our
custom hw key rebinding. This hardware key rebinding
patches did in the past a good job and we extended it prior 4.3 with a lot
Slim custom stuff.

But it is time to go new way and to do the complete
hardware key rebinding more flexible and more centralized. Especially due
that we have now all possible shortcut actions centralized in 4.4

Possible mapping are:
ACTION_HOME
ACTION_BACK
ACTION_SEARCH (in app search)
ACTION_VOICE_SEARCH
ACTION_MENU_BIG
ACTION_POWER
ACTION_NOTIFICATIONS
ACTION_QS
ACTION_RECENTS
ACTION_SCREENSHOT
ACTION_IME
ACTION_LAST_APP
ACTION_KILL
ACTION_ASSIST
ACTION_VIB
ACTION_SILENT
ACTION_VIB_SILENT
ACTION_POWER_MENU
ACTION_TORCH
ACTION_EXPANDED_DESKTOP
ACTION_THEME_SWITCH

and custom app/shortcut of course

Possible actions on all keys are:
normal tap / longpress / double tap

So to summarize if it is in settings array enabled user can bind whatever of the above
actions to every hardware key action.

Main changes to prior solutions are:
- do not depend anymore on hardcoded integer values. We use now strings. This has
  the advantage that we can save whatever shorcut or intent URI we have into this
  value. And gives us the possibility in future without changing anything on the hw
  key rebinding code to get more options/or modify the options. Actions are holded
  like on all other of our features in ButtonsConstants.java
- All actions are peformed over our SlimActions like all other features. SlimActions
  takes care about all possible solutions the user can run into and sets the right
  open animation, keyguard handling etc etc. As well it is easier to maintain only
  one code base.
- Only observe and update the values on hardware key devices. On non hw key devices
  the complete code is non operational
- Removed in settings the not needed overlay due that we can use the fb one to
  check if it is a hw key device or not.
- Major cleanup of a lot old code.

This patch add as well one new SlimActions action....VOICE_SEARCH

To configure your device you need to add the device overlay as usual:

overlay/frameworks/base/core/res/res/values/config.xml
<!-- Hardware "softkeys" present on the device, stored as a bit field.
         This integer should equal the sum of the corresponding value for each
         of the following keys present:
            1 - Home
            2 - Back
            4 - Menu
            8 - Assistant (search)
           16 - App switch
        For example, a device with Home, Back and Menu keys would set this
        config to 7. -->
    <integer name="config_deviceHardwareKeys">7</integer>

Also requires CarbonFibers commit (https://review.carbonrom.org/#/c/501/)
and overlay to function correctly

cheers HCP and kufi

https://github.com/SlimRoms/frameworks_base/commit/2cfd9aa74fe0fc7bc388ce01bc243bbf6ec06790
Change-Id: I25641f3d41232ccb81c0e57c2bfca9131a57df82
frameworks: import AppOpsManager

Change-Id: I5bc8325e257bd5f7b508f3620cbfa7cc113dffa7
Signed-off-by: mattmanwrx <mbloomfield87@gmail.com>
QS: add theme switcher tile (TRDS) 1/2

this adds a theme switcher tile

normal click: turn on/off dark/light theme
longpress: switch between the auto modes (manual/light sensor/twilight)

PS: Fix build

Signed-off-by: MURA Stefano [STELIX PippoX3] <ssspinni@gmail.com>

Change-Id: I62b8e11b5714c179ccbf1c1e341b47c84da0fb56
Circular Memory indicator for recents panel [1/2]

Change-Id: I8f726c0976c0cc841d2cb39d12006a208b665b7e
Signed-off-by: MURA Stefano [STELIX PippoX3] <ssspinni@gmail.com>
Merge "Circular Memory indicator for recents panel [1/2]" into kk
Merge "QS: add theme switcher tile (TRDS) 1/2" into kk
Merge "FWBase - Adding old-school (JB like) battery percents style due to its better visibility [1/2]" into kk
Revert "FWBase - Adding old-school (JB like) battery percents style due to its better visibility [1/2]"

This reverts commit 13d023f94c83774e255fc4b30ba850364d358625.

Should not have been merged.

Change-Id: I92abcd62c22f24f0f4a85bef81e5cec4cce54e1b
Merge "Revert "FWBase - Adding old-school (JB like) battery percents style due to its better visibility [1/2]"" into kk
UserTile: Fix displaying user information for multi-user devices

In commit 89ab0eb097322ac8eec40159b888dfb03b9413e9, we improved
the handling of single user devices but appear to have also
entirely deleted the name / avatar for multi-user devices.

This commit restores the deleted code for multi-user devices.

This fixes CYAN-4023.

Change-Id: I69fe1504da2b32cd5bf0fdc87f8f78c960e9c77f
MediaFile: support more media types

Change-Id: Ib3109c5ebc762b97e45bd0bb5fa82ad77b0e6822
CM11 Themes: Ensure customTheme is not null.

The configuration retrieved via getConfiguration() sometimes contains
a null customTheme which results in the theme returning to holo when
applying a component such as icons.  Icons will change but styles
and fonts would return to the default.

Change-Id: Iac0cb8eed5de8fdc9fe8efd697d968f26e801c08
CM11 Themes: Include alarms in mixnmatch.

Change-Id: I004f6b0149d71c8ed1a3952704f5a3521eca5add
CM11 Themes: Properly handle SystemUI theme package name.

Change-Id: Ia8915684e1620184dcc513c2c5039ea20aabbd04