Fix render issue when button has conditional

If the button has a conditional, the image render function will
return a 0 which indicated that an image was present even if it
was not if the condition was not being met during boot. When the
condition is met, mButtonImg was not set to NULL causing a render
request failure.

Change-Id: I32be0ddcdc1bf7ad22440d66018ef09484280afa
add fix /data/data contexts to fixPermissions
only compile symbols if selinux is defined
Change-Id: I7c8596360cdf2f715c8e1379fc55ea27d9370393
Add support for persistent variables in theme's <variables> section

* Add support for variables with persist="1", which will cause
  them saved into settings file and reloaded on next boot.
* This is handy for theme makers, who can use this to
  implement "theme settings".

Signed-off-by: Vojtech Bocek <vbocek@gmail.com>

Change-Id: I6415979011b38cbb15dec9909c445b02da6eadc0
Support custom graphics.c.

TWRP does not use this, but is needed for other things that depend
on it like charger.

Change-Id: Ic7d10e8230151bcc4be6cfa222a1e07231e7139f
add support for fsflags= option in twrp.fstab file

example userdata line (as needed by MotoX):
/data         f2fs      /dev/block/platform/msm_sdcc.1/by-name/userdata       flags=fsflags="inline_xattr"

Code for parsing flags/options originally based on AOSP fs_mgr sources.

Change-Id: I5fb2b5d5cdd08137e6bf71f0085a3f8aebd889a8
crypto: Fix crypto dependencies for ICS/Samsung methods

- libmincrypt renamed to libmincrypttwrp that is an static library
- libjpegtwrp does not exist
- libfs_mgrtwrp is for JB decryption methods

This fixes making full builds when TW_INCLUDE_CRYPTO_SAMSUNG := true and TW_INCLUDE_CRYPTO := true are set.
Somehow typing make recoveryimage doesnt push the mentioned issue.

Change-Id: I7cad5db4f51152a1a8209e619b188ca88d7c74d1
Merge "add fix /data/data contexts to fixPermissions only compile symbols if selinux is defined Change-Id: I7c8596360cdf2f715c8e1379fc55ea27d9370393" into android-4.4
Merge "Add support for persistent variables in theme's <variables> section" into android-4.4
Create a TWRP Disk Usage Class to retain state about a directory and whether we should skip it in other classes like twrpTar.
Moved Get_Folder_Size to this new class.

Change-Id: If0a0220f900eb109581f2eeaf7b76e3f7d6886f1
Improve SELinux support check

If the kernel does not use SELinux security then the ramdisk
contents will not have contexts set on the files, however we may
still have everything we need in recovery if the kernel supports
EXT4 security labels, so we try to check /cache/recovery if it
exists first.

Change-Id: I96a4ae16418e07b0a2e83cd56e19893898d0b394
declare dir for non data/media devices

Change-Id: I60e2e2a880c3bd5fff3f485f7c8e4ac9ab6fd3bd
add errno.h to fix compile errors on other devices

Change-Id: I84196fb1358264b216b8505b990ae5a0406aa957
Don't interpret ABS_MT_TOUCH_MAJOR == 0 as touch release

On n8013 at least, this event is sometimes/often sent on touch start which
causes touches to be randomly rejected and throws you back to the start screen.

Touch releases still work fine for me, since it sends ABS_MT_TRACKING_ID == -1
for that purpose.

Adds a flag TW_IGNORE_MAJOR_AXIS_0 to configure this behavior.

Change-Id: I14bb036a2c2d4ee676b642c3ab297c55bb6c2084
Fix white point on top-bar images in some themes

Change-Id: Ic6a0b4b3e41818ff510ca652d5f14bdecd531826
Initial 240x240 theme

Change-Id: I478f172e1a549b50ebe29cf9a8b8618a84b3cb17
Set listener properties for UMS mount/unmount

Some kernels require the usb functions be defined before UMS mounting
of storage partitions will work. This sets the sys.storage.ums_enabled
property upon mount/unmount which can be listened for in init.rc.

Example routines to include in init.rc:

on property:sys.storage.ums_enabled=1
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/functions adb,mass_storage
    write /sys/class/android_usb/android0/enable 1

on property:sys.storage.ums_enabled=0
    write /sys/class/android_usb/android0/enable 0
    write /sys/class/android_usb/android0/functions adb
    write /sys/class/android_usb/android0/enable ${service.adb.root}

Change-Id: I8a8ad4b392abbaa173d402714bcb4049ba84ccca
Force GUI render after setting brightness

Change-Id: I4470a3a090d10f400575d45338a8349fbee8a027
Enable UMS mounting of storage drives

Change-Id: I4c369222cf16cb5bd87f007c3b172cd787d20fb1
Fix handling of storage after decryption

Change-Id: I0c2614f841a225699be9d4a52c60e9456241659b
Merge changes I4c369222,I8a8ad4b3 into android-4.4

* changes:
  Enable UMS mounting of storage drives
  Set listener properties for UMS mount/unmount