blob: 75548b026479075f0ccca27e76b5e64d1068eeb2 [file] [log] [blame]
David Anderson9c1020d2019-09-16 13:53:47 -07001/*
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 */
David Anderson9c1020d2019-09-16 13:53:47 -070016
David Andersonb93d6702019-09-16 17:20:03 -070017#pragma once
David Anderson9c1020d2019-09-16 13:53:47 -070018
19#include <hidl/MQDescriptor.h>
David Andersonb93d6702019-09-16 17:20:03 -070020#include <hidl/Status.h>
21
22#include "BootControlShared.h"
23
David Anderson9c1020d2019-09-16 13:53:47 -070024namespace android {
25namespace hardware {
26namespace boot {
Tianjie253b46d2020-11-30 14:38:35 -080027namespace V1_2 {
David Anderson9c1020d2019-09-16 13:53:47 -070028namespace implementation {
29
David Anderson9c1020d2019-09-16 13:53:47 -070030using ::android::hardware::Return;
31using ::android::hardware::boot::V1_0::BoolResult;
David Anderson9c1020d2019-09-16 13:53:47 -070032
David Andersonb93d6702019-09-16 17:20:03 -070033struct BootControl : public BootControlShared {
David Anderson953ea5d2019-10-30 13:07:33 -070034 explicit BootControl(boot_control_module_t *module);
35
David Anderson9c1020d2019-09-16 13:53:47 -070036 // Methods from ::android::hardware::boot::V1_0::IBootControl follow.
37 Return<uint32_t> getNumberSlots() override;
38 Return<uint32_t> getCurrentSlot() override;
39 Return<void> markBootSuccessful(markBootSuccessful_cb _hidl_cb) override;
40 Return<void> setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) override;
41 Return<void> setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) override;
42 Return<BoolResult> isSlotBootable(uint32_t slot) override;
43 Return<BoolResult> isSlotMarkedSuccessful(uint32_t slot) override;
44 Return<void> getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) override;
45
Tianjie253b46d2020-11-30 14:38:35 -080046 // Methods from ::android::hardware::boot::V1_2::IBootControl follow.
47 Return<uint32_t> getActiveBootSlot() override;
48
David Anderson9c1020d2019-09-16 13:53:47 -070049 private:
50 boot_control_module_t *mModule;
51};
52
53extern "C" IBootControl *HIDL_FETCH_IBootControl(const char *name);
54
55} // namespace implementation
Tianjie253b46d2020-11-30 14:38:35 -080056} // namespace V1_2
David Anderson9c1020d2019-09-16 13:53:47 -070057} // namespace boot
58} // namespace hardware
59} // namespace android