Check validity of partition for getvar:partition-type
Test: fastboot getvar partition-type:product_services_a Bug: 79480454 Change-Id: I4020b0c94daf8fb86c29104aecc1eb8f44f89999
This commit is contained in:
parent
f3186de123
commit
4165e00d67
1 changed files with 7 additions and 0 deletions
|
@ -309,7 +309,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";
|
||||
|
|
Loading…
Reference in a new issue