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>
Use white switch thumb activated drawables, not holo blu light.
Follow up change 6e37571ac190c4fa69216a36f7f2467b2c3496d9