Create subdirectories of misc_ce/misc_de when needed

Bug: 25861755
Test: Boot device, check directory exists as it should.
Change-Id: I413631452e8e0bdd869887091f8b077bd5f9297e
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
index 48957c8..1a84e30 100644
--- a/Ext4Crypt.cpp
+++ b/Ext4Crypt.cpp
@@ -632,6 +632,15 @@
             }
             if (!ensure_policy(de_raw_ref, user_de_path)) return false;
         }
+
+        if (volume_uuid.empty()) {
+            if (0 != android::vold::ForkExecvp(
+                         std::vector<std::string>{"/system/bin/vold_prepare_subdirs", "misc_de",
+                                                  misc_de_path, std::to_string(user_id), ""})) {
+                LOG(ERROR) << "vold_prepare_subdirs failed on: " << misc_de_path;
+                return false;
+            }
+        }
     }
 
     if (flags & FLAG_STORAGE_CE) {
@@ -664,6 +673,15 @@
             if (!ensure_policy(ce_raw_ref, media_ce_path)) return false;
             if (!ensure_policy(ce_raw_ref, user_ce_path)) return false;
         }
+
+        if (volume_uuid.empty()) {
+            if (0 != android::vold::ForkExecvp(
+                         std::vector<std::string>{"/system/bin/vold_prepare_subdirs", "misc_ce",
+                                                  misc_ce_path, std::to_string(user_id), ""})) {
+                LOG(ERROR) << "vold_prepare_subdirs failed on: " << misc_ce_path;
+                return false;
+            }
+        }
     }
 
     return true;