From 164c60a4f3de934bab7035114546e9500cd8f232 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Wed, 15 May 2019 13:59:39 -0700 Subject: Clean up some global variables in common.h Some global variables are only used for recovery.cpp and recovery_main.cpp, remove them from common.h and handle their usage accordingly. Variables include: static constexpr int kRecoveryApiVersion; extern struct selabel_handle* sehandle; extern RecoveryUI* ui; extern bool has_cache; bool is_ro_debuggable(); Test: unit tests pass, boot into recovery mode and run graphic tests Change-Id: If83a005786c9b38412731da97aaf85af69a3b917 --- otautil/include/otautil/logging.h | 2 +- otautil/include/otautil/roots.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'otautil/include') diff --git a/otautil/include/otautil/logging.h b/otautil/include/otautil/logging.h index 608349785..4462eca6e 100644 --- a/otautil/include/otautil/logging.h +++ b/otautil/include/otautil/logging.h @@ -53,7 +53,7 @@ void rotate_logs(const char* last_log_file, const char* last_kmsg_file); void check_and_fclose(FILE* fp, const std::string& name); void copy_log_file_to_pmsg(const std::string& source, const std::string& destination); -void copy_logs(bool save_current_log, bool has_cache, const selabel_handle* sehandle); +void copy_logs(bool save_current_log); void reset_tmplog_offset(); void save_kernel_log(const char* destination); diff --git a/otautil/include/otautil/roots.h b/otautil/include/otautil/roots.h index 2ab3f4549..92ee756f0 100644 --- a/otautil/include/otautil/roots.h +++ b/otautil/include/otautil/roots.h @@ -53,3 +53,6 @@ int format_volume(const std::string& volume, const std::string& directory); // Ensure that all and only the volumes that packages expect to find // mounted (/tmp and /cache) are mounted. Returns 0 on success. int setup_install_mounts(); + +// Returns true if there is /cache in the volumes. +bool HasCache(); -- cgit v1.2.3