diff --git a/base/cvd/cuttlefish/common/libs/utils/BUILD.bazel b/base/cvd/cuttlefish/common/libs/utils/BUILD.bazel index 941c386df90..827c224ed4e 100644 --- a/base/cvd/cuttlefish/common/libs/utils/BUILD.bazel +++ b/base/cvd/cuttlefish/common/libs/utils/BUILD.bazel @@ -59,6 +59,9 @@ cf_cc_library( name = "device_type", srcs = ["device_type.cpp"], hdrs = ["device_type.h"], + deps = [ + "@abseil-cpp//absl/strings", + ], ) cf_cc_library( diff --git a/base/cvd/cuttlefish/common/libs/utils/device_type.cpp b/base/cvd/cuttlefish/common/libs/utils/device_type.cpp index 7a56fc1fb75..22267682de7 100644 --- a/base/cvd/cuttlefish/common/libs/utils/device_type.cpp +++ b/base/cvd/cuttlefish/common/libs/utils/device_type.cpp @@ -18,6 +18,8 @@ #include +#include "absl/strings/match.h" + namespace cuttlefish { // Parse device type from android-info.txt config field. @@ -26,8 +28,7 @@ DeviceType ParseDeviceType(std::string_view type_name) { return DeviceType::Phone; } else if (type_name == "wear") { return DeviceType::Wear; - } else if (type_name == "auto" || type_name == "auto_portrait" || - type_name == "auto_dd" || type_name == "auto_md") { + } else if (absl::StartsWith(type_name, "auto")) { return DeviceType::Auto; } else if (type_name == "foldable") { return DeviceType::Foldable;