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

Commit 6dee61bf authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Pause recovery when it ends with Shutdown" into main am: 75014b82

parents 0affc7a1 75014b82
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ class MemMapping {
[[noreturn]] void Reboot(std::string_view target);

// Triggers a shutdown.
bool Shutdown(std::string_view target);
[[noreturn]] void Shutdown(std::string_view target);

// Returns a null-terminated char* array, where the elements point to the C-strings in the given
// vector, plus an additional nullptr at the end. This is a helper function that facilitates
+6 −2
Original line number Diff line number Diff line
@@ -233,9 +233,13 @@ void Reboot(std::string_view target) {
  while (true) pause();
}

bool Shutdown(std::string_view target) {
void Shutdown(std::string_view target) {
  std::string cmd = "shutdown," + std::string(target);
  return android::base::SetProperty(ANDROID_RB_PROPERTY, cmd);
  if (!android::base::SetProperty(ANDROID_RB_PROPERTY, cmd)) {
    LOG(FATAL) << "Shutdown failed";
  }

  while (true) pause();
}

std::vector<char*> StringVectorToNullTerminatedArray(const std::vector<std::string>& args) {