summaryrefslogtreecommitdiff
path: root/services/incremental/BinderIncrementalService.cpp
diff options
context:
space:
mode:
authorYurii Zubrytskyi <zyy@google.com>2020-04-17 23:13:47 -0700
committerYurii Zubrytskyi <zyy@google.com>2020-04-22 00:49:02 -0700
commit629051fd6541e9e4378043d1132dcf98c9ca7726 (patch)
treecd566e00fdb6cdfeba4d8147b59c41796484d62c /services/incremental/BinderIncrementalService.cpp
parent360bbdc7203c851288d8e09d2eee2829975b210f (diff)
[incfs] Use MountRegistry to import existing mounts on start
This is a big cleanup in IncrementalService that makes it behave nicely on runtime restart, and more: - fixed a bunch of threading issues in createStorage/bind - made public functions correctly accept any path in any bind mount and translate it to the proper root mount - got rid of "using namespace" in headers, cleaned includes - removed all unused functions - set CLOEXEC bit on all duped FDs Bug: 151241369 Test: atest PackageManagerShellCommandTest \ PackageManagerShellCommandIncrementalTest \ IncrementalServiceTest Change-Id: Ided4415aabfbfca3925b5e71c91896055886ac4a
Diffstat (limited to 'services/incremental/BinderIncrementalService.cpp')
-rw-r--r--services/incremental/BinderIncrementalService.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/services/incremental/BinderIncrementalService.cpp b/services/incremental/BinderIncrementalService.cpp
index fc8c6feac22b..847667427593 100644
--- a/services/incremental/BinderIncrementalService.cpp
+++ b/services/incremental/BinderIncrementalService.cpp
@@ -18,6 +18,7 @@
#include <android-base/logging.h>
#include <android-base/no_destructor.h>
+#include <android/os/IVold.h>
#include <binder/IResultReceiver.h>
#include <binder/PermissionCache.h>
#include <incfs.h>
@@ -117,11 +118,12 @@ binder::Status BinderIncrementalService::openStorage(const std::string& path,
}
binder::Status BinderIncrementalService::createStorage(
- const std::string& path, const DataLoaderParamsParcel& params,
+ const std::string& path, const content::pm::DataLoaderParamsParcel& params,
const ::android::sp<::android::content::pm::IDataLoaderStatusListener>& listener,
int32_t createMode, int32_t* _aidl_return) {
*_aidl_return =
- mImpl.createStorage(path, const_cast<DataLoaderParamsParcel&&>(params), listener,
+ mImpl.createStorage(path, const_cast<content::pm::DataLoaderParamsParcel&&>(params),
+ listener,
android::incremental::IncrementalService::CreateOptions(
createMode));
return ok();
@@ -238,11 +240,8 @@ binder::Status BinderIncrementalService::isFileRangeLoaded(int32_t storageId,
binder::Status BinderIncrementalService::getMetadataByPath(int32_t storageId,
const std::string& path,
std::vector<uint8_t>* _aidl_return) {
- auto fid = mImpl.nodeFor(storageId, path);
- if (fid != kIncFsInvalidFileId) {
- auto metadata = mImpl.getMetadata(storageId, fid);
- _aidl_return->assign(metadata.begin(), metadata.end());
- }
+ auto metadata = mImpl.getMetadata(storageId, path);
+ _aidl_return->assign(metadata.begin(), metadata.end());
return ok();
}