TWRP MTP: make sure inotify_fd is set

Originally the inotify_init() call was part of a separate thread
which would occasionally allow the readDirs function to run and
start trying to add watches before inotify_fd was init'ed properly
and result in the add watch failing. This patch set relocates the
inotify_init call to happen outside and before starting the
separate thread to ensure that inotify_fd is set properly.

Change-Id: I8748c23473b60b57887df9d692834f3d2b249802
 Make the android-5.0 branch compile in 4.4 to 4.1

Migrate previous minzip to minzipold replacing the existing
minzipold. This will break compatibility with trees that do not
support selinux (ICS and older). Migrate former verifier files to
verifierold.

Add fuse.h to recovery source because older trees do not have it.

Add LOCAL_MODULE_TAGS where needed for 4.1 tree.

Change-Id: Iade57cb2b0115af7fce9f56aa98636b1744a1ef4
bootable recovery: we upgraded to 5.0.1

Change-Id: I9e2f359dd7274e1ae885f6a3b392d5ab5ca99ac9
Reduce libs needed for decrypt and clean up old decypt files

Trim cryptfs.c to remove functions that TWRP does not use for
decrypt and remove the need for libfs_mgr from cryptfs.c by
passing some items to cryptfs.c from the partition manager.

Add support for new fstab flags:
encryptable and forceencrypt=/path/to/cryptokey
For example:
flags=forceencrypt=/dev/block/platform/sdhci-tegra.3/by-name/MD1
Note that "footer" is the default, so you do not need to set this
flag on devices that use the footer for the crypto key.
Also add mounttodecrypt if you need to mount a partition during
the decrypt cycle for firmware of proprietary libs.

Clean up decrypt and only support one version

Android 5.0 lollipop decrypt should be backwards compatible with
older versions so we will only support one version, 1.3 that came
with 5.0 lollipop.

Remove support for Samsung TouchWiz decrypt. It does not work with
the latest versions of Samsung encryption anyway and it has not
been updated to work with any AOSP decryption higher than 1.1

Change-Id: I2d9c6e31df50268c91ee642c2fa090f901d9d5c9
add function to partition.cpp to return max file size to mtp responder
Change-Id: If8114b5eac741db6c512fb35cb48e3825c2ff098
Use linker64 on AArch64

Patch Set 3: Combine into one sed - by bigbiff

Change-Id: Ice3147fae76575f6e09c7df201bcd3f949aa24ea
Remove new images from AOSP

TWRP does not use these images.

Change-Id: I48be648232826aabc14f9674862de7b0b981b988
Fix png graphics load / display on AArch64

This is mostly kang from AOSP resources.c for loading png files
into RAM, but for ease of compatibility we retained the older
gr_surface data types throughout and ensured that we retain
support for alpha blended png files.

Change-Id: Ieea552173d3bfe885460407be73088bbad75663f
Fix slidervalue not showing up in some cases

The button vibration slider was not showing up on portrat layouts.
This commit fixes that issue and maybe some other issues.

Change-Id: Ia0c0ed319358db3b99887b3b37aa7737c7caf0cc
Update minui to work properly

minui is not used by TWRP but it is included in AOSP recovery
source and healthd (formerly charger) uses minui for displaying
the battery charging animation during off-mode charging.

This patch fixes / updates minui to use updated code to load png
files into memory.

Change-Id: I706d10d66de95886396d866e80615b1fb905d201
Include libext2_quota.so if present for e2fsprogs utilities

Needed starting in 5.0 lollipop for e2fsck, mke2fs, and tune2fs
binaries.

Change-Id: Ie76517df4690f6407cb63d0607c6c0c8a77975e5
add support unicode font not only ascii

  need to define custom theme(include custom ttf files)
  in device tree :

  TW_CUSTOM_THEME := device/xxxx/yyyy/recovery/res

  For example:
  https://github.com/twrp/android_device_xiaomi_armani

Change-Id: I6bebdfbdd75c99bfe216a8c0789af63c6fe4b9de
Fix mkexfatfs exclusion when TW_NO_EXFAT enabled

Push to android-5.0

Conflicts:
	Android.mk

Change-Id: I0b831a4e6e52e4b314751035b750e6a398cb4d2d
crypto: fix build in < 5.0 tree

Change-Id: Ie4ed3e91cfb7e509bac1d6db885bd3f415d2b168
Use one mizip for all

The new minzip did not compile in older trees due to needing
mmap64. For older trees we will just use mmap instead. Remove all
files and code pertaining to minzipold. Updater should now build
properly in older trees as well.

Eliminate use of PLATFORM_VERSION in favor of PLATFORM_SDK_VERSION
which should be more consistent and reliable.

Change-Id: I38d2b604a73d1b17a2072c7d60e990b81ece0c10
Fix occasional MTP kernel panic

Add a short sleep between setting up the sysfs entries for MTP and
actually sending MTP data to the MTP device. In some cases a
kernel panic was happening because we were sending data too soon.

Change-Id: Ie5e05690846fc84f161c91829de448bc049f87e2
make header layout more readable for 1440x2560

Change-Id: I109c7ae5963b5b4d9d1a8190e364a7685c41dbdd
This fixes kernel panic on find7 when disabling MTP before flashing zips.

Change-Id: Id11a0fb1a88424d9dd70190c313781607bad3bb8
EPOLLWAKEUP handling in minui/events.c

Older trees may not have EPOLLWAKEUP defined so we will work
around the lack of EPOLLWAKEUP support as best we can. This should
only maybe affect how charger handles waking up the screen in off
mode charging in older trees. No impact on TWRP itself.

Change-Id: Ia72ebfc12778b2bcda648edc27d2092c2ead415c
Fix generating symlinks for older trees

Symlinks for unpigz, toolbox, and busybox were not generating in
older trees.

Change-Id: I3ca2a2047510954e66fb3cf49eef6af713d3268e