Don't wait for the framework to come up before starting to encrypt in place.

Also, change the value that triggers the progress bar framework from
"startup" to "0" in the property vold.encrypt_progress.

Change-Id: I3890e66a95283ce2ceeca82f516859b083919b9e
This commit is contained in:
Ken Sumrall 2011-01-18 14:04:08 -08:00
parent 57b63e61cb
commit 7df84120b2

View file

@ -855,7 +855,7 @@ int cryptfs_enable(char *howarg, char *passwd)
return -1; return -1;
} }
/* Tells the framework that inplace encryption is starting */ /* Tells the framework that inplace encryption is starting */
property_set("vold.encrypt_progress", "startup"); property_set("vold.encrypt_progress", "0");
/* restart the framework. */ /* restart the framework. */
/* Create necessary paths on /data */ /* Create necessary paths on /data */
@ -867,24 +867,10 @@ int cryptfs_enable(char *howarg, char *passwd)
property_set("vold.decrypt", "trigger_restart_min_framework"); property_set("vold.decrypt", "trigger_restart_min_framework");
SLOGD("Just triggered restart_min_framework\n"); SLOGD("Just triggered restart_min_framework\n");
/* Wait till the framework is ready */ /* OK, the framework is restarted and will soon be showing a
for (i=0; i<FRAMEWORK_BOOT_WAIT; i++) { * progress bar. Time to setup an encrypted mapping, and
char progress_state[32]; * either write a new filesystem, or encrypt in place updating
* the progress bar as we work.
sleep(1);
property_get("vold.encrypt_progress", progress_state, "");
if (! strcmp(progress_state, "ready")) {
break;
}
}
if (i == FRAMEWORK_BOOT_WAIT) {
/* The framework never rebooted, so abort */
return -1;
}
/* OK, the framework is restarted and displaying a progress bar,
* time to setup an encrypted mapping, and either write a new
* filesystem or encrypt in place, updating the progress bar
* as we work.
*/ */
} }