Revert "healthd: charger: Modify charger unplug shutdown time to 1s"

This fixes hammerhead off mode charging and shouldn't bother
other devices.

This reverts commit 2e8628e9685c62b2cf881ba9f5aef406713f0175.

Change-Id: Ibe6477884d22e37981a3c5549a3a72aae1963152
core: Fix compile error with QCOM_LEGACY_UIDS

Change-Id: I01c7f73ba0e87533ae06b8af183b4c88dbbf944e
Core: fix compile issue of healthd.`

fixes this in darwin cp: symlink: /sbin/healthd: File exists

Change-Id: Ia0a51962ec6d1713ece1e9c1d4f9df479fee5f5b
adb: Look for bu in /sbin when in recovery mode

 * Restore global variable recovery_mode.  This is set based on the
   commandline parameter --banner.

 * Use recovery_mode to select path to 'bu' binary for both backup and
   restore services.

Change-Id: Ie4c945d00601514d7f16357bae10ff7f232633e1
 healthd: increase healthd fast timer to 10mins instead of 1min

healthd 1 min wakeups are causing significant power impact
during static display use case. so increasing the timer to 10min.

Change-Id: If7a514e4152789144242e198175918b6687c3bcf
adb: Fix compilation warning

Change-Id: Iab0cb977f81824338a37ecba233b45883c0bc13b
adb: Allow configuring the adb shell with a persistent property.

To set to bash: setprop persist.sys.adb.shell /system/xbin/bash

Change-Id: I24e65f4592aaf23356c13db02c9869076df3b841
Set gateway properties for being accessible in DataCallResponse

Some devices need gateway properties to be set inorder to setup route correctly

Change-Id: I45dce29de916f07eb79fad77dec914787c78e7ce
Use RECOVERY_PRE_COMMAND before calling __reboot() recovery

For the Power menu,
frameworks/base/core/jni/android_os_Power.cpp#L180
already uses RECOVERY_PRE_COMMAND if
TARGET_RECOVERY_PRE_COMMAND is defined in the
BoardConfig.mk for a device to make a system() call before
calling __reboot() for recovery. This commit adds
the same thing to the other places that we know we are
getting into recovery using __reboot(), namely,
adb reboot recovery, the reboot binary and init
in the case of errors.

Signed-off-by: Humberto Borba <humberos@gmail.com>

Conflicts:
	libcutils/Android.mk
	libcutils/android_reboot.c

Change-Id: Id0fb6675accd732f46d4b10e0fce459d2582875c
libcutils : reboot mount fix

On aries for eg, cache needs to be rw for the RECOVERY_PRE_COMMAND to
work because we write to /cache/.startrecovery

This patchset moves the RECOVERY_PRE_COMMAND prior to the remount.

Conflicts:
	libcutils/android_reboot.c

Change-Id: I4bd97517e00cdd117191d29b610e9623ad7d9255
RECOVERY_PRE_COMMAND_CLEAR_REASON and extended reboot arguments

fix the 2 new warnings created by our 4-lines recovery patch ;p

Allow also to override toolbox reboot applet, for bootmenu

Conflicts:
	libcutils/Android.mk
	libcutils/android_reboot.c
	toolbox/Android.mk

Change-Id: I2bff30b5f911e7b9ba8f26593523368223b12814
libutils: Properly #ifdef NEEDS_VECTORIMPL_SYMBOLS

 * Compile error might occur otherwise

Change-Id: I982e5f72ea4e84594e415394cceed44f90045526
Remove the adb usb vendor id whitelist.

If there are bad vendors, we should blacklist them. Whitelisting the entire
world is crazy.

Change-Id: I1f4c27fd34fc420e2a3b4b2c8749198030db69f1

Disable vendor id filtering for Linux.

It's time we switched to blacklisting any problematic devices rather than
slowly whitelisting the entire world. This seems to work for me, but let's
see how other people get on before coming back to actually remove the list.

We'll also need to find a Mac to test the equivalent Mac change.

Change-Id: I2bf583a27f9a3f98ef006ea62b906a4f89960507

Disable vendor id filtering for OS X.

Companion patch for change I2bf583a27f9a3f98ef006ea62b906a4f89960507.

Due to the use of USB class 0xff it's not possible to register a listener
which uses the OS methods for filtering notifications, so this patch
also introduces a check in the notification listener which checks the
class, subclass, and protocol for the interface each notification relates
to.

Change-Id: I380cc80f96addc5057660efb2179b35f9378886a
Add SIGHUP Handler to rotate log files

Sending SIGHUP to auditd will now cuase a log
file rotation to occur.

Signed-off-by: William Roberts <wroberts@tresys.com>
Add audit watch rule support and bugfixes

Add libaudit support for adding directory watch rules.
Add rule parsing support to auditd.
Rule format matches auditctl. Currently only supports -w and -e.
Fields supported are uid, euid, suid, fsuid, loginuid, gid, egid, sgid, fsgid and success.
Fields allow further limiting of matches, for example:
 -w /system -pwa -F uid!=system -F success=1
will match a write on /system that was successful and done by a uid other than system

Retry on EAGAIN from recvfrom on the audit netlink socket.
Always enable audit syscall functionality on start of auditd.

Signed-off-by: Joshua Brindle <brindle@quarksecurity.com>

Change-Id: I74a94dbffde835a27539559427f22b73a4c7ea24

Conflicts:
	auditd/README

Conflicts:
	auditd/README
Add sample audit.rules file.

To use:
adb push audit.rules /data/misc/audit
adb reboot
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