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

Commit 40bc741e authored by Aidan Wolter's avatar Aidan Wolter
Browse files

am dumpheap throws error when arguments are after file

The arguments must always be placed before the file path. If arguments
are passed after the file path we now throw an error instead of silently
dropping them.

Bug: 379883920
Change-Id: Ib856d6db3fa480c894fa9d6731d0bb3a26231d0c
parent b6c0fff6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1334,6 +1334,12 @@ final class ActivityManagerShellCommand extends ShellCommand {
            heapFile = "/data/local/tmp/heapdump-" + logNameTimeString + ".prof";
        }

        String argAfterHeapFile = getNextArg();
        if (argAfterHeapFile != null) {
            err.println("Error: Arguments cannot be placed after the heap file");
            return -1;
        }

        // Writes an error message to stderr on failure
        ParcelFileDescriptor fd = openFileForSystem(heapFile, "w");
        if (fd == null) {