blob: a1cc0555925cfa7f6f13041fdd65c9497c0c2bc9 [file] [log] [blame]
David Zeuthen6eddf262015-10-16 15:23:53 -04001//
2// Copyright (C) 2015 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
Alex Deymo39910dc2015-11-09 17:04:30 -080017#include "update_engine/common/boot_control_stub.h"
Yifan Hongdaac7322019-11-07 10:48:26 -080018#include "update_engine/common/dynamic_partition_control_stub.h"
David Zeuthen6eddf262015-10-16 15:23:53 -040019
20#include <base/logging.h>
21
22using std::string;
23
24namespace chromeos_update_engine {
25
Yifan Hongdaac7322019-11-07 10:48:26 -080026BootControlStub::BootControlStub()
27 : dynamic_partition_control_(new DynamicPartitionControlStub()) {}
28
David Zeuthen6eddf262015-10-16 15:23:53 -040029unsigned int BootControlStub::GetNumSlots() const {
30 return 0;
31}
32
33BootControlInterface::Slot BootControlStub::GetCurrentSlot() const {
34 LOG(ERROR) << __FUNCTION__ << " should never be called.";
35 return 0;
36}
37
Tianjie51a5a392020-06-03 14:39:32 -070038bool BootControlStub::GetPartitionDevice(const std::string& partition_name,
39 BootControlInterface::Slot slot,
40 bool not_in_payload,
41 std::string* device,
42 bool* is_dynamic) const {
43 LOG(ERROR) << __FUNCTION__ << " should never be called.";
44 return false;
45}
46
Kelvin Zhang91d95fa2020-11-05 13:52:00 -050047std::optional<PartitionDevice> BootControlStub::GetPartitionDevice(
48 const std::string& partition_name,
49 uint32_t slot,
50 uint32_t current_slot,
51 bool not_in_payload) const {
52 LOG(ERROR) << __FUNCTION__ << " should never be called.";
53 return {};
54}
55
David Zeuthen6eddf262015-10-16 15:23:53 -040056bool BootControlStub::GetPartitionDevice(const string& partition_name,
57 Slot slot,
58 string* device) const {
59 LOG(ERROR) << __FUNCTION__ << " should never be called.";
60 return false;
61}
62
63bool BootControlStub::IsSlotBootable(Slot slot) const {
64 LOG(ERROR) << __FUNCTION__ << " should never be called.";
65 return false;
66}
67
68bool BootControlStub::MarkSlotUnbootable(Slot slot) {
69 LOG(ERROR) << __FUNCTION__ << " should never be called.";
70 return false;
71}
72
73bool BootControlStub::SetActiveBootSlot(Slot slot) {
74 LOG(ERROR) << __FUNCTION__ << " should never be called.";
75 return false;
76}
77
78bool BootControlStub::MarkBootSuccessfulAsync(
79 base::Callback<void(bool)> callback) {
80 // This is expected to be called on update_engine startup.
81 return false;
82}
83
Yifan Hongf1415942020-02-24 18:34:49 -080084bool BootControlStub::IsSlotMarkedSuccessful(Slot slot) const {
85 LOG(ERROR) << __FUNCTION__ << " should never be called.";
86 return false;
87}
88
Yifan Hongdaac7322019-11-07 10:48:26 -080089DynamicPartitionControlInterface*
90BootControlStub::GetDynamicPartitionControl() {
91 return dynamic_partition_control_.get();
92}
93
David Zeuthen6eddf262015-10-16 15:23:53 -040094} // namespace chromeos_update_engine