ANDROID R 没有音量键,如何fastboot flashing unlock

diff --git a/bootable/bootloader/edk2/QcomModulePkg/Include/Library/MenuKeysDetection.h b/bootable/bootloader/edk2/QcomModulePkg/Include/Library/MenuKeysDetection.h
old mode 100644
new mode 100755
index 48cf21d..3c9a0f5
--- a/bootable/bootloader/edk2/QcomModulePkg/Include/Library/MenuKeysDetection.h
+++ b/bootable/bootloader/edk2/QcomModulePkg/Include/Library/MenuKeysDetection.h
@@ -33,6 +33,10 @@
 
 EFI_STATUS EFIAPI
 MenuKeysDetectionInit (IN void *mMsgInfo);
+
+EFI_STATUS EFIAPI
+MenuKeysDetectionInitExt (IN void *mMsgInfo);
+
 VOID ExitMenuKeysDetection (VOID);
 VOID WaitForExitKeysDetection (VOID);
 #endif /* __PLATFORM_MENU_KEYS_DETECTION_H */
diff --git a/bootable/bootloader/edk2/QcomModulePkg/Library/BootLib/MenuKeysDetection.c b/bootable/bootloader/edk2/QcomModulePkg/Library/BootLib/MenuKeysDetection.c
index ecc9d21..cb66b8b 100755
--- a/bootable/bootloader/edk2/QcomModulePkg/Library/BootLib/MenuKeysDetection.c
+++ b/bootable/bootloader/edk2/QcomModulePkg/Library/BootLib/MenuKeysDetection.c
@@ -447,5 +447,40 @@ MenuKeysDetectionInit (IN VOID *mMenuInfo)
     if (!EFI_ERROR (Status) && CallbackKeyDetection)
       StartKeyDetectTimer ();
   }
+
+  return Status;
+}
+
+EFI_STATUS EFIAPI
+MenuKeysDetectionInitExt (IN VOID *mMenuInfo)
+{
+  EFI_STATUS Status = EFI_SUCCESS;
+  OPTION_MENU_INFO *MenuInfo = mMenuInfo;
+
+  if (IsEnableDisplayMenuFlagSupported ()) {
+    StartTimer = GetTimerCountms ();
+
+    /* Close the timer and event firstly */
+    if (CallbackKeyDetection) {
+      gBS->SetTimer (CallbackKeyDetection, TimerCancel, 0);
+      gBS->CloseEvent (CallbackKeyDetection);
+    }
+
+    /* Create event for handle key status */
+    Status =
+        gBS->CreateEvent (EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
+                          MenuKeysHandler, MenuInfo, &CallbackKeyDetection);
+    DEBUG ((EFI_D_VERBOSE, "Create keys detection event: %r\n", Status));
+
+    if (MenuPagesAction[MenuInfo->Info.MenuType].Up_Action_Func != NULL)
+        MenuPagesAction[MenuInfo->Info.MenuType].Up_Action_Func (MenuInfo);
+
+    if (MenuPagesAction[MenuInfo->Info.MenuType].Enter_Action_Func != NULL)
+        MenuPagesAction[MenuInfo->Info.MenuType].Enter_Action_Func (MenuInfo);
+
+    if (!EFI_ERROR (Status) && CallbackKeyDetection)
+      StartKeyDetectTimer ();
+  }
+
   return Status;
 }
diff --git a/bootable/bootloader/edk2/QcomModulePkg/Library/BootLib/UnlockMenu.c b/bootable/bootloader/edk2/QcomModulePkg/Library/BootLib/UnlockMenu.c
old mode 100644
new mode 100755
index 45dbbf5..408141a
--- a/bootable/bootloader/edk2/QcomModulePkg/Library/BootLib/UnlockMenu.c
+++ b/bootable/bootloader/edk2/QcomModulePkg/Library/BootLib/UnlockMenu.c
@@ -320,7 +320,8 @@ DisplayUnlockMenu (INTN Type, BOOLEAN Value)
       return Status;
     }
 
-    MenuKeysDetectionInit (OptionMenuInfo);
+    MenuKeysDetectionInitExt (OptionMenuInfo);
+
     DEBUG ((EFI_D_VERBOSE, "Creating unlock keys detect event\n"));
   } else {
     DEBUG ((EFI_D_INFO, "Display menu is not enabled!\n"));
  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值