1 /* 2 * Copyright (C) 2019 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 */ 16 17 #pragma once 18 19 #include <android/hardware/boot/1.0/IBootControl.h> 20 #include <hidl/MQDescriptor.h> 21 #include <hidl/Status.h> 22 23 namespace android { 24 namespace hardware { 25 namespace boot { 26 namespace V1_0 { 27 namespace implementation { 28 29 using ::android::hardware::hidl_array; 30 using ::android::hardware::hidl_memory; 31 using ::android::hardware::hidl_string; 32 using ::android::hardware::hidl_vec; 33 using ::android::hardware::Return; 34 using ::android::hardware::Void; 35 using ::android::sp; 36 37 struct BootControl : public IBootControl { 38 // Methods from ::android::hardware::boot::V1_0::IBootControl follow. 39 Return<uint32_t> getNumberSlots() override; 40 Return<uint32_t> getCurrentSlot() override; 41 Return<void> markBootSuccessful(markBootSuccessful_cb _hidl_cb) override; 42 Return<void> setActiveBootSlot(uint32_t slot, setActiveBootSlot_cb _hidl_cb) override; 43 Return<void> setSlotAsUnbootable(uint32_t slot, setSlotAsUnbootable_cb _hidl_cb) override; 44 Return<::android::hardware::boot::V1_0::BoolResult> isSlotBootable(uint32_t slot) override; 45 Return<::android::hardware::boot::V1_0::BoolResult> isSlotMarkedSuccessful(uint32_t slot) override; 46 Return<void> getSuffix(uint32_t slot, getSuffix_cb _hidl_cb) override; 47 48 // Methods from ::android::hidl::base::V1_0::IBase follow. 49 50 }; 51 52 // FIXME: most likely delete, this is only for passthrough implementations 53 extern "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