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

Commit d2c9fc51 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Shuffle FD ownership? \noideadog"

am: 46331602

Change-Id: I30e937d0a28361a8e12e9197ef38b0ca8c3840d7
parents b2432b2a 46331602
Loading
Loading
Loading
Loading
+21 −21
Original line number Diff line number Diff line
@@ -2418,10 +2418,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) {
@@ -2433,15 +2435,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);