Add command line capabilities

Allows sending openrecoveryscript commands to TWRP via shell.
This may be handy for visually impaired users, for various one
click utilities to drive TWRP commands from a computer, for using
TWRP when a catastrophic hardware failure like a shattered screen
prevents you from being able to use touch, or even on devices like
a TV stick where touch and USB mouse input is unavailable.

This patch also includes a few minor changes to openrecoveryscript
including proper support for rebooting via the script and for
decrypting the device via the command line.

Change-Id: I796ad168efdd2da9c25334ac93d1079daaa7b0bc
TW_SCREEN_BLANK_ON_BOOT will jolt the screen/touch driver.

If on the default settings the screen will only kick in to action
AFTER it has gone to sleep once and has been woken up again with a
key press, this will be needed to set to 'true' in the
BoardConfig.mk

The code was already there, Dees_Troy and I thought it would be
nice to make it a switch to control at compile time.

Change-Id: I5116a27afe9cba57122761c192ea3ee153d98162
Support reading since_epoch and secondary brightness files

TWFunc::Fixup_Time_On_Boot: Will now try to read
/sys/class/rtc/rtc0/since_epoch to correct time, if that fails
it will try to use the ats files to correct time.

TWFunc::Set_Brightness: One single function to set brightness
from both the automated functions and the gui actions. It is
able to set a second brightness path if present, it will set
them both the same value. Many Sony devices have 2 brightness
files in the sysfs that must be set to properly set the
brightness.

Change-Id: I7ca582109085dfbcb46b8de73ad031e4b7903fca
Allow blacklisting input devices by build flag

Usage:
TW_INPUT_BLACKLIST := accelerometer
TW_INPUT_BLACKLIST := "accelerometer\x0agyroscope"

This can be used to fix touch input on devices where an input
device is breaking touch processing in TWRP.

We are using new line chars to separate multiple devices and in
the make file you specify the new line character with \x0a which
is the hex code in ASCII for a new line.

The new line character might be a bit of a pain to use as a
delimeter, but it is highly unlikely that an OEM will ever name
an input device with a new line character in the name.

Change-Id: I255136b7a686909a23e649918c661843153c2853
Fix derp

Change-Id: Idf41990258361e612635980700fd694b11c1c625
add mtp responder to TWRP.
Big thanks to Dees_Troy for helping with the implementation.

Change-Id: I6c9c522b9c9de5dc139e2ecb0141008182ba07f0
Refresh partition details after changing file system

Change-Id: I24f3c8587f778c4f0ef43737243c8378a3fd0e00
Build block TWRP with RECOVERY_VARIANT

Enable TWRP to reside alongside other recoveries with the naming
convention: bootable/recovery(-flag). If TWRP resides at
bootable/recovery and a device does not specify RECOVERY_VARIANT, then
it will build like normal. If TWRP resides at bootable/recovery-twrp,
then its makefiles will only be parsed if a device specifies
'RECOVERY_VARIANT := twrp'. This prevents TWRP specific makefile
warnings/errors (notably, missing DEVICE_RESOLUTION) when another
recovery is being built.

Change-Id: I8f02fffcd79c309c7123b9428eedc69af02e126e
Only use SELinux tools from toolbox if not in busybox

If busybox has SELinux support, we don't need toolbox to provide SELinux
specific tools. Check busybox for restorecon to see if SELinux support
is present and then adjust the tools built by toolbox based on this.

Change-Id: I30a2b036b97ac3e26510d5e0498c52d7a8af36e1
Ensure that MTP is enabled by default

Change-Id: Ibd644509935cde1e52b3d368060fdcb6e16f4a99
Improve error handling during MTP startup

Change-Id: I9395481dd8d9cbd3346fe6682557236b48b4d6cd
Allow toggle of MTP debug

Via command line in TWRP:
twrp set tw_mtp_debug 1

This will enable debugging for MTP. You will need to disable and
re-enable MTP in order to see the debug logging.

Change-Id: Ia7bb0c584e10a4322b65ecf80a67ed7ee836b38e
Improve MtpStorage handling when more than one storage is present

Change-Id: I02f1984d02a85d9fd42450cc3772e88a43d9e9ff
Allow MTP debug setting to stick through a reboot

Change-Id: I81eb5eaa2286c0ee3078e01304d65b9489f13bf2
Prevent MTP enable on startup if crash detected

Change-Id: Ie1388a8acadf714a29721dd90c7f9a8aa38a860d
Properly set mtp enable variable if disabled during boot

Change-Id: Iedf08419a1fd46908e5b9186a769a0497ce62ca8
MTP Fix property list for multiple storage devices

Change-Id: Ice23fef31439a6c88d0a12380688eccd8dc3a71c
MTP Fix rename in Windows

Change-Id: Ieef2fc16aac1da3d03908cfb285895954b42a14a
MTP: Better handling of stat

Do some error checking of lstat calls and better handle those
errors.
Use lstat instead of dirent to check if an item is a directory
because dirent does not return the correct item type when using
exfat-fuse.

Change-Id: I0d008aff55a0e0b4fbeae24cf8d0c04453b7b77e
Fix reporting of folder size on exfat-fuse

Change-Id: Icfd4af21b9eeade68956e44ae89bae12398920df