summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Wasilczyk <twasilczyk@google.com>2017-05-01 23:17:45 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-05-01 23:17:47 +0000
commit87c3a2576793e5a7bb3669f202eae3440e5121f6 (patch)
tree98fe0b11d9cde32473ffb65af068e516bdb7f6b1
parentd81f12798607248c5db196cb21ef7dcb30b17bab (diff)
parent180b7a37b33c2f757563e2218e397e180c811b43 (diff)
downloadlibhardware-87c3a2576793e5a7bb3669f202eae3440e5121f6.tar.gz
Merge "Convert radio.fm.default to soong, set Werror flag and fix warnings."android-wear-o-preview-4android-wear-o-preview-3android-o-preview-2
-rw-r--r--modules/radio/Android.bp48
-rw-r--r--modules/radio/Android.mk40
-rw-r--r--modules/radio/radio_hw.c3
3 files changed, 48 insertions, 43 deletions
diff --git a/modules/radio/Android.bp b/modules/radio/Android.bp
new file mode 100644
index 00000000..01dc035f
--- /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 221424f3..00000000
--- a/modules/radio/Android.mk
+++ /dev/null
@@ -1,40 +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_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 f1448da0..298bf755 100644
--- a/modules/radio/radio_hw.c
+++ b/modules/radio/radio_hw.c
@@ -629,8 +629,6 @@ exit:
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;
@@ -745,7 +743,6 @@ static int rdev_open(const hw_module_t* module, const char* name,
hw_device_t** device)
{
struct stub_radio_device *rdev;
- int ret;
if (strcmp(name, RADIO_HARDWARE_DEVICE) != 0)
return -EINVAL;