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

Commit 3853f7b0 authored by Tobias Thierer's avatar Tobias Thierer Committed by Automerger Merge Worker
Browse files

Merge "Fix file descriptor ownership." into rvc-dev am: 21ff6de8 am: 88e39e1b am: 965c456f

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

Change-Id: I8e13a33fc56c513a7b9d94078ed3b1b9f1a488a8
parents 097dd224 965c456f
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
package com.android.server.backup.restore;
package com.android.server.backup.restore;


import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor;
import android.os.ParcelFileDescriptor.AutoCloseInputStream;


import libcore.io.IoUtils;
import libcore.io.IoUtils;


import java.io.FileInputStream;
import java.io.InputStream;
import java.io.InputStream;


class FullRestoreEngineThread implements Runnable {
class FullRestoreEngineThread implements Runnable {
@@ -19,7 +19,7 @@ class FullRestoreEngineThread implements Runnable {
        // We *do* want this FileInputStream to own the underlying fd, so that
        // 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
        // when we are finished with it, it closes this end of the pipe in a way
        // that signals its other end.
        // 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
        // Tell it to be sure to leave the agent instance up after finishing
        mMustKillAgent = false;
        mMustKillAgent = false;
    }
    }