recovery: Only show tests in eng builds

Change-Id: If783711ecd0d20728ec27ebc572b57e6d9bee760
diff --git a/common.h b/common.h
index a524a41..bc2c07b 100644
--- a/common.h
+++ b/common.h
@@ -36,3 +36,5 @@
 extern const char* reason;
 
 bool is_ro_debuggable();
+
+std::string get_build_type();
diff --git a/recovery.cpp b/recovery.cpp
index 81322c6..fdd72bf 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -128,6 +128,10 @@
     return android::base::GetBoolProperty("ro.debuggable", false);
 }
 
+std::string get_build_type() {
+  return android::base::GetProperty("ro.build.type", "");
+}
+
 // Clear the recovery command and prepare to boot a (hopefully working) system,
 // copy our log file to cache as well (for the system to read). This function is
 // idempotent: call it as many times as you like.
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 61b6de2..0988afd 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -425,6 +425,11 @@
     device->RemoveMenuItemForAction(Device::ENTER_FASTBOOT);
   }
 
+  if (get_build_type() != "eng") {
+    device->RemoveMenuItemForAction(Device::RUN_GRAPHICS_TEST);
+    device->RemoveMenuItemForAction(Device::RUN_LOCALE_TEST);
+  }
+
   if (!is_ro_debuggable()) {
     device->RemoveMenuItemForAction(Device::ENTER_RESCUE);
   }