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

Commit e9997f81 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Integrate with fastboot HAL to get partition type"

parents 756e28ee bf9f8d1a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ cc_binary {

    shared_libs: [
        "android.hardware.boot@1.0",
        "android.hardware.fastboot@1.0",
        "libadbd",
        "libasyncio",
        "libbase",
+1 −0
Original line number Diff line number Diff line
@@ -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"
+1 −0
Original line number Diff line number Diff line
@@ -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}}};
+4 −2
Original line number Diff line number Diff line
@@ -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"
@@ -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()
@@ -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();
+5 −0
Original line number Diff line number Diff line
@@ -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"
@@ -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