Update events.c

Array max is incorrectly calculated, can lead to missed events for ids > MAX_DEVICES
loki: Update to 2.0, Add support for LG G2 (and device trees in general)

Change-Id: I5bbd6bd7239680f20880ac6fdf7744e2e47b39ac
6.0.4.4

Change-Id: Ia6a077ea71d9f03e90e039ce28eebe26d28a221f
recovery: nandroid: implement preference for backup_format

ro.cwm.prefer.backup_format takes:
dup (dedupe)
tgz (tar + gzip)
(i.e. setprop ro.cwm.prefer.backup_format tgz)

-If nothing is specified or the above is not matched then tar is used.
-If the user specifies a default_backup_format then that is used.

Change-Id: I935d6cc732c5ef2b1d0d44f5459425e85702e710