Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15318104 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

release-request-edd71ba9-6f93-47be-957d-774c9d43a2dc-for-git_oc-mr1-release-42...

release-request-edd71ba9-6f93-47be-957d-774c9d43a2dc-for-git_oc-mr1-release-4281935 snap-temp-L68100000094184972

Change-Id: If1a171a633ee60692c15ca81d99737148401521f
parents 52f0e206 2cf6fe2c
Loading
Loading
Loading
Loading
+5 −4
Original line number Original line Diff line number Diff line
@@ -758,12 +758,13 @@ static bool wipe_data(Device* device) {
}
}


static bool prompt_and_wipe_data(Device* device) {
static bool prompt_and_wipe_data(Device* device) {
  // Use a single string and let ScreenRecoveryUI handles the wrapping.
  const char* const headers[] = {
  const char* const headers[] = {
    "Can't load Android system. Your data may be corrupt.",
    "Can't load Android system. Your data may be corrupt. "
    "If you continue to get this message, you may need to",
    "If you continue to get this message, you may need to "
    "perform a factory data reset and erase all user data",
    "perform a factory data reset and erase all user data "
    "stored on this device.",
    "stored on this device.",
    NULL
    nullptr
  };
  };
  const char* const items[] = {
  const char* const items[] = {
    "Try again",
    "Try again",
+30 −1
Original line number Original line Diff line number Diff line
@@ -278,6 +278,34 @@ int ScreenRecoveryUI::DrawTextLines(int x, int y, const char* const* lines) cons
  return offset;
  return offset;
}
}


int ScreenRecoveryUI::DrawWrappedTextLines(int x, int y, const char* const* lines) const {
  int offset = 0;
  for (size_t i = 0; lines != nullptr && lines[i] != nullptr; ++i) {
    // The line will be wrapped if it exceeds text_cols_.
    std::string line(lines[i]);
    size_t next_start = 0;
    while (next_start < line.size()) {
      std::string sub = line.substr(next_start, text_cols_ + 1);
      if (sub.size() <= text_cols_) {
        next_start += sub.size();
      } else {
        // Line too long and must be wrapped to text_cols_ columns.
        size_t last_space = sub.find_last_of(" \t\n");
        if (last_space == std::string::npos) {
          // No space found, just draw as much as we can
          sub.resize(text_cols_);
          next_start += text_cols_;
        } else {
          sub.resize(last_space);
          next_start += last_space + 1;
        }
      }
      offset += DrawTextLine(x, y + offset, sub.c_str(), false);
    }
  }
  return offset;
}

static const char* REGULAR_HELP[] = {
static const char* REGULAR_HELP[] = {
  "Use volume up/down and power.",
  "Use volume up/down and power.",
  NULL
  NULL
@@ -316,7 +344,8 @@ void ScreenRecoveryUI::draw_screen_locked() {
    y += DrawTextLines(x, y, HasThreeButtons() ? REGULAR_HELP : LONG_PRESS_HELP);
    y += DrawTextLines(x, y, HasThreeButtons() ? REGULAR_HELP : LONG_PRESS_HELP);


    SetColor(HEADER);
    SetColor(HEADER);
    y += DrawTextLines(x, y, menu_headers_);
    // Ignore kMenuIndent, which is not taken into account by text_cols_.
    y += DrawWrappedTextLines(kMarginWidth, y, menu_headers_);


    SetColor(MENU);
    SetColor(MENU);
    y += DrawHorizontalRule(y) + 4;
    y += DrawHorizontalRule(y) + 4;
+3 −0
Original line number Original line Diff line number Diff line
@@ -187,6 +187,9 @@ class ScreenRecoveryUI : public RecoveryUI {
  virtual int DrawTextLine(int x, int y, const char* line, bool bold) const;
  virtual int DrawTextLine(int x, int y, const char* line, bool bold) const;
  // Draws multiple text lines. Returns the offset it should be moving along Y-axis.
  // Draws multiple text lines. Returns the offset it should be moving along Y-axis.
  int DrawTextLines(int x, int y, const char* const* lines) const;
  int DrawTextLines(int x, int y, const char* const* lines) const;
  // Similar to DrawTextLines() to draw multiple text lines, but additionally wraps long lines.
  // Returns the offset it should be moving along Y-axis.
  int DrawWrappedTextLines(int x, int y, const char* const* lines) const;
};
};


#endif  // RECOVERY_UI_H
#endif  // RECOVERY_UI_H
+9 −0
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="recovery_installing" msgid="2013591905463558223">"Installing system update"</string>
    <string name="recovery_erasing" msgid="7334826894904037088">"Erasing"</string>
    <string name="recovery_no_command" msgid="4465476568623024327">"No command"</string>
    <string name="recovery_error" msgid="5748178989622716736">"Error!"</string>
    <string name="recovery_installing_security" msgid="9184031299717114342">"Installing security update"</string>
</resources>
+2 −2
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android"
<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="recovery_installing" msgid="2013591905463558223">"सिस्टम अद्यतन स्थापित करत आहे"</string>
    <string name="recovery_installing" msgid="2013591905463558223">"सिस्टम अपडेट इंस्टॉल करत आहे"</string>
    <string name="recovery_erasing" msgid="7334826894904037088">"मिटवत आहे"</string>
    <string name="recovery_erasing" msgid="7334826894904037088">"मिटवत आहे"</string>
    <string name="recovery_no_command" msgid="4465476568623024327">"कोणताही आदेश नाही"</string>
    <string name="recovery_no_command" msgid="4465476568623024327">"कोणताही आदेश नाही"</string>
    <string name="recovery_error" msgid="5748178989622716736">"त्रुटी!"</string>
    <string name="recovery_error" msgid="5748178989622716736">"त्रुटी!"</string>
    <string name="recovery_installing_security" msgid="9184031299717114342">"सुरक्षा अद्यतन स्थापित करत आहे"</string>
    <string name="recovery_installing_security" msgid="9184031299717114342">"सुरक्षा अपडेट इंस्टॉल करत आहे"</string>
</resources>
</resources>