platform: msm_shared: Optimize the functions for display menu and key's detection

Rename these functions from XXXX_thread to XXXX and from XXXX_menu to
XXXX_menu_renew. It's not well-defined for these functions. So correct their name.

Add option index to record the current keys position and initialize the option
index for key's detection.

Add mutex lock when the menu is updated or switched to avoid the variables is
mismatched for the current menu.

Optimize the keys' detection function, using a array to map power key's action
and integrate the power key's functions to a single function.

Exit the key's detection thread when there is no any action on verified boot
warning page.

Change-Id: Ia1bf7025f86a9399b546f500fa98f41f02af1eb7
diff --git a/app/aboot/aboot.c b/app/aboot/aboot.c
index 2b7cc10..e118136 100644
--- a/app/aboot/aboot.c
+++ b/app/aboot/aboot.c
@@ -2,7 +2,7 @@
  * Copyright (c) 2009, Google Inc.
  * All rights reserved.
  *
- * Copyright (c) 2009-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2009-2016, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are met:
@@ -891,7 +891,7 @@
 	{
 		case RED:
 #if FBCON_DISPLAY_MSG
-			display_bootverify_menu_thread(DISPLAY_MENU_RED);
+			display_bootverify_menu(DISPLAY_MENU_RED);
 			wait_for_users_action();
 #else
 			dprintf(CRITICAL,
@@ -902,7 +902,7 @@
 			break;
 		case YELLOW:
 #if FBCON_DISPLAY_MSG
-			display_bootverify_menu_thread(DISPLAY_MENU_YELLOW);
+			display_bootverify_menu(DISPLAY_MENU_YELLOW);
 			wait_for_users_action();
 #else
 			dprintf(CRITICAL,
@@ -1181,7 +1181,7 @@
 	if(boot_verify_get_state() == ORANGE)
 	{
 #if FBCON_DISPLAY_MSG
-		display_bootverify_menu_thread(DISPLAY_MENU_ORANGE);
+		display_bootverify_menu(DISPLAY_MENU_ORANGE);
 		wait_for_users_action();
 #else
 		dprintf(CRITICAL,
@@ -2006,7 +2006,7 @@
 		}
 
 #if FBCON_DISPLAY_MSG
-		display_unlock_menu_thread(type);
+		display_unlock_menu(type);
 		fastboot_okay("");
 		return;
 #else
@@ -3729,7 +3729,7 @@
 	/* initialize and start fastboot */
 	fastboot_init(target_get_scratch_address(), target_get_max_flash_size());
 #if FBCON_DISPLAY_MSG
-	display_fastboot_menu_thread();
+	display_fastboot_menu();
 #endif
 }