Create profile folder for foreign dex markers. am: 493f5aa160
am: 29593a8128

* commit '29593a8128513863bed1c9f863787d5309bd24ce':
  Create profile folder for foreign dex markers.
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
index a785856..6612eaf 100644
--- a/Ext4Crypt.cpp
+++ b/Ext4Crypt.cpp
@@ -601,11 +601,15 @@
         auto misc_de_path = android::vold::BuildDataMiscDePath(user_id);
         auto user_de_path = android::vold::BuildDataUserDePath(volume_uuid, user_id);
         auto profiles_de_path = android::vold::BuildDataProfilesDePath(user_id);
+        auto foreign_dex_profiles_de_path =
+                android::vold::BuildDataProfilesForeignDexDePath(user_id);
+
 
         if (!prepare_dir(system_de_path, 0770, AID_SYSTEM, AID_SYSTEM)) return false;
         if (!prepare_dir(misc_de_path, 01771, AID_SYSTEM, AID_MISC)) return false;
         if (!prepare_dir(user_de_path, 0771, AID_SYSTEM, AID_SYSTEM)) return false;
         if (!prepare_dir(profiles_de_path, 0771, AID_SYSTEM, AID_SYSTEM)) return false;
+        if (!prepare_dir(foreign_dex_profiles_de_path, 0773, AID_SYSTEM, AID_SYSTEM)) return false;
 
         if (e4crypt_is_native()) {
             std::string de_raw_ref;
diff --git a/Utils.cpp b/Utils.cpp
index 2514f9a..942945d 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -581,6 +581,11 @@
     return StringPrintf("%s/misc/profiles/cur/%u", BuildDataPath(nullptr).c_str(), userId);
 }
 
+std::string BuildDataProfilesForeignDexDePath(userid_t userId) {
+    std::string profiles_path = BuildDataProfilesDePath(userId);
+    return StringPrintf("%s/foreign-dex", profiles_path.c_str());
+}
+
 std::string BuildDataPath(const char* volumeUuid) {
     // TODO: unify with installd path generation logic
     if (volumeUuid == nullptr) {
diff --git a/Utils.h b/Utils.h
index 0248b85..cfc8050 100644
--- a/Utils.h
+++ b/Utils.h
@@ -101,6 +101,7 @@
 std::string BuildDataMiscCePath(userid_t userid);
 std::string BuildDataMiscDePath(userid_t userid);
 std::string BuildDataProfilesDePath(userid_t userid);
+std::string BuildDataProfilesForeignDexDePath(userid_t userid);
 
 std::string BuildDataPath(const char* volumeUuid);
 std::string BuildDataMediaPath(const char* volumeUuid, userid_t userid);