Add support for external dock batteries

Allows the external battery status to be read via framework.

Change-Id: I1340071cecab8f1733e58e4f3ba0d304f861f311

Conflicts:
	core/res/res/values/symbols.xml

Signed-off-by: iceandfire <arhamjamal@gmail.com>
Allow media group to write to External Storage

Change-Id: I7b75d234ef355565061a2f71961b23ebe071e4f6
Fix for ambiguous and broken disk formatting dialog

This patch ensures that the path-string from StorageNotification is converted
to the appropriate StorageVolume so that it can be correctly passed to the
formatting class. It also displays this path to the user so that it is clear
what will be deleted.

While trying to use a USB flash drive over OTG, the drive's FS somehow got
corrupted, so Android gave me a notification to re-format it. Okay, so then
a dialog pops up that doesn't specify what volume/device it will format, and
I incorrectly assumed it would be the USb drive. However this activity defaults
to the main internal memory for some reason, and wiped my data. Thank God for
them internets... (Dropbox)

Change-Id: I5621dff3cfd12a173b0d793398cf729333f97263
Monitor device storage directly in /data/data

The DeviceStorageMonitorService watches over /data, and when things get
full, starts deleting app cached files.  The app caches are actually
under /data/data, which on DINC is its own mount.  This means the
monitor did not notice when app cache grew too big, as it only saw the
size of /data proper.

This patch makes the monitor look at /data/data instead.  For DINC, this
means it can properly manage app cache, but it won't notice if the upper
/data partition is getting full.  That's not as common as /data/data
filling up though.  For the Samsung devices that mount a /datadata and
then symlink to /data/data, it should also work, as statfs dereferences
links first.  For all other devices with only /data, reading statfs on
/data/data still yields the total/free sizes of the /data partition.

Change-Id: I118a85a04c3a257d54d40ce7802426b4e0fe3e87
installd: Delete cache properly for devices using datadata partition

The java side already checks /data/data for free space but installd
still checks /data causing it to never reap the cache (because it
thinks that enough free space is available.)

Change-Id: I736af6ff7ea0c8ae07900168f6b8ac2f7a4dbe0b
android.policy: Fix launching home when waking the device with the home button

Change-Id: I71845bf88943f5ef141ea5c533f997e09ab5b7f4
PackageManager: fix app lib migration for device with /datadata

For devices using /datadata, dataPathString will point
to /datadata while nativeLibraryDir will point to /data/data.
Thus, compare to /data/data directly to avoid problems.

Change-Id: I11149cf9cc5a573cc85513e12d3569b514f5ffb5
Allow USB notification to show when primary SD allows UMS and MTP

Previously if primary SD is set to allowMassStorage="true" the USB
dialog would never show.  This checks if persist.sys.usb.config is
set to mtp,adb and then allows the USB notification to show. With
this you can then have the option to select from MTP, PTP and Mass
storage when clicking the pull down notification. When Mass Storage
is selected it activates the USB connected dialog to turn on USB
storage. When set back to MTP the USB connected notification disappears.

Change-Id: I2287075ec93cae75f19e8fb59965d9dddb234aca