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

Commit 7bea563b authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Do not trigger a disk write violation during dumpsys gfxinfo

Writing to a pipe FD here is okay because it doesn't write to
the physical disk.

Bug: 203682422
Test: dumpsys gfxinfo
Change-Id: Ibb484f0d466d13e55d2c8059a5af964641281110
parent 2edc6b83
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4645,12 +4645,14 @@ public final class ActivityThread extends ClientTransactionHandler
    }

    private void handleDumpGfxInfo(DumpComponentInfo info) {
        final StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskWrites();
        try {
            ThreadedRenderer.handleDumpGfxInfo(info.fd.getFileDescriptor(), info.args);
        } catch (Exception e) {
            Log.w(TAG, "Caught exception from dumpGfxInfo()", e);
        } finally {
            IoUtils.closeQuietly(info.fd);
            StrictMode.setThreadPolicy(oldPolicy);
        }
    }