charger: make default to not suspend in charge mode

  * http://r.cyanogenmod.com/#/c/19760 made the device suspend in
    charge mode when the animation was not displayed. Previously
    the device never suspended.
  * The above change broke charging mode on some (maybe many?) devices
    that do not properly handle suspending in charge mode.
  * This change brings back the more compatible default behavior of
    not suspending in charge mode and introduces a new BoardConfig.mk
    variable called BOARD_ALLOW_SUSPEND_IN_CHARGER that, when set to
    true, will suspend in charge mode.
  * This allows devices that support suspend in charger to opt-in
    instead of having to opt-out previously working devices.

Change-Id: I5a480e34ba5946a52e371ac79a965ecee5471c5a
charger: allow home button to wake

On certain devices (e.g. galaxysmtd), the user expects the physical
home button to be able to wake the device as well as the power button.

Change-Id: If764f36aba3810dfa5233af8baf0a740b04889e0
charger: do not suspend when handling home

When using Google's suspend implementation, home press should also wake
the device from suspend

Change-Id: I51f3e45c5cb418b0b3718e7223a1336876379043
charger: Toggle backlight while in charger mode.

The backlight is now toggled on/off in the charger mode via a sysfs
node. This is to compensate for the fact that on certain targets the
FBIOBLANK ioctl does not turn off the backlight.

Change-Id: I7c4531e7f1b0599b9a1f5ed6f95d13ee6a664066
CRs-fixed: 514940
charger: support alarm in power off charging

To implement this feature need to let the phone reboot some time
earlier than the alarm time.

CRs-fixed: 540039
Change-Id: I5001631114994f5bc29313bbd52395c43f7c4810
charger: modify usb unplugged shutdown time in power off charging

Previous value for this feature is 10 secs which is too long,
and now change it to 2 secs.

CRs-Fixed: 535857
Change-Id: If1d74a25e00f897833092262c49a9a07d18c0674
charger: press power key to turn off charging animation

When charging animation is on, press power key to turn it off.

CRs-Fixed: 535893
Change-Id: Iaac536351426a09cb23c6d77ff3229a8901aaf70
charger: Allow home key on newer devices to wake device

 * On newer devices, the home key button is usually mapped
   to KEY_HOMEPAGE. Allow it to wake the device.

Change-Id: I6423e4c6fb7992c77dc052a9f0aadae1fa8055dd
QuickBoot: Charger: add parameter to support QuickBoot mode

If there is unplug event in QuickBoot mode, close display
and go to sleep mode.

Change-Id: Iaa41255b71767e5cce327c4f441de9a870b384f3
charger: Underp the backlight

 * Always disable the backlight before blanking, or derp is your life.

Change-Id: I225ff0e881cf781fa3e7054c2f6dfa02a6ab23f9
charger: Query pathmap for recovery headers location

 * For compatibility with new recovery

Change-Id: I7054b662f41b2ff3360484f2b9e66efbfb6de09c
Charger: Avoid animation while not charging DO NOT MERGE

At present, charging animation runs irrespective of whether charger
is connected or not. When the charger is disconnected, device not shutdown
for 10secs. Charging animation during this period should be avoided.

Change-Id: Idf8e6a11261aec2812f1ebbbdec1bd1ad769565e
Signed-off-by: Pavan Kumar S <pavan.kumar.s@intel.com>
Signed-off-by: Jenny TC <jenny.tc@intel.com>
Signed-off-by: Yong Yao <yong.yao@intel.com>
fs_mgr.c: fix i++ error and optimize code

Change-Id: I4d7c9846143ec5b9f76af42c7ee4d5a7c2a3fd6d
Add DC-HSPA+ TCP buffer sizes

Change-Id: I5e7ca981ed79a3563215dd7fcef3504c39e973d5
update minui library call

The names of the res_create_* functions have changed.

Change-Id: I9990bb4f6e6dc2d7c62e2cb9e0831532c83b2bb9
adb: Check sender's socket id when receiving packets.

handle_packet() in adb.c didn't check that when an A_WRTE packet is
received, the sender's local-id matches the socket's peer id.

This meant that a compromised adbd server could sent packets to
the host adb server, spoofing the identity of another connected
device if it could "guess" the right host socket id.

This patch gets rid of the issue by enforcing even more checks
to ensure that all packets comply with the description in
protocol.txt.

+ Fix a bug where closing a local socket associated with a
  remote one would always send an A_CLSE(0, remote-id, "")
  message, though protocol.txt says that should only happen
  for failed opens.

  The issue was that local_socket_close() called
  remote_socket_close() after clearing the remote socket's
  'peer' field.

  The fix introduces a new asocket optional callback,
  named 'shutdown' that is called before that, and is
  used to send the A_CLSE() message with the right ID
  in remote_socket_shutdown().

  Also add some code in handle_packet() to detect
  invalid close commands.

Change-Id: I9098bc8c6e81f8809334b060e5dca4fc92e6fbc9
 healthd: increase healthd fast timer to 10mins instead of 1min

healthd 1 min wakeups are causing significant power impact
during static display use case. so increasing the timer to 10min.

Change-Id: If7a514e4152789144242e198175918b6687c3bcf

healthd: Disable the RTC wakeup timer

The timer is used here to avoid battery drained to zero. But the periodic
wakeup during suspend should not be needed as MSM PMIC already support
that by trigger interrupt to avoid the critical low battery situation.
This will save more power. And if the design is not support HW interrupt
of low battery, need to enable the timer to periodic check.

Change-Id: I040b4bc8548dc59b5e7cacb9a5a8a3557604f458