libqservice: Add a client interface.

Add a client interface which interfaces with hwc.
qservice upon receiving IPC, provides a callback notification to the qclient
which does appropriate stuff in hwc.

In future, qservice can safely be even made a separate process with no changes
to exisiting code. This was not true earlier owing to the hwc pointer held by
qservice forcing it to be in the same process that hwc is in.

CRs-fixed: 452977
Change-Id: I05838c213f5d4606a6573693de1bacbc5876107e
diff --git a/libqservice/QService.h b/libqservice/QService.h
index ab458a4..4f7e570 100644
--- a/libqservice/QService.h
+++ b/libqservice/QService.h
@@ -1,5 +1,5 @@
 /*
- *  Copyright (c) 2012, The Linux Foundation. All rights reserved.
+ *  Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -35,6 +35,7 @@
 #include <cutils/log.h>
 #include <binder/IServiceManager.h>
 #include <IQService.h>
+#include <IQClient.h>
 
 struct hwc_context_t;
 
@@ -46,11 +47,12 @@
     virtual ~QService();
     virtual void securing(uint32_t startEnd);
     virtual void unsecuring(uint32_t startEnd);
-    static QService* getInstance(hwc_context_t *ctx);
+    virtual void connect(const android::sp<qClient::IQClient>& client);
+    static void init();
 private:
-    QService(hwc_context_t *ctx);
+    QService();
+    android::sp<qClient::IQClient> mClient;
     static QService *sQService;
-    hwc_context_t *mHwcContext;
 };
 }; // namespace qService
 #endif // ANDROID_QSERVICE_H