Loading core/java/android/os/incremental/IncrementalFileStorages.java +10 −4 Original line number Diff line number Diff line Loading @@ -92,10 +92,7 @@ public final class IncrementalFileStorages { } } if (!result.mDefaultStorage.startLoading()) { // TODO(b/146080380): add incremental-specific error code throw new IOException("Failed to start loading data for Incremental installation."); } result.startLoading(); return result; } Loading Loading @@ -143,6 +140,15 @@ public final class IncrementalFileStorages { } } /** * Starts or re-starts loading of data. */ public void startLoading() throws IOException { if (!mDefaultStorage.startLoading()) { throw new IOException("Failed to start loading data for Incremental installation."); } } /** * Resets the states and unbinds storage instances for an installation session. * TODO(b/136132412): make sure unnecessary binds are removed but useful storages are kept Loading services/core/java/com/android/server/pm/PackageInstallerSession.java +12 −1 Original line number Diff line number Diff line Loading @@ -395,7 +395,6 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { private boolean mDataLoaderFinished = false; // TODO(b/146080380): merge file list with Callback installation. private IncrementalFileStorages mIncrementalFileStorages; private static final FileFilter sAddedApkFilter = new FileFilter() { Loading Loading @@ -2698,6 +2697,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { /** * Makes sure files are present in staging location. * @return if the image is ready for installation */ @GuardedBy("mLock") private boolean prepareDataLoaderLocked() Loading @@ -2709,6 +2709,17 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { return true; } // Retrying commit. if (mIncrementalFileStorages != null) { try { mIncrementalFileStorages.startLoading(); } catch (IOException e) { throw new PackageManagerException(INSTALL_FAILED_MEDIA_UNAVAILABLE, e.getMessage(), e.getCause()); } return false; } final List<InstallationFileParcel> addedFiles = new ArrayList<>(); final List<String> removedFiles = new ArrayList<>(); Loading services/incremental/IncrementalService.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -1807,6 +1807,8 @@ bool IncrementalService::DataLoaderStub::fsmStep() { targetStatus = mTargetStatus; } LOG(DEBUG) << "fsmStep: " << mId << ": " << currentStatus << " -> " << targetStatus; if (currentStatus == targetStatus) { return true; } Loading Loading @@ -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); } } Loading services/incremental/test/IncrementalServiceTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading Loading
core/java/android/os/incremental/IncrementalFileStorages.java +10 −4 Original line number Diff line number Diff line Loading @@ -92,10 +92,7 @@ public final class IncrementalFileStorages { } } if (!result.mDefaultStorage.startLoading()) { // TODO(b/146080380): add incremental-specific error code throw new IOException("Failed to start loading data for Incremental installation."); } result.startLoading(); return result; } Loading Loading @@ -143,6 +140,15 @@ public final class IncrementalFileStorages { } } /** * Starts or re-starts loading of data. */ public void startLoading() throws IOException { if (!mDefaultStorage.startLoading()) { throw new IOException("Failed to start loading data for Incremental installation."); } } /** * Resets the states and unbinds storage instances for an installation session. * TODO(b/136132412): make sure unnecessary binds are removed but useful storages are kept Loading
services/core/java/com/android/server/pm/PackageInstallerSession.java +12 −1 Original line number Diff line number Diff line Loading @@ -395,7 +395,6 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { private boolean mDataLoaderFinished = false; // TODO(b/146080380): merge file list with Callback installation. private IncrementalFileStorages mIncrementalFileStorages; private static final FileFilter sAddedApkFilter = new FileFilter() { Loading Loading @@ -2698,6 +2697,7 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { /** * Makes sure files are present in staging location. * @return if the image is ready for installation */ @GuardedBy("mLock") private boolean prepareDataLoaderLocked() Loading @@ -2709,6 +2709,17 @@ public class PackageInstallerSession extends IPackageInstallerSession.Stub { return true; } // Retrying commit. if (mIncrementalFileStorages != null) { try { mIncrementalFileStorages.startLoading(); } catch (IOException e) { throw new PackageManagerException(INSTALL_FAILED_MEDIA_UNAVAILABLE, e.getMessage(), e.getCause()); } return false; } final List<InstallationFileParcel> addedFiles = new ArrayList<>(); final List<String> removedFiles = new ArrayList<>(); Loading
services/incremental/IncrementalService.cpp +5 −3 Original line number Diff line number Diff line Loading @@ -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 Loading Loading @@ -1807,6 +1807,8 @@ bool IncrementalService::DataLoaderStub::fsmStep() { targetStatus = mTargetStatus; } LOG(DEBUG) << "fsmStep: " << mId << ": " << currentStatus << " -> " << targetStatus; if (currentStatus == targetStatus) { return true; } Loading Loading @@ -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); } } Loading
services/incremental/test/IncrementalServiceTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -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); Loading