Have recovery reboot using the new android_reboot() function.
The new android_reboot() function is a nicer way to reboot the system. I can optionally sync() and remount read-only writable filesystems. This fixes bug 3350709. Change-Id: Ic4c8676debd642e57bce3107b99dd810d90b6f82
This commit is contained in:
+2
-3
@@ -23,7 +23,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/reboot.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
@@ -33,6 +32,7 @@
|
|||||||
#include "bootloader.h"
|
#include "bootloader.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "cutils/properties.h"
|
#include "cutils/properties.h"
|
||||||
|
#include "cutils/android_reboot.h"
|
||||||
#include "install.h"
|
#include "install.h"
|
||||||
#include "minui/minui.h"
|
#include "minui/minui.h"
|
||||||
#include "minzip/DirUtil.h"
|
#include "minzip/DirUtil.h"
|
||||||
@@ -768,7 +768,6 @@ main(int argc, char **argv) {
|
|||||||
// Otherwise, get ready to boot the main system...
|
// Otherwise, get ready to boot the main system...
|
||||||
finish_recovery(send_intent);
|
finish_recovery(send_intent);
|
||||||
ui_print("Rebooting...\n");
|
ui_print("Rebooting...\n");
|
||||||
sync();
|
android_reboot(ANDROID_RB_RESTART, 0, 0);
|
||||||
reboot(RB_AUTOBOOT);
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/reboot.h>
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@@ -30,6 +29,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include <cutils/android_reboot.h>
|
||||||
#include "minui/minui.h"
|
#include "minui/minui.h"
|
||||||
#include "recovery_ui.h"
|
#include "recovery_ui.h"
|
||||||
|
|
||||||
@@ -358,7 +358,7 @@ static void *input_thread(void *cookie)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ev.value > 0 && device_reboot_now(key_pressed, ev.code)) {
|
if (ev.value > 0 && device_reboot_now(key_pressed, ev.code)) {
|
||||||
reboot(RB_AUTOBOOT);
|
android_reboot(ANDROID_RB_RESTART, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user