summaryrefslogtreecommitdiff
path: root/services/incremental/IncrementalService.cpp
diff options
context:
space:
mode:
author Alex Buynytskyy <alexbuy@google.com> 2020-04-11 21:40:37 -0700
committer Alex Buynytskyy <alexbuy@google.com> 2020-04-11 21:40:37 -0700
commit6994166a09aabeb9e81bf3e7e64f078cdf3ffce2 (patch)
treec7a21cabfd659c320f7ed6756951d06550f86109 /services/incremental/IncrementalService.cpp
parent507bbaeb9b629cfdf2d790ceb50a6ef34bf70687 (diff)
Reconnect to DataLoaders on restart.
Bug: b/151241369 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest Change-Id: I1532df63a2a36104dbd9cd90ee4e5f40bae00a6a
Diffstat (limited to 'services/incremental/IncrementalService.cpp')
-rw-r--r--services/incremental/IncrementalService.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index 2c6bf0a80fe0..695b68bf71cb 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -353,10 +353,14 @@ void IncrementalService::onSystemReady() {
}
}
- /* TODO(b/151241369): restore data loaders on reboot.
+ if (mounts.empty()) {
+ return;
+ }
+
std::thread([this, mounts = std::move(mounts)]() {
+ mJni->initializeForCurrentThread();
for (auto&& ifs : mounts) {
- if (prepareDataLoader(*ifs)) {
+ if (ifs->dataLoaderStub->create()) {
LOG(INFO) << "Successfully started data loader for mount " << ifs->mountId;
} else {
// TODO(b/133435829): handle data loader start failures
@@ -364,7 +368,6 @@ void IncrementalService::onSystemReady() {
}
}
}).detach();
- */
}
auto IncrementalService::getStorageSlotLocked() -> MountMap::iterator {
@@ -1068,6 +1071,9 @@ bool IncrementalService::mountExistingImage(std::string_view root) {
dataLoaderParams.arguments = loader.arguments();
}
+ prepareDataLoader(*ifs, std::move(dataLoaderParams), nullptr);
+ CHECK(ifs->dataLoaderStub);
+
std::vector<std::pair<std::string, metadata::BindPoint>> bindPoints;
auto d = openDir(path::c_str(mountTarget));
while (auto e = ::readdir(d.get())) {