Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c495455b authored by Josh Gao's avatar Josh Gao Committed by Automerger Merge Worker
Browse files

Merge "Fix file descriptor ownership." am: 72376bf0

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

Change-Id: I411c002095090acf12bb576051f5b05106f3dd30
parents ca5aa7df 72376bf0
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
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;
    }