Merge "Fix file descriptor ownership." into rvc-dev am: 21ff6de81f am: 88e39e1bdf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11872627 Change-Id: Ib814d3da85665156cbbc239325cbb3c4a3b5b9c9
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
package com.android.server.backup.restore;
|
||||
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.ParcelFileDescriptor.AutoCloseInputStream;
|
||||
|
||||
import libcore.io.IoUtils;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
|
||||
class FullRestoreEngineThread implements Runnable {
|
||||
@@ -19,7 +19,7 @@ class FullRestoreEngineThread implements Runnable {
|
||||
// We *do* want this FileInputStream to own the underlying fd, so that
|
||||
// when we are finished with it, it closes this end of the pipe in a way
|
||||
// that signals its other end.
|
||||
mEngineStream = new FileInputStream(engineSocket.getFileDescriptor(), true);
|
||||
mEngineStream = new AutoCloseInputStream(engineSocket);
|
||||
// Tell it to be sure to leave the agent instance up after finishing
|
||||
mMustKillAgent = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user