advanced reboot: add soft reboot option

Adds a "Soft reboot" option which restarts zygote.

Also includes "ShutdownThread: set soft reboot trigger accordingly"
commit by Dan Pasanen <dan.pasanen@gmail.com>

Signed-off-by: Roman Birg <roman@cyngn.com>
Change-Id: Ia6e5ed9b053e1c5ebd1fc55e5692858b97f7e0fc
Revert "(1/2) Add support for using the flip switch (Samsung cover) to turn off the screen"

This reverts commit f9d6f17446fa56e176a1eb068ae3dca6af726eaf.

Change-Id: I82a5d5c82d004c2303a610be10a896c0d64de9d2
Merge "advanced reboot: add soft reboot option" into kitkat3
Themes: Fix setting wallpaper from a legacy theme

Change-Id: I3bfc9ee24d2a3ee5c1bdb97f2c07427e6d723206
Themes: Track NotFoundException on app launch failure

We should probably keep an eye on NotFoundExceptions too since they
are a common exception thrown when a bad theme is applied.

Change-Id: I2ccaed0349a90ab99b99fb83cef0c9183d598088
Themes: Remove listener if exception is thrown

If something goes wrong and a client does not remove itself, the
theme manager may still have a reference to the listener and an
exception is thrown while trying to call one of the listener's methods.
When this happens, we should not only log it but remove the bad listener.

Change-Id: I052cdcc10b0eaa75ebf076b3ece5f8a668d3868e
Themes: Fix native crash in libandroidfw

If a missing attribute needs to be added in somewhere in the middle
of the bag, a segfault would occur because we change curEntry to a
value that is beyond the set's allocated space.  This patch stores
curEntry in prevEntry before changing it's value and memmove uses
prevEntry to index the set.

Change-Id: Ie70f2ad465097c3acf76caa729999c424fb01ee2
Merge remote-tracking branch 'liquid/kitkat3' into kitkat3

Conflicts:
	services/java/com/android/server/power/ShutdownThread.java