healdth: A capacity value of 0 is valid

http://jira.omnirom.org/browse/OMNI-676

During booting when this is checked it is possible that
the kernel drivers hasnt set the real capacity and will
return 0 but still the path is valid

Change-Id: Ie6469f8209225c1079da0db21e3f037eb9bececc
Init: Add support for mounting emmc partitions by name

Allow init to mount partitions by their labels on emmc devices. This brings it in line
with mtd devices who already support this.

This initial implementation respects the BOARD_VOLD_MAX_PARTITIONS build flag,
but is limited to partitions on mmc block zero.

Change-Id: I7b30e8beb7d159d920c9eb87d7b9e42094da2649
fix corruption in Vector<> when malloc falied

1. When alloc or realloc failed in the function SharedBuffer::editResize,
it would return a NULL pointer, then mStorage would update to be 1 by
SharedBuffer::data() if no pointer check here, which is an obviously
wrong address, and would cause corruption when used it e.g. in capacity().

So add the pointer check here for the return value of SharedBuffer::editResize,
if it's NULL do not use it to update mStorage, to avoid the value of mStorage
polluted.

2. when alloc or realloc falied in _grow & _shrink function, mStorage keep
the original value, so mCount should not be updated here.

Otherwise, mStorage might be 0 but mCount>0, so a corruption would happend
when it try to delete items from the Vector since mCount>0.

Change-Id: I7c3814e843c459834ca5eed392e8d63d1cb7d2d8
Signed-off-by: Shuo Gao <shuo.gao@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>
Author-tracking-BZ: 139626
init: Fix queue_all_property_triggers with nonexistent properties

Don't queue actions for "on property=*" if the property does not exist.
This fixes the following errors during boot:

    init: property 'sys.powerctl' doesn't exist while
    expanding '${sys.powerctl}'
    init: powerctl: cannot expand '${sys.powerctl}

PS3: Rebase
PS4: Rebase

Change-Id: I3bd354d73a860f856be5df2c654f940445f9efd9
Fix assertion failure

Adding 0 items to vector causes assertion failure in _grow -> itemLocation

Change-Id: Ief232a9c12e2e43ee6c87a7a137fe8a94aa741d4
ueventd: fix a busy loop while reading uevents

Under certain conditions, poll() may raise the POLLERR
flag along with POLLIN, in which case the check for
(ufd.revents == POLLIN) results in an endless busy loop.

The following fix was applied to
hardware/libhardware_legacy/uevent/uevent.c
to fix a similar bug:

  commit 3aabb260ceef10377c31c9e45fb239247f5cfeba
  Author: Mathias Agopian <mathias@google.com>
  Date:   Mon Oct 1 14:53:18 2012 -0700

    fix a typo in uevent_next_eventi

    Bug: 7114973
    Change-Id: I15a4c714b59aeb1d02db00517d70b5f0e5ab22c2

Applying the same fix for two more poll loops in init
and ueventd.

https://android.googlesource.com/platform/hardware/libhardware_legacy.git/+/3aabb260ceef10377c31c9e45fb239247f5cfeba
Signed-off-by: houst0nn <houstonn@gmail.com>
Change-Id: I50693f6d3c904992ac4b8a9a14a83c7106e6b9e0
Camera: Add meta data types for meta data callback

Add meta data callback types in order to reuse same callback
path for diffrent data types.

Change-Id: I9892771c11eda0bd15a2330ba98f70b02490c802
Camera: Adds auto HDR Metadata type

- This type is used during auto HDR
  Metadata callbacks.

Change-Id: Ifd6fd88c9345d12af8406e59ed209cb91677b9c1
Camera: move CAMERA_CMD_METADATA_* outside of QCOM_HARDWARE

Change-Id: I2374419f2939ca737fd0a887b552f3e5a9bcd349
Merge branch 'android-4.4' of https://github.com/omnirom/android_system_core into android-4.4