Cache IMapper instances.
am: e5f1e5a262

Change-Id: Ice65d227069c4b336ee9efbc6373f01fddb2b5cc
diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000..9b3f9d9
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,24 @@
+#
+# Copyright (C) 2017 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.
+#
+
+BasedOnStyle: Google
+CommentPragmas: NOLINT:.*
+DerivePointerAlignment: false
+AllowShortFunctionsOnASingleLine: Inline
+ColumnLimit: 100
+TabWidth: 4
+UseTab: Never
+IndentWidth: 4
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
new file mode 100644
index 0000000..213c93a
--- /dev/null
+++ b/PREUPLOAD.cfg
@@ -0,0 +1,5 @@
+[Options]
+ignore_merged_commits = true
+
+[Builtin Hooks]
+clang_format = true
diff --git a/base/Android.bp b/base/Android.bp
index 5ba464a..e4cf6cb 100644
--- a/base/Android.bp
+++ b/base/Android.bp
@@ -23,7 +23,6 @@
         "libutils",
     ],
     export_shared_lib_headers: [
-        "libbase",
         "libutils",
         "libcutils", // for native_handle.h
     ],
diff --git a/base/HidlSupport.cpp b/base/HidlSupport.cpp
index 8223599..4de7f7c 100644
--- a/base/HidlSupport.cpp
+++ b/base/HidlSupport.cpp
@@ -70,7 +70,7 @@
     if (other.mHandle != nullptr) {
         mHandle = native_handle_clone(other.mHandle);
         if (mHandle == nullptr) {
-            LOG(FATAL) << "Failed to clone native_handle in hidl_handle.";
+            PLOG(FATAL) << "Failed to clone native_handle in hidl_handle";
         }
         mOwnsHandle = true;
     } else {
@@ -218,7 +218,7 @@
     // assume my resources are freed.
 
     if (size > UINT32_MAX) {
-        LOG(FATAL) << "string size can't exceed 2^32 bytes.";
+        LOG(FATAL) << "string size can't exceed 2^32 bytes: " << size;
     }
     char *buf = (char *)malloc(size + 1);
     memcpy(buf, data, size);
@@ -252,7 +252,7 @@
 
 void hidl_string::setToExternal(const char *data, size_t size) {
     if (size > UINT32_MAX) {
-        LOG(FATAL) << "string size can't exceed 2^32 bytes.";
+        LOG(FATAL) << "string size can't exceed 2^32 bytes: " << size;
     }
     clear();
 
diff --git a/base/TaskRunner.cpp b/base/TaskRunner.cpp
index 33117e7..782b40b 100644
--- a/base/TaskRunner.cpp
+++ b/base/TaskRunner.cpp
@@ -43,6 +43,10 @@
     }
 }
 
+bool TaskRunner::push(const Task &t) {
+    return (mQueue != nullptr) && (!!t) && this->mQueue->push(t);
+}
+
 } // namespace details
 } // namespace hardware
 } // namespace android
diff --git a/base/include/hidl/MQDescriptor.h b/base/include/hidl/MQDescriptor.h
index abab212..23be971 100644
--- a/base/include/hidl/MQDescriptor.h
+++ b/base/include/hidl/MQDescriptor.h
@@ -17,7 +17,8 @@
 #ifndef _FMSGQ_DESCRIPTOR_H
 #define _FMSGQ_DESCRIPTOR_H
 
-#include <android-base/macros.h>
+#include <unistd.h>
+
 #include <cutils/native_handle.h>
 #include <hidl/HidlInternal.h>
 #include <hidl/HidlSupport.h>
diff --git a/base/include/hidl/Status.h b/base/include/hidl/Status.h
index a04cf77..7c716c7 100644
--- a/base/include/hidl/Status.h
+++ b/base/include/hidl/Status.h
@@ -20,7 +20,6 @@
 #include <cstdint>
 #include <sstream>
 
-#include <android-base/macros.h>
 #include <hidl/HidlInternal.h>
 #include <utils/Errors.h>
 #include <utils/StrongPointer.h>
@@ -195,6 +194,9 @@
         return mVal;
     }
 
