Loading fastboot/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ cc_binary { shared_libs: [ "android.hardware.boot@1.0", "android.hardware.fastboot@1.0", "libadbd", "libasyncio", "libbase", Loading fastboot/constants.h +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ #define FB_VAR_HAS_SLOT "has-slot" #define FB_VAR_SLOT_COUNT "slot-count" #define FB_VAR_PARTITION_SIZE "partition-size" #define FB_VAR_PARTITION_TYPE "partition-type" #define FB_VAR_SLOT_SUCCESSFUL "slot-successful" #define FB_VAR_SLOT_UNBOOTABLE "slot-unbootable" #define FB_VAR_IS_LOGICAL "is-logical" Loading fastboot/device/commands.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args) {FB_VAR_SLOT_SUCCESSFUL, {GetSlotSuccessful, nullptr}}, {FB_VAR_SLOT_UNBOOTABLE, {GetSlotUnbootable, nullptr}}, {FB_VAR_PARTITION_SIZE, {GetPartitionSize, GetAllPartitionArgsWithSlot}}, {FB_VAR_PARTITION_TYPE, {GetPartitionType, GetAllPartitionArgsWithSlot}}, {FB_VAR_IS_LOGICAL, {GetPartitionIsLogical, GetAllPartitionArgsWithSlot}}, {FB_VAR_IS_USERSPACE, {GetIsUserspace, nullptr}}, {FB_VAR_HW_REVISION, {GetHardwareRevision, nullptr}}}; Loading fastboot/device/fastboot_device.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ #include <android-base/logging.h> #include <android-base/strings.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <algorithm> #include "constants.h" Loading @@ -29,6 +29,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::boot::V1_0::IBootControl; using ::android::hardware::boot::V1_0::Slot; using ::android::hardware::fastboot::V1_0::IFastboot; namespace sph = std::placeholders; FastbootDevice::FastbootDevice() Loading @@ -49,7 +50,8 @@ FastbootDevice::FastbootDevice() {FB_CMD_UPDATE_SUPER, UpdateSuperHandler}, }), transport_(std::make_unique<ClientUsbTransport>()), boot_control_hal_(IBootControl::getService()) {} boot_control_hal_(IBootControl::getService()), fastboot_hal_(IFastboot::getService()) {} FastbootDevice::~FastbootDevice() { CloseDevice(); Loading fastboot/device/fastboot_device.h +5 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <vector> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include "commands.h" #include "transport.h" Loading @@ -49,11 +50,15 @@ class FastbootDevice { android::sp<android::hardware::boot::V1_0::IBootControl> boot_control_hal() { return boot_control_hal_; } android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal() { return fastboot_hal_; } private: const std::unordered_map<std::string, CommandHandler> kCommandMap; std::unique_ptr<Transport> transport_; android::sp<android::hardware::boot::V1_0::IBootControl> boot_control_hal_; android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal_; std::vector<char> download_data_; }; Loading
fastboot/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ cc_binary { shared_libs: [ "android.hardware.boot@1.0", "android.hardware.fastboot@1.0", "libadbd", "libasyncio", "libbase", Loading
fastboot/constants.h +1 −0 Original line number Diff line number Diff line Loading @@ -53,6 +53,7 @@ #define FB_VAR_HAS_SLOT "has-slot" #define FB_VAR_SLOT_COUNT "slot-count" #define FB_VAR_PARTITION_SIZE "partition-size" #define FB_VAR_PARTITION_TYPE "partition-type" #define FB_VAR_SLOT_SUCCESSFUL "slot-successful" #define FB_VAR_SLOT_UNBOOTABLE "slot-unbootable" #define FB_VAR_IS_LOGICAL "is-logical" Loading
fastboot/device/commands.cpp +1 −0 Original line number Diff line number Diff line Loading @@ -88,6 +88,7 @@ bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args) {FB_VAR_SLOT_SUCCESSFUL, {GetSlotSuccessful, nullptr}}, {FB_VAR_SLOT_UNBOOTABLE, {GetSlotUnbootable, nullptr}}, {FB_VAR_PARTITION_SIZE, {GetPartitionSize, GetAllPartitionArgsWithSlot}}, {FB_VAR_PARTITION_TYPE, {GetPartitionType, GetAllPartitionArgsWithSlot}}, {FB_VAR_IS_LOGICAL, {GetPartitionIsLogical, GetAllPartitionArgsWithSlot}}, {FB_VAR_IS_USERSPACE, {GetIsUserspace, nullptr}}, {FB_VAR_HW_REVISION, {GetHardwareRevision, nullptr}}}; Loading
fastboot/device/fastboot_device.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ #include <android-base/logging.h> #include <android-base/strings.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <algorithm> #include "constants.h" Loading @@ -29,6 +29,7 @@ using ::android::hardware::hidl_string; using ::android::hardware::boot::V1_0::IBootControl; using ::android::hardware::boot::V1_0::Slot; using ::android::hardware::fastboot::V1_0::IFastboot; namespace sph = std::placeholders; FastbootDevice::FastbootDevice() Loading @@ -49,7 +50,8 @@ FastbootDevice::FastbootDevice() {FB_CMD_UPDATE_SUPER, UpdateSuperHandler}, }), transport_(std::make_unique<ClientUsbTransport>()), boot_control_hal_(IBootControl::getService()) {} boot_control_hal_(IBootControl::getService()), fastboot_hal_(IFastboot::getService()) {} FastbootDevice::~FastbootDevice() { CloseDevice(); Loading
fastboot/device/fastboot_device.h +5 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <vector> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include "commands.h" #include "transport.h" Loading @@ -49,11 +50,15 @@ class FastbootDevice { android::sp<android::hardware::boot::V1_0::IBootControl> boot_control_hal() { return boot_control_hal_; } android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal() { return fastboot_hal_; } private: const std::unordered_map<std::string, CommandHandler> kCommandMap; std::unique_ptr<Transport> transport_; android::sp<android::hardware::boot::V1_0::IBootControl> boot_control_hal_; android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal_; std::vector<char> download_data_; };