Merge commit '222107507d126c33bd48647fb92e0b4021fb861f' from
oc-mr1-dev-plus-aosp into stage-aosp-master

Change-Id: Ibd45fbd904abfbb986d8f3adfc415ddd0e35b1e7
diff --git a/Android.bp b/Android.bp
index 64fdde4..5417899 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,7 +1,4 @@
-// This is an autogenerated file, do not edit.
-subdirs = [
-    "net/netd/1.0",
-    "net/netd/1.0/vts/functional",
-    "wifi/keystore/1.0",
-    "wifi/keystore/1.0/vts/functional",
-]
+hidl_package_root {
+    name: "android.system",
+    path: "system/hardware/interfaces",
+}
diff --git a/net/netd/1.0/Android.bp b/net/netd/1.0/Android.bp
index 0746efc..14a79eb 100644
--- a/net/netd/1.0/Android.bp
+++ b/net/netd/1.0/Android.bp
@@ -1,62 +1,17 @@
-// This file is autogenerated by hidl-gen. Do not edit manually.
+// This file is autogenerated by hidl-gen -Landroidbp.
 
-filegroup {
-    name: "android.system.net.netd@1.0_hal",
-    srcs: [
-        "INetd.hal",
-    ],
-}
-
-genrule {
-    name: "android.system.net.netd@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.net.netd@1.0",
-    srcs: [
-        ":android.system.net.netd@1.0_hal",
-    ],
-    out: [
-        "android/system/net/netd/1.0/NetdAll.cpp",
-    ],
-}
-
-genrule {
-    name: "android.system.net.netd@1.0_genc++_headers",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.net.netd@1.0",
-    srcs: [
-        ":android.system.net.netd@1.0_hal",
-    ],
-    out: [
-        "android/system/net/netd/1.0/INetd.h",
-        "android/system/net/netd/1.0/IHwNetd.h",
-        "android/system/net/netd/1.0/BnHwNetd.h",
-        "android/system/net/netd/1.0/BpHwNetd.h",
-        "android/system/net/netd/1.0/BsNetd.h",
-    ],
-}
-
-cc_library {
+hidl_interface {
     name: "android.system.net.netd@1.0",
-    defaults: ["hidl-module-defaults"],
-    generated_sources: ["android.system.net.netd@1.0_genc++"],
-    generated_headers: ["android.system.net.netd@1.0_genc++_headers"],
-    export_generated_headers: ["android.system.net.netd@1.0_genc++_headers"],
-    vendor_available: true,
+    root: "android.system",
     vndk: {
         enabled: true,
     },
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
+    srcs: [
+        "INetd.hal",
     ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
+    interfaces: [
+        "android.hidl.base@1.0",
     ],
+    gen_java: true,
 }
+
diff --git a/net/netd/1.0/vts/functional/Android.bp b/net/netd/1.0/vts/functional/Android.bp
index 61e612a..c79d116 100644
--- a/net/netd/1.0/vts/functional/Android.bp
+++ b/net/netd/1.0/vts/functional/Android.bp
@@ -14,5 +14,7 @@
     cflags: [
         "-O0",
         "-g",
+        "-Wall",
+        "-Werror",
     ],
 }
diff --git a/wifi/keystore/1.0/Android.bp b/wifi/keystore/1.0/Android.bp
index ff47e42..1afcdc2 100644
--- a/wifi/keystore/1.0/Android.bp
+++ b/wifi/keystore/1.0/Android.bp
@@ -1,162 +1,17 @@
-// This file is autogenerated by hidl-gen. Do not edit manually.
+// This file is autogenerated by hidl-gen -Landroidbp.
 
-filegroup {
-    name: "android.system.wifi.keystore@1.0_hal",
-    srcs: [
-        "IKeystore.hal",
-    ],
-}
-
-genrule {
-    name: "android.system.wifi.keystore@1.0_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.wifi.keystore@1.0",
-    srcs: [
-        ":android.system.wifi.keystore@1.0_hal",
-    ],
-    out: [
-        "android/system/wifi/keystore/1.0/KeystoreAll.cpp",
-    ],
-}
-
-genrule {
-    name: "android.system.wifi.keystore@1.0_genc++_headers",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.wifi.keystore@1.0",
-    srcs: [
-        ":android.system.wifi.keystore@1.0_hal",
-    ],
-    out: [
-        "android/system/wifi/keystore/1.0/IKeystore.h",
-        "android/system/wifi/keystore/1.0/IHwKeystore.h",
-        "android/system/wifi/keystore/1.0/BnHwKeystore.h",
-        "android/system/wifi/keystore/1.0/BpHwKeystore.h",
-        "android/system/wifi/keystore/1.0/BsKeystore.h",
-    ],
-}
-
-cc_library {
+hidl_interface {
     name: "android.system.wifi.keystore@1.0",
-    defaults: ["hidl-module-defaults"],
-    generated_sources: ["android.system.wifi.keystore@1.0_genc++"],
-    generated_headers: ["android.system.wifi.keystore@1.0_genc++_headers"],
-    export_generated_headers: ["android.system.wifi.keystore@1.0_genc++_headers"],
-    vendor_available: true,
+    root: "android.system",
     vndk: {
         enabled: true,
     },
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-    ],
-}
-
-genrule {
-    name: "android.system.wifi.keystore-V1.0-java_gen_java",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Ljava -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.wifi.keystore@1.0",
     srcs: [
-        ":android.system.wifi.keystore@1.0_hal",
+        "IKeystore.hal",
     ],
-    out: [
-        "android/system/wifi/keystore/V1_0/IKeystore.java",
+    interfaces: [
+        "android.hidl.base@1.0",
     ],
+    gen_java: true,
 }
 
-java_library {
-    name: "android.system.wifi.keystore-V1.0-java",
-    no_framework_libs: true,
-    defaults: ["hidl-java-module-defaults"],
-    srcs: [":android.system.wifi.keystore-V1.0-java_gen_java"],
-    libs: [
-        "hwbinder",
-        "android.hidl.base-V1.0-java",
-    ]
-}
-
-// This package does not export any types. Not creating java constants export.
-
-
-genrule {
-    name: "android.system.wifi.keystore@1.0-adapter-helper_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-adapter-sources -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.wifi.keystore@1.0",
-    srcs: [
-        ":android.system.wifi.keystore@1.0_hal",
-    ],
-    out: [
-        "android/system/wifi/keystore/1.0/AKeystore.cpp",
-    ],
-}
-
-genrule {
-    name: "android.system.wifi.keystore@1.0-adapter-helper_genc++_headers",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-adapter-headers -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.wifi.keystore@1.0",
-    srcs: [
-        ":android.system.wifi.keystore@1.0_hal",
-    ],
-    out: [
-        "android/system/wifi/keystore/1.0/AKeystore.h",
-    ],
-}
-
-cc_library {
-    name: "android.system.wifi.keystore@1.0-adapter-helper",
-    defaults: ["hidl-module-defaults"],
-    generated_sources: ["android.system.wifi.keystore@1.0-adapter-helper_genc++"],
-    generated_headers: ["android.system.wifi.keystore@1.0-adapter-helper_genc++_headers"],
-    export_generated_headers: ["android.system.wifi.keystore@1.0-adapter-helper_genc++_headers"],
-    vendor_available: true,
-    shared_libs: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "liblog",
-        "libutils",
-        "libcutils",
-        "libhidladapter",
-        "android.system.wifi.keystore@1.0",
-        "android.hidl.base@1.0-adapter-helper",
-    ],
-    export_shared_lib_headers: [
-        "libhidlbase",
-        "libhidltransport",
-        "libhwbinder",
-        "libutils",
-        "libhidladapter",
-        "android.system.wifi.keystore@1.0",
-        "android.hidl.base@1.0-adapter-helper",
-    ],
-}
-
-genrule {
-    name: "android.system.wifi.keystore@1.0-adapter_genc++",
-    tools: ["hidl-gen"],
-    cmd: "$(location hidl-gen) -o $(genDir) -Lc++-adapter-main -randroid.hidl:system/libhidl/transport -randroid.system:system/hardware/interfaces android.system.wifi.keystore@1.0",
-    out: ["main.cpp"]
-}
-
-cc_test {
-    name: "android.system.wifi.keystore@1.0-adapter",
-    defaults: ["hidl-module-defaults"],
-    shared_libs: [
-        "libhidladapter",
-        "libhidlbase",
-        "libhidltransport",
-        "libutils",
-        "android.system.wifi.keystore@1.0",
-        "android.system.wifi.keystore@1.0-adapter-helper",
-    ],
-    generated_sources: ["android.system.wifi.keystore@1.0-adapter_genc++"],
-}
diff --git a/wifi/keystore/1.0/default/Android.bp b/wifi/keystore/1.0/default/Android.bp
new file mode 100644
index 0000000..e6cb6df
--- /dev/null
+++ b/wifi/keystore/1.0/default/Android.bp
@@ -0,0 +1,21 @@
+cc_library_shared {
+    name: "libwifikeystorehal",
+    cppflags: [
+        "-Wall",
+        "-Werror",
+        "-Wextra",
+    ],
+    srcs: ["keystore.cpp"],
+    shared_libs: [
+        "android.system.wifi.keystore@1.0",
+        "libbase",
+        "libbinder",
+        "libcutils",
+        "libhidlbase",
+        "libhidltransport",
+        "libkeystore_binder",
+        "liblog",
+        "libutils",
+    ],
+    export_include_dirs: ["include"],
+}
diff --git a/wifi/keystore/1.0/default/Android.mk b/wifi/keystore/1.0/default/Android.mk
deleted file mode 100644
index 415387f..0000000
--- a/wifi/keystore/1.0/default/Android.mk
+++ /dev/null
@@ -1,33 +0,0 @@
-# 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.
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libwifikeystorehal
-LOCAL_CPPFLAGS := -Wall -Werror -Wextra
-LOCAL_SRC_FILES := \
-    keystore.cpp
-LOCAL_SHARED_LIBRARIES := \
-    android.system.wifi.keystore@1.0 \
-    libbase \
-    libbinder \
-    libcutils \
-    libhidlbase \
-    libhidltransport \
-    libkeystore_binder \
-    liblog \
-    libutils
-LOCAL_EXPORT_C_INCLUDE_DIRS := \
-    $(LOCAL_PATH)/include
-include $(BUILD_SHARED_LIBRARY)