ConnectivtyService : Execute connectivityCheck in thread pool

Since this async task takes long when doing things like waiting for
network connectivity...etc, rather than holding up the single executor
of async task for the framework (app_process), run it on a thread from
the pool so other tasks can execute in parallel.

Change-Id: I7b88a4837c7e117ef47014a20c57f828b811edfb
base: Fix screen on stats after a boot

Prior to this change, the following sequence:

  * Turn the display off
  * Issue a reboot via adb
  * Unlock the device (after rebooting) before the screen turns off

results in the screen being on but the battery stats not reflecting
this fact.

In general, the mismatch occurs when either there is no serialized
battery stats state or when it is serialized in a state where the
screen is off.

Change-Id: I17374553fae6a08a1be8fdf445967509474177a9
base: Add blacklist provider permission

Change-Id: I4febc2c0aa1a690d607b2a459e2d60d30ecf5abf
JIRA: CYAN-3727
Issue: https://jira.cyanogenmod.org/browse/CYAN-3727
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>
Merge "base: Fix screen on stats after a boot" into cm-11.0
SysUI: Use LocationController from status bar service for GPSTile.

Change-Id: Iaf24f25432ec2238bc8b0785b78f6acb21bb78cb
Set some GC parameters only for dalvik

Commit https://github.com/CyanogenMod/android_frameworks_base/commit/8f566390bceee9f01b1721c4d00b1b246d26be16
fixed parsing of certain GC values. Before the result was "" and so the
if statement was always false, never executing the setTargetHeap* calls.

Now they are executed but ART currently doesn't support setting
heapminfree and heapconcurrentstart resulting in a UnsatisfiedLinkError
Exception.

Check for the used runtime first and only execute the methods for Dalvik. 

Change-Id: I09e60802685acbec04598646e9f7700f33b53b4c
Signed-off-by: Dirk Rettschlag <dirk.rettschlag@gmail.com>
Frameworks: Lockscreen custom wallpaper (1/2)

kitkat now has code for a custom wallpaper image.

Using that code set a switch case to set the custom background between
  - Custom Wallpaper
  - Default background

This way allows the same overlay shadow thats set on the keyguard when
its the defualt way.

Change-Id: I98fde63ef9f3c0a5f334cd9a97b237a6f99c57f6
Merge "Set some GC parameters only for dalvik" into cm-11.0
Lockscreen: Fix SystemUI crash on initial selection of Custom Background.

Change-Id: I8df4984f4b90d211baa888d380a95fc00a85d1ad
Merge "SysUI: Use LocationController from status bar service for GPSTile." into cm-11.0
Merge "base: Add blacklist provider permission" into cm-11.0
Merge "ConnectivtyService : Execute connectivityCheck in thread pool" into cm-11.0
Update settings after recreating status bar.

This is needed to e.g. keep the circle battery after theme changes.

Change-Id: Id1eb23d19c8cbc33c4987a908382f4b5fe17cfd4
Automatic translation import

Change-Id: I43f9c1f1f13c2a774f17f553b57d52f0b42db839
Wallpaper Overscroll and Transparent NavBar

Now possible to offset wallpaper windows by more than the size of the wallpaper
and add added a transparent mode to the NavigationBar

Change-Id: I2b0f1129a4cf73b8def35abb7072d0472a9cc972
add Custom Lockscreen switch

Change-Id: I3cc14cacf5462f589373b686f0dd87100507d524
Remove T-mobile items not used by new theme engine

Change-Id: I1e9c14e63ec25fdff61cfd2b7b8a05b1e488e558
New command line tool 'idmap'

Introduce a new tool 'idmap' to handle generation and verification of
idmap files. The tool is modelled on 'dexopt', and is intended to be
used similarly, notably by 'installd'.
See cmds/idmap/idmap.cpp for further documentation on 'idmap'.

Note: this commit is interdependent on a commit in project build/ to add
'idmap' to PRODUCT_PACKAGES.