+    T withDefault(T t) {
+        return isOk() ? mVal : t;
+    }
 };
 
 template<typename T> class Return<sp<T>> : public details::return_status {
@@ -220,6 +222,10 @@
         assertOk();
         return mVal;
     }
+
+    sp<T> withDefault(sp<T> t) {
+        return isOk() ? mVal : t;
+    }
 };
 
 
diff --git a/base/include/hidl/TaskRunner.h b/base/include/hidl/TaskRunner.h
index 8ecceca..28ea01c 100644
--- a/base/include/hidl/TaskRunner.h
+++ b/base/include/hidl/TaskRunner.h
@@ -52,9 +52,7 @@
      * Add a task. Return true if successful, false if
      * the queue's size exceeds limit or t doesn't contain a callable target.
      */
-    inline bool push(const Task &t) {
-        return (mQueue != nullptr) && (!!t) && this->mQueue->push(t);
-    }
+    bool push(const Task &t);
 
 private:
     std::shared_ptr<SynchronizedQueue<Task>> mQueue;
diff --git a/libhidlmemory/include/hidlmemory/mapping.h b/libhidlmemory/include/hidlmemory/mapping.h
index 8ed0d54..5e1dab3 100644
--- a/libhidlmemory/include/hidlmemory/mapping.h
+++ b/libhidlmemory/include/hidlmemory/mapping.h
@@ -19,7 +19,11 @@
 namespace android {
 namespace hardware {
 
+/**
+ * Returns the IMemory instance corresponding to a hidl_memory object.
+ * If the shared memory cannot be fetched, this returns nullptr.
+ */
 sp<android::hidl::memory::V1_0::IMemory> mapMemory(const hidl_memory &memory);
 
 }  // namespace hardware
-}  // namespace android
\ No newline at end of file
+}  // namespace android
diff --git a/libhidlmemory/mapping.cpp b/libhidlmemory/mapping.cpp
index e3806e8..3cb6485 100644
--- a/libhidlmemory/mapping.cpp
+++ b/libhidlmemory/mapping.cpp
@@ -54,17 +54,20 @@
     sp<IMapper> mapper = getMapperService(memory.name());
 
     if (mapper == nullptr) {
-        LOG(FATAL) << "Could not fetch mapper for " << memory.name() << " shared memory";
+        LOG(ERROR) << "Could not fetch mapper for " << memory.name() << " shared memory";
+        return nullptr;
     }
 
     if (mapper->isRemote()) {
-        LOG(FATAL) << "IMapper must be a passthrough service.";
+        LOG(ERROR) << "IMapper must be a passthrough service.";
+        return nullptr;
     }
 
     Return<sp<IMemory>> ret = mapper->mapMemory(memory);
 
     if (!ret.isOk()) {
-        LOG(FATAL) << "hidl_memory map returned transport error.";
+        LOG(ERROR) << "hidl_memory map returned transport error.";
+        return nullptr;
     }
 
     return ret;
diff --git a/test_main.cpp b/test_main.cpp
index 4be2eb9..bce9294 100644
--- a/test_main.cpp
+++ b/test_main.cpp
@@ -363,6 +363,29 @@
     ret.isOk();
 }
 
