recovery: Hide unmountable volumes from selection
* In volume manager, check if new volumes are mountable.
* Check volumes for mountable for inclusion into update list.
* Erase unmountable volumes from volumes vector for consistency with
the item array.
Change-Id: I89ff6cc05a93afffe5e46b24d70fc368bccaf020
diff --git a/recovery.cpp b/recovery.cpp
index 7b8e32b..864e8cb 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -224,8 +224,13 @@
items.clear();
items.push_back("Apply from ADB");
VolumeManager::Instance()->getVolumeInfo(volumes);
- for (auto& vitr : volumes) {
- items.push_back("Choose from " + vitr.mLabel);
+ for (auto vol = volumes.begin(); vol != volumes.end(); /* empty */) {
+ if (!vol->mMountable) {
+ vol = volumes.erase(vol);
+ continue;
+ }
+ items.push_back("Choose from " + vol->mLabel);
+ ++vol;
}
int chosen = ui->ShowMenu(