Move HidlSupport and IServiceManager from libhwbinder.

libhidl will contain data types and functionality that
is independent from libhwbinder, such as hidl_vec,
hidl_string, etc.

libhidl also contains an implementation of the service
manager interface. Initially that implementation is
exactly the same as the servicemanager we had in libhwbinder,
but eventually it should be capable of passing out
pass-through or remote HAL interfaces as well. Therefore,
the servicemanager belongs more in libhidl than in libhwbinder.

This initial version of the library still links against
libhwbinder because of the following dependencies:
- hidl_vec/hidl_string have methods for (de)serialization
  to/from a Parcel
- IServiceManager requires instantiation of a proxy for
  the hwbinder ServiceManager.

These can be dealt with in the future, if we deem it necessary,
since they don't leak through to clients; clients can link
against libhidl only when we have the other changes to the
class hierarchy in place.

Bug: 30839546
Change-Id: Ib05de8c98ba8a807618a0b2e37d809a29d2de9ca
diff --git a/include/hidl/Static.h b/include/hidl/Static.h
new file mode 100644
index 0000000..a021e6e
--- /dev/null
+++ b/include/hidl/Static.h
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2016 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// All static variables go here, to control initialization and
+// destruction order in the library.
+
+#include <utils/threads.h>
+#include <hidl/IServiceManager.h>
+
+namespace android {
+namespace hardware {
+
+// For IServiceManager.cpp
+extern Mutex gDefaultServiceManagerLock;
+extern sp<IServiceManager> gDefaultServiceManager;
+
+}   // namespace hardware
+}   // namespace android