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

Commit f3ce5ac7 authored by Brint E. Kriebel's avatar Brint E. Kriebel Committed by Tom Marshall
Browse files

update-binary: support reboot_now on older recoveries

Attempt to reboot using older methods in case the recovery that we
are updating does not support init reboots

Ticket: CYNGNOS-1242
Change-Id: I9d6ec23c65291221e99d67b2361a2bd150319eee
parent 840bfc92
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1280,6 +1280,13 @@ Value* RebootNowFn(const char* name, State* state, const std::vector<std::unique
  android::base::SetProperty(ANDROID_RB_PROPERTY, reboot_cmd);

  sleep(5);

  // Attempt to reboot using older methods in case the recovery
  // that we are updating does not support init reboots
  android_reboot(ANDROID_RB_RESTART, 0, 0);

  sleep(5);

  return ErrorAbort(state, kRebootFailure, "%s() failed to reboot", name);
}