Fix some special usb can't mount issue.
[Description]
The usb has invalid partition table, but vold thinks it has partition.
So vold not to treat entire disk as partition.
Bug: 160433451
[Test Report]
Build pass.
The special usb can mount ok.
Change-Id: I0b0e761641f6961e69d7d7f7fbc58d33eeab3a08
diff --git a/model/Disk.cpp b/model/Disk.cpp
index 4df4e9d..01cd0c3 100644
--- a/model/Disk.cpp
+++ b/model/Disk.cpp
@@ -365,7 +365,6 @@
continue;
}
} else if (*it == "PART") {
- foundParts = true;
if (++it == split.end()) continue;
int i = 0;
@@ -390,6 +389,7 @@
case 0x0c: // W95 FAT32 (LBA)
case 0x0e: // W95 FAT16 (LBA)
createPublicVolume(partDevice);
+ foundParts = true;
break;
}
} else if (table == Table::kGpt) {
@@ -400,8 +400,10 @@
if (android::base::EqualsIgnoreCase(typeGuid, kGptBasicData)) {
createPublicVolume(partDevice);
+ foundParts = true;
} else if (android::base::EqualsIgnoreCase(typeGuid, kGptAndroidExpand)) {
createPrivateVolume(partDevice, partGuid);
+ foundParts = true;
}
}
}