Teach vold to use the new android_reboot() function.
The new android_reboot() function is a nicer way to reboot. It can optionally sync(2) and remount as read-only writable filesystems. This fixes bug 3350709. Change-Id: I4618bd5e8cccdce08494a7ca3f40ef72b2875e68
This commit is contained in:
parent
cd235da6fb
commit
c290eaf685
1 changed files with 3 additions and 5 deletions
|
@ -35,7 +35,7 @@
|
|||
#include <openssl/evp.h>
|
||||
#include <openssl/sha.h>
|
||||
#include <errno.h>
|
||||
#include <sys/reboot.h>
|
||||
#include <cutils/android_reboot.h>
|
||||
#include <ext4.h>
|
||||
#include "cryptfs.h"
|
||||
#define LOG_TAG "Cryptfs"
|
||||
|
@ -1074,8 +1074,7 @@ int cryptfs_enable(char *howarg, char *passwd)
|
|||
put_crypt_ftr_and_key(real_blkdev, &crypt_ftr, 0, 0);
|
||||
|
||||
sleep(2); /* Give the UI a change to show 100% progress */
|
||||
sync();
|
||||
reboot(LINUX_REBOOT_CMD_RESTART);
|
||||
android_reboot(ANDROID_RB_RESTART, 0, 0);
|
||||
} else {
|
||||
property_set("vold.encrypt_progress", "error_partially_encrypted");
|
||||
release_wake_lock(lockid);
|
||||
|
@ -1103,8 +1102,7 @@ error_shutting_down:
|
|||
* vold to restart the system.
|
||||
*/
|
||||
SLOGE("Error enabling encryption after framework is shutdown, no data changed, restarting system");
|
||||
sync();
|
||||
reboot(LINUX_REBOOT_CMD_RESTART);
|
||||
android_reboot(ANDROID_RB_RESTART, 0, 0);
|
||||
|
||||
/* shouldn't get here */
|
||||
property_set("vold.encrypt_progress", "error_shutting_down");
|
||||
|
|
Loading…
Reference in a new issue