Loading fastboot/Android.bp +5 −0 Original line number Original line Diff line number Diff line Loading @@ -122,6 +122,7 @@ cc_binary { shared_libs: [ shared_libs: [ "android.hardware.boot@1.0", "android.hardware.boot@1.0", "android.hardware.fastboot@1.0", "android.hardware.fastboot@1.0", "android.hardware.health@2.0", "libadbd", "libadbd", "libasyncio", "libasyncio", "libbase", "libbase", Loading @@ -139,6 +140,10 @@ cc_binary { "libutils", "libutils", ], ], static_libs: [ "libhealthhalutils", ], cpp_std: "c++17", cpp_std: "c++17", } } Loading fastboot/constants.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -62,3 +62,4 @@ #define FB_VAR_HW_REVISION "hw-revision" #define FB_VAR_HW_REVISION "hw-revision" #define FB_VAR_VARIANT "variant" #define FB_VAR_VARIANT "variant" #define FB_VAR_OFF_MODE_CHARGE_STATE "off-mode-charge" #define FB_VAR_OFF_MODE_CHARGE_STATE "off-mode-charge" #define FB_VAR_BATTERY_VOLTAGE "battery-voltage" fastboot/device/commands.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -96,6 +96,7 @@ bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args) {FB_VAR_IS_LOGICAL, {GetPartitionIsLogical, GetAllPartitionArgsWithSlot}}, {FB_VAR_IS_LOGICAL, {GetPartitionIsLogical, GetAllPartitionArgsWithSlot}}, {FB_VAR_IS_USERSPACE, {GetIsUserspace, nullptr}}, {FB_VAR_IS_USERSPACE, {GetIsUserspace, nullptr}}, {FB_VAR_OFF_MODE_CHARGE_STATE, {GetOffModeChargeState, nullptr}}, {FB_VAR_OFF_MODE_CHARGE_STATE, {GetOffModeChargeState, nullptr}}, {FB_VAR_BATTERY_VOLTAGE, {GetBatteryVoltage, nullptr}}, {FB_VAR_HW_REVISION, {GetHardwareRevision, nullptr}}}; {FB_VAR_HW_REVISION, {GetHardwareRevision, nullptr}}}; if (args.size() < 2) { if (args.size() < 2) { Loading fastboot/device/fastboot_device.cpp +5 −0 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <android-base/strings.h> #include <android-base/strings.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <healthhalutils/HealthHalUtils.h> #include <algorithm> #include <algorithm> #include "constants.h" #include "constants.h" Loading @@ -30,6 +32,8 @@ using ::android::hardware::hidl_string; using ::android::hardware::boot::V1_0::IBootControl; using ::android::hardware::boot::V1_0::IBootControl; using ::android::hardware::boot::V1_0::Slot; using ::android::hardware::boot::V1_0::Slot; using ::android::hardware::fastboot::V1_0::IFastboot; using ::android::hardware::fastboot::V1_0::IFastboot; using ::android::hardware::health::V2_0::get_health_service; namespace sph = std::placeholders; namespace sph = std::placeholders; FastbootDevice::FastbootDevice() FastbootDevice::FastbootDevice() Loading @@ -52,6 +56,7 @@ FastbootDevice::FastbootDevice() }), }), transport_(std::make_unique<ClientUsbTransport>()), transport_(std::make_unique<ClientUsbTransport>()), boot_control_hal_(IBootControl::getService()), boot_control_hal_(IBootControl::getService()), health_hal_(get_health_service()), fastboot_hal_(IFastboot::getService()) {} fastboot_hal_(IFastboot::getService()) {} FastbootDevice::~FastbootDevice() { FastbootDevice::~FastbootDevice() { Loading fastboot/device/fastboot_device.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <android/hardware/health/2.0/IHealth.h> #include "commands.h" #include "commands.h" #include "transport.h" #include "transport.h" Loading Loading @@ -53,12 +54,14 @@ class FastbootDevice { android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal() { android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal() { return fastboot_hal_; return fastboot_hal_; } } android::sp<android::hardware::health::V2_0::IHealth> health_hal() { return health_hal_; } private: private: const std::unordered_map<std::string, CommandHandler> kCommandMap; const std::unordered_map<std::string, CommandHandler> kCommandMap; std::unique_ptr<Transport> transport_; std::unique_ptr<Transport> transport_; android::sp<android::hardware::boot::V1_0::IBootControl> boot_control_hal_; android::sp<android::hardware::boot::V1_0::IBootControl> boot_control_hal_; android::sp<android::hardware::health::V2_0::IHealth> health_hal_; android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal_; android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal_; std::vector<char> download_data_; std::vector<char> download_data_; }; }; Loading
fastboot/Android.bp +5 −0 Original line number Original line Diff line number Diff line Loading @@ -122,6 +122,7 @@ cc_binary { shared_libs: [ shared_libs: [ "android.hardware.boot@1.0", "android.hardware.boot@1.0", "android.hardware.fastboot@1.0", "android.hardware.fastboot@1.0", "android.hardware.health@2.0", "libadbd", "libadbd", "libasyncio", "libasyncio", "libbase", "libbase", Loading @@ -139,6 +140,10 @@ cc_binary { "libutils", "libutils", ], ], static_libs: [ "libhealthhalutils", ], cpp_std: "c++17", cpp_std: "c++17", } } Loading
fastboot/constants.h +1 −0 Original line number Original line Diff line number Diff line Loading @@ -62,3 +62,4 @@ #define FB_VAR_HW_REVISION "hw-revision" #define FB_VAR_HW_REVISION "hw-revision" #define FB_VAR_VARIANT "variant" #define FB_VAR_VARIANT "variant" #define FB_VAR_OFF_MODE_CHARGE_STATE "off-mode-charge" #define FB_VAR_OFF_MODE_CHARGE_STATE "off-mode-charge" #define FB_VAR_BATTERY_VOLTAGE "battery-voltage"
fastboot/device/commands.cpp +1 −0 Original line number Original line Diff line number Diff line Loading @@ -96,6 +96,7 @@ bool GetVarHandler(FastbootDevice* device, const std::vector<std::string>& args) {FB_VAR_IS_LOGICAL, {GetPartitionIsLogical, GetAllPartitionArgsWithSlot}}, {FB_VAR_IS_LOGICAL, {GetPartitionIsLogical, GetAllPartitionArgsWithSlot}}, {FB_VAR_IS_USERSPACE, {GetIsUserspace, nullptr}}, {FB_VAR_IS_USERSPACE, {GetIsUserspace, nullptr}}, {FB_VAR_OFF_MODE_CHARGE_STATE, {GetOffModeChargeState, nullptr}}, {FB_VAR_OFF_MODE_CHARGE_STATE, {GetOffModeChargeState, nullptr}}, {FB_VAR_BATTERY_VOLTAGE, {GetBatteryVoltage, nullptr}}, {FB_VAR_HW_REVISION, {GetHardwareRevision, nullptr}}}; {FB_VAR_HW_REVISION, {GetHardwareRevision, nullptr}}}; if (args.size() < 2) { if (args.size() < 2) { Loading
fastboot/device/fastboot_device.cpp +5 −0 Original line number Original line Diff line number Diff line Loading @@ -20,6 +20,8 @@ #include <android-base/strings.h> #include <android-base/strings.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <healthhalutils/HealthHalUtils.h> #include <algorithm> #include <algorithm> #include "constants.h" #include "constants.h" Loading @@ -30,6 +32,8 @@ using ::android::hardware::hidl_string; using ::android::hardware::boot::V1_0::IBootControl; using ::android::hardware::boot::V1_0::IBootControl; using ::android::hardware::boot::V1_0::Slot; using ::android::hardware::boot::V1_0::Slot; using ::android::hardware::fastboot::V1_0::IFastboot; using ::android::hardware::fastboot::V1_0::IFastboot; using ::android::hardware::health::V2_0::get_health_service; namespace sph = std::placeholders; namespace sph = std::placeholders; FastbootDevice::FastbootDevice() FastbootDevice::FastbootDevice() Loading @@ -52,6 +56,7 @@ FastbootDevice::FastbootDevice() }), }), transport_(std::make_unique<ClientUsbTransport>()), transport_(std::make_unique<ClientUsbTransport>()), boot_control_hal_(IBootControl::getService()), boot_control_hal_(IBootControl::getService()), health_hal_(get_health_service()), fastboot_hal_(IFastboot::getService()) {} fastboot_hal_(IFastboot::getService()) {} FastbootDevice::~FastbootDevice() { FastbootDevice::~FastbootDevice() { Loading
fastboot/device/fastboot_device.h +3 −0 Original line number Original line Diff line number Diff line Loading @@ -24,6 +24,7 @@ #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/boot/1.0/IBootControl.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <android/hardware/fastboot/1.0/IFastboot.h> #include <android/hardware/health/2.0/IHealth.h> #include "commands.h" #include "commands.h" #include "transport.h" #include "transport.h" Loading Loading @@ -53,12 +54,14 @@ class FastbootDevice { android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal() { android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal() { return fastboot_hal_; return fastboot_hal_; } } android::sp<android::hardware::health::V2_0::IHealth> health_hal() { return health_hal_; } private: private: const std::unordered_map<std::string, CommandHandler> kCommandMap; const std::unordered_map<std::string, CommandHandler> kCommandMap; std::unique_ptr<Transport> transport_; std::unique_ptr<Transport> transport_; android::sp<android::hardware::boot::V1_0::IBootControl> boot_control_hal_; android::sp<android::hardware::boot::V1_0::IBootControl> boot_control_hal_; android::sp<android::hardware::health::V2_0::IHealth> health_hal_; android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal_; android::sp<android::hardware::fastboot::V1_0::IFastboot> fastboot_hal_; std::vector<char> download_data_; std::vector<char> download_data_; }; };