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
Merge branch 'cm-12.0' of https://github.com/CyanogenMod/android_system_core into lp5.0