Merge "Check validity of partition for getvar:partition-type"

am: 9810709d91

Change-Id: If60e2ace22f215464757ce97b181d0a59f104a1a
This commit is contained in:
Hridya Valsaraju 2018-10-09 16:33:42 -07:00 committed by android-build-merger
commit de809e0122

View file

@ -308,7 +308,14 @@ bool GetPartitionType(FastbootDevice* device, const std::vector<std::string>& ar
*message = "Missing argument";
return false;
}
std::string partition_name = args[0];
if (!FindPhysicalPartition(partition_name) &&
!LogicalPartitionExists(partition_name, device->GetCurrentSlot())) {
*message = "Invalid partition";
return false;
}
auto fastboot_hal = device->fastboot_hal();
if (!fastboot_hal) {
*message = "Fastboot HAL not found";