hwc: external: Cleanup overlay objects on external disconnect.

Cleanup overlay objects and close fds when external is disconnected.  Without
this, the external does not come on when cable connected-disconnected multiple
times when device is in suspended state.

Bug: 7150885 (part of the fix)
Bug: 7295979
Bug: 7150885 (partial)
Change-Id: I1ae2ce7220b9928dde332ce3644dbe671d25c7e6
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 37708e6..d27c509 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -168,6 +168,15 @@
 struct hwc_context_t {
     hwc_composer_device_1_t device;
     const hwc_procs_t* proc;
+
+    //Private hwc handlers
+    struct Callbacks {
+        void (*onExtDisconnect)(const Callbacks& priv_proc);
+        hwc_context_t *ctx;
+    };
+
+    Callbacks priv_proc;
+
     int numHwLayers;
     int overlayInUse[HWC_NUM_DISPLAY_TYPES];
 
@@ -199,7 +208,6 @@
     mutable Locker mBlankLock;
     //Vsync
     struct vsync_state vstate;
-
 };
 
 #endif //HWC_UTILS_H