create gBsConstructorMap; add wrapPassthrough

Similar to gBnConstructorMap, this map helps wrapping a local
interface with the smallest BsFoo possible. They are added
in Static.h/cpp.

Added HidlPassthroughSupport.h/cpp to hold wrapPassthrough.

Also fixes a few Return object isOk() checks.

Fix: 33307350

Test: hidl_test

Change-Id: I92a7283699bfe5b022df5ab5a9ead5690477ea97
diff --git a/transport/include/hidl/HidlPassthroughSupport.h b/transport/include/hidl/HidlPassthroughSupport.h
new file mode 100644
index 0000000..2b2f86b
--- /dev/null
+++ b/transport/include/hidl/HidlPassthroughSupport.h
@@ -0,0 +1,36 @@
+/*
+ * 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.
+ */
+
+#ifndef ANDROID_HIDL_PASSTHROUGH_SUPPORT_H
+#define ANDROID_HIDL_PASSTHROUGH_SUPPORT_H
+
+#include <android/hidl/base/1.0/IBase.h>
+
+namespace android {
+namespace hardware {
+
+/*
+ * Wrap the given interface with the smallest BsChild possible. Will return the
+ * argument directly if nullptr or isRemote().
+ */
+sp<::android::hidl::base::V1_0::IBase> wrapPassthrough(
+        sp<::android::hidl::base::V1_0::IBase> iface);
+
+}  // namespace hardware
+}  // namespace android
+
+
+#endif  // ANDROID_HIDL_PASSTHROUGH_SUPPORT_H