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
This commit is contained in:
Jeff Sharkey 2018-01-04 16:46:34 -07:00
parent 91f1886e14
commit 8c24ae7c47
2 changed files with 12 additions and 17 deletions

View file

@ -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 @@ static status_t execRm(const std::string& path, int startProgress, int stepProgr
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 @@ static status_t execRm(const std::string& path, int startProgress, int stepProgr
((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 @@ static status_t execCp(const std::string& fromPath, const std::string& toPath, i
}
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 @@ static status_t execCp(const std::string& fromPath, const std::string& toPath, i
((deltaFreeBytes * stepProgress) / expectedBytes), 0, stepProgress), listener);
}
return -1;
#endif
}
static void bringOffline(const std::shared_ptr<VolumeBase>& vol) {

View file

@ -455,12 +455,6 @@ status_t Disk::partitionPrivate() {
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;