Set read file permissions for WM trace

Test: Flash a device. Enable WM trace. Disable WM trace. Check
/data/misc/wmtrace for the read permissions for wm_trace.pb

Change-Id: Ib5cb7cd825b167156fe1dd5ab62dc99a2a811bdc
This commit is contained in:
Nataniel Borges
2019-03-12 15:16:46 -07:00
parent 1b425f0a7e
commit 8c074c6338

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());