Support SurfaceView synchronization.

Add API for fetching the next frame number to be produced by
a given buffer producer. Add an API to SurfaceComposer to 
defer execution of the current transaction until a given frame number. 
Together these may be used to synchronize app drawing and surface 
control updates.

Change-Id: I8e0f4993332ac0199c768c88581a453fefbaff1d
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index eafda86..06f13e8 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -38,6 +38,8 @@
     *reinterpret_cast<layer_state_t::matrix22_t *>(
             output.writeInplace(sizeof(layer_state_t::matrix22_t))) = matrix;
     output.write(crop);
+    output.writeStrongBinder(handle);
+    output.writeUint64(frameNumber);
     output.write(transparentRegion);
     return NO_ERROR;
 }
@@ -62,6 +64,8 @@
         return BAD_VALUE;
     }
     input.read(crop);
+    handle = input.readStrongBinder();
+    frameNumber = input.readUint64();
     input.read(transparentRegion);
     return NO_ERROR;
 }