blob: 907f670755b349f06ae4418bd7b04a0b23a9904b [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
David Zeuthen6eddf262015-10-16 15:23:53 -040047bool BootControlStub::GetPartitionDevice(const string& partition_name,
48 Slot slot,
49 string* device) const {
50 LOG(ERROR) << __FUNCTION__ << " should never be called.";
51 return false;
52}
53
54bool BootControlStub::IsSlotBootable(Slot slot) const {
55 LOG(ERROR) << __FUNCTION__ << " should never be called.";
56 return false;
57}
58
59bool BootControlStub::MarkSlotUnbootable(Slot slot) {
60 LOG(ERROR) << __FUNCTION__ << " should never be called.";
61 return false;
62}
63
64bool BootControlStub::SetActiveBootSlot(Slot slot) {
65 LOG(ERROR) << __FUNCTION__ << " should never be called.";
66 return false;
67}
68
69bool BootControlStub::MarkBootSuccessfulAsync(
70 base::Callback<void(bool)> callback) {
71 // This is expected to be called on update_engine startup.
72 return false;
73}
74
Yifan Hongf1415942020-02-24 18:34:49 -080075bool BootControlStub::IsSlotMarkedSuccessful(Slot slot) const {
76 LOG(ERROR) << __FUNCTION__ << " should never be called.";
77 return false;
78}
79
Yifan Hongdaac7322019-11-07 10:48:26 -080080DynamicPartitionControlInterface*
81BootControlStub::GetDynamicPartitionControl() {
82 return dynamic_partition_control_.get();
83}
84
David Zeuthen6eddf262015-10-16 15:23:53 -040085} // namespace chromeos_update_engine