diff --git a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java index 31ea5faa05f18..9a33fc9548a00 100644 --- a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java +++ b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java @@ -998,6 +998,11 @@ public final class ContentCaptureManagerService extends sendErrorSignal(mClientAdapterReference, serviceAdapterReference, ContentCaptureManager.DATA_SHARE_ERROR_UNKNOWN); + } finally { + synchronized (parentService.mLock) { + parentService.mPackagesWithShareRequests + .remove(mDataShareRequest.getPackageName()); + } } });