Skip to content

Commit

Permalink
Refactor to prevent audits from ViewOnlyFormHierarchyActivity
Browse files Browse the repository at this point in the history
  • Loading branch information
cooperka committed Nov 19, 2018
1 parent 2c5a701 commit a6d1843
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -449,16 +449,18 @@ void onQuestionClicked(FormIndex index) {
* level in the hierarchy as the "Go Up" button does.
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
FormController fc = Collect.getInstance().getFormController();
if (fc != null) {
fc.getTimerLogger().exitView();
fc.jumpToIndex(startIndex);
}
public void onBackPressed() {
FormController formController = Collect.getInstance().getFormController();
if (formController != null) {
formController.getTimerLogger().exitView();
formController.jumpToIndex(startIndex);
}
return super.onKeyDown(keyCode, event);

onBackPressedWithoutLogger();
}

protected void onBackPressedWithoutLogger() {
super.onBackPressed();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ void onQuestionClicked(FormIndex index) {
* Prevents logging an audit event when the user exits the activity.
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
return super.onKeyDown(keyCode, event);
public void onBackPressed() {
onBackPressedWithoutLogger();
}
}

0 comments on commit a6d1843

Please sign in to comment.