+TEST_F(LibHidlTest, ReturnTest) {
+    using ::android::DEAD_OBJECT;
+    using ::android::hardware::Return;
+    using ::android::hardware::Status;
+    using ::android::hardware::hidl_string;
+
+    EXPECT_FALSE(Return<void>(Status::fromStatusT(DEAD_OBJECT)).isOk());
+    EXPECT_TRUE(Return<void>(Status::ok()).isOk());
+
+    hidl_string one = "1";
+    hidl_string two = "2";
+    Return<hidl_string> ret = Return<hidl_string>(Status::fromStatusT(DEAD_OBJECT));
+
+    EXPECT_EQ(one, Return<hidl_string>(one).withDefault(two));
+    EXPECT_EQ(two, ret.withDefault(two));
+
+    hidl_string&& moved = ret.withDefault(std::move(two));
+    EXPECT_EQ("2", moved);
+
+    const hidl_string three = "3";
+    EXPECT_EQ(three, ret.withDefault(three));
+}
+
 std::string toString(const ::android::hardware::Status &s) {
     using ::android::hardware::operator<<;
     std::ostringstream oss;
diff --git a/transport/Android.bp b/transport/Android.bp
index 47a4de3..4e424be 100644
--- a/transport/Android.bp
+++ b/transport/Android.bp
@@ -59,6 +59,7 @@
     srcs: [
         "HidlBinderSupport.cpp",
         "HidlTransportSupport.cpp",
+        "HidlTransportUtils.cpp",
         "ServiceManagement.cpp",
         "Static.cpp"
     ],
diff --git a/transport/HidlBinderSupport.cpp b/transport/HidlBinderSupport.cpp
index f421953..d293542 100644
--- a/transport/HidlBinderSupport.cpp
+++ b/transport/HidlBinderSupport.cpp
@@ -28,6 +28,22 @@
 namespace android {
 namespace hardware {
 
+hidl_binder_death_recipient::hidl_binder_death_recipient(const sp<hidl_death_recipient> &recipient,
+        uint64_t cookie, const sp<::android::hidl::base::V1_0::IBase> &base) :
+    mRecipient(recipient), mCookie(cookie), mBase(base) {
+}
+
+void hidl_binder_death_recipient::binderDied(const wp<IBinder>& /*who*/) {
+    sp<hidl_death_recipient> recipient = mRecipient.promote();
+    if (recipient != nullptr) {
+        recipient->serviceDied(mCookie, mBase);
+    }
+}
+
+wp<hidl_death_recipient> hidl_binder_death_recipient::getRecipient() {
+    return mRecipient;
+}
+
 const size_t hidl_memory::kOffsetOfHandle = offsetof(hidl_memory, mHandle);
 const size_t hidl_memory::kOffsetOfName = offsetof(hidl_memory, mName);
 static_assert(hidl_memory::kOffsetOfHandle == 0, "wrong offset");
@@ -69,7 +85,6 @@
 
     return _hidl_err;
 }
-// static
 const size_t hidl_string::kOffsetOfBuffer = offsetof(hidl_string, mBuffer);
 static_assert(hidl_string::kOffsetOfBuffer == 0, "wrong offset");
 
diff --git a/transport/HidlTransportUtils.cpp b/transport/HidlTransportUtils.cpp
new file mode 100644
index 0000000..eda9b8a
--- /dev/null
+++ b/transport/HidlTransportUtils.cpp
@@ -0,0 +1,60 @@
+/*
+ * 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.
+ */
+
+#include <hidl/HidlTransportUtils.h>
+
+namespace android {
+namespace hardware {
+namespace details {
+
+Return<bool> canCastInterface(::android::hidl::base::V1_0::IBase* interface,
+        const char* castTo, bool emitError) {
+    if (interface == nullptr) {
+        return false;
+    }
+
+    bool canCast = false;
+    auto chainRet = interface->interfaceChain([&](const hidl_vec<hidl_string> &types) {
+        for (size_t i = 0; i < types.size(); i++) {
+            if (types[i] == castTo) {
+                canCast = true;
+                break;
+            }
+        }
+    });
+
+    if (!chainRet.isOk()) {
+        // call fails, propagate the error if emitError
+        return emitError
+                ? details::StatusOf<void, bool>(chainRet)
+                : Return<bool>(false);
+    }
+
+    return canCast;
+}
+
+std::string getDescriptor(::android::hidl::base::V1_0::IBase* interface) {
+    std::string myDescriptor{};
+    auto ret = interface->interfaceDescriptor([&](const hidl_string &types) {
+        myDescriptor = types.c_str();
+    });
+    ret.isOk(); // ignored, return empty string if not isOk()
+    return myDescriptor;
+}
+
+}  // namespace details
+}  // namespace hardware
+}  // namespace android
diff --git a/transport/ServiceManagement.cpp b/transport/ServiceManagement.cpp
index 617a858..b14479e 100644
--- a/transport/ServiceManagement.cpp
+++ b/transport/ServiceManagement.cpp
@@ -26,6 +26,7 @@
 
 #include <mutex>
 #include <regex>
+#include <set>
 
 #include <hidl/HidlBinderSupport.h>
 #include <hidl/ServiceManagement.h>
@@ -184,10 +185,11 @@
     return results;
 }
 
-bool matchPackageName(const std::string &lib, std::string *matchedName) {
+bool matchPackageName(const std::string& lib, std::string* matchedName, std::string* implName) {
     std::smatch match;
     if (std::regex_match(lib, match, gLibraryFileNamePattern)) {
         *matchedName = match.str(1) + "::I*";
+        *implName = match.str(2);
         return true;
     }
     return false;
@@ -212,6 +214,44 @@
                  << interfaceName << "/" << instanceName;
 }
 
+using InstanceDebugInfo = hidl::manager::V1_0::IServiceManager::InstanceDebugInfo;
+static inline void fetchPidsForPassthroughLibraries(
+    std::map<std::string, InstanceDebugInfo>* infos) {
+    static const std::string proc = "/proc/";
+
+    std::map<std::string, std::set<pid_t>> pids;
+    std::unique_ptr<DIR, decltype(&closedir)> dir(opendir(proc.c_str()), closedir);
+    if (!dir) return;
+    dirent* dp;
+    while ((dp = readdir(dir.get())) != nullptr) {
+        pid_t pid = strtoll(dp->d_name, NULL, 0);
+        if (pid == 0) continue;
+        std::string mapsPath = proc + dp->d_name + "/maps";
+        std::ifstream ifs{mapsPath};
+        if (!ifs.is_open()) continue;
+
+        for (std::string line; std::getline(ifs, line);) {
+            // The last token of line should look like
+            // vendor/lib64/hw/android.hardware.foo@1.0-impl-extra.so
+            // Use some simple filters to ignore bad lines before extracting libFileName
+            // and checking the key in info to make parsing faster.
+            if (line.back() != 'o') continue;
+            if (line.rfind('@') == std::string::npos) continue;
+
+            auto spacePos = line.rfind(' ');
+            if (spacePos == std::string::npos) continue;
+            auto libFileName = line.substr(spacePos + 1);
+            auto it = infos->find(libFileName);
+            if (it == infos->end()) continue;
+            pids[libFileName].insert(pid);
+        }
+    }
+    for (auto& pair : *infos) {
+        pair.second.clientPids =
+            std::vector<pid_t>{pids[pair.first].begin(), pids[pair.first].end()};
+    }
+}
+
 struct PassthroughServiceManager : IServiceManager {
     Return<sp<IBase>> get(const hidl_string& fqName,
                           const hidl_string& name) override {
@@ -339,6 +379,7 @@
 
     Return<void> debugDump(debugDump_cb _hidl_cb) override {
         using Arch = ::android::hidl::base::V1_0::DebugInfo::Architecture;
+        using std::literals::string_literals::operator""s;
         static std::vector<std::pair<Arch, std::vector<const char *>>> sAllPaths{
             {Arch::IS_64BIT, {HAL_LIBRARY_PATH_ODM_64BIT,
                                       HAL_LIBRARY_PATH_VENDOR_64BIT,
@@ -347,24 +388,32 @@
                                       HAL_LIBRARY_PATH_VENDOR_32BIT,
                                       HAL_LIBRARY_PATH_SYSTEM_32BIT}}
         };
-        std::vector<InstanceDebugInfo> vec;
+        std::map<std::string, InstanceDebugInfo> map;
         for (const auto &pair : sAllPaths) {
             Arch arch = pair.first;
             for (const auto &path : pair.second) {
                 std::vector<std::string> libs = search(path, "", ".so");
                 for (const std::string &lib : libs) {
                     std::string matchedName;
-                    if (matchPackageName(lib, &matchedName)) {
-                        vec.push_back({
-                            .interfaceName = matchedName,
-                            .instanceName = "*",
-                            .clientPids = {},
-                            .arch = arch
-                        });
+                    std::string implName;
+                    if (matchPackageName(lib, &matchedName, &implName)) {
+                        std::string instanceName{"* ("s + path + ")"s};
+                        if (!implName.empty()) instanceName += " ("s + implName + ")"s;
+                        map.emplace(path + lib, InstanceDebugInfo{.interfaceName = matchedName,
+                                                                  .instanceName = instanceName,
+                                                                  .clientPids = {},
+                                                                  .arch = arch});
                     }
                 }
             }
         }
+        fetchPidsForPassthroughLibraries(&map);
+        hidl_vec<InstanceDebugInfo> vec;
+        vec.resize(map.size());
+        size_t idx = 0;
+        for (auto&& pair : map) {
+            vec[idx++] = std::move(pair.second);
+        }
         _hidl_cb(vec);
         return Void();
     }
diff --git a/transport/allocator/1.0/Android.bp b/transport/allocator/1.0/Android.bp
index f127316..b836d26 100644
--- a/transport/allocator/1.0/Android.bp
+++ b/transport/allocator/1.0/Android.bp
@@ -49,13 +49,11 @@
         "liblog",
         "libutils",
         "libcutils",
-        "android.hidl.base@1.0",
     ],
     export_shared_lib_headers: [
         "libhidlbase",
         "libhidltransport",
         "libhwbinder",
         "libutils",
-        "android.hidl.base@1.0",
     ],
 }
diff --git a/transport/allocator/1.0/default/Android.bp b/transport/allocator/1.0/default/Android.bp
index d15d7c2..7d5fd8b 100644
--- a/transport/allocator/1.0/default/Android.bp
+++ b/transport/allocator/1.0/default/Android.bp
@@ -23,7 +23,6 @@
     init_rc: ["android.hidl.allocator@1.0-service.rc"],
 
     shared_libs: [
-        "android.hidl.base@1.0",
         "android.hidl.allocator@1.0",
         "libhidlbase",
         "libhidltransport",
diff --git a/transport/base/1.0/Android.bp b/transport/base/1.0/Android.bp
index a137f78..8382824 100644
--- a/transport/base/1.0/Android.bp
+++ b/transport/base/1.0/Android.bp
@@ -39,24 +39,4 @@
     ],
 }
 
-cc_library_shared {
-    name: "android.hidl.base@1.0",
-    generated_sources: ["android.hidl.base@1.0_genc++"],
-    generated_headers: ["android.hidl.base@1.0_genc++_headers"],
-    export_generated_headers: ["android.hidl.base@1.0_genc++_headers"],
-    vendor_available: true,
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-    ],
-}
+// android.hidl.base@1.0 is exported from libhidltransport
diff --git a/transport/include/hidl/HidlBinderSupport.h b/transport/include/hidl/HidlBinderSupport.h
index a82f977..6f82dbc 100644
--- a/transport/include/hidl/HidlBinderSupport.h
+++ b/transport/include/hidl/HidlBinderSupport.h
@@ -40,18 +40,9 @@
 // DeathRecipient interface.
 struct hidl_binder_death_recipient : IBinder::DeathRecipient {
     hidl_binder_death_recipient(const sp<hidl_death_recipient> &recipient,
-            uint64_t cookie, const sp<::android::hidl::base::V1_0::IBase> &base) :
-        mRecipient(recipient), mCookie(cookie), mBase(base) {
-    }
-    virtual void binderDied(const wp<IBinder>& /*who*/) {
-        sp<hidl_death_recipient> recipient = mRecipient.promote();
-        if (recipient != nullptr) {
-            recipient->serviceDied(mCookie, mBase);
-        }
-    }
-    wp<hidl_death_recipient> getRecipient() {
-        return mRecipient;
-    }
+            uint64_t cookie, const sp<::android::hidl::base::V1_0::IBase> &base);
+    virtual void binderDied(const wp<IBinder>& /*who*/);
+    wp<hidl_death_recipient> getRecipient();
 private:
     wp<hidl_death_recipient> mRecipient;
     uint64_t mCookie;
diff --git a/transport/include/hidl/HidlTransportUtils.h b/transport/include/hidl/HidlTransportUtils.h
index fbd6516..5afb9a6 100644
--- a/transport/include/hidl/HidlTransportUtils.h
+++ b/transport/include/hidl/HidlTransportUtils.h
@@ -28,40 +28,10 @@
  * @param emitError if emitError is false, return Return<bool>{false} on error; if emitError
  * is true, the Return<bool> object contains the actual error.
  */
-inline Return<bool> canCastInterface(::android::hidl::base::V1_0::IBase* interface,
-        const char* castTo, bool emitError = false) {
-    if (interface == nullptr) {
-        return false;
-    }
+Return<bool> canCastInterface(::android::hidl::base::V1_0::IBase* interface,
+        const char* castTo, bool emitError = false);
 
-    bool canCast = false;
-    auto chainRet = interface->interfaceChain([&](const hidl_vec<hidl_string> &types) {
-        for (size_t i = 0; i < types.size(); i++) {
-            if (types[i] == castTo) {
-                canCast = true;
-                break;
-            }
-        }
-    });
-
-    if (!chainRet.isOk()) {
-        // call fails, propagate the error if emitError
-        return emitError
-                ? details::StatusOf<void, bool>(chainRet)
-                : Return<bool>(false);
-    }
-
-    return canCast;
-}
-
-inline std::string getDescriptor(::android::hidl::base::V1_0::IBase* interface) {
-    std::string myDescriptor{};
-    auto ret = interface->interfaceDescriptor([&](const hidl_string &types) {
-        myDescriptor = types.c_str();
-    });
-    ret.isOk(); // ignored, return empty string if not isOk()
-    return myDescriptor;
-}
+std::string getDescriptor(::android::hidl::base::V1_0::IBase* interface);
 
 }   // namespace details
 }   // namespace hardware
