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
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index ad3865e..8da2543 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -143,7 +143,11 @@
 
     // reset screen orientation
     Vector<ComposerState> state;
-    setTransactionState(state, eOrientationDefault, 0);
+    Vector<DisplayState> displays;
+    DisplayState d;
+    d.orientation = eOrientationDefault;
+    displays.add(d);
+    setTransactionState(state, displays, 0);
 
     // restart the boot-animation
     startBootAnim();
@@ -1325,10 +1329,19 @@
 }
 
 
-void SurfaceFlinger::setTransactionState(const Vector<ComposerState>& state,
-        int orientation, uint32_t flags) {
+void SurfaceFlinger::setTransactionState(
+        const Vector<ComposerState>& state,
+        const Vector<DisplayState>& 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) {
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 569fe35..3ecaa7f 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -165,7 +165,7 @@
     virtual sp<IMemoryHeap> getCblk() const;
     virtual void bootFinished();
     virtual void setTransactionState(const Vector<ComposerState>& state,
-        int orientation, uint32_t flags);
+            const Vector<DisplayState>& displays, uint32_t flags);
     virtual bool authenticateSurfaceTexture(
         const sp<ISurfaceTexture>& surface) const;
     virtual sp<IDisplayEventConnection> createDisplayEventConnection();