Merge "Close a file descriptor that's a copy of the one that the receiver receives." into rvc-dev am: 219daf9eef

Change-Id: I14625c5d29608b15c078d5421bf9ddf1162bdbc4
This commit is contained in:
TreeHugger Robot
2020-05-29 19:18:08 +00:00
committed by Automerger Merge Worker

View File

@@ -960,10 +960,11 @@ public final class ContentCaptureManagerService extends
mClientAdapter.write(sourceIn); mClientAdapter.write(sourceIn);
serviceAdapter.start(sinkOut); serviceAdapter.start(sinkOut);
// File descriptor received by the client app will be a copy of the current one. Close // File descriptors received by remote apps will be copies of the current one. Close
// the one that belongs to the system server, so there's only 1 open left for the // the ones that belong to the system server, so there's only 1 open left for the
// current pipe. // current pipe. Therefore when remote parties decide to close them - all descriptors
bestEffortCloseFileDescriptor(sourceIn); // pointing to the pipe will be closed.
bestEffortCloseFileDescriptors(sourceIn, sinkOut);
mParentService.mDataShareExecutor.execute(() -> { mParentService.mDataShareExecutor.execute(() -> {
try (InputStream fis = try (InputStream fis =