summaryrefslogtreecommitdiff
path: root/services/incremental/BinderIncrementalService.cpp
diff options
context:
space:
mode:
authorAlex Buynytskyy <alexbuy@google.com>2021-01-27 06:58:55 -0800
committerAlex Buynytskyy <alexbuy@google.com>2021-01-29 11:16:02 -0800
commit07694ed49b14c0f03aea21c5e42773e542f867ce (patch)
treec8f27e1f1c4d932b3b6f1e563bb91e077ea092e5 /services/incremental/BinderIncrementalService.cpp
parentdd56fa93f65b38f47883e88300aacb53902b8857 (diff)
Inherited installation support for Incremental.
Bug: 162345970 Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest Change-Id: I360f44bc52e05553eacc448faa26f603d9eaae59 Merged-In: I360f44bc52e05553eacc448faa26f603d9eaae59
Diffstat (limited to 'services/incremental/BinderIncrementalService.cpp')
-rw-r--r--services/incremental/BinderIncrementalService.cpp45
1 files changed, 27 insertions, 18 deletions
diff --git a/services/incremental/BinderIncrementalService.cpp b/services/incremental/BinderIncrementalService.cpp
index d2244286450b..b2efc71860fb 100644
--- a/services/incremental/BinderIncrementalService.cpp
+++ b/services/incremental/BinderIncrementalService.cpp
@@ -118,18 +118,10 @@ binder::Status BinderIncrementalService::openStorage(const std::string& path,
binder::Status BinderIncrementalService::createStorage(
const ::std::string& path, const ::android::content::pm::DataLoaderParamsParcel& params,
- int32_t createMode,
- const ::android::sp<::android::content::pm::IDataLoaderStatusListener>& statusListener,
- const ::android::os::incremental::StorageHealthCheckParams& healthCheckParams,
- const ::android::sp<::android::os::incremental::IStorageHealthListener>& healthListener,
- const ::std::vector<::android::os::incremental::PerUidReadTimeouts>& perUidReadTimeouts,
- int32_t* _aidl_return) {
- *_aidl_return =
- mImpl.createStorage(path, const_cast<content::pm::DataLoaderParamsParcel&&>(params),
- android::incremental::IncrementalService::CreateOptions(createMode),
- statusListener,
- const_cast<StorageHealthCheckParams&&>(healthCheckParams),
- healthListener, perUidReadTimeouts);
+ int32_t createMode, int32_t* _aidl_return) {
+ *_aidl_return = mImpl.createStorage(path, params,
+ android::incremental::IncrementalService::CreateOptions(
+ createMode));
return ok();
}
@@ -144,6 +136,21 @@ binder::Status BinderIncrementalService::createLinkedStorage(const std::string&
return ok();
}
+binder::Status BinderIncrementalService::startLoading(
+ int32_t storageId, const ::android::content::pm::DataLoaderParamsParcel& params,
+ const ::android::sp<::android::content::pm::IDataLoaderStatusListener>& statusListener,
+ const ::android::os::incremental::StorageHealthCheckParams& healthCheckParams,
+ const ::android::sp<IStorageHealthListener>& healthListener,
+ const ::std::vector<::android::os::incremental::PerUidReadTimeouts>& perUidReadTimeouts,
+ bool* _aidl_return) {
+ *_aidl_return =
+ mImpl.startLoading(storageId, const_cast<content::pm::DataLoaderParamsParcel&&>(params),
+ statusListener,
+ const_cast<StorageHealthCheckParams&&>(healthCheckParams),
+ healthListener, perUidReadTimeouts);
+ return ok();
+}
+
binder::Status BinderIncrementalService::makeBindMount(int32_t storageId,
const std::string& sourcePath,
const std::string& targetFullPath,
@@ -253,9 +260,16 @@ binder::Status BinderIncrementalService::isFileFullyLoaded(int32_t storageId,
return ok();
}
+binder::Status BinderIncrementalService::isFullyLoaded(int32_t storageId, int32_t* _aidl_return) {
+ *_aidl_return = mImpl.getLoadingProgress(storageId, /*stopOnFirstIncomplete=*/true)
+ .blocksRemainingOrError();
+ return ok();
+}
+
binder::Status BinderIncrementalService::getLoadingProgress(int32_t storageId,
float* _aidl_return) {
- *_aidl_return = mImpl.getLoadingProgress(storageId).getProgress();
+ *_aidl_return =
+ mImpl.getLoadingProgress(storageId, /*stopOnFirstIncomplete=*/false).getProgress();
return ok();
}
@@ -291,11 +305,6 @@ binder::Status BinderIncrementalService::makeDirectories(int32_t storageId, cons
return ok();
}
-binder::Status BinderIncrementalService::startLoading(int32_t storageId, bool* _aidl_return) {
- *_aidl_return = mImpl.startLoading(storageId);
- return ok();
-}
-
binder::Status BinderIncrementalService::configureNativeBinaries(
int32_t storageId, const std::string& apkFullPath, const std::string& libDirRelativePath,
const std::string& abi, bool extractNativeLibs, bool* _aidl_return) {