blob: d198e9d42598e276d759427790b4414c0eeffdb5 [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
38bool BootControlStub::GetPartitionDevice(const string& partition_name,
39 Slot slot,
40 string* device) const {
41 LOG(ERROR) << __FUNCTION__ << " should never be called.";
42 return false;
43}
44
45bool BootControlStub::IsSlotBootable(Slot slot) const {
46 LOG(ERROR) << __FUNCTION__ << " should never be called.";
47 return false;
48}
49
50bool BootControlStub::MarkSlotUnbootable(Slot slot) {
51 LOG(ERROR) << __FUNCTION__ << " should never be called.";
52 return false;
53}
54
55bool BootControlStub::SetActiveBootSlot(Slot slot) {
56 LOG(ERROR) << __FUNCTION__ << " should never be called.";
57 return false;
58}
59
60bool BootControlStub::MarkBootSuccessfulAsync(
61 base::Callback<void(bool)> callback) {
62 // This is expected to be called on update_engine startup.
63 return false;
64}
65
Yifan Hongdaac7322019-11-07 10:48:26 -080066DynamicPartitionControlInterface*
67BootControlStub::GetDynamicPartitionControl() {
68 return dynamic_partition_control_.get();
69}
70
David Zeuthen6eddf262015-10-16 15:23:53 -040071} // namespace chromeos_update_engine