Fix Ext4 filesystem support.

This patch fixes the way the emulator handles Ext4 partition images.

Before the patch:

  - The hardware property 'hw.useext4' was used to determine whether
    the partition images use yaffs2 (for 'no') or ext4 (for 'yes').
    The default value was based on the API level, since ext4 is
    used since Android 4.4 (API level 19), but it was easy to get
    confused, resulting in the inability to properly boot the
    AVD. The symptom was not trivial, i.e.:

      - Mounting /system with the disk image failed, so the
        system kept using the ramdisk mount.

      - Later, logcat contained plenty of complaints that some
        stuff couldn't be found under /system/bin/

After the patch:

  - The partition format is simply auto-detected by probing the
    start of the disk image. The hardware property has not been
    removed because doing this breaks snapshots, but it is now
    tagged as deprecated.

+ Move the ext4 probing code from android/avd/util.* to
  android/filesystems/ext4_utils.* and add proper unit tests.

Change-Id: Iab24191e491d4cb8589dd13408618a0d13efeb76
14 files changed