FBE devices now fully support adoptable storage.

We've finished all the underlying work to support adoptable storage
on FBE devices, so remove the code that was disabling it by default.

To aid debugging, support blocking move commands (so that we log
the stdout) via a system property, so we don't have to recompile
end user devices stuck in funky states.

Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AdoptableHostTest
Bug: 29923055, 25861755, 33252673, 37289651
Change-Id: I6b781de7e196a1a50ba543843aca0caf74c3e282
diff --git a/MoveStorage.cpp b/MoveStorage.cpp
index 4f5ebe8..4624026 100644
--- a/MoveStorage.cpp
+++ b/MoveStorage.cpp
@@ -18,10 +18,11 @@
 #include "Utils.h"
 #include "VolumeManager.h"
 
-#include <android-base/stringprintf.h>
 #include <android-base/logging.h>
-#include <private/android_filesystem_config.h>
+#include <android-base/properties.h>
+#include <android-base/stringprintf.h>
 #include <hardware_legacy/power.h>
+#include <private/android_filesystem_config.h>
 
 #include <thread>
 
@@ -30,7 +31,7 @@
 
 #define CONSTRAIN(amount, low, high) ((amount) < (low) ? (low) : ((amount) > (high) ? (high) : (amount)))
 
-#define EXEC_BLOCKING 0
+static const char* kPropBlockingExec = "persist.sys.blocking_exec";
 
 using android::base::StringPrintf;
 
@@ -93,9 +94,10 @@
         return OK;
     }
 
-#if EXEC_BLOCKING
-    return ForkExecvp(cmd);
-#else
+    if (android::base::GetBoolProperty(kPropBlockingExec, false)) {
+        return ForkExecvp(cmd);
+    }
+
     pid_t pid = ForkExecvpAsync(cmd);
     if (pid == -1) return -1;
 
@@ -116,7 +118,6 @@
                 ((deltaFreeBytes * stepProgress) / expectedBytes), 0, stepProgress), listener);
     }
     return -1;
-#endif
 }
 
 static status_t execCp(const std::string& fromPath, const std::string& toPath, int startProgress,
@@ -144,9 +145,10 @@
     }
     cmd.push_back(toPath.c_str());
 
-#if EXEC_BLOCKING
-    return ForkExecvp(cmd);
-#else
+    if (android::base::GetBoolProperty(kPropBlockingExec, false)) {
+        return ForkExecvp(cmd);
+    }
+
     pid_t pid = ForkExecvpAsync(cmd);
     if (pid == -1) return -1;
 
@@ -167,7 +169,6 @@
                 ((deltaFreeBytes * stepProgress) / expectedBytes), 0, stepProgress), listener);
     }
     return -1;
-#endif
 }
 
 static void bringOffline(const std::shared_ptr<VolumeBase>& vol) {
diff --git a/model/Disk.cpp b/model/Disk.cpp
index b42f215..9b772e4 100644
--- a/model/Disk.cpp
+++ b/model/Disk.cpp
@@ -455,12 +455,6 @@
 status_t Disk::partitionMixed(int8_t ratio) {
     int res;
 
-    if (e4crypt_is_native()
-            && !android::base::GetBoolProperty("persist.sys.adoptable_fbe", false)) {
-        LOG(ERROR) << "Private volumes not yet supported on FBE devices";
-        return -EINVAL;
-    }
-
     destroyAllVolumes();
     mJustPartitioned = true;