Merge "fastbootd: Add is-userspace variable."

This commit is contained in:
Treehugger Robot 2018-08-09 23:17:16 +00:00 committed by Gerrit Code Review
commit 6d5b931466
4 changed files with 8 additions and 1 deletions

View file

@ -57,3 +57,4 @@
#define FB_VAR_SLOT_SUCCESSFUL "slot-successful"
#define FB_VAR_SLOT_UNBOOTABLE "slot-unbootable"
#define FB_VAR_IS_LOGICAL "is-logical"
#define FB_VAR_IS_USERSPACE "is-userspace"

View file

@ -59,7 +59,8 @@ bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args)
{FB_VAR_SLOT_SUCCESSFUL, GetSlotSuccessful},
{FB_VAR_SLOT_UNBOOTABLE, GetSlotUnbootable},
{FB_VAR_PARTITION_SIZE, GetPartitionSize},
{FB_VAR_IS_LOGICAL, GetPartitionIsLogical}};
{FB_VAR_IS_LOGICAL, GetPartitionIsLogical},
{FB_VAR_IS_USERSPACE, GetIsUserspace}};
// args[0] is command name, args[1] is variable.
auto found_variable = kVariableMap.find(args[1]);

View file

@ -165,3 +165,7 @@ bool GetPartitionIsLogical(FastbootDevice* device, const std::vector<std::string
}
return device->WriteFail("Partition not found");
}
bool GetIsUserspace(FastbootDevice* device, const std::vector<std::string>& /* args */) {
return device->WriteOkay("yes");
}

View file

@ -36,3 +36,4 @@ bool GetUnlocked(FastbootDevice* device, const std::vector<std::string>& args);
bool GetHasSlot(FastbootDevice* device, const std::vector<std::string>& args);
bool GetPartitionSize(FastbootDevice* device, const std::vector<std::string>& args);
bool GetPartitionIsLogical(FastbootDevice* device, const std::vector<std::string>& args);
bool GetIsUserspace(FastbootDevice* device, const std::vector<std::string>& args);