diff options
author | Scott Lobdell <slobdell@google.com> | 2021-03-29 16:12:49 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-04-02 22:35:29 +0000 |
commit | 21cdef883cc867db55340b25d5c95e19b12ab383 (patch) | |
tree | 93d1444ebe783f53f5f0ae2647592723b27b3fb8 /services/incremental/BinderIncrementalService.cpp | |
parent | 7deab3736bb5f3a92be8ac820096926dce2366ad (diff) | |
parent | d1d45f856fdf68835f5b42eacecab44e6dfa8545 (diff) |
Merge SP1A.210329.001
Change-Id: I1e21c5890b5b2e2f2855f09960bc8eec8aa922bf
Diffstat (limited to 'services/incremental/BinderIncrementalService.cpp')
-rw-r--r-- | services/incremental/BinderIncrementalService.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/services/incremental/BinderIncrementalService.cpp b/services/incremental/BinderIncrementalService.cpp index 8f12b2e5c132..63488f995865 100644 --- a/services/incremental/BinderIncrementalService.cpp +++ b/services/incremental/BinderIncrementalService.cpp @@ -118,9 +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, int32_t* _aidl_return) { - *_aidl_return = mImpl.createStorage(path, params, - android::incremental::IncrementalService::CreateOptions( - createMode)); + *_aidl_return = + mImpl.createStorage(path, const_cast<content::pm::DataLoaderParamsParcel&&>(params), + android::incremental::IncrementalService::CreateOptions( + createMode)); return ok(); } @@ -144,9 +145,8 @@ binder::Status BinderIncrementalService::startLoading( bool* _aidl_return) { *_aidl_return = mImpl.startLoading(storageId, const_cast<content::pm::DataLoaderParamsParcel&&>(params), - statusListener, - const_cast<StorageHealthCheckParams&&>(healthCheckParams), - healthListener, perUidReadTimeouts); + statusListener, healthCheckParams, healthListener, + perUidReadTimeouts); return ok(); } @@ -255,20 +255,18 @@ binder::Status BinderIncrementalService::unlink(int32_t storageId, const std::st binder::Status BinderIncrementalService::isFileFullyLoaded(int32_t storageId, const std::string& path, int32_t* _aidl_return) { - *_aidl_return = mImpl.isFileFullyLoaded(storageId, path); + *_aidl_return = (int)mImpl.isFileFullyLoaded(storageId, path); return ok(); } binder::Status BinderIncrementalService::isFullyLoaded(int32_t storageId, int32_t* _aidl_return) { - *_aidl_return = mImpl.getLoadingProgress(storageId, /*stopOnFirstIncomplete=*/true) - .blocksRemainingOrError(); + *_aidl_return = (int)mImpl.isMountFullyLoaded(storageId); return ok(); } binder::Status BinderIncrementalService::getLoadingProgress(int32_t storageId, float* _aidl_return) { - *_aidl_return = - mImpl.getLoadingProgress(storageId, /*stopOnFirstIncomplete=*/false).getProgress(); + *_aidl_return = mImpl.getLoadingProgress(storageId).getProgress(); return ok(); } @@ -281,8 +279,8 @@ binder::Status BinderIncrementalService::getMetadataByPath(int32_t storageId, } static FileId toFileId(const std::vector<uint8_t>& id) { - FileId fid; - memcpy(&fid, id.data(), id.size()); + FileId fid = {}; + memcpy(&fid, id.data(), std::min(sizeof(fid), id.size())); return fid; } @@ -336,10 +334,8 @@ binder::Status BinderIncrementalService::registerStorageHealthListener( int32_t storageId, const ::android::os::incremental::StorageHealthCheckParams& healthCheckParams, const ::android::sp<IStorageHealthListener>& healthListener, bool* _aidl_return) { - *_aidl_return = mImpl.registerStorageHealthListener(storageId, - const_cast<StorageHealthCheckParams&&>( - healthCheckParams), - healthListener); + *_aidl_return = + mImpl.registerStorageHealthListener(storageId, healthCheckParams, healthListener); return ok(); } |