From 26dbad2b984e69f6c938ac3e82267d0ded0df8fd Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Wed, 28 Jan 2015 12:09:05 -0800 Subject: Add missing includes. Change-Id: I0737456e0221ebe9cc854d65c95a7d37d0869d56 --- install.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'install.cpp') diff --git a/install.cpp b/install.cpp index 9db5640a0..31606bb1a 100644 --- a/install.cpp +++ b/install.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From 145d86146084b199e64c3b2db21a22c05aa30098 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 25 Mar 2015 15:51:15 -0700 Subject: Factor out option variables from int to bool types Change-Id: Ia897aa43e44d115bde6de91789b35723826ace22 --- install.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'install.cpp') diff --git a/install.cpp b/install.cpp index 31606bb1a..63b1d38c3 100644 --- a/install.cpp +++ b/install.cpp @@ -48,7 +48,7 @@ static const float DEFAULT_IMAGE_PROGRESS_FRACTION = 0.1; // If the package contains an update binary, extract it and run it. static int -try_update_binary(const char *path, ZipArchive *zip, int* wipe_cache) { +try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache) { const ZipEntry* binary_entry = mzFindZipEntry(zip, ASSUMED_UPDATE_BINARY_NAME); if (binary_entry == NULL) { @@ -129,7 +129,7 @@ try_update_binary(const char *path, ZipArchive *zip, int* wipe_cache) { } close(pipefd[1]); - *wipe_cache = 0; + *wipe_cache = false; char buffer[1024]; FILE* from_child = fdopen(pipefd[0], "r"); @@ -158,7 +158,7 @@ try_update_binary(const char *path, ZipArchive *zip, int* wipe_cache) { } fflush(stdout); } else if (strcmp(command, "wipe_cache") == 0) { - *wipe_cache = 1; + *wipe_cache = true; } else if (strcmp(command, "clear_display") == 0) { ui->SetBackground(RecoveryUI::NONE); } else if (strcmp(command, "enable_reboot") == 0) { @@ -183,7 +183,7 @@ try_update_binary(const char *path, ZipArchive *zip, int* wipe_cache) { } static int -really_install_package(const char *path, int* wipe_cache, bool needs_mount) +really_install_package(const char *path, bool* wipe_cache, bool needs_mount) { ui->SetBackground(RecoveryUI::INSTALLING_UPDATE); ui->Print("Finding update package...\n"); @@ -253,7 +253,7 @@ really_install_package(const char *path, int* wipe_cache, bool needs_mount) } int -install_package(const char* path, int* wipe_cache, const char* install_file, +install_package(const char* path, bool* wipe_cache, const char* install_file, bool needs_mount) { FILE* install_log = fopen_path(install_file, "w"); -- cgit v1.2.3 From 682c34bbc32f3a9f007dd949282651ed35d4f6e3 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 7 Apr 2015 17:16:35 -0700 Subject: Rotate logs only when there are actual operations Currently it rotates the log files every time it boots into the recovery mode. We lose useful logs after ten times. This CL changes the rotation condition so that it will rotate only if it performs some actual operations that modify the flash (installs, wipes, sideloads and etc). Bug: 19695622 Change-Id: Ie708ad955ef31aa500b6590c65faa72391705940 --- install.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'install.cpp') diff --git a/install.cpp b/install.cpp index 63b1d38c3..662f81c76 100644 --- a/install.cpp +++ b/install.cpp @@ -256,6 +256,8 @@ int install_package(const char* path, bool* wipe_cache, const char* install_file, bool needs_mount) { + modified_flash = true; + FILE* install_log = fopen_path(install_file, "w"); if (install_log) { fputs(path, install_log); -- cgit v1.2.3 From b07e1f3a3a5dbe3b2e733681080b6c692164a632 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 10 Apr 2015 16:14:52 -0700 Subject: Update the comments for package installer commands These commands are for the communication between the installer and the update binary (edify interpreter). Update the comments in sync with the codes. Change-Id: I7390f022b1447049a974b0b45697ef1d2e71d4e0 --- install.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'install.cpp') diff --git a/install.cpp b/install.cpp index 662f81c76..c7d382f3e 100644 --- a/install.cpp +++ b/install.cpp @@ -88,7 +88,7 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache) { // fill up the next part of of the progress bar // over seconds. If is zero, use // set_progress commands to manually control the - // progress of this segment of the bar + // progress of this segment of the bar. // // set_progress // should be between 0.0 and 1.0; sets the @@ -107,6 +107,18 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache) { // ui_print // display on the screen. // + // wipe_cache + // a wipe of cache will be performed following a successful + // installation. + // + // clear_display + // turn off the text display. + // + // enable_reboot + // packages can explicitly request that they want the user + // to be able to reboot during installation (useful for + // debugging packages that don't exit). + // // - the name of the package zip file. // -- cgit v1.2.3