diff --git a/transport/manager/1.0/Android.bp b/transport/manager/1.0/Android.bp
index bb712e1..8bdbfa5 100644
--- a/transport/manager/1.0/Android.bp
+++ b/transport/manager/1.0/Android.bp
@@ -42,26 +42,4 @@
     ],
 }
 
-cc_library_shared {
-    name: "android.hidl.manager@1.0",
-    generated_sources: ["android.hidl.manager@1.0_genc++"],
-    generated_headers: ["android.hidl.manager@1.0_genc++_headers"],
-    export_generated_headers: ["android.hidl.manager@1.0_genc++_headers"],
-    vendor_available: true,
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "android.hidl.base@1.0",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "android.hidl.base@1.0",
-    ],
-}
+// android.hidl.manager@1.0 is exported from libhidltransport
diff --git a/transport/memory/1.0/Android.bp b/transport/memory/1.0/Android.bp
index bcd2321..ec9d0eb 100644
--- a/transport/memory/1.0/Android.bp
+++ b/transport/memory/1.0/Android.bp
@@ -56,13 +56,11 @@
         "liblog",
         "libutils",
         "libcutils",
-        "android.hidl.base@1.0",
     ],
     export_shared_lib_headers: [
         "libhidlbase",
         "libhidltransport",
         "libhwbinder",
         "libutils",
-        "android.hidl.base@1.0",
     ],
 }
