No Description

common.h 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (C) 2007 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 RECOVERY_COMMON_H
  17. #define RECOVERY_COMMON_H
  18. #include <stdio.h>
  19. #include <stdarg.h>
  20. #include <string>
  21. // Not using the command-line defined macro here because this header could be included by
  22. // device-specific recovery libraries. We static assert the value consistency in recovery.cpp.
  23. static constexpr int kRecoveryApiVersion = 3;
  24. // Minimum valid seconds since epoch (2017-01-01 00:00:00)
  25. #define TV_MIN 1483228800
  26. class RecoveryUI;
  27. extern RecoveryUI* ui;
  28. extern bool modified_flash;
  29. // The current stage, e.g. "1/2".
  30. extern std::string stage;
  31. // The reason argument provided in "--reason=".
  32. extern const char* reason;
  33. // fopen a file, mounting volumes and making parent dirs as necessary.
  34. FILE* fopen_path(const char *path, const char *mode);
  35. void ui_print(const char* format, ...);
  36. bool is_ro_debuggable();
  37. bool reboot(const std::string& command);
  38. #endif // RECOVERY_COMMON_H