Don't reboot after default encrypting
Instead trigger normal default encryption mount Requires matching change to system/core: https://googleplex-android-review.git.corp.google.com/#/c/527286/ Bug: 17041092 Change-Id: Ifcf023386e08325db7dce61395fbb056f7d9815b
This commit is contained in:
parent
a70abc6009
commit
b6672e135a
1 changed files with 13 additions and 3 deletions
16
cryptfs.c
16
cryptfs.c
|
@ -2709,12 +2709,22 @@ int cryptfs_enable_internal(char *howarg, int crypt_type, char *passwd,
|
||||||
|
|
||||||
put_crypt_ftr_and_key(&crypt_ftr);
|
put_crypt_ftr_and_key(&crypt_ftr);
|
||||||
|
|
||||||
sleep(2); /* Give the UI a chance to show 100% progress */
|
|
||||||
/* Partially encrypted - ensure writes are flushed to ssd */
|
|
||||||
|
|
||||||
if (crypt_ftr.encrypted_upto == crypt_ftr.fs_size) {
|
if (crypt_ftr.encrypted_upto == crypt_ftr.fs_size) {
|
||||||
|
char value[PROPERTY_VALUE_MAX];
|
||||||
|
property_get("ro.crypto.state", value, "");
|
||||||
|
if (!strcmp(value, "")) {
|
||||||
|
/* default encryption - continue first boot sequence */
|
||||||
|
property_set("ro.crypto.state", "encrypted");
|
||||||
|
release_wake_lock(lockid);
|
||||||
|
cryptfs_check_passwd(DEFAULT_PASSWORD);
|
||||||
|
cryptfs_restart_internal(1);
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
sleep(2); /* Give the UI a chance to show 100% progress */
|
||||||
cryptfs_reboot(reboot);
|
cryptfs_reboot(reboot);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
sleep(2); /* Partially encrypted, ensure writes flushed to ssd */
|
||||||
cryptfs_reboot(shutdown);
|
cryptfs_reboot(shutdown);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue