Try to handle Android Rescue Party triggers.

The Rescue Party trigger manifests itself when a user is trying to boot
a ROM but keeps getting dumped back to recovery.

Normally, TWRP doesn't capture this, and the user is often wondering
what is happening. This patch captures the trigger and presents a clear
message to the user about what is going on (with options of how to
resolve the situation).

Change-Id: Ia4414ce6270a7ee9e54d14381990ca4766e757bd
diff --git a/startupArgs.cpp b/startupArgs.cpp
index 5d19dc2..4fe6ec0 100755
--- a/startupArgs.cpp
+++ b/startupArgs.cpp
@@ -24,6 +24,16 @@
 
 	LOGINFO("Startup Commands: ");
 	for (index = 1; index < args.size(); index++) {
+		if (args[index].find(RESCUE_PARTY) != std::string::npos) {
+		      gui_print("\n\n");
+		      gui_msg(Msg(msg::kError, "rescue_party0=Android Rescue Party trigger! Possible solutions? Either:"));
+		      gui_msg(Msg(msg::kError, "rescue_party1= 1. Wipe caches, and/or"));
+		      gui_msg(Msg(msg::kError, "rescue_party2= 2. Format data, and/or"));
+		      gui_msg(Msg(msg::kError, "rescue_party3= 3. Clean-flash your ROM."));
+		      gui_print(" \n");
+		      gui_msg(Msg(msg::kError, "rescue_party4=The reported problem is:"));
+		      gui_print_color("error", " '%s'\n\n", args[index+1].c_str());
+		} else
 		printf("'%s'", args[index].c_str());
 		if (args[index] == FASTBOOT) {
 			fastboot_mode = true;