blob: 0e0205c4f8241c511fe81ac1810926740cfe533b [file] [log] [blame]
Alex Deymoaea4c1c2015-08-19 20:24:43 -07001//
2// Copyright (C) 2013 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//
Alex Deymo42432912013-07-12 20:21:15 -070016
Gilad Arnoldcf175a02014-07-10 16:48:47 -070017#ifndef UPDATE_ENGINE_HARDWARE_H_
18#define UPDATE_ENGINE_HARDWARE_H_
Alex Deymo42432912013-07-12 20:21:15 -070019
Alex Deymodf632d12014-04-29 20:04:36 -070020#include <string>
21#include <vector>
Alex Deymo42432912013-07-12 20:21:15 -070022
Ben Chan05735a12014-09-03 07:48:22 -070023#include <base/macros.h>
Alex Deymodf632d12014-04-29 20:04:36 -070024
25#include "update_engine/hardware_interface.h"
Alex Deymo42432912013-07-12 20:21:15 -070026
27namespace chromeos_update_engine {
28
29// Implements the real interface with the hardware.
30class Hardware : public HardwareInterface {
31 public:
Chris Masonef8d037f2014-02-19 01:53:00 +000032 Hardware();
Alex Vakulenko157fe302014-08-11 15:59:58 -070033 ~Hardware() override;
Alex Deymo42432912013-07-12 20:21:15 -070034
35 // HardwareInterface methods.
Alex Vakulenko157fe302014-08-11 15:59:58 -070036 std::string BootKernelDevice() const override;
37 std::string BootDevice() const override;
38 bool IsBootDeviceRemovable() const override;
39 std::vector<std::string> GetKernelDevices() const override;
40 bool IsKernelBootable(const std::string& kernel_device,
41 bool* bootable) const override;
42 bool MarkKernelUnbootable(const std::string& kernel_device) override;
43 bool IsOfficialBuild() const override;
44 bool IsNormalBootMode() const override;
45 bool IsOOBEComplete(base::Time* out_time_of_oobe) const override;
46 std::string GetHardwareClass() const override;
47 std::string GetFirmwareVersion() const override;
48 std::string GetECVersion() const override;
Alex Deymoebbe7ef2014-10-30 13:02:49 -070049 int GetPowerwashCount() const override;
Alex Deymo42432912013-07-12 20:21:15 -070050
51 private:
52 DISALLOW_COPY_AND_ASSIGN(Hardware);
53};
54
55} // namespace chromeos_update_engine
56
Gilad Arnoldcf175a02014-07-10 16:48:47 -070057#endif // UPDATE_ENGINE_HARDWARE_H_