From 11676d963f3a5c0148ec4d764b5ab55ae9cd40aa Mon Sep 17 00:00:00 2001 From: Ramanan Rajeswaran Date: Wed, 22 Aug 2012 14:23:50 -0700 Subject: [PATCH] Revert "Added display initialization method" This reverts commit 3f3956236aac97b6aa25fa89f0983d5e9d065fdb Change-Id: Ia2a15d9a5db88add6019edf9d955cef1f73d432d --- services/surfaceflinger/SurfaceFlinger.cpp | 44 +++++----------------- services/surfaceflinger/SurfaceFlinger.h | 9 +---- 2 files changed, 11 insertions(+), 42 deletions(-) diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index aba701ca8..c63d0cf14 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -137,8 +137,15 @@ void SurfaceFlinger::binderDied(const wp& who) { // the window manager died on us. prepare its eulogy. - // restore initial conditions (default device unblank, etc) - initializeDisplays(); + // reset screen orientation + Vector state; + Vector displays; + DisplayState d; + d.what = DisplayState::eOrientationChanged; + d.token = mDefaultDisplays[DisplayDevice::DISPLAY_ID_MAIN]; + d.orientation = DisplayState::eOrientationDefault; + displays.add(d); + setTransactionState(state, displays, 0); // restart the boot-animation startBootAnim(); @@ -424,9 +431,6 @@ status_t SurfaceFlinger::readyToRun() // We're now ready to accept clients... mReadyToRunBarrier.open(); - // set initial conditions (e.g. unblank default device) - initializeDisplays(); - // start boot animation startBootAnim(); @@ -1697,36 +1701,6 @@ status_t SurfaceFlinger::onLayerDestroyed(const wp& layer) // --------------------------------------------------------------------------- -void SurfaceFlinger::onInitializeDisplays() { - // reset screen orientation - Vector state; - Vector displays; - DisplayState d; - d.what = DisplayState::eOrientationChanged; - d.token = mDefaultDisplays[DisplayDevice::DISPLAY_ID_MAIN]; - d.orientation = DisplayState::eOrientationDefault; - displays.add(d); - setTransactionState(state, displays, 0); - - // XXX: this should init default device to "unblank" and all other devices to "blank" - onScreenAcquired(); -} - -void SurfaceFlinger::initializeDisplays() { - class MessageScreenInitialized : public MessageBase { - SurfaceFlinger* flinger; - public: - MessageScreenInitialized(SurfaceFlinger* flinger) : flinger(flinger) { } - virtual bool handler() { - flinger->onInitializeDisplays(); - return true; - } - }; - sp msg = new MessageScreenInitialized(this); - postMessageAsync(msg); // we may be called from main thread, use async message -} - - void SurfaceFlinger::onScreenAcquired() { ALOGD("Screen about to return, flinger = %p", this); sp hw(getDefaultDisplayDevice()); // XXX: this should be per DisplayDevice diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index b1fe7383c..1f799068d 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -231,11 +231,9 @@ private: void signalLayerUpdate(); void signalRefresh(); - // called on the main thread in response to initializeDisplays() - void onInitializeDisplays(); - // called on the main thread in response to blank() + // called on the main thread in response to screenReleased() void onScreenReleased(); - // called on the main thread in response to unblank() + // called on the main thread in response to screenAcquired() void onScreenAcquired(); void handleMessageTransaction(); @@ -323,9 +321,6 @@ private: /* ------------------------------------------------------------------------ * Display and layer stack management */ - // called when starting, or restarting after system_server death - void initializeDisplays(); - sp getDisplayDevice(DisplayID dpy) const { return mDisplays.valueFor(dpy); }