recovery: Only show tests in eng builds

[DD3Boh]: Adapt for Android 11

Change-Id: If783711ecd0d20728ec27ebc572b57e6d9bee760
diff --git a/recovery_main.cpp b/recovery_main.cpp
index 9a358ab..13e82c2 100644
--- a/recovery_main.cpp
+++ b/recovery_main.cpp
@@ -73,6 +73,10 @@
   return "orange" == android::base::GetProperty("ro.boot.verifiedbootstate", "");
 }
 
+static std::string get_build_type() {
+  return android::base::GetProperty("ro.build.type", "");
+}
+
 static void UiLogger(android::base::LogId log_buffer_id, android::base::LogSeverity severity,
                      const char* tag, const char* file, unsigned int line, const char* message) {
   android::base::KernelLogger(log_buffer_id, severity, tag, file, line, message);
@@ -444,6 +448,11 @@
     device->RemoveMenuItemForAction(Device::ENTER_FASTBOOT);
   }
 
+  if (get_build_type() != "eng") {
+    device->RemoveMenuItemForAction(Device::RUN_GRAPHICS_TEST);
+    device->RemoveMenuItemForAction(Device::RUN_LOCALE_TEST);
+  }
+
   if (!IsRoDebuggable()) {
     device->RemoveMenuItemForAction(Device::ENTER_RESCUE);
   }