SF: Remove display lookup in SurfaceTracing

Remove the strong reference to prevent a removed display from being
destroyed off the main thread. This is also a step in adding thread
annotations to display state accessors.

Also, clean up SurfaceTracing usage in the SurfaceFlinger class.

Bug: 123715322
Test: Tracing still works.
Change-Id: Iad174e7b42fbde96a46155c740838f6cd3966365
diff --git a/services/surfaceflinger/SurfaceTracing.h b/services/surfaceflinger/SurfaceTracing.h
index e90fc4d..f208eb8 100644
--- a/services/surfaceflinger/SurfaceTracing.h
+++ b/services/surfaceflinger/SurfaceTracing.h
@@ -27,8 +27,6 @@
 #include <queue>
 #include <thread>
 
-#include "DisplayDevice.h"
-
 using namespace android::surfaceflinger;
 
 namespace android {
@@ -44,7 +42,7 @@
 class SurfaceTracing {
 public:
     explicit SurfaceTracing(SurfaceFlinger& flinger);
-    void enable();
+    bool enable();
     bool disable();
     status_t writeToFile();
     bool isEnabled() const;
@@ -92,9 +90,7 @@
     void mainLoop();
     bool addFirstEntry();
     LayersTraceProto traceWhenNotified();
-    LayersTraceProto traceLayersLocked(const char* where,
-                                       const sp<const DisplayDevice>& displayDevice)
-            REQUIRES(mSfLock);
+    LayersTraceProto traceLayersLocked(const char* where) REQUIRES(mSfLock);
 
     // Returns true if trace is enabled.
     bool addTraceToBuffer(LayersTraceProto& entry);