diff options
Diffstat (limited to 'services/incremental')
-rw-r--r-- | services/incremental/IncrementalService.cpp | 8 | ||||
-rw-r--r-- | services/incremental/test/IncrementalServiceTest.cpp | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp index a9dc92fca971..78439dba2724 100644 --- a/services/incremental/IncrementalService.cpp +++ b/services/incremental/IncrementalService.cpp @@ -748,7 +748,7 @@ int IncrementalService::unbind(StorageId storage, std::string_view target) { return -EINVAL; } - LOG(INFO) << "Removing bind point " << target; + LOG(INFO) << "Removing bind point " << target << " for storage " << storage; // Here we should only look up by the exact target, not by a subdirectory of any existing mount, // otherwise there's a chance to unmount something completely unrelated @@ -1807,6 +1807,8 @@ bool IncrementalService::DataLoaderStub::fsmStep() { targetStatus = mTargetStatus; } + LOG(DEBUG) << "fsmStep: " << mId << ": " << currentStatus << " -> " << targetStatus; + if (currentStatus == targetStatus) { return true; } @@ -1868,8 +1870,8 @@ binder::Status IncrementalService::DataLoaderStub::onStatusChanged(MountId mount listener = mListener; if (mCurrentStatus == IDataLoaderStatusListener::DATA_LOADER_UNAVAILABLE) { - // For unavailable, reset target status. - setTargetStatusLocked(IDataLoaderStatusListener::DATA_LOADER_UNAVAILABLE); + // For unavailable, unbind from DataLoader to ensure proper re-commit. + setTargetStatusLocked(IDataLoaderStatusListener::DATA_LOADER_DESTROYED); } } diff --git a/services/incremental/test/IncrementalServiceTest.cpp b/services/incremental/test/IncrementalServiceTest.cpp index 325218dfa6a5..2e4625cf85a1 100644 --- a/services/incremental/test/IncrementalServiceTest.cpp +++ b/services/incremental/test/IncrementalServiceTest.cpp @@ -677,10 +677,10 @@ TEST_F(IncrementalServiceTest, testStartDataLoaderRecreateOnPendingReads) { mDataLoaderManager->bindToDataLoaderSuccess(); mDataLoaderManager->getDataLoaderSuccess(); EXPECT_CALL(*mDataLoaderManager, bindToDataLoader(_, _, _, _)).Times(2); - EXPECT_CALL(*mDataLoaderManager, unbindFromDataLoader(_)).Times(1); + EXPECT_CALL(*mDataLoaderManager, unbindFromDataLoader(_)).Times(2); EXPECT_CALL(*mDataLoader, create(_, _, _, _)).Times(2); EXPECT_CALL(*mDataLoader, start(_)).Times(0); - EXPECT_CALL(*mDataLoader, destroy(_)).Times(1); + EXPECT_CALL(*mDataLoader, destroy(_)).Times(2); EXPECT_CALL(*mVold, unmountIncFs(_)).Times(2); EXPECT_CALL(*mLooper, addFd(MockIncFs::kPendingReadsFd, _, _, _, _)).Times(1); EXPECT_CALL(*mLooper, removeFd(MockIncFs::kPendingReadsFd)).Times(1); |