Revert "bootable: Read all asserts in case there are more than one"
This reverts commit e6c0b5f437aa7eb4c0fc2cc05d0a076e16f8a2c0.
diff --git a/install/install.cpp b/install/install.cpp
index 5177b72..e1a9ae5 100644
--- a/install/install.cpp
+++ b/install/install.cpp
@@ -74,7 +74,7 @@
static constexpr int VERIFICATION_PROGRESS_TIME = 60;
static constexpr float VERIFICATION_PROGRESS_FRACTION = 0.25;
// The charater used to separate dynamic fingerprints. e.x. sargo|aosp-sargo
-#define FINGERPRING_SEPARATOR "|"
+static const char* FINGERPRING_SEPARATOR = "|";
static std::condition_variable finish_log_temperature;
static bool isInStringList(const std::string& target_token, const std::string& str_list,
const std::string& deliminator);
@@ -213,19 +213,10 @@
return false;
}
- // We allow the package to carry multiple product names split by ",";
- // e.g. pre-device=device1,device2,device3 ... We will fail the
- // verification if the device's name doesn't match any of these carried names.
auto device = android::base::GetProperty("ro.product.device", "");
auto pkg_device = get_value(metadata, "pre-device");
- bool product_name_match = false;
- for (const auto& name : android::base::Split(pkg_device, FINGERPRING_SEPARATOR ":" ",")) {
- if (device == android::base::Trim(name)) {
- product_name_match = true;
- break;
- }
- }
- if (!product_name_match) {
+ // device name can be a | separated list, so need to check
+ if (pkg_device.empty() || !isInStringList(device, pkg_device, FINGERPRING_SEPARATOR)) {
LOG(ERROR) << "Package is for product " << pkg_device << " but expected " << device;
return false;
}