hardware_android.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. #ifndef UPDATE_ENGINE_HARDWARE_ANDROID_H_
  17. #define UPDATE_ENGINE_HARDWARE_ANDROID_H_
  18. #include <string>
  19. #include <base/macros.h>
  20. #include <base/time/time.h>
  21. #include "update_engine/common/hardware.h"
  22. #include "update_engine/common/hardware_interface.h"
  23. namespace chromeos_update_engine {
  24. // Implements the real interface with the hardware in the Android platform.
  25. class HardwareAndroid final : public HardwareInterface {
  26. public:
  27. HardwareAndroid() = default;
  28. ~HardwareAndroid() override = default;
  29. // HardwareInterface methods.
  30. bool IsOfficialBuild() const override;
  31. bool IsNormalBootMode() const override;
  32. bool AreDevFeaturesEnabled() const override;
  33. bool IsOOBEEnabled() const override;
  34. bool IsOOBEComplete(base::Time* out_time_of_oobe) const override;
  35. std::string GetHardwareClass() const override;
  36. std::string GetFirmwareVersion() const override;
  37. std::string GetECVersion() const override;
  38. int GetMinKernelKeyVersion() const override;
  39. int GetMinFirmwareKeyVersion() const override;
  40. int GetMaxFirmwareKeyRollforward() const override;
  41. bool SetMaxFirmwareKeyRollforward(int firmware_max_rollforward) override;
  42. bool SetMaxKernelKeyRollforward(int kernel_max_rollforward) override;
  43. int GetPowerwashCount() const override;
  44. bool SchedulePowerwash(bool is_rollback) override;
  45. bool CancelPowerwash() override;
  46. bool GetNonVolatileDirectory(base::FilePath* path) const override;
  47. bool GetPowerwashSafeDirectory(base::FilePath* path) const override;
  48. int64_t GetBuildTimestamp() const override;
  49. bool GetFirstActiveOmahaPingSent() const override;
  50. bool SetFirstActiveOmahaPingSent() override;
  51. private:
  52. DISALLOW_COPY_AND_ASSIGN(HardwareAndroid);
  53. };
  54. } // namespace chromeos_update_engine
  55. #endif // UPDATE_ENGINE_HARDWARE_ANDROID_H_