Recombine hidl lib build.

Now that the libraries are combined, also combine their build so that it
is clearer what is going on.

Bug: N/A
Test: N/A
Change-Id: I0db446a99f4ff321107b78c16733b3a4abbe62a1
diff --git a/Android.bp b/Android.bp
index 9207656..5c783b8 100644
--- a/Android.bp
+++ b/Android.bp
@@ -50,7 +50,10 @@
         "libutils",
         "libcutils",
     ],
-    static_libs: ["libgtest", "libgmock"],
+    static_libs: [
+        "libgtest",
+        "libgmock",
+    ],
 
     cflags: [
         "-O0",
@@ -58,21 +61,6 @@
     ],
 }
 
-cc_defaults {
-    name: "libhidlbase-combined-impl",
-
-    defaults: [
-        "libhwbinder-impl-shared-libs",
-        "libhidlbase-impl-shared-libs",
-        "libhidltransport-impl-shared-libs",
-    ],
-
-    whole_static_libs: [
-        "libhidlbase-impl-internal",
-        "libhidltransport-impl-internal",
-    ],
-}
-
 cc_library {
     name: "libhidlbase",
     defaults: ["libhidlbase-combined-impl"],
@@ -112,3 +100,92 @@
     name: "libhidltransport",
     vendor_available: true,
 }
+
+cc_defaults {
+    name: "libhidlbase-combined-impl",
+
+    defaults: [
+        "hidl-module-defaults",
+        "libhidl-defaults",
+        "libhwbinder-impl-shared-libs",
+    ],
+
+    shared_libs: [
+        "libbase",
+        "liblog",
+        "libutils",
+        "libcutils",
+    ],
+    export_shared_lib_headers: [
+        "libcutils", // for native_handle.h
+        "libutils",
+    ],
+    static_libs: [
+        "libhwbinder-impl-internal",
+    ],
+
+    target: {
+        android: {
+            shared_libs: [
+                "libvndksupport",
+            ],
+        },
+        recovery: {
+            exclude_shared_libs: [
+                "libvndksupport",
+            ],
+        },
+    },
+
+    export_include_dirs: [
+        "base/include",
+        "transport/include",
+    ],
+
+    generated_sources: [
+        "android.hidl.manager@1.0_genc++",
+        "android.hidl.manager@1.1_genc++",
+        "android.hidl.manager@1.2_genc++",
+        "android.hidl.base@1.0_genc++",
+    ],
+    generated_headers: [
+        "android.hidl.manager@1.0_genc++_headers",
+        "android.hidl.manager@1.1_genc++_headers",
+        "android.hidl.manager@1.2_genc++_headers",
+        "android.hidl.base@1.0_genc++_headers",
+    ],
+    export_generated_headers: [
+        "android.hidl.manager@1.0_genc++_headers",
+        "android.hidl.manager@1.1_genc++_headers",
+        "android.hidl.manager@1.2_genc++_headers",
+        "android.hidl.base@1.0_genc++_headers",
+    ],
+
+    srcs: [
+        "base/HidlInternal.cpp",
+        "base/HidlSupport.cpp",
+        "base/Status.cpp",
+        "base/TaskRunner.cpp",
+        "transport/HidlBinderSupport.cpp",
+        "transport/HidlLazyUtils.cpp",
+        "transport/HidlPassthroughSupport.cpp",
+        "transport/HidlTransportSupport.cpp",
+        "transport/HidlTransportUtils.cpp",
+        "transport/LegacySupport.cpp",
+        "transport/ServiceManagement.cpp",
+        "transport/Static.cpp",
+    ],
+
+    product_variables: {
+        debuggable: {
+            cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
+        },
+        enforce_vintf_manifest: {
+            cflags: ["-DENFORCE_VINTF_MANIFEST"],
+        },
+    },
+
+    sanitize: {
+        misc_undefined: ["integer"],
+    },
+}
diff --git a/base/Android.bp b/base/Android.bp
deleted file mode 100644
index ca4e259..0000000
--- a/base/Android.bp
+++ /dev/null
@@ -1,59 +0,0 @@
-// 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.
-
-cc_defaults {
-    name: "libhidlbase-impl-shared-libs",
-    shared_libs: [
-        "libbase",
-        "libcutils",
-        "liblog",
-        "libutils",
-    ],
-    export_shared_lib_headers: [
-        "libutils",
-        "libcutils", // for native_handle.h
-    ],
-}
-
-cc_library {
-    name: "libhidlbase-impl-internal",
-    host_supported: true,
-    recovery_available: true,
-    vendor_available: true,
-    defaults: [
-        "libhidlbase-impl-shared-libs",
-        "libhidl-defaults"
-    ],
-    local_include_dirs: ["include"],
-    export_include_dirs: ["include"],
-
-    sanitize: {
-        misc_undefined: ["integer"],
-    },
-
-    srcs: [
-        "HidlInternal.cpp",
-        "HidlSupport.cpp",
-        "Status.cpp",
-        "TaskRunner.cpp",
-    ],
-
-    product_variables: {
-        debuggable: {
-            cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
-        },
-    },
-
-    visibility: ["//system/libhidl:__subpackages__"],
-}
diff --git a/transport/Android.bp b/transport/Android.bp
index 2d5d88c..86603ee 100644
--- a/transport/Android.bp
+++ b/transport/Android.bp
@@ -15,95 +15,3 @@
 hidl_package_root {
     name: "android.hidl",
 }
