blob: 5c76989da2ae129d7a6ca1f6d0944ee3f374e649 [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.";
52 *out_time_of_oobe = base::Time();
53 return true;
54}
55
56string HardwareAndroid::GetHardwareClass() const {
57 LOG(WARNING) << "STUB: GetHardwareClass().";
58 return "ANDROID";
59}
60
61string HardwareAndroid::GetFirmwareVersion() const {
62 LOG(WARNING) << "STUB: GetFirmwareVersion().";
63 return "0";
64}
65
66string HardwareAndroid::GetECVersion() const {
67 LOG(WARNING) << "STUB: GetECVersion().";
68 return "0";
69}
70
71int HardwareAndroid::GetPowerwashCount() const {
72 LOG(WARNING) << "STUB: Assuming no factory reset was performed.";
73 return 0;
74}
75
76} // namespace chromeos_update_engine