OSDN Git Service

Add read permissions to wm trace file
authorVishnu Nair <vishnun@google.com>
Fri, 17 Nov 2017 00:35:22 +0000 (16:35 -0800)
committerVishnu Nair <vishnun@google.com>
Fri, 17 Nov 2017 01:07:59 +0000 (17:07 -0800)
- 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

index 5657f6c..6aa5101 100644 (file)
@@ -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;