blob: 3d668dc0adf84f3f98d597080682b1476d0022cb [file] [log] [blame]
Steven Moreland9f8b5c72016-11-29 15:03:38 -08001/*
2 * Copyright (C) 2016 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
Steven Moreland33e87b82016-11-22 15:34:39 -080016#ifndef ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H
17#define ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H
Connor O'Brienfe25fd82016-10-10 12:31:37 -070018
19#include <android/hardware/boot/1.0/IBootControl.h>
20#include <hidl/Status.h>
21
22#include <hidl/MQDescriptor.h>
23namespace android {
24namespace hardware {
25namespace boot {
26namespace V1_0 {
27namespace implementation {
28
29using ::android::hardware::boot::V1_0::BoolResult;
30using ::android::hardware::boot::V1_0::CommandResult;
31using ::android::hardware::boot::V1_0::IBootControl;
32using ::android::hardware::Return;
33using ::android::hardware::Void;
34using ::android::hardware::hidl_vec;
35using ::android::hardware::hidl_string;
36using ::android::sp;
37
38struct BootControl : public IBootControl {
39 BootControl(boot_control_module_t* module);
40 // Methods from ::android::hardware::boot::V1_0::IBootControl follow.
41 Return<uint32_t> getNumberSlots() override;
42 Return<uint32_t> getCurrentSlot() override;
43 Return<void> markBootSuccessful(markBootSuccessful_cb _hidl_cb) override;
44 Return<void> setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) override;
45 Return<void> setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) override;
46 Return<BoolResult> isSlotBootable(uint32_t slot) override;
47 Return<BoolResult> isSlotMarkedSuccessful(uint32_t slot) override;
48 Return<void> getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) override;
49private:
50 boot_control_module_t* mModule;
51};
52
53extern "C" IBootControl* HIDL_FETCH_IBootControl(const char* name);
54
55} // namespace implementation
56} // namespace V1_0
57} // namespace boot
58} // namespace hardware
59} // namespace android
60
Steven Moreland33e87b82016-11-22 15:34:39 -080061#endif // ANDROID_HARDWARE_BOOT_V1_0_BOOTCONTROL_H