Don't unnecessarily set LayoutParams on children

Setting LayoutParams on children triggers requestLayout
which can be expensive and result in significantly lower
framerate for children layouts that don't need it. When
requestLayout method is invoked the needToMeasure boolean
will be true, this is what we'd like to avoid unless
it is actually needed.

BUG: https://code.google.com/p/android/issues/detail?id=72733

Change-Id: Id5d8f3431b5f943b1279eae41ee43d32a99514fc
Signed-off-by: Jacob Abrams <satur9nine@gmail.com>
[ActivityManager] Prevent provider creating twice.

Root Cause:
If a process which contains provider is starting by not
from accessing provider, e.g. service/activity/receiver,
its providers' will be created during handleBindApplication.
And before the process complete publish provider to
ActivityManagerService, if there is an access to its provider,
these providers will be created again (there will have 2nd onCreate).

Solution:
Check if provider record is existed, do not schedule install provider,
becuase it is already creating and will be published later.

Change-Id: Ic200ceae042c014c86e7edee0acd013b513af334
Frameworks: network traffic color option (1/2)

Change-Id: I94f28e12cffb46fb36d2b311319bdbd7213d4d7c
ActivityManagerService: Penalise large apps going to background

Large applications (PSS more than a given threshold) when closed are
penalised with higher ADJ. Now, they will be more prone to be killed by
lowmemorykiller during memory pressure levels. This ensures better app
concurrency and improved subsequent latencies as it leaves some more room
for other smaller bg apps to be alive

Change-Id: I448fa12f55370949b22075595cd75b9c29e5d4b5
Magnification: Fix screen freeze after activity resumes from rotation

mMagnifedViewport.onRotationChangedLocked() will call setShown(),
and then cancel a anime. As the anime should be only canceled in
a looper, if it is executed in the onRotationChangedLocked() of
DisplayMagnifier, a crash will be caused. Therefore when the
magnification is enabled, the activity will crash after rotation.

Move mMagnifedViewport.onRotationChangedLocked() from main thread
into the handler. When MESSAGE_NOTIFY_ROTATION_CHANGED is received,
execute it. As handler is created with a looper, the crash will be
fixed.

CRs-Fixed: 541799

Change-Id: I2a78f24f73d5a9b8693e557d18e2fb01fcaec8fa
SystemServer: Move sensor init to a new thread.

Move Sensor init to a separate thread so that it doesn't block the
critical booting path.

Initializing Sensors in separate thread has been seen to improve boot
time on customer devices with low-tier / ult chipsets(less cpu cores)

Change-Id: I5c46a5805c04ffe551019b4683523e3bf70274a2
Add reboot reason to detect device shutdown

This change will detect silent device shutdown

Change-Id: Ia3c13e372b02dd4d3ec4a99d1c1f7c4787977ac3
Prevent killing of process during service bringup

ActivityManagerService sometimes kills the process whose service
is being brought up during bindService.
This happens when the process starts hitting some Pss threashold.
Specifically this is causing InCallUI process to be killed during
bind request from Phone app.

CRs-Fixed: 681329

Change-Id: Id548a22d7e7ce3aa0b0511763078f813fafd6e16
Show plugged type (AC / USB) on QS battery tile

Conflicts:
	packages/SystemUI/res/values/custom_strings.xml
	packages/SystemUI/src/com/android/systemui/quicksettings/BatteryTile.java

Change-Id: I2219a2f771cc5907b3853fb8108df6ce9833433f

Conflicts:
	packages/SystemUI/res/values/ldroid_strings.xml
Themes: Add ability to apply color filters to composed icons

Themes can include one or more of the following filter tags in
assets/icons/res/xml/appfilter.xml

    <!-- HUE filter
         Integer value between -180 and 180 representing the degree.
         0 = no change
    -->
    <filter name="hue">0</filter>

    <!-- SATURATION filter.
         0 = grayscale, 100 = no change, 200 = over saturated
    -->
    <filter name="saturation">0</filter>

    <!-- BRIGHTNESS filter.
         0 = pitch black, 100 = no change, 200 = 200% brightness
    -->
    <filter name="brightness">100</filter>

    <!-- CONTRAST filter.
         -100 = minimal contrast, 0 = no change, 100 = maximum contrast
    -->
    <filter name="contrast">100</filter>

    <!-- ALPHA filter.
         0 = transparent, 100 = opaque
    -->
    <filter name="alpha">75</filter>

    <!-- INVERT filter.
         Valid values are true or false
         true = invert colors
    -->
    <filter name="invert">false</filter>

    <!-- TINT filter.
         A hexadecimal value representing ARGB
    -->
    <filter name="tint">#ff0000ff</filter>

Change-Id: I2431237dd2766176be16c730020557ce87d623e4
Make sure ThemeConfig is non-null when loading resources

When the device boots into safemode, the theme config will end up
being null and we need to check that prior to using it to retrieve
resources for the StatusBarIconView

This fixes CYAN-5009

Change-Id: I1a90bc9f9c65cb41a6e58947bbd1b6d7728a952b
PowerManager : Make proximity check opt-in

Conflicts:
	core/res/res/values/config.xml
	core/res/res/values/symbols.xml
	services/java/com/android/server/power/PowerManagerService.java

Change-Id: I4b67ad0b51882108baf1c494e38803af53312b0b