recovery: Only show tests in eng builds

[DD3Boh]: Adapt for Android 11

Change-Id: If783711ecd0d20728ec27ebc572b57e6d9bee760
This commit is contained in:
Michael Bestas 2019-09-27 20:29:42 +03:00 committed by zlewchan
parent 08817c0e89
commit e211e4dc3d

View file

@ -73,6 +73,10 @@ static bool IsDeviceUnlocked() {
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);
@ -448,6 +452,11 @@ int main(int argc, char** argv) {
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);
}