From 471eb4e140b36c9a6092c70bf4e286961b1378e3 Mon Sep 17 00:00:00 2001 From: "Brint E. Kriebel" Date: Thu, 26 Mar 2015 14:11:04 -0700 Subject: [PATCH] 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 Change-Id: I9d6ec23c65291221e99d67b2361a2bd150319eee --- updater/install.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/updater/install.c b/updater/install.c index 23be45713..95795e35b 100644 --- a/updater/install.c +++ b/updater/install.c @@ -1558,6 +1558,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);