summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 5e6200c7e975..81a547290d5e 100644
--- a/services/incremental/IncrementalService.cpp
+++ b/services/incremental/IncrementalService.cpp
@@ -2831,6 +2831,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");
}