merge in nyc-release history after reset to nyc-dev
diff --git a/recovery.cpp b/recovery.cpp
index dbdc1fb..9873f97 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -75,6 +75,7 @@
{ "stages", required_argument, NULL, 'g' },
{ "shutdown_after", no_argument, NULL, 'p' },
{ "reason", required_argument, NULL, 'r' },
+ { "security", no_argument, NULL, 'e'},
{ NULL, 0, NULL, 0 },
};
@@ -1344,6 +1345,7 @@
bool just_exit = false;
bool shutdown_after = false;
int retry_count = 0;
+ bool security_update = false;
int arg;
while ((arg = getopt_long(argc, argv, "", OPTIONS, NULL)) != -1) {
@@ -1368,6 +1370,7 @@
}
case 'p': shutdown_after = true; break;
case 'r': reason = optarg; break;
+ case 'e': security_update = true; break;
case '?':
LOGE("Invalid command argument\n");
continue;
@@ -1387,6 +1390,9 @@
ui->SetLocale(locale);
ui->Init();
+ // Set background string to "installing security update" for security update,
+ // otherwise set it to "installing system update".
+ ui->SetSystemUpdateText(security_update);
int st_cur, st_max;
if (stage != NULL && sscanf(stage, "%d/%d", &st_cur, &st_max) == 2) {
@@ -1442,6 +1448,10 @@
int status = INSTALL_SUCCESS;
if (update_package != NULL) {
+ // It's not entirely true that we will modify the flash. But we want
+ // to log the update attempt since update_package is non-NULL.
+ modified_flash = true;
+
if (!is_battery_ok()) {
ui->Print("battery capacity is not enough for installing package, needed is %d%%\n",
BATTERY_OK_PERCENTAGE);
diff --git a/res-560dpi b/res-560dpi
index 8576a9b..1db3a2e 120000
--- a/res-560dpi
+++ b/res-560dpi
@@ -1 +1 @@
-res-xxhdpi
\ No newline at end of file
+res-xxxhdpi
\ No newline at end of file
diff --git a/screen_ui.cpp b/screen_ui.cpp
index ccff5ba..85f789f 100644
--- a/screen_ui.cpp
+++ b/screen_ui.cpp
@@ -425,6 +425,16 @@
return result;
}
+// Choose the right background string to display during update.
+void ScreenRecoveryUI::SetSystemUpdateText(bool security_update) {
+ if (security_update) {
+ LoadLocalizedBitmap("installing_security_text", &installing_text);
+ } else {
+ LoadLocalizedBitmap("installing_text", &installing_text);
+ }
+ Redraw();
+}
+
void ScreenRecoveryUI::Init() {
gr_init();
@@ -450,7 +460,10 @@
LoadBitmap("stage_empty", &stageMarkerEmpty);
LoadBitmap("stage_fill", &stageMarkerFill);
- LoadLocalizedBitmap("installing_text", &installing_text);
+ // Background text for "installing_update" could be "installing update"
+ // or "installing security update". It will be set after UI init according
+ // to commands in BCB.
+ installing_text = nullptr;
LoadLocalizedBitmap("erasing_text", &erasing_text);
LoadLocalizedBitmap("no_command_text", &no_command_text);
LoadLocalizedBitmap("error_text", &error_text);
diff --git a/screen_ui.h b/screen_ui.h
index d8ac85b..4319b76 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -34,6 +34,7 @@
// overall recovery state ("background image")
void SetBackground(Icon icon);
+ void SetSystemUpdateText(bool security_update);
// progress indicator
void SetProgressType(ProgressType type);
diff --git a/tests/component/verifier_test.cpp b/tests/component/verifier_test.cpp
index 9ac9657..780ff28 100644
--- a/tests/component/verifier_test.cpp
+++ b/tests/component/verifier_test.cpp
@@ -46,6 +46,7 @@
void SetStage(int, int) { }
void SetLocale(const char*) { }
void SetBackground(Icon icon) { }
+ void SetSystemUpdateText(bool security_update) { }
void SetProgressType(ProgressType determinate) { }
void ShowProgress(float portion, float seconds) { }
diff --git a/ui.h b/ui.h
index ca72911..82d95a3 100644
--- a/ui.h
+++ b/ui.h
@@ -39,6 +39,7 @@
// Set the overall recovery state ("background image").
enum Icon { NONE, INSTALLING_UPDATE, ERASING, NO_COMMAND, ERROR };
virtual void SetBackground(Icon icon) = 0;
+ virtual void SetSystemUpdateText(bool security_update) = 0;
// --- progress indicator ---
enum ProgressType { EMPTY, INDETERMINATE, DETERMINATE };