Pass fences with buffers from SurfaceTextureClient

Change-Id: I09b49433788d01e8b2b3684bb4d0112be29538d3
diff --git a/include/ui/Fence.h b/include/ui/Fence.h
index 3d49e6a..17cb018 100644
--- a/include/ui/Fence.h
+++ b/include/ui/Fence.h
@@ -51,6 +51,11 @@
     // closed.
     Fence(int fenceFd);
 
+    // Check whether the Fence has an open fence file descriptor. Most Fence
+    // methods treat an invalid file descriptor just like a valid fence that
+    // is already signalled, so using this is usually not necessary.
+    bool isValid() const { return mFenceFd != -1; }
+
     // wait waits for up to timeout milliseconds for the fence to signal.  If
     // the fence signals then NO_ERROR is returned. If the timeout expires
     // before the fence signals then -ETIME is returned.  A timeout of