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

Commit 331084dc authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Move the remaining am commands to ActivityManagerShellCommand.

The only thing not removed is the "instrument" command, which
really needs to run Java code in the shell.  We'll deal with
that later.

Test: manual
Change-Id: I9df0cdf831ac280cb0eb85c857d27166bc00604d
parent 9cf75061
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.