vold: Support for moving crypto metadata

 * We have a situation where we need to move the crypto metadata
   from a partition footer to a new place. Add support for this.

Change-Id: I5ccc312f7f062d8a8215530957da9c6283ed7ca5
GCC 4.8 Build Fix

Change-Id: I88a4cec56760df388cb12dd425fac021979fabb9
Fix Vold to properly handle full-disk file systems

(full-disk: no partitions)

In Android, Vold recognizes a USB drive having a full-disk file system
and mounts it properly, but when the drive is removed from system Vold
won't unmount the device. This is because Vold only unmounts partitions.
For a FAT32 USB drive (with partitions), kernel will create two devices:
sda (disk device) and sda1 (partition device). When the drive is removed,
Vold will receive two netlink events: one for partition remove (sda1)
and one for disk remove (sda). The unmount occurs only when partition
remove event is received.
For a full-disk FS USB drive, kernel will only create one device: sda
(disk device). When the drive is removed, Vold will only receive one
netlink event for disk remove (sda) and it won't unmount the device.

This patch will verify if there is a currently mounted device when disk
remove event is received and will perform unmount, to properly unmount
the device.

Change-Id: I4866ab2482fddfb40a8fc73083f31df846bbb24f
Signed-off-by: Robert Chiras <robert.chiras@intel.com>
Add more headroom for ext4 app package containers.

Code in the volume daemon that creates the filesystem image to contain
an installed application package currently adds about 1.6% to the
size estimate that is passed down to it to account for filesystem
overhead. That figure is based upon an assumption that the filesystem
is of type FAT, but is insufficient for some big application packages
when the filesystem is of type ext4.

This change checks the filesystem type, and in the case where it's
ext4, adds about 6% to the input estimate to account for journaling,
etc.

Change-Id: I261fa7ee2bc7e8ea37c3d0bfd3be00c9917a6f9f
Signed-off-by: Tom Keel <thomas.keel@intel.com>