From ca6ce2c848eb343021a19e51d8384b1da0c2266b Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Thu, 13 Jul 2017 11:15:27 -0700 Subject: Fix the missing char when showing recovery logs. This is a regression when adding support for margin space in commit 171b4c4c. We're losing one char when showing long log lines. Because text_ is aware of kMarginWidth, but not the the added indent (TEXT_INDENT). Test: 'View recovery logs' on angler, with no missing character. Change-Id: I284d54681d603e85e69d8e9c25173b1437a704df --- screen_ui.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/screen_ui.cpp b/screen_ui.cpp index d9574d869..8f792f162 100644 --- a/screen_ui.cpp +++ b/screen_ui.cpp @@ -301,15 +301,15 @@ void ScreenRecoveryUI::draw_screen_locked() { gr_color(0, 0, 0, 255); gr_clear(); - static constexpr int TEXT_INDENT = 4; - int x = TEXT_INDENT + kMarginWidth; int y = kMarginHeight; if (show_menu) { - std::string recovery_fingerprint = - android::base::GetProperty("ro.bootimage.build.fingerprint", ""); + static constexpr int kMenuIndent = 4; + int x = kMarginWidth + kMenuIndent; SetColor(INFO); y += DrawTextLine(x, y, "Android Recovery", true); + std::string recovery_fingerprint = + android::base::GetProperty("ro.bootimage.build.fingerprint", ""); for (const auto& chunk : android::base::Split(recovery_fingerprint, ":")) { y += DrawTextLine(x, y, chunk.c_str(), false); } @@ -343,7 +343,7 @@ void ScreenRecoveryUI::draw_screen_locked() { size_t count = 0; for (int ty = gr_fb_height() - kMarginHeight - char_height_; ty >= y && count < text_rows_; ty -= char_height_, ++count) { - DrawTextLine(x, ty, text_[row], false); + DrawTextLine(kMarginWidth, ty, text_[row], false); --row; if (row < 0) row = text_rows_ - 1; } -- cgit v1.2.3 From 7af933b6a6fd687bd17710ef6fda0ad5483e4d6d Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 11 Jul 2017 16:45:04 -0700 Subject: Remove the obsolete reference to /file_contexts. This file no longer exists: - /file_contexts has been split into plat_file_contexts and nonplat_file_contexts since commit b236eb6ca204cefcb926e19bd5682f9dcad4021d (system/sepolicy). - It was named /file_contexts.bin prior to the split. '-S file_contexts' is also no longer required by e2fsdroid, since commit 2fff6fb036cbbb6dedd7da3d208b312a9038a5ce (external/e2fsprogs). It will load the file contexts via libselinux. Test: Trigger the path by performing a data wipe for converting to FBE. Change-Id: I179939da409e5c0415ae0ea0bf5ddb23f9e6331e --- roots.cpp | 4 +--- updater/install.cpp | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/roots.cpp b/roots.cpp index e98dfd448..c4afd5de3 100644 --- a/roots.cpp +++ b/roots.cpp @@ -260,8 +260,6 @@ int format_volume(const char* volume, const char* directory) { if (result == 0 && directory != nullptr) { const char* e2fsdroid_argv[] = { "/sbin/e2fsdroid_static", "-e", - "-S", - "/file_contexts", "-f", directory, "-a", @@ -270,7 +268,7 @@ int format_volume(const char* volume, const char* directory) { nullptr }; result = exec_cmd(e2fsdroid_argv[0], const_cast(e2fsdroid_argv)); - } + } } else { /* Has to be f2fs because we checked earlier. */ if (v->key_loc != NULL && strcmp(v->key_loc, "footer") == 0 && length < 0) { LOG(ERROR) << "format_volume: crypt footer + negative length (" << length diff --git a/updater/install.cpp b/updater/install.cpp index c9a3a0799..bfe91e7f9 100644 --- a/updater/install.cpp +++ b/updater/install.cpp @@ -322,8 +322,7 @@ Value* FormatFn(const char* name, State* state, const std::vector(e2fsdroid_argv)); if (status != 0) { -- cgit v1.2.3