Skip to content

Commit

Permalink
FastbootMenu: use different colors
Browse files Browse the repository at this point in the history
Use yellow for Fastboot mode and conditionalize color for DEVICE STATE:
  - green when locked
  - red when unlocked

Change-Id: I970af3e2dfd1e84a04f4812a61f44ea82cc456e6
Signed-off-by: Alexander Martinz <[email protected]>
  • Loading branch information
amartinz committed Sep 10, 2021
1 parent 80b2e2e commit 7487038
Showing 1 changed file with 18 additions and 8 deletions.
26 changes: 18 additions & 8 deletions QcomModulePkg/Library/BootLib/FastbootMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = {
COMMON,
0,
NOACTION},
{{"FastBoot Mode"},
{{"Fastboot mode\n\n"},
COMMON_FACTOR,
BGR_RED,
BGR_YELLOW,
BGR_BLACK,
COMMON,
0,
Expand Down Expand Up @@ -159,13 +159,20 @@ STATIC MENU_MSG_INFO mFastbootCommonMsgInfo[] = {
COMMON,
0,
NOACTION},
{{"DEVICE STATE - "},
{{"\nDEVICE STATE - unlocked"},
COMMON_FACTOR,
BGR_RED,
BGR_BLACK,
COMMON,
0,
NOACTION},
{{"\nDEVICE STATE - locked"},
COMMON_FACTOR,
BGR_GREEN,
BGR_BLACK,
COMMON,
0,
NOACTION},
};

/**
Expand Down Expand Up @@ -323,11 +330,14 @@ FastbootMenuShowScreen (OPTION_MENU_INFO *OptionMenuInfo)
IsSecureBootEnabled () ? AsciiStrLen ("yes") : AsciiStrLen ("no"));
break;
case 10:
/* Get device status */
AsciiStrnCatS (
mFastbootCommonMsgInfo[i].Msg, sizeof (mFastbootCommonMsgInfo[i].Msg),
IsUnlocked () ? "unlocked" : "locked",
IsUnlocked () ? AsciiStrLen ("unlocked") : AsciiStrLen ("locked"));
/* Get device status, only show when unlocked */
if (!IsUnlocked ())
continue;
break;
case 11:
/* Get device status, only show when locked */
if (IsUnlocked ())
continue;
break;
}

Expand Down

0 comments on commit 7487038

Please sign in to comment.