From 8b33f032327f8de0dcc0e6d0d43ed80f834b51f6 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Tue, 24 Jul 2012 20:43:54 -0700 Subject: update SF binder protocol to support setting display attributes no change of functionality -- the old behavior is implemented on top of this new protocol. this new protocol will allow, eventually, to pass informations about displays and layer stacks. Change-Id: Ic6c2295e61ec8ecbc8ce01ab7664e35d928202fc --- services/surfaceflinger/SurfaceFlinger.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'services/surfaceflinger/SurfaceFlinger.cpp') diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index ad3865ed0e..8da2543da7 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -143,7 +143,11 @@ void SurfaceFlinger::binderDied(const wp& who) // reset screen orientation Vector state; - setTransactionState(state, eOrientationDefault, 0); + Vector displays; + DisplayState d; + d.orientation = eOrientationDefault; + displays.add(d); + setTransactionState(state, displays, 0); // restart the boot-animation startBootAnim(); @@ -1325,10 +1329,19 @@ uint32_t SurfaceFlinger::setTransactionFlags(uint32_t flags) } -void SurfaceFlinger::setTransactionState(const Vector& state, - int orientation, uint32_t flags) { +void SurfaceFlinger::setTransactionState( + const Vector& state, + const Vector& displays, + uint32_t flags) +{ Mutex::Autolock _l(mStateLock); + int orientation = eOrientationUnchanged; + if (displays.size()) { + // TODO: handle all displays + orientation = displays[0].orientation; + } + uint32_t transactionFlags = 0; if (mCurrentState.orientation != orientation) { if (uint32_t(orientation)<=eOrientation270 || orientation==42) { -- cgit v1.2.3-59-g8ed1b