app: aboot: shutdown device if verity is in eio and no user action
device should be shutdown if device is started in eio mode and there
is no input from user.
Change-Id: I431348566a62c019ec200a333cf7c7800d14966b
diff --git a/platform/msm_shared/display_menu.c b/platform/msm_shared/display_menu.c
index 1d1be46..8ee11ff 100644
--- a/platform/msm_shared/display_menu.c
+++ b/platform/msm_shared/display_menu.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
+/* Copyright (c) 2015-2017, 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
@@ -70,6 +70,9 @@
#define EIO_WARNING_MSG "Your device is corrupt. It can't be\n trusted and may not work properly.\n\n"\
"Visit this link on another device:\n g.co/ABH"
+#define DELAY_5SEC 5000
+#define DELAY_30SEC 30000
+
static bool is_thread_start = false;
static struct select_msg_info msg_info;
@@ -252,9 +255,12 @@
char str1[]= "Start >";
char str2[] = "Continue boot";
+ char *str3 = NULL;
+
char *str_target = NULL;
uint32 fp_size = 0;
unsigned int i = 0;
+ uint32_t timeout = DELAY_5SEC;
fbcon_clear();
memset(&msg_info->info, 0, sizeof(struct menu_info));
@@ -300,13 +306,22 @@
display_fbcon_menu_message(fp_str, FBCON_COMMON_MSG, common_factor);
}
- display_fbcon_menu_message("\n\nIf no key pressed:\n"\
- "Your device will boot in 5 seconds\n\n", FBCON_COMMON_MSG, common_factor);
+ str3 = "\n\nIf no key pressed:\n"\
+ "Your device will boot in 5 seconds\n\n";
+#if ENABLE_VB_ATTEST
+ if(type == DISPLAY_MENU_EIO)
+ {
+ str3 ="\n\nIf power key is not pressed:\n"\
+ "Your device will poweroff in 30 seconds\n\n";
+ timeout = DELAY_30SEC;
+ }
+#endif
+ display_fbcon_menu_message(str3, FBCON_COMMON_MSG, common_factor);
msg_info->info.msg_type = type;
/* Initialize the time out time */
- msg_info->info.timeout_time = 5000; //5s
+ msg_info->info.timeout_time = timeout; //5s
}
#endif
diff --git a/platform/msm_shared/menu_keys_detect.c b/platform/msm_shared/menu_keys_detect.c
index efea07e..8ffbacb 100644
--- a/platform/msm_shared/menu_keys_detect.c
+++ b/platform/msm_shared/menu_keys_detect.c
@@ -50,6 +50,7 @@
static time_t before_time;
+extern bool pwr_key_is_pressed;
extern int target_volume_up();
extern uint32_t target_volume_down();
extern void reboot_device(unsigned reboot_reason);
@@ -251,7 +252,10 @@
case DISPLAY_MENU_ORANGE:
case DISPLAY_MENU_RED:
case DISPLAY_MENU_LOGGING:
+ reason = CONTINUE;
+ break;
case DISPLAY_MENU_EIO:
+ pwr_key_is_pressed = true;
reason = CONTINUE;
break;
case DISPLAY_MENU_MORE_OPTION: