Merge "Set read file permissions for WM trace"

This commit is contained in:
TreeHugger Robot
2019-03-13 20:19:38 +00:00
committed by Android (Google) Code Review

View File

@@ -93,8 +93,8 @@ class WindowTraceBuffer {
void writeTraceToFile(File traceFile) throws IOException {
synchronized (mBufferLock) {
traceFile.delete();
traceFile.setReadable(true, false);
try (OutputStream os = new FileOutputStream(traceFile)) {
traceFile.setReadable(true /* readable */, false /* ownerOnly */);
ProtoOutputStream proto = new ProtoOutputStream();
proto.write(MAGIC_NUMBER, MAGIC_NUMBER_VALUE);
os.write(proto.getBytes());