Skip to content

Commit

Permalink
recovery: Only set relevant sysbar state flags
Browse files Browse the repository at this point in the history
Change-Id: I9fc0fa29299610865f622dc296bdadff59d74447
  • Loading branch information
tdmcyngn authored and Steve Kondik committed Sep 4, 2016
1 parent 05b793a commit 07afc27
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions screen_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,18 @@ void ScreenRecoveryUI::ShowFile(const char* filename) {
text_top_ = old_text_top;
}

void ScreenRecoveryUI::SetSysbarState(int state)
{
if (HasBackKey()) {
state &= ~SYSBAR_BACK;
}
if (HasHomeKey()) {
state &= ~SYSBAR_HOME;
}
sysbar_state = state;
Redraw();
}

void ScreenRecoveryUI::StartMenu(const char* const * headers, const char* const * items,
int initial_selection) {
pthread_mutex_lock(&updateMutex);
Expand Down
2 changes: 1 addition & 1 deletion screen_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ScreenRecoveryUI : public RecoveryUI {
// sysbar
int GetSysbarHeight() { return gr_get_height(sysbarBackHighlightIcon); }
int GetSysbarState() { return sysbar_state; }
void SetSysbarState(int state) { sysbar_state = state; Redraw(); }
void SetSysbarState(int state);

// menu display
virtual int MenuItemStart() const { return menu_item_start_; }
Expand Down
4 changes: 2 additions & 2 deletions ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -514,12 +514,12 @@ void RecoveryUI::handle_release(input_device* dev) {

int sysbar_state = GetSysbarState();
SetSysbarState(0);
if (sysbar_state == 0x01) {
if (sysbar_state == SYSBAR_BACK) {
ProcessKey(dev, KEY_BACK, 1);
ProcessKey(dev, KEY_BACK, 0);
return;
}
if (sysbar_state == 0x02) {
if (sysbar_state == SYSBAR_HOME) {
ProcessKey(dev, KEY_HOME, 1);
ProcessKey(dev, KEY_HOME, 0);
return;
Expand Down

0 comments on commit 07afc27

Please sign in to comment.