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

Commit 83800601 authored by Daniel Zheng's avatar Daniel Zheng Committed by Gerrit Code Review
Browse files

Merge "Adding const to task constructors"

parents 23631b9b e6dbd4f1
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -42,8 +42,8 @@ void FlashTask::Run() {
    do_for_partitions(pname_, slot_, flash, true);
}

RebootTask::RebootTask(FlashingPlan* fp) : fp_(fp){};
RebootTask::RebootTask(FlashingPlan* fp, const std::string& reboot_target)
RebootTask::RebootTask(const FlashingPlan* fp) : fp_(fp){};
RebootTask::RebootTask(const FlashingPlan* fp, const std::string& reboot_target)
    : reboot_target_(reboot_target), fp_(fp){};

void RebootTask::Run() {
@@ -153,7 +153,7 @@ std::unique_ptr<FlashSuperLayoutTask> FlashSuperLayoutTask::Initialize(
                                                  partition_size);
}

UpdateSuperTask::UpdateSuperTask(FlashingPlan* fp) : fp_(fp) {}
UpdateSuperTask::UpdateSuperTask(const FlashingPlan* fp) : fp_(fp) {}

void UpdateSuperTask::Run() {
    unique_fd fd = fp_->source->OpenFile("super_empty.img");
@@ -177,7 +177,7 @@ void UpdateSuperTask::Run() {
    fp_->fb->RawCommand(command, "Updating super partition");
}

ResizeTask::ResizeTask(FlashingPlan* fp, const std::string& pname, const std::string& size,
ResizeTask::ResizeTask(const FlashingPlan* fp, const std::string& pname, const std::string& size,
                       const std::string& slot)
    : fp_(fp), pname_(pname), size_(size), slot_(slot) {}

@@ -190,13 +190,13 @@ void ResizeTask::Run() {
    do_for_partitions(pname_, slot_, resize_partition, false);
}

DeleteTask::DeleteTask(FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};
DeleteTask::DeleteTask(const FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};

void DeleteTask::Run() {
    fp_->fb->DeletePartition(pname_);
}

WipeTask::WipeTask(FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};
WipeTask::WipeTask(const FlashingPlan* fp, const std::string& pname) : fp_(fp), pname_(pname){};

void WipeTask::Run() {
    std::string partition_type;
+6 −6
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@ class FlashTask : public Task {

class RebootTask : public Task {
  public:
    RebootTask(FlashingPlan* fp);
    RebootTask(FlashingPlan* fp, const std::string& reboot_target);
    RebootTask(const FlashingPlan* fp);
    RebootTask(const FlashingPlan* fp, const std::string& reboot_target);
    void Run() override;

  private:
@@ -73,7 +73,7 @@ class FlashSuperLayoutTask : public Task {

class UpdateSuperTask : public Task {
  public:
    UpdateSuperTask(FlashingPlan* fp);
    UpdateSuperTask(const FlashingPlan* fp);
    void Run() override;

  private:
@@ -82,7 +82,7 @@ class UpdateSuperTask : public Task {

class ResizeTask : public Task {
  public:
    ResizeTask(FlashingPlan* fp, const std::string& pname, const std::string& size,
    ResizeTask(const FlashingPlan* fp, const std::string& pname, const std::string& size,
               const std::string& slot);
    void Run() override;

@@ -95,7 +95,7 @@ class ResizeTask : public Task {

class DeleteTask : public Task {
  public:
    DeleteTask(FlashingPlan* _fp, const std::string& _pname);
    DeleteTask(const FlashingPlan* _fp, const std::string& _pname);
    void Run() override;

  private:
@@ -105,7 +105,7 @@ class DeleteTask : public Task {

class WipeTask : public Task {
  public:
    WipeTask(FlashingPlan* fp, const std::string& pname);
    WipeTask(const FlashingPlan* fp, const std::string& pname);
    void Run() override;

  private: