summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Buynytskyy <alexbuy@google.com>2023-02-08 21:24:01 -0800
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2023-02-09 05:56:29 +0000
commita12b93996e9a3f39434fd3351a7dd9d11ade75f9 (patch)
tree14720a91cf1add28099424e43078daa08f650736
parent26da25fe898e911c335be59f5033ce4dc6c32a84 (diff)
downloadbase-a12b93996e9a3f39434fd3351a7dd9d11ade75f9.tar.gz
Remove stale connections to DataLoaders.
Bug: 263449831 Fixes: 263449831 Test: atest service.incremental_test Change-Id: Ia3da6ca047c46807cbd72ef797bb4b300c38efb3 (cherry picked from commit 96cac56f51fdac09d7e542d4dfa852b91b53e99b) Merged-In: Ia3da6ca047c46807cbd72ef797bb4b300c38efb3
-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 a49577b21957..1aeb0ca6f8ae 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");
}