blob: b33be928c6a4ba3c05eb1ddea80633a7394046c5 [file] [log] [blame]
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ZIRCON_SYSTEM_CORE_DEVMGR_DEVCOORDINATOR_RESUME_TASK_H_
#define ZIRCON_SYSTEM_CORE_DEVMGR_DEVCOORDINATOR_RESUME_TASK_H_
#include "device.h"
#include "task.h"
namespace devmgr {
class ResumeTask final : public Task {
public:
static fbl::RefPtr<ResumeTask> Create(fbl::RefPtr<Device> device, uint32_t target_system_state,
Completion completion = nullptr);
// Don't invoke this, use Create
ResumeTask(fbl::RefPtr<Device> device, uint32_t target_system_state, Completion completion);
uint32_t target_system_state() { return target_system_state_; }
~ResumeTask() final;
const Device& device() const { return *device_; }
private:
void Run() final;
bool AddChildResumeTasks();
// The device being resumeed
fbl::RefPtr<Device> device_;
// Target system resume state
uint32_t target_system_state_;
bool child_resume_tasks_not_issued_ = false;
};
} // namespace devmgr
#endif // ZIRCON_SYSTEM_CORE_DEVMGR_DEVCOORDINATOR_RESUME_TASK_H_