summaryrefslogtreecommitdiffstats
path: root/recovery.cpp
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2012-08-23 22:16:12 +0200
committerDoug Zongker <dougz@google.com>2012-08-23 22:19:02 +0200
commit4f33e55d1c38d2f72f3306a82c177850f3676408 (patch)
tree26f0cfb8893bf21faaf3ec6ad1670159a01d454b /recovery.cpp
parentadd simple text to recovery UI (diff)
downloadandroid_bootable_recovery-4f33e55d1c38d2f72f3306a82c177850f3676408.tar
android_bootable_recovery-4f33e55d1c38d2f72f3306a82c177850f3676408.tar.gz
android_bootable_recovery-4f33e55d1c38d2f72f3306a82c177850f3676408.tar.bz2
android_bootable_recovery-4f33e55d1c38d2f72f3306a82c177850f3676408.tar.lz
android_bootable_recovery-4f33e55d1c38d2f72f3306a82c177850f3676408.tar.xz
android_bootable_recovery-4f33e55d1c38d2f72f3306a82c177850f3676408.tar.zst
android_bootable_recovery-4f33e55d1c38d2f72f3306a82c177850f3676408.zip
Diffstat (limited to 'recovery.cpp')
-rw-r--r--recovery.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/recovery.cpp b/recovery.cpp
index e374c7d5a..70817d307 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -277,6 +277,18 @@ finish_recovery(const char *send_intent) {
}
}
+ // Save the locale to cache, so if recovery is next started up
+ // without a --locale argument (eg, directly from the bootloader)
+ // it will use the last-known locale.
+ if (locale != NULL) {
+ LOGI("Saving locale \"%s\"\n", locale);
+ FILE* fp = fopen_path(LOCALE_FILE, "w");
+ fwrite(locale, 1, strlen(locale), fp);
+ fflush(fp);
+ fsync(fileno(fp));
+ check_and_fclose(fp, LOCALE_FILE);
+ }
+
// Copy logs to cache so the system can find out what happened.
copy_log_file(TEMPORARY_LOG_FILE, LOG_FILE, true);
copy_log_file(TEMPORARY_LOG_FILE, LAST_LOG_FILE, false);
@@ -286,15 +298,6 @@ finish_recovery(const char *send_intent) {
chmod(LAST_LOG_FILE, 0640);
chmod(LAST_INSTALL_FILE, 0644);
- // Save the locale to cache, so if recovery is next started up
- // without a --locale argument (eg, directly from the bootloader)
- // it will use the last-known locale.
- if (locale != NULL) {
- FILE* fp = fopen(LOCALE_FILE, "w");
- fwrite(locale, 1, strlen(locale), fp);
- fclose(fp);
- }
-
// Reset to normal system boot so recovery won't cycle indefinitely.
struct bootloader_message boot;
memset(&boot, 0, sizeof(boot));