Revert "healthd: Add dock battery support"

This reverts commit 4bc9f638a11046daae3ea6dbd7de9246af7dd164.
ueventd: Handle online events

Based on upstream commit 75b287b771b302c99797d812122b72f83d2f56f9.

Change-Id: If3bae9f1e9299be386fe805ff903eeba2b165ba2
Unify zipfile implementations : Step 1.

Extract zip file processing logic from libdvm into a
standalone library.

This library is a stricter than the libdvm library in
several ways:
- Duplicate zip entry names are now disallowed. Files with
  such entries will fail to parse.
- We now verify CD file size information with the individual
  file header information. (This was pointed out as a deficiency
  of this implementation in past discussions.)
- We also add support for crc checking, which means we might
  need to parse the optional data descriptor footer (if one
  exists).

We also provide an API for iterating over the entries of
a zip file. This library is optimized for two use cases :

- Lookup for a single entry in the file, with the intention
  of processing or extracting the data associated with that
  entry
- Iterating over all entries in a file *and* processing
  / extracting their data.

Change-Id: Ia87de6184ef753cc470b0af755c47a4f92ac8198
Fix Mac OS build for libziparchive.

BSD off_t are implicitly 64 bit so the platform
doesn't define off64_t.

Change-Id: I51cbe94ead01d2d6bc7c5010d9472487bee7c2d3
Fix return code for ended iteration.

The API promises a return code of -1 for an
ended iteration and lower negative values for
errors.

Change-Id: I688a1ee2efad1bdfc6959cf27e49c0426ebf27f8
Add unit tests for libziparchive.

- Add a build rule for host tests
- Add basic tests for Find / Iterate and Extract
  for both deflated & stored entries.
- Fix an off by one error that the test uncovered.

Change-Id: If72009b1ea9791d5a265829f05c32ffe1c2752c4
Use FileMap from libcutil instead of rolling our own.

Adds windows support as a side effect.

Change-Id: I912c1f980f284d01d4f3936291999646ddf6250a
Get rid of some log spam.

We don't need a warning if an entry isn't found in a zip
file. It can happen as part of normal operation.

Change-Id: I86c132a040371f36f0dd981b49c02b3173821439
Fix ExtractEntryToFile.

We would always write uncompressed data at offset 0 instead
of the current filedescriptor offset.

Also adds a unit-test & a clarifying comment on the API.

Change-Id: If44757e96dde504ce63d81b4dec7115fc6f6d5fb
Fix a sporadic build breakage.

The issue here is that the makefile sets LOCAL_LDFLAGS
and asks for -llog without declaring a dependency on it.
This will cause build breakages if liblog hasn't already
been built yet.

Change-Id: Ia38761cda44a38b6c2a88902d6108cbe64a328ce
Fix entry handling for 0 length entries.

Two minor issues were fixed:
- The offset to entry data can be the same as the
  central directory offset when the last entry in the
  file has length 0 and is stored (not deflated). Fix
  a check that disallowed this. We already have a strict
  check that entry data must end before the central directory,
  so we're covered.
- We would attempt to map a segment of length 0 when writing
  an entry whose length is 0. We should just return early in
  this case.

bug: 12623277
Change-Id: I2a4ca0c4d170cc3cbf326e5ca13894acd9c434c9
Add free to CloseArchive.

Currently CloseArchive doesn't call free and call sites don't appear
to either. I could not find any call sites which manually freed the
archive by deleting the handle. This fixes several memory leaks.

Change-Id: I21f187dde60fd87e6e54bde06de9e76fd0791104
Revert "property_get: do argument checking."

This reverts commit 0e54ec825e6eae234a486c2049039fb6986a39b8.

Conflicts:
	include/cutils/properties.h
<utils/Macros.h>: introduce

Summary:
Issue:
These macros are non-standard to the C standard, but standard in GCC.
This causes issues since compiler-rt assumes we provide these when built with
LLVM Clang.

Solution:
Include these macros as a easy to utilize header.

Test Plan: verification is a WIP

Reviewers: randall.rushing, synergy

Reviewed By: synergy

Differential Revision: http://review.codefirex.com/D107

Change-Id: If4f06e75f0b42f9656618ee3dad6f8a4a997a377
Signed-off-by: DHOMD <DHO@dho.im>
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