Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de809e01 authored by Hridya Valsaraju's avatar Hridya Valsaraju Committed by android-build-merger
Browse files

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

am: 9810709d

Change-Id: If60e2ace22f215464757ce97b181d0a59f104a1a
parents 9e7c9241 9810709d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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";