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

Commit ddec7b1f authored by Felka Chang's avatar Felka Chang Committed by Android (Google) Code Review
Browse files

Merge "Fix hang of `adb shell cmd resources dump ...`"

parents fd214867 953135ff
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -62,13 +62,12 @@ public class ResourcesManagerShellCommand extends ShellCommand {

    private int dumpResources() throws RemoteException {
        String processId = getNextArgRequired();
        try {
        try (ParcelFileDescriptor pfd = ParcelFileDescriptor.dup(getOutFileDescriptor())) {
            ConditionVariable lock = new ConditionVariable();
            RemoteCallback
                    finishCallback = new RemoteCallback(result -> lock.open(), null);

            if (!mInterface.dumpResources(processId,
                    ParcelFileDescriptor.dup(getOutFileDescriptor()), finishCallback)) {
            if (!mInterface.dumpResources(processId, pfd, finishCallback)) {
                getErrPrintWriter().println("RESOURCES DUMP FAILED on process " + processId);
                return -1;
            }