system: Support for offloading Java audio tracks

Offload Java audio tracks if the property is set.
This is used to avoid mixing in audioflinger and
to apply effects in DSP. Also update function to
calculate bytes per sample for offload format.

Change-Id: I0705e70a806a335e372e844de8a1210fbfe58cd7
logd: throttle SELinux denials to 20/sec

Impose a limit of 20 selinux denials per second. Denials beyond
that point don't add any value, and have the potential to cause
crashes or denial of service attacks.

Do some other misc cleanup while I'm here.

Bug: 18341932
Change-Id: I6125d629ae4d6ae131d2e53bfa41e1f50277d402
healthd: Reinitialize mChargerNames for every battery update

Booting up the device without the usb sets the usb power supply
type as UNKNOWN. Due to this mChargerNames gets incorrectly
initialized at bootup. The value of usb power supply type changes
at run-time. So it makes sense to update mChargerNames everytime
we have a battery related update.

Change-Id: I2ec9f9a420ca61814d43c316b418ce94de3691bc
audio: Add 24-bit offload format to audio_bytes_per_sample

Change-Id: I238f302beadf8ba7705ffcb70639fb32be4ff2c4
Healthd: charger: allow override of LED/BACKLIGHT paths

Change-Id: Ib7372e441d554e16ffc20ce43993ee78cdc5b187
set /system/etc/init.d/* permissions

ported from CM7

Change-Id: I279d78679f7d779d6cd6bbc6c834d94706937ae8
healthd: Detect power supply type for all charger devices

Power supply type is not determined via the device name,
hence iterate over all available devices in the subsystem
node and read the type from device file.

  shell@hammerhead:/ $ ls /sys/class/power_supply
  ac
  batt_therm
  battery
  touch
  usb
  wireless

<4>[ 3184.867782] healthd: touch: Unknown power supply type
<4>[ 3184.868039] healthd: batt_therm: Unknown power supply type
<6>[ 3184.880506] healthd: battery l=89 v=4181 t=25.5 h=2 st=2 c=-288 chg=u
<4>[ 3184.890362] healthd: touch: Unknown power supply type
<4>[ 3184.890549] healthd: batt_therm: Unknown power supply type
<6>[ 3184.899419] healthd: battery l=89 v=4181 t=25.5 h=2 st=2 c=-59 chg=u
<4>[ 3184.908756] healthd: touch: Unknown power supply type
<4>[ 3184.908984] healthd: batt_therm: Unknown power supply type
<6>[ 3184.919672] healthd: battery l=89 v=4181 t=25.6 h=2 st=2 c=-25 chg=u

Change-Id: I863bfab95193899460237b51997e0418eeb4ee2c
adb: host: Provide better sideload status

 * Show data transfer in MB and in multiple of the file size.

 * Show a spinner to indicate liveness, which is updated at least once
   per second regardless of data transfer.

 * Do not allow sideload of zero sized files.

Change-Id: I1bd0df6a8183fad5a502fc26a7e789c27d24f71a
adb: Fix host build

Change-Id: I173e920aa836bb0327bfae235022de011f3e2b99
set /system/etc/init.d/* permissions

ported from CM7

Change-Id: I3422c392248673fd7a8c8b45f34678097e553b5b
init: create symlinks to mtd block device nodes

Given a device in the form of "/devices/virtual/mtd/mtd0/mtdblock0":
* Creates symlinks for mtd block devices in
  /dev/block/mtd/mtd<partition number>
* Creates symlinks based on partition name in
  /dev/block/mtd/by-name/<partition name>

Change-Id: Id8d61be88935a0ef83297d1d5e453d8ba0d586de
fastboot: Add missing fastboot USB IDs

Change-Id: I1616e9e6a57652aa919f979833c0e19479343966
libcutils: Do not use the kernel headers

No idea why this is here, but it breaks arm64 builds. bionic's signal.h
must be used on those

Change-Id: Id4f07a9b13a32c563fda6e96e4a87b8b97d125fd
libsysutils: Do not use the kernel headers

No idea why this is here, but it breaks arm64 builds. bionic's signal.h
must be used on those

Change-Id: I64f71565b179af38345fcf1496274ee5858abb05
Forward-port mkbootimg / unpackbootimg support

 * Mostly from Koush and Seth Shelnutt

unpackbootimg (squashed)

unpackbootimg ported forward from eclair

Change-Id: I74d2df0b47d40e7105cc58c2b05f8f383dc7f8a0

port forward pagesize arg from eclair

Change-Id: Ia789a4f392a3890aa0efa7efb42032482b48beb0

unpackbootimg should output BOARD_PAGE_SIZE

Change-Id: Ieb5cda01943a33da97eee4d025f56c2c6e7560e8

output page size in mkbootimg

add an option to override the pagesize for boot images created by nubs. ie, acer liquid mkliquidbootimg.

Change-Id: Ie0c7e67edf5ae59019517e72b9be8c0b81388e41

Update unpackbootimg to verify the Android boot image magic value. It will also search the first 512 bytes for padding.

Change-Id: I490cba05f2bb616a3f64e3271ecaa61eb9e64be8

unpackbootimg: Fix up the padding search in case the magic does not fall on a 8 byte boundary.

Change-Id: I57471f9c2117cd7965b6958ea0aa88e356436da6

unpackbootimg: Fix magic search.

Change-Id: I68470b637556a08e48ff72b7ef8811cba13b04ad

unpackbootimg: apparently mkbootimg no longer accepts hex values

Change-Id: I95a33f7b40470e4500d418d863a65a75e7aa8499

unpackbootimg: Need to also update the written file.

Change-Id: I45faddbae85273c79b2837f97933634b6e70546f

ramdiskaddr is now ramdisk_offset

Change-Id: I3bf83af5f7001f581506dc7fd9b1eb653334ad35

unpackbootimg: remove host LOCAL_MODULE_TAG

Change-Id: I199d680dc5ab8bf50f5be65c29095bf3adade695

unpackbootimg: Add support for device trees

Change-Id: I340eed99d2274a2f4cbaf5a9f27726ff3a9302e5

unpackbootimg: Add support for detecting lz4 compressed ramdisks

This will check for lz4 magic, and if found change the extension of the
file. Else it'll fall back to the default behavior of assuming gzip. This has
been tested with stock LS980 boot images and LS970 boot images for lz4
and gzip respectively.

Change-Id: If2139ff172397b6db079ffb7ab9cb61897c38fb3

unpackbootimg: Add support for dumping ramdisk offset

Change-Id: Ic62b9fe61db4435ecbc52b66db5ffc9b9d79cbb4

unpackbootimg: Add support for second, second_offset and tags_offset.

Change-Id: Ia7ef7f00191dbf2c44736c4e4d980f72afa8c253
Merge branch 'cm-12.0' of https://github.com/CyanogenMod/android_system_core into HEAD