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

Commit 56be27cb authored by Robin Lee's avatar Robin Lee
Browse files

Don't suggest writing to /tmp if we already are

Small fix to not write the suggestion line about saving to
/data/local/tmp/ if that's what we're already trying to do but the
actual problem is file permissions (eg from adb unroot)

Test: adb shell am dumpheap com.android.systemui /data/local/tmp/systemui.hprof
Test: adb shell am dumpheap com.android.systemui /tmp/systemui.hprof
Change-Id: I201456a4a72e3d5c988a14590374b2dd559b97d2
parent 0ecc14fb
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -202,7 +202,11 @@ public abstract class ShellCommand {
            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/");

        String suggestedPath = "/data/local/tmp/";
        if (path == null || !path.startsWith(suggestedPath)) {
            getErrPrintWriter().println("Consider using a file under " + suggestedPath);
        }
        return null;
    }