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

Commit 1e6f03bf authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Move the remaining am commands to ActivityManagerShellCommand."

parents 04afb248 331084dc
Loading
Loading
Loading
Loading
+70 −1819

File changed.

Preview size limit exceeded, changes collapsed.

+19 −0
Original line number Diff line number Diff line
@@ -187,6 +187,25 @@ public abstract class ShellCommand {
        return mInputStream;
    }

    /**
     * Helper for just system services to ask the shell to open an output file.
     * @hide
     */
    public ParcelFileDescriptor openOutputFileForSystem(String path) {
        try {
            ParcelFileDescriptor pfd = getShellCallback().openOutputFile(path,
                    "u:r:system_server:s0");
            if (pfd != null) {
                return pfd;
            }
        } catch (RuntimeException e) {
            getErrPrintWriter().println("Failure opening file: " + e.getMessage());
        }
        getErrPrintWriter().println("Error: Unable to open file: " + path);
        getErrPrintWriter().println("Consider using a file under /data/local/tmp/");
        return null;
    }

    /**
     * Return the next option on the command line -- that is an argument that
     * starts with '-'.  If the next argument is not an option, null is returned.
+2274 −140

File changed.

Preview size limit exceeded, changes collapsed.