nanoapp_cmd: fix final fallback erasure step
The final fallback erasure step when downloading nanoapps doesn't
re-query nanohub for the list of nanoapps loaded, so it will only
download the nanoapps that were missing from the previous query
(ommitting all the nanoapps that just got erased)
So if A, B, and C are downloaded and D fails to download, only
D gets downloaded after erasing the flash. A, B, and C won't
be download until the next reboot.
Bug: 63404254
Test: build
Change-Id: Iac57ee9c4cbef8db74fed460a0e2bdc7124a791c
Signed-off-by: Ben Fennema <[email protected]>
diff --git a/util/nanoapp_cmd/nanoapp_cmd.c b/util/nanoapp_cmd/nanoapp_cmd.c
index 328ba0c..682a45f 100644
--- a/util/nanoapp_cmd/nanoapp_cmd.c
+++ b/util/nanoapp_cmd/nanoapp_cmd.c
@@ -480,7 +480,7 @@
LOGE("Download failed after %d retries; erasing all apps "
"before final attempt", i);
eraseSharedArea();
- uninstallCnt = 0;
+ parseConfigAppInfo(&installCnt, &uninstallCnt);
}
removeApps(uninstallCnt);
downloadApps(installCnt);