Skip to content

Commit

Permalink
update-binary: support reboot_now on older recoveries
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Brint E. Kriebel authored and tdmcyngn committed Nov 25, 2015
1 parent 5e381e9 commit 7cfda80
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions updater/install.c
Expand Up @@ -1529,6 +1529,11 @@ Value* RebootNowFn(const char* name, State* state, int argc, Expr* argv[]) {

property_set(ANDROID_RB_PROPERTY, buffer);

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);
free(property);
ErrorAbort(state, "%s() failed to reboot", name);
Expand Down

0 comments on commit 7cfda80

Please sign in to comment.