summaryrefslogtreecommitdiff
path: root/services/contentcapture/java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-05-29 19:01:30 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2020-05-29 19:01:30 +0000
commit219daf9eefbb92b11ff87060ece8b0f83d9e622b (patch)
treefe5acca3376ee37a579d1a09ad05dafe5e592a20 /services/contentcapture/java
parentd4fe81e7e76fdd990321532bee21b49887a1b780 (diff)
parent3b3445d5e5733479f84b49540f15539c0854d87d (diff)
Merge "Close a file descriptor that's a copy of the one that the receiver receives." into rvc-dev
Diffstat (limited to 'services/contentcapture/java')
-rw-r--r--services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
index ce539dabfac1..fcdf3cf6f857 100644
--- a/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
+++ b/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java
@@ -960,10 +960,11 @@ public final class ContentCaptureManagerService extends
mClientAdapter.write(sourceIn);
serviceAdapter.start(sinkOut);
- // File descriptor received by the client app will be a copy of the current one. Close
- // the one that belongs to the system server, so there's only 1 open left for the
- // current pipe.
- bestEffortCloseFileDescriptor(sourceIn);
+ // File descriptors received by remote apps will be copies of the current one. Close
+ // the ones that belong to the system server, so there's only 1 open left for the
+ // current pipe. Therefore when remote parties decide to close them - all descriptors
+ // pointing to the pipe will be closed.
+ bestEffortCloseFileDescriptors(sourceIn, sinkOut);
mParentService.mDataShareExecutor.execute(() -> {
try (InputStream fis =