release-request-655284b0-7f0b-48b5-b01d-27f48a99f2c0-for-git_oc-mr1-release-4017105 snap-temp-L82600000064873863

Change-Id: I1f3a9aa2646b8d2080979cb58dd048339580412b
diff --git a/Android.bp b/Android.bp
index b5a21a5..ec66f73 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1,3 +1,5 @@
 subdirs = [
+    "client",
+    "hal",
     "messages",
 ]
diff --git a/client/Android.bp b/client/Android.bp
new file mode 100644
index 0000000..c430efe
--- /dev/null
+++ b/client/Android.bp
@@ -0,0 +1,29 @@
+//
+// 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_binary {
+    name: "nvram-client",
+    srcs: ["nvram_client.c"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wextra",
+    ],
+    shared_libs: [
+        "libhardware",
+        "libbase",
+    ],
+}
diff --git a/client/Android.mk b/client/Android.mk
deleted file mode 100644
index f1a852a..0000000
--- a/client/Android.mk
+++ /dev/null
@@ -1,26 +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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := nvram-client
-LOCAL_SRC_FILES := \
-	nvram_client.c
-LOCAL_CFLAGS := -Wall -Werror -Wextra
-LOCAL_CLANG := true
-LOCAL_SHARED_LIBRARIES := libhardware libbase
-include $(BUILD_EXECUTABLE)
diff --git a/hal/Android.bp b/hal/Android.bp
new file mode 100644
index 0000000..f542e0f
--- /dev/null
+++ b/hal/Android.bp
@@ -0,0 +1,57 @@
+//
+// 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.
+//
+
+subdirs = [
+    "tests"
+]
+
+// A static library providing glue logic that simplifies creation of NVRAM HAL
+// modules.
+cc_library_static {
+    name: "libnvram-hal",
+    srcs: ["nvram_device_adapter.cpp"],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wextra",
+    ],
+    export_include_dirs: ["include"],
+    shared_libs: ["libnvram-messages"],
+}
+
+// nvram.testing is the software-only testing NVRAM HAL module backed by the
+// fake_nvram daemon.
+cc_library_shared {
+    name: "nvram.testing",
+    relative_install_path: "hw",
+    srcs: [
+        "testing_module.c",
+        "testing_nvram_implementation.cpp",
+    ],
+    cflags: [
+        "-Wall",
+        "-Werror",
+        "-Wextra",
+        "-fvisibility=hidden",
+    ],
+    static_libs: ["libnvram-hal"],
+    shared_libs: [
+        "libnvram-messages",
+        "libcutils",
+        "libbase",
+    ],
+
+}
diff --git a/hal/Android.mk b/hal/Android.mk
index 7f135df..973ac38 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -16,34 +16,6 @@
 
 LOCAL_PATH := $(call my-dir)
 
-# A static library providing glue logic that simplifies creation of NVRAM HAL
-# modules.
-include $(CLEAR_VARS)
-LOCAL_MODULE := libnvram-hal
-LOCAL_SRC_FILES := \
-	nvram_device_adapter.cpp
-LOCAL_CFLAGS := -Wall -Werror -Wextra
-LOCAL_CLANG := true
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
-LOCAL_SHARED_LIBRARIES := libnvram-messages
-include $(BUILD_STATIC_LIBRARY)
-
-# nvram.testing is the software-only testing NVRAM HAL module backed by the
-# fake_nvram daemon.
-include $(CLEAR_VARS)
-LOCAL_MODULE := nvram.testing
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_SRC_FILES := \
-	testing_module.c \
-	testing_nvram_implementation.cpp
-LOCAL_CLANG := true
-LOCAL_CFLAGS := -Wall -Werror -Wextra -fvisibility=hidden
-LOCAL_STATIC_LIBRARIES := libnvram-hal
-LOCAL_SHARED_LIBRARIES := libnvram-messages libcutils libbase
-LOCAL_MODULE_TAGS := optional
-include $(BUILD_SHARED_LIBRARY)
-
 # fake_nvram is a system daemon that provides a software-only access-controlled
 # NVRAM implementation. This is only for illustration and in order to get code
 # using access-controlled NVRAM running on emulators. It *DOES NOT* meet the
@@ -76,5 +48,3 @@
 LOCAL_SRC_FILES := fake-nvram-seccomp-$(TARGET_ARCH).policy
 LOCAL_MODULE_TARGET_ARCH := arm arm64 x86 x86_64
 include $(BUILD_PREBUILT)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/hal/tests/Android.bp b/hal/tests/Android.bp
new file mode 100644
index 0000000..28d9adf
--- /dev/null
+++ b/hal/tests/Android.bp
@@ -0,0 +1,35 @@
+// 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.
+
+// nvram_hal_test
+// ========================================================
+cc_test {
+    name: "nvram_hal_test",
+
+    cflags: [
+        "-Wall",
+        "-Wextra",
+        "-Werror",
+    ],
+    shared_libs: [
+        "libhardware",
+        "libcrypto",
+        "libbase",
+    ],
+    static_libs: ["libnvram-hal"],
+    srcs: [
+        "nvram_hal_test.cc",
+        "scoped_nvram_device.cc",
+    ],
+}
diff --git a/hal/tests/Android.mk b/hal/tests/Android.mk
deleted file mode 100644
index 3c2573d..0000000
--- a/hal/tests/Android.mk
+++ /dev/null
@@ -1,28 +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.
-
-LOCAL_PATH := $(call my-dir)
-
-# nvram_hal_test
-# ========================================================
-include $(CLEAR_VARS)
-LOCAL_MODULE := nvram_hal_test
-LOCAL_MODULE_TAGS := debug
-LOCAL_CPP_EXTENSION := cc
-LOCAL_CFLAGS := -Wall -Wextra -Werror
-LOCAL_CLANG := true
-LOCAL_SHARED_LIBRARIES := libhardware libcrypto libbase
-LOCAL_STATIC_LIBRARIES := libnvram-hal
-LOCAL_SRC_FILES := nvram_hal_test.cc scoped_nvram_device.cc
-include $(BUILD_NATIVE_TEST)