// call a clean reboot
void reboot_main_system(int cmd, int flags, char *arg) {
    verify_settings_file();
    write_recovery_version();

    verify_root_and_recovery();

    finish_recovery(NULL); // sync() in here
    vold_unmount_all();

    char buffer[80];
    if ((unsigned)cmd == ANDROID_RB_POWEROFF) {
        strcpy(buffer, "shutdown,");
    } else {
        strcpy(buffer, "reboot,");
    }
    if (arg != NULL) {
        strncat(buffer, arg, sizeof(buffer));
    }
    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 property reboot
    // android_reboot() is defined in libcutils/android_reboot.c
    LOGI("trying legacy android_reboot() command\n");
    android_reboot(cmd, flags, arg);
}
Ejemplo n.º 2
0
// call a clean reboot
void reboot_main_system(int cmd, int flags, char *arg) {
    write_recovery_version();
    verify_root_and_recovery();
    finish_recovery(NULL); // sync() in here
    vold_unmount_all();
    android_reboot(cmd, flags, arg);
}
Ejemplo n.º 3
0
// call a clean reboot
void reboot_main_system(int cmd, int flags, char *arg) {
    write_recovery_version();

#ifdef BOARD_NATIVE_DUALBOOT
    device_verify_root_and_recovery();
#else
    verify_root_and_recovery();
#endif

    finish_recovery(NULL); // sync() in here
    vold_unmount_all();
    android_reboot(cmd, flags, arg);
}