From 14ce96449e328f7ebfbbfe176c36ed4bf0d2e4aa Mon Sep 17 00:00:00 2001 From: Vishnu Nair Date: Thu, 16 Nov 2017 16:35:22 -0800 Subject: Add read permissions to wm trace file - rename window trace file path to use common location Bug: 64831661 Test: adb shell cmd window tracing start && adb shell cmd window tracing stop && adb bugreport ~/tmp.zip; Change-Id: I85fb8e29477f8512120359571e4ef96929d65917 --- services/core/java/com/android/server/wm/WindowTracing.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/wm/WindowTracing.java b/services/core/java/com/android/server/wm/WindowTracing.java index 5657f6c4f9c5..6aa51016ebe9 100644 --- a/services/core/java/com/android/server/wm/WindowTracing.java +++ b/services/core/java/com/android/server/wm/WindowTracing.java @@ -67,6 +67,7 @@ class WindowTracing { mWriteQueue.clear(); mTraceFile.delete(); try (OutputStream os = new FileOutputStream(mTraceFile)) { + mTraceFile.setReadable(true, false); ProtoOutputStream proto = new ProtoOutputStream(os); proto.write(MAGIC_NUMBER, MAGIC_NUMBER_VALUE); proto.flush(); @@ -147,7 +148,7 @@ class WindowTracing { } static WindowTracing createDefaultAndStartLooper(Context context) { - File file = new File("/data/system/window_trace.proto"); + File file = new File("/data/misc/wmtrace/wm_trace.pb"); WindowTracing windowTracing = new WindowTracing(file); new Thread(windowTracing::loop, "window_tracing").start(); return windowTracing; -- cgit v1.2.3-59-g8ed1b