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
This commit is contained in:
Xiuqin Wang 2020-08-11 14:49:39 +08:00 committed by Lyon Wang
parent e76fb7a810
commit 22fa53488a

View file

@ -365,7 +365,6 @@ status_t Disk::readPartitions() {
continue;
}
} else if (*it == "PART") {
foundParts = true;
if (++it == split.end()) continue;
int i = 0;
@ -390,6 +389,7 @@ status_t Disk::readPartitions() {
case 0x0c: // W95 FAT32 (LBA)
case 0x0e: // W95 FAT16 (LBA)
createPublicVolume(partDevice);
foundParts = true;
break;
}
} else if (table == Table::kGpt) {
@ -400,8 +400,10 @@ status_t Disk::readPartitions() {
if (android::base::EqualsIgnoreCase(typeGuid, kGptBasicData)) {
createPublicVolume(partDevice);
foundParts = true;
} else if (android::base::EqualsIgnoreCase(typeGuid, kGptAndroidExpand)) {
createPrivateVolume(partDevice, partGuid);
foundParts = true;
}
}
}