高通P为例
diff --git a/bootable/bootloader/lk/platform/msm_shared/display_menu.c b/bootable/bootloader/lk/platform/msm_shared/display_menu.c
index 5f4582f..a3f25e9 100644
--- a/bootable/bootloader/lk/platform/msm_shared/display_menu.c
+++ b/bootable/bootloader/lk/platform/msm_shared/display_menu.c
@@ -553,7 +553,8 @@ void display_unlock_menu(int type, bool status)
dprintf(INFO, "creating %s keys detect thread\n",
status ? "unlock":"lock");
- display_menu_thread_start(unlock_menu_msg_info);
+ /* display_menu_thread_start(unlock_menu_msg_info); */
+ unlock_device_keys_detect((void*)unlock_menu_msg_info);
}
void display_fastboot_menu()
diff --git a/bootable/bootloader/lk/platform/msm_shared/include/menu_keys_detect.h b/bootable/bootloader/lk/platform/msm_shared/include/menu_keys_detect.h
index 4f904c4..7b6e8d9 100644
--- a/bootable/bootloader/lk/platform/msm_shared/include/menu_keys_detect.h
+++ b/bootable/bootloader/lk/platform/msm_shared/include/menu_keys_detect.h
@@ -47,5 +47,6 @@ enum keys_option {
};
int select_msg_keys_detect(void *param);
+int unlock_device_keys_detect(void *param);
void keys_detect_init();
#endif /* __PLATFORM_MSM_SHARED_KEYS_DETECT_H */
diff --git a/bootable/bootloader/lk/platform/msm_shared/menu_keys_detect.c b/bootable/bootloader/lk/platform/msm_shared/menu_keys_detect.c
index 6b552e8..1e0f059 100644
--- a/bootable/bootloader/lk/platform/msm_shared/menu_keys_detect.c
+++ b/bootable/bootloader/lk/platform/msm_shared/menu_keys_detect.c
@@ -404,3 +404,27 @@ int select_msg_keys_detect(void *param) {
return 0;
}
+
+int unlock_device_keys_detect(void *param) {
+ struct select_msg_info *msg_info = (struct select_msg_info*)param;
+ dprintf(INFO, "unlock_device_keys_detect \n");
+
+ msg_lock_init();
+ /* VOLUME_UP */
+ mutex_acquire(&msg_info->msg_lock);
+ menu_pages_action[msg_info->info.msg_type].up_action_func(msg_info);
+ mutex_release(&msg_info->msg_lock);
+
+ dprintf(INFO, "unlock_device_keys_detect up_action_func\n");
+ thread_sleep(KEY_DETECT_FREQUENCY);
+
+ /* POWER_KEY */
+ mutex_acquire(&msg_info->msg_lock);
+ menu_pages_action[msg_info->info.msg_type].enter_action_func(msg_info);
+ mutex_release(&msg_info->msg_lock);
+
+ /* Never time out if the timeout_time is 0 */
+ thread_sleep(KEY_DETECT_FREQUENCY);
+
+ return 0;
+}