diff options
author | Alex Buynytskyy <alexbuy@google.com> | 2020-02-10 08:34:18 -0800 |
---|---|---|
committer | Alex Buynytskyy <alexbuy@google.com> | 2020-02-11 13:11:31 -0800 |
commit | 04f7391fc3a3bd2dc0dd477a84d13e111d59423c (patch) | |
tree | 5ca2b8e14ac72043e9f27616074172f2a2f8ff9c /services/incremental/IncrementalService.h | |
parent | ad1c9607445e374c88a273d562295d492b9072e1 (diff) |
Incremental installations in PackageManagerShellCommand.
- onPrepareImage in native,
- allow to check installation type and choose native or managed
dataloaders,
- native data loader for Incremental,
- install-incremental shell command.
Test: atest PackageManagerShellCommandTest
Test: atest IncrementalServiceTest
Bug: b/136132412 b/133435829
Change-Id: I530a8a203fb50132c1869abd0b869036add18699
Diffstat (limited to 'services/incremental/IncrementalService.h')
-rw-r--r-- | services/incremental/IncrementalService.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/services/incremental/IncrementalService.h b/services/incremental/IncrementalService.h index 2e7ced37e91d..75d066b9444a 100644 --- a/services/incremental/IncrementalService.h +++ b/services/incremental/IncrementalService.h @@ -59,6 +59,8 @@ using Clock = std::chrono::steady_clock; using TimePoint = std::chrono::time_point<Clock>; using Seconds = std::chrono::seconds; +using DataLoaderStatusListener = ::android::sp<::android::content::pm::IDataLoaderStatusListener>; + class IncrementalService final { public: explicit IncrementalService(ServiceManagerWrapper&& sm, std::string_view rootDir); @@ -94,7 +96,9 @@ public: std::optional<std::future<void>> onSystemReady(); - StorageId createStorage(std::string_view mountPoint, DataLoaderParamsParcel&& dataLoaderParams, + StorageId createStorage(std::string_view mountPoint, + DataLoaderParamsParcel&& dataLoaderParams, + const DataLoaderStatusListener& dataLoaderStatusListener, CreateOptions options = CreateOptions::Default); StorageId createLinkedStorage(std::string_view mountPoint, StorageId linkedStorage, CreateOptions options = CreateOptions::Default); @@ -129,13 +133,14 @@ public: std::string_view libDirRelativePath, std::string_view abi); class IncrementalDataLoaderListener : public android::content::pm::BnDataLoaderStatusListener { public: - IncrementalDataLoaderListener(IncrementalService& incrementalService) - : incrementalService(incrementalService) {} + IncrementalDataLoaderListener(IncrementalService& incrementalService, DataLoaderStatusListener externalListener) + : incrementalService(incrementalService), externalListener(externalListener) {} // Callbacks interface binder::Status onStatusChanged(MountId mount, int newStatus) override; private: IncrementalService& incrementalService; + DataLoaderStatusListener externalListener; }; private: @@ -201,7 +206,7 @@ private: std::string&& source, std::string&& target, BindKind kind, std::unique_lock<std::mutex>& mainLock); - bool prepareDataLoader(IncFsMount& ifs, DataLoaderParamsParcel* params); + bool prepareDataLoader(IncFsMount& ifs, DataLoaderParamsParcel* params = nullptr, const DataLoaderStatusListener* externalListener = nullptr); BindPathMap::const_iterator findStorageLocked(std::string_view path) const; StorageId findStorageId(std::string_view path) const; |