Don't show UI on default encryption

Bug: 22989588
Change-Id: I21403233d84031869d929c46c3c7b2ebefb3caff
diff --git a/cryptfs.c b/cryptfs.c
index 1a63a5b..1828ece 100644
--- a/cryptfs.c
+++ b/cryptfs.c
@@ -2893,7 +2893,7 @@
 }
 
 int cryptfs_enable_internal(char *howarg, int crypt_type, char *passwd,
-                            int allow_reboot)
+                            int no_ui)
 {
     int how = 0;
     char crypto_blkdev[MAXPATHLEN], real_blkdev[MAXPATHLEN];
@@ -2992,11 +2992,7 @@
 
     /* Now unmount the /data partition. */
     if (wait_and_unmount(DATA_MNT_POINT, false)) {
-        if (allow_reboot) {
-            goto error_shutting_down;
-        } else {
-            goto error_unencrypted;
-        }
+        goto error_unencrypted;
     }
 
     /* Do extra work for a better UX when doing the long inplace encryption */
@@ -3086,7 +3082,7 @@
         }
     }
 
-    if (how == CRYPTO_ENABLE_INPLACE) {
+    if (how == CRYPTO_ENABLE_INPLACE && !no_ui) {
         /* startup service classes main and late_start */
         property_set("vold.decrypt", "trigger_restart_min_framework");
         SLOGD("Just triggered restart_min_framework\n");
@@ -3223,15 +3219,15 @@
     return -1;
 }
 
-int cryptfs_enable(char *howarg, int type, char *passwd, int allow_reboot)
+int cryptfs_enable(char *howarg, int type, char *passwd, int no_ui)
 {
-    return cryptfs_enable_internal(howarg, type, passwd, allow_reboot);
+    return cryptfs_enable_internal(howarg, type, passwd, no_ui);
 }
 
-int cryptfs_enable_default(char *howarg, int allow_reboot)
+int cryptfs_enable_default(char *howarg, int no_ui)
 {
     return cryptfs_enable_internal(howarg, CRYPT_TYPE_DEFAULT,
-                          DEFAULT_PASSWORD, allow_reboot);
+                          DEFAULT_PASSWORD, no_ui);
 }
 
 int cryptfs_changepw(int crypt_type, const char *newpw)