diff --git a/transport/memory/1.0/default/Android.bp b/transport/memory/1.0/default/Android.bp
index 3b1b7da..b0c601a 100644
--- a/transport/memory/1.0/default/Android.bp
+++ b/transport/memory/1.0/default/Android.bp
@@ -32,7 +32,6 @@
         "libutils",
         "libhidlbase",
         "libhidltransport",
-        "android.hidl.base@1.0",
         "android.hidl.memory@1.0",
     ],
 }
diff --git a/transport/token/1.0/Android.bp b/transport/token/1.0/Android.bp
index 75ff679..d5825c2 100644
--- a/transport/token/1.0/Android.bp
+++ b/transport/token/1.0/Android.bp
@@ -49,13 +49,11 @@
         "liblog",
         "libutils",
         "libcutils",
-        "android.hidl.base@1.0",
     ],
     export_shared_lib_headers: [
         "libhidlbase",
         "libhidltransport",
         "libhwbinder",
         "libutils",
-        "android.hidl.base@1.0",
     ],
 }
diff --git a/update-makefiles.sh b/update-makefiles.sh
index 7f43031..e82d24c 100755
--- a/update-makefiles.sh
+++ b/update-makefiles.sh
@@ -1,11 +1,5 @@
 #!/bin/bash
 
-# TODO(b/33276472)
-if [ ! -d system/libhidl/transport ] ; then
-  echo "Where is system/libhidl/transport?";
-  exit 1;
-fi
-
 packages=(
     android.hidl.allocator@1.0
     android.hidl.base@1.0