Alex Deymo | 40d86b2 | 2015-09-03 22:27:10 -0700 | [diff] [blame] | 1 | // |
| 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 Deymo | 1b03f9f | 2015-12-09 00:38:36 -0800 | [diff] [blame] | 17 | #ifndef UPDATE_ENGINE_HARDWARE_ANDROID_H_ |
| 18 | #define UPDATE_ENGINE_HARDWARE_ANDROID_H_ |
Alex Deymo | 40d86b2 | 2015-09-03 22:27:10 -0700 | [diff] [blame] | 19 | |
| 20 | #include <string> |
| 21 | |
| 22 | #include <base/macros.h> |
| 23 | #include <base/time/time.h> |
| 24 | |
Alex Deymo | 39910dc | 2015-11-09 17:04:30 -0800 | [diff] [blame] | 25 | #include "update_engine/common/hardware.h" |
| 26 | #include "update_engine/common/hardware_interface.h" |
Alex Deymo | 40d86b2 | 2015-09-03 22:27:10 -0700 | [diff] [blame] | 27 | |
| 28 | namespace chromeos_update_engine { |
| 29 | |
| 30 | // Implements the real interface with the hardware in the Android platform. |
| 31 | class 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; |
Sen Jiang | e67bb5b | 2016-06-20 15:53:56 -0700 | [diff] [blame] | 39 | bool AreDevFeaturesEnabled() const override; |
Alex Deymo | 46a9aae | 2016-05-04 20:20:11 -0700 | [diff] [blame] | 40 | bool IsOOBEEnabled() const override; |
Alex Deymo | 40d86b2 | 2015-09-03 22:27:10 -0700 | [diff] [blame] | 41 | bool IsOOBEComplete(base::Time* out_time_of_oobe) const override; |
| 42 | std::string GetHardwareClass() const override; |
| 43 | std::string GetFirmwareVersion() const override; |
| 44 | std::string GetECVersion() const override; |
Zentaro Kavanagh | baacb98 | 2018-02-20 17:48:39 -0800 | [diff] [blame] | 45 | int GetMinKernelKeyVersion() const override; |
Marton Hunyady | 99ced78 | 2018-05-08 12:59:50 +0200 | [diff] [blame] | 46 | int GetMinFirmwareKeyVersion() const override; |
Zentaro Kavanagh | 5d95615 | 2018-05-15 09:40:33 -0700 | [diff] [blame^] | 47 | bool SetMaxKernelKeyRollforward(int kernel_max_rollforward) override; |
Alex Deymo | 40d86b2 | 2015-09-03 22:27:10 -0700 | [diff] [blame] | 48 | int GetPowerwashCount() const override; |
Alex Deymo | fb905d9 | 2016-06-03 19:26:58 -0700 | [diff] [blame] | 49 | bool SchedulePowerwash() override; |
| 50 | bool CancelPowerwash() override; |
Alex Deymo | dd132f3 | 2015-09-14 19:12:07 -0700 | [diff] [blame] | 51 | bool GetNonVolatileDirectory(base::FilePath* path) const override; |
| 52 | bool GetPowerwashSafeDirectory(base::FilePath* path) const override; |
Amin Hassani | 1677e81 | 2017-06-21 13:36:36 -0700 | [diff] [blame] | 53 | bool GetFirstActiveOmahaPingSent() const override; |
| 54 | void SetFirstActiveOmahaPingSent() override; |
Alex Deymo | 40d86b2 | 2015-09-03 22:27:10 -0700 | [diff] [blame] | 55 | |
| 56 | private: |
| 57 | DISALLOW_COPY_AND_ASSIGN(HardwareAndroid); |
| 58 | }; |
| 59 | |
| 60 | } // namespace chromeos_update_engine |
| 61 | |
Alex Deymo | 1b03f9f | 2015-12-09 00:38:36 -0800 | [diff] [blame] | 62 | #endif // UPDATE_ENGINE_HARDWARE_ANDROID_H_ |