Snap for 11679388 from 63e3128023 to 24Q3-release

Change-Id: I0e2d8ca6bca8155b0b207d522ce42ab9d85e2cda
This commit is contained in:
Android Build Coastguard Worker 2024-04-06 01:00:47 +00:00
commit f445350d16
2 changed files with 16 additions and 0 deletions

View file

@ -189,6 +189,17 @@ static bool CheckAbSpecificMetadata(const std::map<std::string, std::string>& me
return false;
}
}
const auto post_build = get_value(metadata, "post-build");
const auto build_fingerprint = android::base::Tokenize(post_build, "/");
if (!build_fingerprint.empty()) {
const auto& post_build_tag = build_fingerprint.back();
const auto build_tag = android::base::GetProperty("ro.build.tags", "");
if (build_tag != post_build_tag) {
LOG(ERROR) << "Post build-tag " << post_build_tag << " does not match device build tag "
<< build_tag;
return false;
}
}
return true;
}

View file

@ -176,6 +176,11 @@ static bool ask_to_wipe_data(Device* device) {
}
static InstallResult prompt_and_wipe_data(Device* device) {
// Reset to normal system boot so recovery won't cycle indefinitely.
std::string err;
if (!clear_bootloader_message(&err)) {
LOG(ERROR) << "Failed to clear BCB message: " << err;
}
// Use a single string and let ScreenRecoveryUI handles the wrapping.
std::vector<std::string> wipe_data_menu_headers{
"Can't load Android system. Your data may be corrupt. "