Steven Moreland | 33e87b8 | 2016-11-22 15:34:39 -0800 | [diff] [blame] | 1 | #ifndef ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H |
| 2 | #define ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H |
Connor O'Brien | fe25fd8 | 2016-10-10 12:31:37 -0700 | [diff] [blame] | 3 | |
| 4 | #include <android/hardware/boot/1.0/IBootControl.h> |
| 5 | #include <hidl/Status.h> |
| 6 | |
| 7 | #include <hidl/MQDescriptor.h> |
| 8 | namespace android { |
| 9 | namespace hardware { |
| 10 | namespace boot { |
| 11 | namespace V1_0 { |
| 12 | namespace implementation { |
| 13 | |
| 14 | using ::android::hardware::boot::V1_0::BoolResult; |
| 15 | using ::android::hardware::boot::V1_0::CommandResult; |
| 16 | using ::android::hardware::boot::V1_0::IBootControl; |
| 17 | using ::android::hardware::Return; |
| 18 | using ::android::hardware::Void; |
| 19 | using ::android::hardware::hidl_vec; |
| 20 | using ::android::hardware::hidl_string; |
| 21 | using ::android::sp; |
| 22 | |
| 23 | struct BootControl : public IBootControl { |
| 24 | BootControl(boot_control_module_t* module); |
| 25 | // Methods from ::android::hardware::boot::V1_0::IBootControl follow. |
| 26 | Return<uint32_t> getNumberSlots() override; |
| 27 | Return<uint32_t> getCurrentSlot() override; |
| 28 | Return<void> markBootSuccessful(markBootSuccessful_cb _hidl_cb) override; |
| 29 | Return<void> setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) override; |
| 30 | Return<void> setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) override; |
| 31 | Return<BoolResult> isSlotBootable(uint32_t slot) override; |
| 32 | Return<BoolResult> isSlotMarkedSuccessful(uint32_t slot) override; |
| 33 | Return<void> getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) override; |
| 34 | private: |
| 35 | boot_control_module_t* mModule; |
| 36 | }; |
| 37 | |
| 38 | extern "C" IBootControl* HIDL_FETCH_IBootControl(const char* name); |
| 39 | |
| 40 | } // namespace implementation |
| 41 | } // namespace V1_0 |
| 42 | } // namespace boot |
| 43 | } // namespace hardware |
| 44 | } // namespace android |
| 45 | |
Steven Moreland | 33e87b8 | 2016-11-22 15:34:39 -0800 | [diff] [blame] | 46 | #endif // ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H |