blob: 1b036614db93c6ff514e4d86f4a6bffededadfe6 [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
Alex Deymo1b03f9f2015-12-09 00:38:36 -080017#ifndef UPDATE_ENGINE_HARDWARE_ANDROID_H_
18#define UPDATE_ENGINE_HARDWARE_ANDROID_H_
Alex Deymo40d86b22015-09-03 22:27:10 -070019
20#include <string>
21
22#include <base/macros.h>
23#include <base/time/time.h>
24
Alex Deymo39910dc2015-11-09 17:04:30 -080025#include "update_engine/common/hardware.h"
26#include "update_engine/common/hardware_interface.h"
Alex Deymo40d86b22015-09-03 22:27:10 -070027
28namespace chromeos_update_engine {
29
30// Implements the real interface with the hardware in the Android platform.
31class HardwareAndroid final : public HardwareInterface {
32 public:
33 HardwareAndroid() = default;
34 ~HardwareAndroid() override = default;
35
36 // HardwareInterface methods.
37 bool IsOfficialBuild() const override;
38 bool IsNormalBootMode() const override;
39 bool IsOOBEComplete(base::Time* out_time_of_oobe) const override;
40 std::string GetHardwareClass() const override;
41 std::string GetFirmwareVersion() const override;
42 std::string GetECVersion() const override;
43 int GetPowerwashCount() const override;
Alex Deymodd132f32015-09-14 19:12:07 -070044 bool GetNonVolatileDirectory(base::FilePath* path) const override;
45 bool GetPowerwashSafeDirectory(base::FilePath* path) const override;
Alex Deymo40d86b22015-09-03 22:27:10 -070046
47 private:
48 DISALLOW_COPY_AND_ASSIGN(HardwareAndroid);
49};
50
51} // namespace chromeos_update_engine
52
Alex Deymo1b03f9f2015-12-09 00:38:36 -080053#endif // UPDATE_ENGINE_HARDWARE_ANDROID_H_