Browse Source

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
Brint E. Kriebel 6 years ago
parent
commit
b7641b6bcf
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      updater/install.cpp

+ 7
- 0
updater/install.cpp View File

@@ -1290,6 +1290,13 @@ Value* RebootNowFn(const char* name, State* state, const std::vector<std::unique
1290 1290
   android::base::SetProperty(ANDROID_RB_PROPERTY, reboot_cmd);
1291 1291
 
1292 1292
   sleep(5);
1293
+
1294
+  // Attempt to reboot using older methods in case the recovery
1295
+  // that we are updating does not support init reboots
1296
+  android_reboot(ANDROID_RB_RESTART, 0, 0);
1297
+
1298
+  sleep(5);
1299
+
1293 1300
   return ErrorAbort(state, kRebootFailure, "%s() failed to reboot", name);
1294 1301
 }
1295 1302