1 // 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 17 #include "update_engine/common/boot_control_stub.h" 18 #include "update_engine/common/dynamic_partition_control_stub.h" 19 20 #include <base/logging.h> 21 22 using std::string; 23 24 namespace chromeos_update_engine { 25 BootControlStub()26BootControlStub::BootControlStub() 27 : dynamic_partition_control_(new DynamicPartitionControlStub()) {} 28 GetNumSlots() const29unsigned int BootControlStub::GetNumSlots() const { 30 return 0; 31 } 32 GetCurrentSlot() const33BootControlInterface::Slot BootControlStub::GetCurrentSlot() const { 34 LOG(ERROR) << __FUNCTION__ << " should never be called."; 35 return 0; 36 } 37 GetPartitionDevice(const string & partition_name,Slot slot,string * device) const38bool 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 IsSlotBootable(Slot slot) const45bool BootControlStub::IsSlotBootable(Slot slot) const { 46 LOG(ERROR) << __FUNCTION__ << " should never be called."; 47 return false; 48 } 49 MarkSlotUnbootable(Slot slot)50bool BootControlStub::MarkSlotUnbootable(Slot slot) { 51 LOG(ERROR) << __FUNCTION__ << " should never be called."; 52 return false; 53 } 54 SetActiveBootSlot(Slot slot)55bool BootControlStub::SetActiveBootSlot(Slot slot) { 56 LOG(ERROR) << __FUNCTION__ << " should never be called."; 57 return false; 58 } 59 MarkBootSuccessfulAsync(base::Callback<void (bool)> callback)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 IsSlotMarkedSuccessful(Slot slot) const66bool BootControlStub::IsSlotMarkedSuccessful(Slot slot) const { 67 LOG(ERROR) << __FUNCTION__ << " should never be called."; 68 return false; 69 } 70 71 DynamicPartitionControlInterface* GetDynamicPartitionControl()72BootControlStub::GetDynamicPartitionControl() { 73 return dynamic_partition_control_.get(); 74 } 75 76 } // namespace chromeos_update_engine 77