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
This commit is contained in:
Makoto Onuki
2022-01-07 10:18:00 -08:00
parent 2edc6b83a2
commit 7bea563b87

View File

@@ -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);
}
}