blob: 73fef9938869861c63e6da9dd52e6925bb41c802 [file] [log] [blame]
Alex Deymo40d86b22015-09-03 22:27:10 -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/hardware_android.h"
18
19#include <chromeos/make_unique_ptr.h>
20
21#include "update_engine/hardware.h"
22
23using std::string;
24
25namespace chromeos_update_engine {
26
27namespace hardware {
28
29// Factory defined in hardware.h.
30std::unique_ptr<HardwareInterface> CreateHardware() {
31 return chromeos::make_unique_ptr(new HardwareAndroid());
32}
33
34} // namespace hardware
35
36bool HardwareAndroid::IsOfficialBuild() const {
37 // TODO(deymo): Read the kind of build we are running from the metadata
38 // partition.
39 LOG(WARNING) << "STUB: Assuming we are not an official build.";
40 return false;
41}
42
43bool HardwareAndroid::IsNormalBootMode() const {
44 // TODO(deymo): Read the kind of build we are running from the metadata
45 // partition.
46 LOG(WARNING) << "STUB: Assuming we are in dev-mode.";
47 return false;
48}
49
50bool HardwareAndroid::IsOOBEComplete(base::Time* out_time_of_oobe) const {
51 LOG(WARNING) << "STUB: Assuming OOBE is complete.";
Alex Deymo4d2990d2015-09-15 12:11:26 -070052 if (out_time_of_oobe)
53 *out_time_of_oobe = base::Time();
Alex Deymo40d86b22015-09-03 22:27:10 -070054 return true;
55}
56
57string HardwareAndroid::GetHardwareClass() const {
58 LOG(WARNING) << "STUB: GetHardwareClass().";
59 return "ANDROID";
60}
61
62string HardwareAndroid::GetFirmwareVersion() const {
63 LOG(WARNING) << "STUB: GetFirmwareVersion().";
64 return "0";
65}
66
67string HardwareAndroid::GetECVersion() const {
68 LOG(WARNING) << "STUB: GetECVersion().";
69 return "0";
70}
71
72int HardwareAndroid::GetPowerwashCount() const {
73 LOG(WARNING) << "STUB: Assuming no factory reset was performed.";
74 return 0;
75}
76
77} // namespace chromeos_update_engine