SF: default display is active display

For devices with multiple internal displays, choose the internal
display the is powered on (if any) to be the default display that
would be used mainly for vsync tracking.

Bug: 187539899
Test: SF unit tests
Change-Id: Icc305cdeec1c8a04729f00ff795dfbb806d8f72c
Merged-In: Icc305cdeec1c8a04729f00ff795dfbb806d8f72c
diff --git a/services/surfaceflinger/DisplayDevice.h b/services/surfaceflinger/DisplayDevice.h
index 70dcc1e..e5fe067 100644
--- a/services/surfaceflinger/DisplayDevice.h
+++ b/services/surfaceflinger/DisplayDevice.h
@@ -79,6 +79,9 @@
 
     bool isVirtual() const { return !mConnectionType; }
     bool isPrimary() const { return mIsPrimary; }
+    bool isInternal() const {
+        return !isVirtual() && mConnectionType == ui::DisplayConnectionType::Internal;
+    }
 
     // isSecure indicates whether this display can be trusted to display
     // secure surfaces.