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 --- install/install.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'install/install.cpp') diff --git a/install/install.cpp b/install/install.cpp index 09b88392a..9d67b0105 100644 --- a/install/install.cpp +++ b/install/install.cpp @@ -60,7 +60,8 @@ using namespace std::chrono_literals; static constexpr int kRecoveryApiVersion = 3; -// Assert the version defined in code and in Android.mk are consistent. +// We define RECOVERY_API_VERSION in Android.mk, which will be picked up by build system and packed +// into target_files.zip. Assert the version defined in code and in Android.mk are consistent. static_assert(kRecoveryApiVersion == RECOVERY_API_VERSION, "Mismatching recovery API versions."); // Default allocation of progress bar segments to operations @@ -621,6 +622,8 @@ InstallResult InstallPackage(Package* package, const std::string_view package_id InstallResult result; std::vector log_buffer; + ui->Print("Supported API: %d\n", kRecoveryApiVersion); + ui->Print("Finding update package...\n"); LOG(INFO) << "Update package id: " << package_id; if (!package) { -- cgit v1.2.3