summaryrefslogtreecommitdiff
path: root/services/incremental/IncrementalService.cpp
diff options
context:
space:
mode:
author Alex Buynytskyy <alexbuy@google.com> 2023-02-08 21:24:01 -0800
committer Alex Buynytskyy <alexbuy@google.com> 2023-02-09 05:30:17 +0000
commit875cf6421adbe27b5bfaf687a2962f6d11873a93 (patch)
tree98155a2db9c1f2d039718c86ccc253f38d580f23 /services/incremental/IncrementalService.cpp
parent63c5a5aca1be92bc8347f86ad07038babf84b12f (diff)
Remove stale connections to DataLoaders.
Bug: 263449831 Fixes: 263449831 Test: atest service.incremental_test Change-Id: Ia3da6ca047c46807cbd72ef797bb4b300c38efb3
Diffstat (limited to 'services/incremental/IncrementalService.cpp')
-rw-r--r--services/incremental/IncrementalService.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/services/incremental/IncrementalService.cpp b/services/incremental/IncrementalService.cpp
index 9c9b363b948e..7ed95991642f 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -2816,6 +2816,12 @@ bool IncrementalService::DataLoaderStub::fsmStep() {
binder::Status IncrementalService::DataLoaderStub::onStatusChanged(MountId mountId, int newStatus) {
if (!isValid()) {
+ if (newStatus == IDataLoaderStatusListener::DATA_LOADER_BOUND) {
+ // Async "bound" came to already destroyed stub.
+ // Unbind immediately to avoid invalid stub sitting around in DataLoaderManagerService.
+ mService.mDataLoaderManager->unbindFromDataLoader(mountId);
+ return binder::Status::ok();
+ }
return binder::Status::
fromServiceSpecificError(-EINVAL, "onStatusChange came to invalid DataLoaderStub");
}