Merge "Remove stale connections to DataLoaders." into tm-qpr-dev am: da38e58db2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/21342999

Change-Id: I988c7ac970d185bbadd49889d786e990334c111e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2023-02-09 16:17:38 +00:00
committed by Automerger Merge Worker

View File

@@ -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");
}