add Torch resources
core: add support for translucent volume panel

Add support for display the volume panel in translucent mode

Change-Id: I4f21a6cc88282789072a0e71ae696b754a5e083e
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>

Conflicts:
	core/java/android/view/VolumePanel.java
server: Handle broadcast intent and receiver

Ensure the receivers of broadcast intent is not launched before boot
completion by adding an intent flag, since connectivity events can
happen before boot has completed.

Change-Id: Id6fc9e34c89d947d768def38e5c5bb0df54a3a7b
Service: Keep services needing restart.

Services needing restart after crash include:
1) service with 'persistent == true'
2) service explicitly reuqired restart by returning START_STICKY
   or START_REDELIVER_INTENT from onStartCommand

Change-Id: Idc490a1ceb1e151a3eb7f34b7b4cf8058a06f34a
Signed-off-by: Liangcai Li <liangcail@nvidia.com>

Conflicts:
	services/java/com/android/server/am/ActiveServices.java
Keyguard: don't refresh ui when screen off

KeyguardStatusView is doing refresh all the time,
which cause high power when screen off.

Change-Id: Ifabdde4419a23e919cd52fe77e78ec3160575af1

Conflicts:
	packages/Keyguard/src/com/android/keyguard/KeyguardStatusView.java
Thermal: Add Thermal Monitoring functionality to Android Framework

This patch adds Thermal monitoring support to Android
Framework based on Linux kernel thermal framework. This has
been tested on various x86 based android platforms and
Nexus 4 (mako).

The Thermal sensors, zones and their attributes are defined
in thermal_sensor_config.xml. The cooling devices and their
relationship with various zones (policies) are defined in
thermal_throttle_config.xml.

A sample version of both these xml files are put in
frameworks/base/.../overlays/ directory. The platform
specific version can be present in device/vendor/platform/
directory. The sample (default version) xml configuration
files are not expected to work as such for any platform;
so they must be overridden with platform specific files
using overlays.

Summary of the Changes in the patch (file by file):
m - existing file modified
c - newly created file

ThermalService.java: (c)
        A system service that monitors the thermal zones
        on the platform. It takes inputs from thermal_sensor_config.xml
        This can be enabled/disabled through persist.service.thermal
        property.
SystemServer.java: (m)
        Start the Thermal Service if enabled through adb property
ThermalSensor.java: (c)
        This class describes attributes of a thermal sensor.
ThermalZone.java: (c)
        This class describes the attributes of a thermal zone and has
        methods to access them. A thermal zone can have one or more
        thermal sensors in it.
ThermalManager.java: (c)
        This file describes several common attributes of thermal
        management functionality that are not specific to a thermal
        zone/sensor or a cooling device.
ThermalCoolingDevice.java: (c)
        This class describes attributes of a cooling device. A cooling
        device is a component which when throttled, can bring down
        the temperature of a thermal zone.
ThermalCooling.java: (c)
        This class parses the thermal_throttle_config.xml to know about
        the relationship between various thermal zones and cooling
        devices on a particular platform. This file also handles
        thermal events (Intents) and triggers appropriate actions,
        according to the policies configured in the xml file.
ThermalEvent.java: (c)
        This class contains the elements of a Thermal Event like
        Thermal Zone ID, Temperature of the zone etc.
ThermalNotifier.java: (c)
        This file implements a simple notification mechanism
        through which User can be notified of thermal events.
        Notifications can be in the form of 'vibra', 'tone',
        or a 'toast message'. These are configurable through
        adb properties.
CPUMaxFreqControl.java: (c)
        A simple implementation to control the CPU frequency
        when a thermal zone temperature crosses its limits.
BrightnessControl.java: (c)
        This class controls the LCD Brighness (based on the
        temperature of a thermal zone) by setting a limit
        on the brightness value through PowerManagerService.
        This releases the brightness cap as soon as the thermal
        condition clears.
BatteryChargeControl.java: (c)
        This class can control the battery charge current in
        order to reduce platform temperature.
PowerManagerService.java: (m)
        Add a method to facilitate adjusting the brightness
        levels based on thermal conditions. A stub for the
        method has been added in BridgePowerManager.java. The
        interface for the same is defined in IPowerManager.aidl.
thermal_ThermalManager.cpp: (c)
        This file implements the native functions that are used
        to read/write the kernel sysfs interfaces.

Change-Id: I7a49a0b90e6c5b9c9f0f4ad5514dbcd17ebe7146
Signed-off-by: Durgadoss R <durgadoss.r@intel.com>
Signed-off-by: Saikat Roychowdury <saikat.roychowdury@intel.com>
Signed-off-by: Jian Luo <jian.luo@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Missing break in switch statement

