healthd: Only use battery values that seems legit

On some devices, there are other sysfs paths having a "capacity"
node than just the battery, which can return a weirdo value. We
make sure we only use legit battery levels (> 0%).

Change-Id: I3caf34e7fed4b89f953ec98c486b53b8786c8f74
rootdir: Allow to use a custom environ.rc

This is helpful for device which relies on blobs that needs their dependencies to be placed on a different dir

Change-Id: Ic5ebb7abe6ea97599c28c8a0d61350358b18fda6
audio: Add APIs for supported compress formats

-Add APIs for supported compress capture & compress voip formats.
-Add default bytes per sample as 1.

Change-Id: If63a50f02389475855f2f0729b03b6049d44fb29
core: add QCOM_HARDWARE ifdefs

Change-Id: I5fb1420d5ce99a86cd8bc42556be5616ff89229b
ADB: Don't force -O2 if something else is provided instead.
C++11 fixes.
restorecon /data/misc/media.

Otherwise it will be mislabeled on upgrades with existing userdata.

AOSP: https://android-review.googlesource.com/79022/

Signed-off-by: Humberto Borba <humberos@gmail.com>
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Change-Id: Ibde88d5d692ead45b480bb34cfe0831baeffbf94
Allow a device to define the max number of service groups in init.h

Certain proprieatary binaries (such as tcmd for instance) require
more than 12 supplementary service groups.  By definiing:
TARGET_NR_SVC_SUPP_GIDS := in BoardConfig this can now be changed
per device.

Change-Id: I8f968adc21768ca90232ded7b7e1ffa68dc7ea78
Add support for init mknod command.

This is required for statically allocated devices.
These don't hit ueventd and hence doesn't automatically get a device node.

Change-Id: I83d19f0666e1f1bbb369b226fba019994d403a89
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
Camera: move CAMERA_CMD_METADATA_* outside of QCOM_HARDWARE

Change-Id: I2374419f2939ca737fd0a887b552f3e5a9bcd349
C++11 literal fixes.
fs_mgr: support multiple file systems on a mount point

This is a combination of 3 commits pulled from Motorola's github for
allowing f2_mgr to have "fallback" handling for a mount point.  This
is most useful in the case of f2fs where some variants may be formatted
ext4 and some f2fs.  These device can now be supported in 1 fstab.

Example snippet of fstab.* for userdata mount point:
/dev/block/platform/msm_sdcc.1/by-name/userdata    /data        ext4    rw,discard,nosuid,nodev,noatime,nodiratime,noauto_da_alloc,nobarrier    wait,check,encryptable=footer
/dev/block/platform/msm_sdcc.1/by-name/userdata    /data        f2fs    rw,discard,nosuid,nodev,noatime,nodiratime,inline_xattr                 wait,encryptable=footer

Changes in logic ignore 1st failure as an automatic assumption of encryption.
Instead fstab is checked for another line describing mount point (2 retries)
Once all retries fail, encryption is assumed.

NOTE: Some logic was removed from the original sources: If userdata failed to mount
and was not encrypted a format of the filesystem was forced as a way of recovering
the device.  Most custom ROM users have access to recovery where they can decide
what to do in this case.

REFERENCE COMMITS:

IKJBMR2-6556: don't assume that mount failure implies encryption
https://github.com/MotorolaMobilityLLC/system-core/commit/f3c3b19f93967952e1811cad82d5a0ef5bbfcad3

fs_mgr: support multiple file systems on a mount point
https://github.com/MotorolaMobilityLLC/system-core/commit/84ea2cd252515384a254b52dfd84721b885707ab

fs_mgr: rename "recover_userdata" relic to join fs_mgr
https://github.com/MotorolaMobilityLLC/system-core/commit/a4ef7c2c321b71496a13066af94b4b1cb557dd28

Change-Id: I682580d2a756bff4dba75760e0f117d95613e790
pixelflinger: use __builtin___clear_cache instead of cacheflush

cacheflush doesn't exist on LP64 any more, and gcc's
__builtin___clear_cache is better in every way.  Use it instead.

Change-Id: Ibbf6facbdefc15b6dda51d014e1c44fb7aa2b17d

Conflicts:
	libpixelflinger/codeflinger/CodeCache.cpp
	libpixelflinger/tests/arch-arm64/assembler/arm64_assembler_test.cpp
libcutils: Socket type might contain bitwise OR flags

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Change-Id: Ia5c8f136793a989fc1d71c61292afe4e5cf169fa