blob: fa9defd15f12f79c666f3d8c8d8d3adbf24d089d [file] [log] [blame]
Alex Deymob17327c2015-09-04 10:29:00 -07001//
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
23using std::string;
24
25namespace chromeos_update_engine {
26
27namespace boot_control {
28
29// Factory defined in boot_control.h.
30std::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
38unsigned int BootControlAndroid::GetNumSlots() const {
39 return 2;
40}
41
42BootControlInterface::Slot BootControlAndroid::GetCurrentSlot() const {
43 return 0;
44}
45
46bool BootControlAndroid::GetPartitionDevice(const string& partition_name,
47 unsigned int slot,
48 string* device) const {
49 return false;
50}
51
52bool BootControlAndroid::IsSlotBootable(Slot slot) const {
53 return false;
54}
55
56bool BootControlAndroid::MarkSlotUnbootable(Slot slot) {
57 return true;
58}
59
60} // namespace chromeos_update_engine