Squash all 4.2.2 changes into one

libsuspend: compile as a static library

Compile libsuspend as a static library as well, currently needed by the charger
code in some cases.

Related-to-bug: 7429504
Change-Id: I113017c2c855f915b77c76d8934b6e57c0bb532c
Signed-off-by: Iliyan Malchev <malchev@google.com>

init.usb.rc: set sys.usb.config to none before changing it

On encrypted devices, persistent properties are loaded after the device
is decrypted. To properly change sys.usb.config to its persistent value,
it must first be set to "none" and then to ${persist.sys.usb.config}.

Bug: 7678835
Change-Id: I4f91245cedc04e3178ce9cee21390f5b657733c9

charger: suspend enable in charger mode

To reduce power consumption after charging completion, enable suspend when LCD
is turned off.

Bug: 7429504
Change-Id: I34731dc392661c9051a20cea74f70d94a8aaeb42
Signed-off-by: Iliyan Malchev <malchev@google.com>

charger: fix build

Looks like libsuspend is not available on all platforms.

Change-Id: Ic32dc93221f3c488e846da35235f247f4ddb4c69
Signed-off-by: Iliyan Malchev <malchev@google.com>

charger: Do not suspend when disconnecting from charger

The device should be power off when disconnecting from charger.
If the device enter to suspend, the device couldn't handle the power off
process. So the device shouldn't suspend to handle the power off at that time

Bug: 7429504
Change-Id: I9a0a60e53f315cd83550dc730a33bc7bd464ef67

rootdir: init.rc: set perms for cpufreq governor boostpulse_duration

Change-Id: I09b9a1ed548e4ffe1232f583e8ff5f026760f616
Fix boostpulse perms

Change-Id: I51746ac85898578bba8b3001eab77e8145444cc0
Fix slim specific init derp

This was causing the init.slim.mk not being called
coz it was referring to init.cm.mk

Change-Id: I773befe5d22546fb55eb0934ec3e6f849543b288
Seems to have fixed the lazy screen on on cappy

Change-Id: I76476b58347c79e6fd6ec3206f99bdd10bd965f2
Let them read

Change-Id: Ie5c3272953b17e041a8e614a92df09dad6d6d11c
More HTC specific perms

Change-Id: I7970568fb8967e352eb6c341ab1ac3eac3aeb9c7
Update WiFi buffer

Change-Id: I93592a9eff9908a8b77e1747add1e1480f381d45
Symlink fstab

Patching init to get the 'right' fstab was a bad idea as vold has
the path hardcoded. This patch changes init to symlink the correct
fstab to the expected place

Credits: Adrian Ulrich

Change-Id: I6a55efa89f55dc1733220e26f445938bf47542c4
Stop the damn warning

Change-Id: I825a0887fb4c9e4c7127e13c9cfe4c0c22b765d6
Add a "smash-stack" option to crasher.

bionic's __stack_chk_fail was preventing debuggerd from dumping
stacks, which was not helpful.

Bug: 2487269
Change-Id: Idba2a274037b960dfb2ac1c21686323268c4b372
adb: Use 64 bit capabilities.

Fix the following kernel warning:

$ adb shell dmesg | grep adb
<6>[    7.813003] warning: `adbd' uses 32-bit capabilities (legacy support in use)

Change-Id: I3912302c5c577f1cb03f0c591834ab7b3a72ddf5
init.rc: allow IPPROTO_ICMP support

Allow userspace programs to create IPPROTO_ICMP sockets.

This socket type allows an unprivileged program to safely
send ICMP_ECHO messages and receive the corresponding
ICMP_ECHOREPLY messages, without relying on raw sockets or
setuid programs.

Please see http://lwn.net/Articles/443051/ for details.

In particular, this allows us to use a version of ping
which doesn't have any capabilities
(https://android-review.googlesource.com/52072).
In addition, this allows us to safely implement an IPv4 ICMP
based version of InetAddress.isReachable()
(https://code.google.com/p/android/issues/detail?id=20106)

Change-Id: I876718151efa8219c4f34f573e35e21256fe2316
add 32K 64K and 128K pagesizes in bootimage

Change-Id: I4bc74ad6b0a473de68c906422bcd7eac00c89793
Signed-off-by: ChampionSwimmer <android@championswimmer.tk>
Create mountpoint for sdcard

Change-Id: I4cc46c0a7f7cf1c43139c790f23f9590a8b68d55
Fix issues where the filename is referred to as 'sideload'

The adb sideload utility referes to the filename as 'sideload' in some
places. This patch changes the printouts to display the filename instead.

Change-Id: I38ada01a08bed53a8d9697c03f55ce8cee2abe12
Signed-off-by: Magnus Eriksson <eriksson.mag@gmail.com>
Close adb_usb.ini after reading it

Signed-off-by: Chris Dearman <chris@mips.com>
Change-Id: I7d3ee8cbd54af206dac89225c438e6c7322c571f
fmradio: cleanup QCOM_HARDWARE/STE_FM defs and ifdef

thanks Kali for that

Change-Id: Ib9b4a23e7a2026565575611e6e7e871e7ea95e0a
liblog: fix fd leakage

File descriptors remain open across an exec unless FD_CLOEXEC is
set.  Add O_CLOEXEC to the open() call to prevent file descriptor
leakage.

In particular, the following program will eventually run out of
file descriptors:

int main(int argc, char **argv) {
  printf("===== entering main =====\n");
  ALOGW("entering main");
  system("ls -l /proc/self/fd/");

  execv(argv[0], argv);
  printf("exec failed\n");
  return -1;
}

Change-Id: I5be43ab3b9f82a05f242b1f586454c50568af388
debuggerd: Fix minor memory leak

free_ptrace_context(context) doesn't free(context),
which leaks the memory allocated to context.

Change-Id: Ic199b257aefc9a05ec2d902958efa8a57a601fb1
Signed-off-by: Liangtao Gao <gliangtao@gmail.com>
libnetutils: add ifc_set_mtu

Change-Id: I3031e9ee38583648350f2c46baa7a9a714b9ea1e