Fix `fastboot flash-all` on Nexus 7.
The Nexus 7 bootloader just returns the empty string for unknown
variables, which confused the new snapshot code.
Bug: https://issuetracker.google.com/158232468
Test: no Nexus 7 available during covid-19 :-(
Change-Id: I35ff8889b27944e8b7426eca4f513d9fa562c6d4
diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp
index 7abc936..46d1d36 100644
--- a/fastboot/fastboot.cpp
+++ b/fastboot/fastboot.cpp
@@ -1229,7 +1229,7 @@
static void CancelSnapshotIfNeeded() {
std::string merge_status = "none";
if (fb->GetVar(FB_VAR_SNAPSHOT_UPDATE_STATUS, &merge_status) == fastboot::SUCCESS &&
- merge_status != "none") {
+ !merge_status.empty() && merge_status != "none") {
fb->SnapshotUpdateCommand("cancel");
}
}