summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Sumrall <ksumrall@android.com>2012-10-17 20:57:14 -0700
committerKen Sumrall <ksumrall@android.com>2012-10-17 20:57:14 -0700
commit92736efab068bdbfeb1177544907b84511fb04e0 (patch)
treebd4aeef2de1cc07917abf9bf0a9d03dc08f3282d
parent9dedfd473dc59e0277004e5b917e4eced02c8af5 (diff)
downloadsystem_vold-92736efab068bdbfeb1177544907b84511fb04e0.zip
system_vold-92736efab068bdbfeb1177544907b84511fb04e0.tar.gz
system_vold-92736efab068bdbfeb1177544907b84511fb04e0.tar.bz2
Another fix for encryption
The previous problem of the framework not properly restarting after accepting the password to decrypt the storage is also a problem when restarting the framework to display the encryption progress screen. So like the previous hacky fix, add a sleep to wait a few moments before proceeding. Also, increase the sleep of the previous fix from 1 second to 2, as the problem was seen once more in testing. A proper fix has been designed and hopefully will work and be checked-in RSN. Change-Id: Icc2c072ce7f7ebcdea22cd7ff8cb2b87a627c578
-rw-r--r--cryptfs.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/cryptfs.c b/cryptfs.c
index 67533a4..bcacc39 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -688,8 +688,12 @@ int cryptfs_restart(void)
property_set("vold.decrypt", "trigger_reset_main");
SLOGD("Just asked init to shut down class main\n");
- /* Give everything a chance to shutdown */
- sleep(1);
+ /* Ugh, shutting down the framework is not synchronous, so until it
+ * can be fixed, this horrible hack will wait a moment for it all to
+ * shut down before proceeding. Without it, some devices cannot
+ * restart the graphics services.
+ */
+ sleep(2);
/* Now that the framework is shutdown, we should be able to umount()
* the tmpfs filesystem, and mount the real one.
@@ -1275,6 +1279,13 @@ int cryptfs_enable(char *howarg, char *passwd)
goto error_shutting_down;
}
+ /* Ugh, shutting down the framework is not synchronous, so until it
+ * can be fixed, this horrible hack will wait a moment for it all to
+ * shut down before proceeding. Without it, some devices cannot
+ * restart the graphics services.
+ */
+ sleep(2);
+
/* startup service classes main and late_start */
property_set("vold.decrypt", "trigger_restart_min_framework");
SLOGD("Just triggered restart_min_framework\n");