Merge commit 'b28bdeefe25a69d9dd2d9c7adfa11b9aadb7baad' into manual_merge_b28bdeef
Bug: 37512442
Bug: 37159108
Test: it builds
Change-Id: I96a78d45e9f63f82a0b0b904c1ecdcd8fe4ff564
diff --git a/modules/radio/Android.bp b/modules/radio/Android.bp
new file mode 100644
index 0000000..01dc035
--- /dev/null
+++ b/modules/radio/Android.bp
@@ -0,0 +1,48 @@
+// 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.
+
+// Stub radio HAL module, used for tests
+cc_library_shared {
+ name: "radio.fm.default",
+ relative_install_path: "hw",
+ vendor: true,
+ srcs: ["radio_hw.c"],
+ cflags: [
+ "-Wall",
+ "-Wno-unused-parameter",
+ "-Werror",
+ ],
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libradio_metadata",
+ ],
+}
+
+// Stub radio tool that can be run in native.
+cc_binary {
+ name: "radio_hal_tool",
+ srcs: ["radio_hal_tool.c"],
+ cflags: [
+ "-Wall",
+ "-Wno-unused-parameter",
+ "-Werror",
+ ],
+ shared_libs: [
+ "libcutils",
+ "libhardware",
+ "liblog",
+ "libradio_metadata",
+ ],
+}
diff --git a/modules/radio/Android.mk b/modules/radio/Android.mk
deleted file mode 100644
index 6f11169..0000000
--- a/modules/radio/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-# Copyright (C) 2015 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)
-
-# Stub radio HAL module, used for tests
-include $(CLEAR_VARS)
-
-LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
-
-LOCAL_MODULE := radio.fm.default
-LOCAL_MODULE_RELATIVE_PATH := hw
-LOCAL_PROPRIETARY_MODULE := true
-LOCAL_SRC_FILES := radio_hw.c
-LOCAL_SHARED_LIBRARIES := liblog libcutils libradio_metadata
-LOCAL_MODULE_TAGS := optional
-
-include $(BUILD_SHARED_LIBRARY)
-
-# Stub radio tool that can be run in native.
-include $(CLEAR_VARS)
-
-LOCAL_MULTILIB := $(AUDIOSERVER_MULTILIB)
-
-LOCAL_MODULE := radio_hal_tool
-LOCAL_SRC_FILES := radio_hal_tool.c
-LOCAL_CFLAGS := -Wall -Wno-unused-parameter -Werror
-LOCAL_SHARED_LIBRARIES := libcutils libhardware liblog libradio_metadata
-
-include $(BUILD_EXECUTABLE)
diff --git a/modules/radio/radio_hw.c b/modules/radio/radio_hw.c
index 456c866..964a8b6 100644
--- a/modules/radio/radio_hw.c
+++ b/modules/radio/radio_hw.c
@@ -637,8 +637,6 @@
static int rdev_get_properties(const struct radio_hw_device *dev,
radio_hal_properties_t *properties)
{
- struct stub_radio_device *rdev = (struct stub_radio_device *)dev;
-
ALOGI("%s", __func__);
if (properties == NULL)
return -EINVAL;
@@ -753,7 +751,6 @@
hw_device_t** device)
{
struct stub_radio_device *rdev;
- int ret;
if (strcmp(name, RADIO_HARDWARE_DEVICE) != 0)
return -EINVAL;