• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 <aidl/android/hardware/boot/BnBootControl.h>
20 #include <libboot_control/libboot_control.h>
21 
22 namespace aidl::android::hardware::boot {
23 
24 class BootControl final : public BnBootControl {
25   public:
26     BootControl();
27     ::ndk::ScopedAStatus getActiveBootSlot(int32_t* _aidl_return) override;
28     ::ndk::ScopedAStatus getCurrentSlot(int32_t* _aidl_return) override;
29     ::ndk::ScopedAStatus getNumberSlots(int32_t* _aidl_return) override;
30     ::ndk::ScopedAStatus getSnapshotMergeStatus(
31             ::aidl::android::hardware::boot::MergeStatus* _aidl_return) override;
32     ::ndk::ScopedAStatus getSuffix(int32_t in_slot, std::string* _aidl_return) override;
33     ::ndk::ScopedAStatus isSlotBootable(int32_t in_slot, bool* _aidl_return) override;
34     ::ndk::ScopedAStatus isSlotMarkedSuccessful(int32_t in_slot, bool* _aidl_return) override;
35     ::ndk::ScopedAStatus markBootSuccessful() override;
36     ::ndk::ScopedAStatus setActiveBootSlot(int32_t in_slot) override;
37     ::ndk::ScopedAStatus setSlotAsUnbootable(int32_t in_slot) override;
38     ::ndk::ScopedAStatus setSnapshotMergeStatus(
39             ::aidl::android::hardware::boot::MergeStatus in_status) override;
40 
41   private:
42     ::android::bootable::BootControl impl_;
43 };
44 
45 }  // namespace aidl::android::hardware::boot
46