Eliminate duplicate device creation code
On startup, SurfaceFlinger used a special code path to set up the
primary display.
This removes the code, as all display event processing is done on
initialization, so the normal DisplayDevice creation path is used.
This also resolves some differences between the two code paths so the
primary display is set up the same way.
Bug: 38464421
Test: Settings app is navigable.
Change-Id: Icef8ee6c2ddd26604a33f06fb45ec0a743d82a29
Merged-In: Icef8ee6c2ddd26604a33f06fb45ec0a743d82a29
(cherry picked from commit fcd86617fb5cbbad3463c828211868859de23329)
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 6b743b1..e32fa58 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -483,9 +483,9 @@
// called when starting, or restarting after system_server death
void initializeDisplays();
- // Create an IBinder for a builtin display and add it to current state
+#ifndef USE_HWC2
void createBuiltinDisplayLocked(DisplayDevice::DisplayType type);
-
+#endif
sp<const DisplayDevice> getDisplayDevice(const wp<IBinder>& dpy) const {
Mutex::Autolock _l(mStateLock);
@@ -511,8 +511,6 @@
return getDisplayDeviceLocked(mBuiltinDisplays[DisplayDevice::DISPLAY_PRIMARY]);
}
- void createDefaultDisplayDevice();
-
int32_t getDisplayType(const sp<IBinder>& display) {
if (!display.get()) return NAME_NOT_FOUND;
for (int i = 0; i < DisplayDevice::NUM_BUILTIN_DISPLAY_TYPES; ++i) {