MdeModulePkg/UiApp: Show test key warning info in FrontPage.
authorJiewen Yao <jiewen.yao@intel.com>
Sun, 9 Oct 2016 04:47:18 +0000 (12:47 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Tue, 8 Nov 2016 14:37:08 +0000 (22:37 +0800)
The UiApp is updated to consume PcdTestKeyUsed to know if there is any
test key used in current BIOS, such as recovery key,
or capsule update key.
Then UiApp show warning information in front page.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
MdeModulePkg/Application/UiApp/FrontPageCustomizedUi.c
MdeModulePkg/Application/UiApp/FrontPageStrings.uni
MdeModulePkg/Application/UiApp/UiApp.inf

index 6e4f7b5c22b41bce95590bc8234ce6a97094aee5..a9d22696602d12abbd44485a768474a7e9644941 100644 (file)
@@ -16,8 +16,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Protocol/HiiConfigAccess.h>\r
 #include <Library/BaseLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
+#include "FrontPage.h"\r
 #include "FrontPageCustomizedUiSupport.h"\r
 \r
+extern FRONT_PAGE_CALLBACK_DATA  gFrontPagePrivate;\r
+\r
 /**\r
   Customize menus in the page.\r
 \r
@@ -129,4 +132,14 @@ UiCustomizeFrontPageBanner (
   IN OUT EFI_STRING     *BannerStr\r
   )\r
 {\r
+  if ((LineIndex == 5) && LeftOrRight) {\r
+    // Update STR_CUSTOMIZE_BANNER_LINE5_LEFT\r
+    if (PcdGetBool(PcdTestKeyUsed)) {\r
+      if (BannerStr != NULL) {\r
+        FreePool(*BannerStr);\r
+      }\r
+      *BannerStr = HiiGetString(gFrontPagePrivate.HiiHandle, STRING_TOKEN(STR_TEST_KEY_USED), NULL);\r
+    }\r
+  }\r
+  return;\r
 }\r
index 71cb7887d199ba3b8e375865b43db43401943d54..8080a209a32048884c4bc3c842246075171e2a63 100644 (file)
@@ -2,7 +2,7 @@
 //\r
 //  String definitions for BdsPlatform formset.\r
 //\r
-//  Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
+//  Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>\r
 //  This program and the accompanying materials\r
 //  are licensed and made available under the terms and conditions of the BSD License\r
 //  which accompanies this distribution.  The full text of the license may be found at\r
@@ -68,5 +68,7 @@
                                          #language fr-FR  ""\r
 #string STR_CUSTOMIZE_BANNER_LINE5_RIGHT #language en-US  ""\r
                                          #language fr-FR  ""\r
+#string STR_TEST_KEY_USED                #language en-US  "WARNING: Test key detected."\r
+                                         #language fr-FR  "WARNING: Test key detected."\r
 #string STR_NULL_STRING                #language en-US  " "\r
                                        #language fr-FR  " "\r
index 6df6e4739e4fe2bc698f42a3b3d9042513d29695..d144462ce46d3d2fac5b5bc5cf9a26ffbde63e6d 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  UiApp module is driver for BDS phase.\r
 #\r
-#  Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2011 - 2016, Intel Corporation. All rights reserved.<BR>\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  which accompanies this distribution.  The full text of the license may be found at\r
@@ -82,6 +82,7 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution  ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution    ## CONSUMES\r
   gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString           ## CONSUMES\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdTestKeyUsed                     ## CONSUMES\r
 \r
 [UserExtensions.TianoCore."ExtraFiles"]\r
   UiAppExtra.uni\r