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

Commit 344960b4 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Josh Gao
Browse files

Shuffle FD ownership? \noideadog

Test: manual
Bug: 111746860
Change-Id: I1d88bcf81efe71d622bcf3056a6d7c1a4c793383
(cherry picked from commit a651b783)
parent 9b04b2fd
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);