Alex Deymo | b17327c | 2015-09-04 10:29:00 -0700 | [diff] [blame^] | 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/boot_control_android.h" |
| 18 | |
| 19 | #include <chromeos/make_unique_ptr.h> |
| 20 | |
| 21 | #include "update_engine/boot_control.h" |
| 22 | |
| 23 | using std::string; |
| 24 | |
| 25 | namespace chromeos_update_engine { |
| 26 | |
| 27 | namespace boot_control { |
| 28 | |
| 29 | // Factory defined in boot_control.h. |
| 30 | std::unique_ptr<BootControlInterface> CreateBootControl() { |
| 31 | return chromeos::make_unique_ptr(new BootControlAndroid()); |
| 32 | } |
| 33 | |
| 34 | } // namespace boot_control |
| 35 | |
| 36 | // TODO(deymo): Read the values from the libhardware HAL. |
| 37 | |
| 38 | unsigned int BootControlAndroid::GetNumSlots() const { |
| 39 | return 2; |
| 40 | } |
| 41 | |
| 42 | BootControlInterface::Slot BootControlAndroid::GetCurrentSlot() const { |
| 43 | return 0; |
| 44 | } |
| 45 | |
| 46 | bool BootControlAndroid::GetPartitionDevice(const string& partition_name, |
| 47 | unsigned int slot, |
| 48 | string* device) const { |
| 49 | return false; |
| 50 | } |
| 51 | |
| 52 | bool BootControlAndroid::IsSlotBootable(Slot slot) const { |
| 53 | return false; |
| 54 | } |
| 55 | |
| 56 | bool BootControlAndroid::MarkSlotUnbootable(Slot slot) { |
| 57 | return true; |
| 58 | } |
| 59 | |
| 60 | } // namespace chromeos_update_engine |