recovery: ui: Support hardware virtual keys
* Also swipe left -> KEY_BACK
Change-Id: I6bd8054485d680df35abb86cb79f1dda683e4459
diff --git a/install/fuse_install.cpp b/install/fuse_install.cpp
index 197e1de..09d04a8 100644
--- a/install/fuse_install.cpp
+++ b/install/fuse_install.cpp
@@ -99,13 +99,16 @@
if (chosen_item == static_cast<size_t>(RecoveryUI::KeyError::INTERRUPTED)) {
return "";
}
-
- const std::string& item = entries[chosen_item];
- if (chosen_item == 0) {
- // Go up but continue browsing (if the caller is BrowseDirectory).
+ if (chosen_item == Device::kGoHome) {
+ return "@";
+ }
+ if (chosen_item == Device::kGoBack || chosen_item == 0) {
+ // Go up but continue browsing (if the caller is browse_directory).
return "";
}
+ const std::string& item = entries[chosen_item];
+
std::string new_path = path + "/" + item;
if (new_path.back() == '/') {
// Recurse down into a subdirectory.