Note: the changes to androidfw are only stubs. The actual implementation
will be provided in Runtime resource overlay, iteration 2.

Change-Id: I7131b74ece1e46c8a9c0a31d103e686aa07da2bb
Runtime resource overlay, iteration 2

Support any number of overlay packages. Support any target package.

UPDATED PACKAGE MATCHING
------------------------
In Runtime resource overlay, iteration 1, only a single overlay package
was considered. Package matching was based on file paths:
/vendor/overlay/system/framework-res.apk corresponded to
/system/framework-res.apk. Introduce a more flexible matching scheme
where any package is an overlay package if its manifest includes

    <overlay targetPackage="com.target.package"/>

For security reasons, an overlay package must fulfill certain criteria
to take effect: see below.

THE IDMAP TOOL AND IDMAP FILES
------------------------------
Idmap files are created by the 'idmap' binary; idmap files must be
present when loading packages. For the Android system, Zygote calls
'idmap' as part of the resource pre-loading. For application packages,
'idmap' is invoked via 'installd' during package installation (similar
to 'dexopt').

UPDATED FLOW
------------
The following is an outline of the start-up sequences for the Android
system and Android apps. Steps marked with '+' are introduced by this
commit.

Zygote initialization
   Initial AssetManager object created
+    idmap --scan creates idmaps for overlays targeting 'android', \
           stores list of overlays in /data/resource-cache/overlays.list
   AssetManager caches framework-res.apk
+  AssetManager caches overlay packages listed in overlays.list

Android boot
   New AssetManager's ResTable acquired
     AssetManager re-uses cached framework-res.apk
+    AssetManager re-uses cached 'android' overlays (if any)

App boot
   ActivityThread prepares AssetManager to load app.apk
+  ActivityThread prepares AssetManager to load app overlays (if any)
   New AssetManager's ResTable acquired as per Android boot

SECURITY
--------
Overlay packages are required to be pre-loaded (in /vendor/overlay).
These packages are trusted by definition. A future iteration of runtime
resource overlay may add support for downloaded overlays, which would
likely require target and overlay signatures match for the overlay to
be trusted.

LOOKUP PRIORITY
---------------
During resource lookup, packages are sequentially queried to provide a
best match, given the constraints of the current configuration. If any
package provide a better match than what has been found so far, it
replaces the previous match. The target package is always queried last.

When loading a package with more than one overlay, the order in which
the overlays are added become significant if several packages overlay
the same resource.

Had downloaded overlays been supported, the install time could have been
used to determine the load order. Regardless, for pre-installed
overlays, the install time is randomly determined by the order in which
the Package Manager locates the packages during initial boot. To support
a well-defined order, pre-installed overlay packages are expected to
define an additional 'priority' attribute in their <overlay> tags:

    <overlay targetPackage="com.target.package" priority="1234"/>

Pre-installed overlays are loaded in order of their priority attributes,
sorted in ascending order.

Assigning the same priority to several overlays targeting the same base
package leads to undefined behaviour. It is the responsibility of the
vendor to avoid this.

The following example shows the ResTable and PackageGroups after loading
an application and two overlays. The resource lookup framework will
query the packages in the order C, B, A.

        +------+------+-     -+------+------+
        | 0x01 |      |  ...  |      | 0x7f |
        +------+------+-     -+------+------+
            |                           |
        "android"                Target package A
                                        |
                       Pre-installed overlay B (priority 1)
                                        |
                       Pre-installed overlay C (priority 2)

Change-Id: If49c963149369b1957f7d2303b3dd27f669ed24e
Runtime resource overlay, iteration 2, test cases

Add automated test cases for runtime resource overlay, iteration 2.

The test cases are a mixture of 'adb shell' commands and regular
instrumentation tests. The device is rebooted between tests to setup
different overlay scenarios for framework-res.apk.

To verify Runtime resoure overlay, iteration 2, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py

For a list of supported options, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py --help

Change-Id: I692aa1a7ad073efd116b24f9ec7f197dfd65dfef