fastboot: Check if super_empty.img exists before reading it.

On non-DAP devices, fastboot flash <partition> will spam error messages
about not being able to read super_empty.img. We should check that
super_empty.img exists before trying to read it.

Bug: 120429424
Test: fastboot flash system on non-DAP device
Change-Id: I6c4eec19cb3ef8d24595a75e072e1d75baaa8cdd
This commit is contained in:
David Anderson 2018-12-04 17:05:47 -08:00
parent 5ae47e10c8
commit 0047580398
1 changed files with 1 additions and 1 deletions

View File

@ -1541,7 +1541,7 @@ static bool should_flash_in_userspace(const std::string& partition_name) {
return false;
}
auto path = find_item_given_name("super_empty.img");
if (path.empty()) {
if (path.empty() || access(path.c_str(), R_OK)) {
return false;
}
auto metadata = android::fs_mgr::ReadFromImageFile(path);