Add support for custom kernel headers

Change-Id: I39fe4de8919e59dd75e8cb535fa0648948035c26
Fix adb sideload page on 1440x2560 layout

Change-Id: If79086b0128e57087fd87f07d56984eb2a15d8b2
Update SuperSU to 2.40

The SuperSU install process is getting rather complicated, so we
will modify the install script slightly and use it to install
all the things and stop trying to check to see if root permissions
have been lost like we used to do.

Change-Id: Ibdb64c909d2bd16e12bb35b4f31f572cc29add47
Toggle MTP during ADB sideload

Windows does not do very well if you try to sideload while MTP is
enabled due to drivers. This will toggle MTP off and back on if
MTP is currently enabled before and after a sideload operation.

Change-Id: I022dbedecc97565b50b6ae1fda8922b822f63440
Fix include paths in crypto

Change-Id: Ia9fd0cd75bd6ee6e14909890cb18a8edb3b22267
Recovery init.rc setenforce 0 to make SELinux permissive

This will only work if the sepolicy is changed by also applying:
https://gerrit.omnirom.org/10924
Otherwise the sepolicy will deny the request.

Change-Id: I8a52cdfdd38bda19aa89686ff0ad31b90e1aa3b7
MTP add/remove storage instead of disabling MTP

Implement a pipe between TWRP and MTP to allow TWRP to tell MTP
to remove storage partitions as they become unavailable (e.g.
during a wipe, unmount, etc) instead of disabling MTP completely.
This includes some fixes and improvements in destructors to
properly remove / delete various items. This also means that we
will not be toggling adb off and on quite as often.

I do not like that we had to add another thread, but we were
unable to use select() on the mtp_usb character device because
this device does not support polling. Select always returned
indicating that the mtp file descriptor was ready to be read and
the resulting read would block. The read block prevented us from
being able to include reading of the pipe between TWRP and MTP in
the main MTP thread.

We might want to add a return pipe letting TWRP know if the
removal of the storage device was successful, but I am not sure
how we want to implement this. It would invovle timeouts in both
TWRP and MTP to ensure that we returned a failure indicator in a
timely manner to TWRP and prevent deleting the storage device in
the case of a failure. Right now we make no attempt to ensure that
an MTP operation is underway like a large file transfer, but we
were not doing anything like this in the past. In some respects we
have limited control over what happens. If the user installs a
zip that unmounts a storage partition, we will not know about the
change in storage status anyway. Regular Android does not have
these troubles because partitions rarely get unmounted like in
recovery. At some point, we have to hold the user accountable for
performing actions that may remove a storage partition while they
are using MTP anyway.

Ideally we do not want to toggle the USB IDs and thus toggle adb
off and on during early boot, but I am not sure what the best way
to handle that at this time.

Change-Id: I9343e5396bf6023d3b994de1bf01ed91d129bc14
Allow non datamedia devices to wipe encryption

With 5.0 L, we decrypt automatically if the default_password is
used. Non datamedia devices do not get the format data button so
they cannot wipe encryption off the device. This patch add a wipe
encryption button where the format data button would normally be
located on the Wipe page.

This patch also attempts to remove / delete the dm-crypt block
device before formatting.

Change-Id: I100d5d154d6c49254fd48e23279df973db5f23ae
fixPermissions: simplify code, fix bugs

- avoid parsing permission strings
- fix memory leaks, a fix new/free mismatch and a compiler warning
- fix that only first updated-package was processed
- fix a potential stack overflow if packages.xml is huge
- minor refactoring for reducing duplicated code
- don't process packages without codePath
- fix path for deleting app data (currently unused anyway)
- fix file ownership on libs
- try not to mess up Android 5.0 app permissions

Patch set 4

- make fixing SELinux contexts an option with a check box
- add some notes / text to the themes

Patch set 6

- decouple "fix permissions" from "fix contexts"

Change-Id: Icc77ecc581befc5ce6e419b1f3b8ca189208c234
Fix else if and maxFileSize initializer.

Change-Id: Iac7852a4fb2add5744d5ea424d6ad5a82828f102
Fix twrpTar building

- ifdef around set_metadata
- Set tags as optional

Change-Id: I438e370c3bf6b590dc80ba372724c47cead6cbe5
2.8.3.0

Change-Id: If2084a8c8815b079db6b6a6b45ea180ba1282092
Merge remote-tracking branch 'twrp/android-5.0' into white