Change-Id: I462c0c5fec96a850032266b04419ec409ad02174
Fixed cancel() not working correctly

The method handleMessage(Message msg) from mHandler variable was
not checking if the timer was cancelled, so
sendMessageDelayed(obtainMessage(MSG), delay) was keeping the
timer alive. The patch simply adds a boolean and checks if the
CountDownTimer was cancelled before calling
sendMessageDelayed(obtainMessage(MSG), delay)

bug: https://code.google.com/p/android/issues/detail?id=58668

Change-Id: Ic6bbb9d33a3616f8503db222513cc14ad2270cb8
Signed-off-by: jl1990 <jlcarrasco1990@gmail.com>
Fix resource leak: When call MediaMetadataRetriever.setDataSource or getFrameAtTime should ensure call release in finally to avoid resource leak
                   Patch set 2: Remove unnecessary white spaces

Change-Id: I49a7f2fb99dc8b9560e7c17421125356e45a87ac
[ActivityManager]: Fix the activity visibility state not sync between ActivityManager and WindowManager

Symptom:
When press Home key to home screen, user is able to see the activity's window shown on top of wallpaper and below launcher(widgets).

Root Cause:
The ensureActivitiesVisibleLocked() is called pretty often (for example when a new process bound).
If the top activity "B" was finishing, then the previous activity "A" should be visible.
Therefore, the activity "A" window will be set to visible and then launched activity "A", but it does not updates the visible state in ActivityRecord for "A".
There has a timing issue that if a new activity "C" is started, "C" becomes the new top activity and be resumed.
In that case, Activity "A" window will remain visible even if it is behind a full screen activity "C" because the ActivityRecord.visble of "A" is still false, so the window visibility won't be update.
So when user press home key and back to launcher, the surface of activity "A" will be composed on top of wallpaper.

Solution:
Updates ActivityRecord.visible to true for "A". After "C" is started, the "A" will be called WindowManagerService.setAppVisibility() to set invisible, then called onStop() when execute ensureActivitiesVisibleLocked() again.

Change-Id: I536ba04b95d8d274fea6d679a6493e620bc981e2
Improve Parcel's handling of non-primitive arrays

Treat arrays other than actual Object arrays (i.e. those whose component type
is actually Object) and the primitive arrays already handled specially by
Parcel as Serializable's.

Issue: 64583
Change-Id: I3ff797f3262e77e4de27f35709bceee5410d1ed4
Added 2D PieChartView.

Extracted from Dialer+Settings apps

Change-Id: I30f36f508f8485f7a49cd555aa444541a2135bee
Support for new gTLDs

Add support for new generic Top-Level Domains (gTLDs) from ICANN.
The last time this was updated was 2011.
In 2013 and 2014 the web got and will get many more gTLDs.
Without this support many new gTLDs are not clickable in Android
and needs to be copied and pasted to reach them by the user.

Change-Id: Ic3c533883037c767e972b28eb128040648ebbd3e
Signed-off-by: Marvin Reimer <therealmarv@gmail.com>
Live Volume Steps [1/2]

-Created by me(@Meticulus) for the almighty BeanStalk ROM!

-Volume steps changes are instant, no need to reboot!

Change-Id: I1f50a68f5e361976f463b2497e2fea765144e5a1

Conflicts:
	media/java/android/media/AudioService.java
Quicksettings: Few misc adjustements and fixes.

* Fix sleep time tile label on clean flash boot, was showing unknown till you set it in settings.
  Initialize screen timeout with default 30 seconds (wrongly initialized with 0 that is never compared).
* Use switch statement (better performance wise).
* Bit cleanup for wifi ap tile, useless resources reload.

Signed-off-by: Carlo Savignano <stevewatersy@gmail.com>

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java
	packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java
Avoid layout passes when updating data activity indicators.

ImageView can optimize out layout passes if old and new drawable have
equal sizes. Take advantage of that by displaying a transparent drawable
with the same size as the in/out drawables when there's no activity
instead of clearing out the drawable in that case.

Added missing code

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java

Change-Id: Iaaa556ffab3ed4be1da8016ed40d0a9c2efcde01

Conflicts:
	packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java
Fix the issue that the top of fullscreen dialog is clipped away

The visibility of status bar comes from the top fullscreen window,
not from the focused window.
That has to be taken into account during the calculation of the
decor rect. You can use mTopIsFullscreen for this purpose.

Change-Id: I6159eb2ee389885cf5ab507157f9451841364d2f
core: add support for translucent volume panel

Add support for display the volume panel in translucent mode

Change-Id: I4f21a6cc88282789072a0e71ae696b754a5e083e
Signed-off-by: Jorge Ruesga <jorge@ruesga.com>