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

Commit 9db0d1b8 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Shuffle FD ownership? \noideadog"

parents 0256ebef a651b783
Loading
Loading
Loading
Loading
+21 −21
Original line number Diff line number Diff line
@@ -2419,10 +2419,12 @@ class PackageManagerShellCommand extends ShellCommand {

    private int doWriteSplit(int sessionId, String inPath, long sizeBytes, String splitName,
            boolean logSuccess) throws RemoteException {
        PackageInstaller.Session session = null;
        try {
            final PrintWriter pw = getOutPrintWriter();
            final ParcelFileDescriptor fd;
            if (STDIN_PATH.equals(inPath)) {
            fd = new ParcelFileDescriptor(getInFileDescriptor());
                fd = ParcelFileDescriptor.dup(getInFileDescriptor());
            } else if (inPath != null) {
                fd = openFileForSystem(inPath, "r");
                if (fd == null) {
@@ -2434,15 +2436,13 @@ class PackageManagerShellCommand extends ShellCommand {
                    return -1;
                }
            } else {
            fd = new ParcelFileDescriptor(getInFileDescriptor());
                fd = ParcelFileDescriptor.dup(getInFileDescriptor());
            }
            if (sizeBytes <= 0) {
                getErrPrintWriter().println("Error: must specify a APK size");
                return 1;
            }

        PackageInstaller.Session session = null;
        try {
            session = new PackageInstaller.Session(
                    mInterface.getPackageInstaller().openSession(sessionId));
            session.write(splitName, 0, sizeBytes, fd);