Unicode: Fix mismatched type initialization

Fixes the following:
system/core/libutils/Unicode.cpp:579:27: error: cannot initialize a variable of type 'const uint16_t *const' (aka 'const
unsigned short *const') with an rvalue of type 'char16_t *'
    const uint16_t* const u16end = dst + dstLen;
                          ^        ~~~~~~~~~~~~

Change-Id: I6b1c64d69bb78faeb0e7ae7b08afe05f426c7532
<utils/Errors.h>: Fix c++11 narrowing

Summary:
C style casting opposed to static casting was used here due to Errors.h being included by C as well.

Depends on D309

Test Plan: verified

Reviewers: randall.rushing, jriordan001

Reviewed By: randall.rushing

Differential Revision: http://review.codefirex.com/D310
charger: add locale global variable

Some functions in minui reference a global extern char *locale.  None
of them are used by charger, but the bfd linker cannot optimize them
out and fails to link charger.  Define char *locale in charger.c
so it can resolve the symbol.

Change-Id: I738daf95d24356bf96bd226d91a5dc64b5d4dc9b
Remove dead code.

We have benchmarking for memset in bionic itself, and a benchmarking
framework for other native benchmarking.

Change-Id: I241a288a96d3b2d37f3d51b04a519ac23f18a989
Move creation of /data/misc/wifi and /data/misc/dhcp to main init.rc file.

mkdir /data/misc/wifi subdirectories and /data/misc/dhcp is performed
in the various device-specific init*.rc files but seems generic.
Move it to the main init.rc file.

Drop the separate chown for /data/misc/dhcp as this is handled by mkdir
built-in if the directory already exists.

Add a restorecon_recursive /data/misc/wifi/sockets.

Change-Id: I51b09c5e40946673a38732ea9f601b2d047d3b62
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
Label existing /data/mediadrm files.

Use restorecon_recursive to label devices
where the directory and subfiles have
already been built and labeled.

Change-Id: I0dfe1e542fb153ad20adf7b2b1f1c087b4956a12
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
adbd: switch to su domain when running as root

When adbd runs as root, it should transition into the
su domain. This is needed to run the adbd and shell
domains in enforcing on userdebug / eng devices without
breaking developer workflows.

Introduce a new device_banner command line option.

Change-Id: Ib33c0dd2dd6172035230514ac84fcaed2ecf44d6
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.

Change-Id: I50693f6d3c904992ac4b8a9a14a83c7106e6b9e0
Fix assertion failure

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

Change-Id: Ief232a9c12e2e43ee6c87a7a137fe8a94aa741d4