-
-cc_defaults {
-    name: "libhidltransport-impl-shared-libs",
-    shared_libs: [
-        "libbase",
-        "liblog",
-        "libutils",
-        "libcutils",
-    ],
-    export_shared_lib_headers: [
-        "libutils",
-    ],
-    static_libs: [
-        "libhwbinder-impl-internal",
-    ],
-
-    target: {
-        android: {
-            shared_libs: [
-                "libvndksupport",
-            ],
-        },
-        recovery: {
-            exclude_shared_libs: [
-                "libvndksupport",
-            ],
-        },
-    },
-}
-
-cc_library_static {
-    name: "libhidltransport-impl-internal",
-    host_supported: true,
-    vendor_available: true,
-    recovery_available: true,
-
-    defaults: [
-        "hidl-module-defaults",
-        "libhidl-defaults",
-        "libhidltransport-impl-shared-libs",
-    ],
-
-    static_libs: [
-        "libhidlbase-impl-internal",
-    ],
-    export_static_lib_headers: [
-        "libhidlbase-impl-internal",
-    ],
-
-    export_include_dirs: ["include"],
-
-    generated_sources: [
-        "android.hidl.manager@1.0_genc++",
-        "android.hidl.manager@1.1_genc++",
-        "android.hidl.manager@1.2_genc++",
-        "android.hidl.base@1.0_genc++"
-    ],
-    generated_headers: [
-        "android.hidl.manager@1.0_genc++_headers",
-        "android.hidl.manager@1.1_genc++_headers",
-        "android.hidl.manager@1.2_genc++_headers",
-        "android.hidl.base@1.0_genc++_headers"
-    ],
-    export_generated_headers: [
-        "android.hidl.manager@1.0_genc++_headers",
-        "android.hidl.manager@1.1_genc++_headers",
-        "android.hidl.manager@1.2_genc++_headers",
-        "android.hidl.base@1.0_genc++_headers"
-    ],
-
-    srcs: [
-        "HidlBinderSupport.cpp",
-        "HidlLazyUtils.cpp",
-        "HidlPassthroughSupport.cpp",
-        "HidlTransportSupport.cpp",
-        "HidlTransportUtils.cpp",
-        "LegacySupport.cpp",
-        "ServiceManagement.cpp",
-        "Static.cpp"
-    ],
-
-    product_variables: {
-        debuggable: {
-            cflags: ["-DLIBHIDL_TARGET_DEBUGGABLE"],
-        },
-        enforce_vintf_manifest: {
-            cflags: ["-DENFORCE_VINTF_MANIFEST"]
-        },
-    },
-
-    visibility: ["//system/libhidl:__subpackages__"],
-}
diff --git a/transport/HidlBinderSupport.cpp b/transport/HidlBinderSupport.cpp
index 02d10d0..89b3a24 100644
--- a/transport/HidlBinderSupport.cpp
+++ b/transport/HidlBinderSupport.cpp
@@ -18,9 +18,9 @@
 
 #include <hidl/HidlBinderSupport.h>
 
-#include <InternalStatic.h>  // TODO(b/69122224): remove this include, for getOrCreateCachedBinder
 #include <android/hidl/base/1.0/BpHwBase.h>
 #include <hwbinder/IPCThreadState.h>
+#include "InternalStatic.h"  // TODO(b/69122224): remove this include, for getOrCreateCachedBinder
 
 // C includes
 #include <inttypes.h>
diff --git a/transport/HidlPassthroughSupport.cpp b/transport/HidlPassthroughSupport.cpp
index bc67656..6f30b7b 100644
--- a/transport/HidlPassthroughSupport.cpp
+++ b/transport/HidlPassthroughSupport.cpp
@@ -16,7 +16,7 @@
 
 #include <hidl/HidlPassthroughSupport.h>
 
-#include <InternalStatic.h>  // TODO(b/69122224): remove this include, for tryWrap
+#include "InternalStatic.h"  // TODO(b/69122224): remove this include, for tryWrap
 
 #include <hidl/HidlTransportUtils.h>
 #include <hidl/Static.h>
diff --git a/transport/Static.cpp b/transport/Static.cpp
index af16e8f..240d196 100644
--- a/transport/Static.cpp
+++ b/transport/Static.cpp
@@ -17,8 +17,8 @@
 // All static variables go here, to control initialization and
 // destruction order in the library.
 
-#include <InternalStatic.h>
 #include <hidl/Static.h>
+#include "InternalStatic.h"
 
 #include <android/hidl/manager/1.0/IServiceManager.h>
 #include <utils/Mutex.h>