namespace {
constexpr const char* kDump = "android.permission.DUMP";
+constexpr auto kIncFsReadNoTimeoutMs = 100;
static binder::Status error(const std::string& msg) {
PLOG(ERROR) << msg;
auto control = incfs::mount(backingPath, targetDir,
{.flags = IncFsMountFlags(flags),
+ // Mount with read timeouts.
.defaultReadTimeoutMs = INCFS_DEFAULT_READ_TIMEOUT_MS,
// Mount with read logs disabled.
.readLogBufferPages = 0});
binder::Status VoldNativeService::setIncFsMountOptions(
const ::android::os::incremental::IncrementalFileSystemControlParcel& control,
- bool enableReadLogs) {
+ bool enableReadLogs, bool enableReadTimeouts) {
ENFORCE_SYSTEM_OR_ROOT;
auto incfsControl =
std::unique_ptr<incfs::Control, decltype(cleanupFunc)>(&incfsControl, cleanupFunc);
if (auto error = incfs::setOptions(
incfsControl,
- {.defaultReadTimeoutMs = INCFS_DEFAULT_READ_TIMEOUT_MS,
+ {.defaultReadTimeoutMs =
+ enableReadTimeouts ? INCFS_DEFAULT_READ_TIMEOUT_MS : kIncFsReadNoTimeoutMs,
.readLogBufferPages = enableReadLogs ? INCFS_DEFAULT_PAGE_READ_BUFFER_PAGES : 0});
error < 0) {
return binder::Status::fromServiceSpecificError(error);
binder::Status unmountIncFs(const std::string& dir) override;
binder::Status setIncFsMountOptions(
const ::android::os::incremental::IncrementalFileSystemControlParcel& control,
- bool enableReadLogs) override;
+ bool enableReadLogs, bool enableReadTimeouts) override;
binder::Status bindMount(const std::string& sourceDir, const std::string& targetDir) override;
binder::Status destroyDsuMetadataKey(const std::string& dsuSlot) override;
boolean incFsEnabled();
IncrementalFileSystemControlParcel mountIncFs(@utf8InCpp String backingPath, @utf8InCpp String targetDir, int flags);
void unmountIncFs(@utf8InCpp String dir);
- void setIncFsMountOptions(in IncrementalFileSystemControlParcel control, boolean enableReadLogs);
+ void setIncFsMountOptions(in IncrementalFileSystemControlParcel control, boolean enableReadLogs, boolean enableReadTimeouts);
void bindMount(@utf8InCpp String sourceDir, @utf8InCpp String targetDir);
void destroyDsuMetadataKey(@utf8InCpp String dsuSlot);