aboutsummaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/install.cpp b/install.cpp
index 8ddae4f2..688ec698 100644
--- a/install.cpp
+++ b/install.cpp
@@ -34,6 +34,8 @@
#include "verifier.h"
#include "ui.h"
+#include "cutils/properties.h"
+
extern RecoveryUI* ui;
#define ASSUMED_UPDATE_BINARY_NAME "META-INF/com/google/android/update-binary"
@@ -184,6 +186,8 @@ 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)
{
+ int ret = 0;
+
ui->SetBackground(RecoveryUI::INSTALLING_UPDATE);
ui->Print("Finding update package...\n");
// Give verification half the progress bar...
@@ -237,6 +241,8 @@ really_install_package(const char *path, int* wipe_cache, bool needs_mount)
}
LOGI("%d key(s) loaded from %s\n", numKeys, PUBLIC_KEYS_FILE);
+ set_perf_mode(true);
+
ui->Print("Verifying update package...\n");
int err;
@@ -246,7 +252,8 @@ really_install_package(const char *path, int* wipe_cache, bool needs_mount)
if (err != VERIFY_SUCCESS) {
LOGE("signature verification failed\n");
sysReleaseMap(&map);
- return INSTALL_CORRUPT;
+ ret = INSTALL_CORRUPT;
+ goto out;
}
/* Try to open the package.
@@ -256,20 +263,23 @@ really_install_package(const char *path, int* wipe_cache, bool needs_mount)
if (err != 0) {
LOGE("Can't open %s\n(%s)\n", path, err != -1 ? strerror(err) : "bad");
sysReleaseMap(&map);
- return INSTALL_CORRUPT;
+ ret = INSTALL_CORRUPT;
+ goto out;
}
/* Verify and install the contents of the package.
*/
ui->Print("Installing update...\n");
ui->SetEnableReboot(false);
- int result = try_update_binary(path, &zip, wipe_cache);
+ ret = try_update_binary(path, &zip, wipe_cache);
ui->SetEnableReboot(true);
ui->Print("\n");
sysReleaseMap(&map);
- return result;
+out:
+ set_perf_mode(false);
+ return ret;
}
int
@@ -297,3 +307,8 @@ install_package(const char* path, int* wipe_cache, const char* install_file,
}
return result;
}
+
+void
+set_perf_mode(bool enable) {
+ property_set("recovery.perf.mode", enable ? "1" : "0");
+}