summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-04-07 23:48:23 -0700
committerSteve Kondik <shade@chemlab.org>2013-04-08 02:23:23 -0700
commit06a8727b06f9f9630bf93cd037d73c3028d26612 (patch)
tree1e02f70a3fbefa194d913dde9ae5547ba181c213
parenteb084f936a6b3ed20ef64e155b5bd064a819c262 (diff)
downloaddevice_samsung_t0lte-06a8727b06f9f9630bf93cd037d73c3028d26612.tar.gz
device_samsung_t0lte-06a8727b06f9f9630bf93cd037d73c3028d26612.tar.bz2
device_samsung_t0lte-06a8727b06f9f9630bf93cd037d73c3028d26612.zip
t0lte: Allow extension by carrier-specific configurations
Change-Id: Icf1cf20fda21579950ede21da7a0e455046087c7
-rw-r--r--Android.mk2
-rw-r--r--BoardCommonConfig.mk38
-rw-r--r--BoardConfig.mk21
-rw-r--r--DeviceSettings/Android.mk2
-rwxr-xr-xaudio/audio_hw.c16
-rw-r--r--audio/audio_hw.h2
-rw-r--r--configs/Android.mk12
-rwxr-xr-xextract-files.sh2
-rw-r--r--t0lte.mk4
9 files changed, 65 insertions, 34 deletions
diff --git a/Android.mk b/Android.mk
index 3164264..8c6c058 100644
--- a/Android.mk
+++ b/Android.mk
@@ -16,7 +16,7 @@
LOCAL_PATH := $(call my-dir)
-ifneq ($(filter t0lte i605 l900 r950,$(TARGET_DEVICE)),)
+ifneq ($(filter t0lte t0lteatt t0ltetmo i605 l900 r950,$(TARGET_DEVICE)),)
include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/BoardCommonConfig.mk b/BoardCommonConfig.mk
new file mode 100644
index 0000000..f95f617
--- /dev/null
+++ b/BoardCommonConfig.mk
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2013 The CyanogenMod 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.
+#
+
+# This variable is set first, so it can be overridden
+# by BoardConfigVendor.mk
+
+LOCAL_PATH := device/samsung/t0lte
+
+# Bluetooth
+BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(LOCAL_PATH)/bluetooth
+BOARD_BLUEDROID_VENDOR_CONF := $(LOCAL_PATH)/bluetooth/vnd_t0lte.txt
+
+# RIL
+COMMON_GLOBAL_CFLAGS += -DPROPERTY_PERMS_APPEND='{ "ril.ks.status", AID_SYSTEM, 0 },'
+
+# Camera
+COMMON_GLOBAL_CFLAGS += -DCAMERA_WITH_CITYID_PARAM
+
+# Kernel
+TARGET_KERNEL_SOURCE := kernel/samsung/smdk4412
+TARGET_KERNEL_CONFIG := cyanogenmod_t0lte_defconfig
+
+# assert
+TARGET_OTA_ASSERT_DEVICE := t0lte,t0ltexx,GT-N7105,t0ltedv,GT-N7105T,t0lteatt,SGH-I317,t0ltetmo,SGH-T889,t0ltecan,t0ltevl,SGH-I317M
+
diff --git a/BoardConfig.mk b/BoardConfig.mk
index ed99f0b..c145f4e 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -16,28 +16,11 @@
# This variable is set first, so it can be overridden
# by BoardConfigVendor.mk
-
-include device/samsung/smdk4412-common/BoardCommonConfig.mk
-include device/samsung/smdk4412-qcom-common/BoardCommonConfig.mk
-LOCAL_PATH := device/samsung/t0lte
-
-# Bluetooth
-BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(LOCAL_PATH)/bluetooth
-BOARD_BLUEDROID_VENDOR_CONF := $(LOCAL_PATH)/bluetooth/vnd_t0lte.txt
-
-# RIL
-COMMON_GLOBAL_CFLAGS += -DPROPERTY_PERMS_APPEND='{ "ril.ks.status", AID_SYSTEM, 0 },'
-
-# Camera
-COMMON_GLOBAL_CFLAGS += -DCAMERA_WITH_CITYID_PARAM
-
-# Kernel
-TARGET_KERNEL_SOURCE := kernel/samsung/smdk4412
-TARGET_KERNEL_CONFIG := cyanogenmod_t0lte_defconfig
-
-# assert
-TARGET_OTA_ASSERT_DEVICE := t0lte,t0ltexx,GT-N7105,t0ltedv,GT-N7105T,t0lteatt,SGH-I317,t0ltetmo,SGH-T889,t0ltecan,t0ltevl,SGH-I317M
+-include device/samsung/t0lte/BoardCommonConfig.mk
# inherit from the proprietary version
-include vendor/samsung/t0lte/BoardConfigVendor.mk
+
diff --git a/DeviceSettings/Android.mk b/DeviceSettings/Android.mk
index c18c07a..b568664 100644
--- a/DeviceSettings/Android.mk
+++ b/DeviceSettings/Android.mk
@@ -1,6 +1,6 @@
LOCAL_PATH:= $(call my-dir)
-ifeq ($(TARGET_DEVICE),t0lte)
+ifneq ($(filter t0lte t0lteatt t0ltetmo,$(TARGET_DEVICE)),)
include $(CLEAR_VARS)
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index b556211..e65b40a 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -3096,19 +3096,15 @@ static int adev_config_parse(struct m0_audio_device *adev)
struct config_parse_state s;
FILE *f;
XML_Parser p;
- char property[PROPERTY_VALUE_MAX];
- char file[80];
int ret = 0;
bool eof = false;
int len;
+ char buf[1024];
- property_get("ro.product.device", property, "tiny_hw");
- snprintf(file, sizeof(file), "/system/etc/sound/%s", property);
-
- ALOGV("Reading configuration from %s\n", file);
- f = fopen(file, "r");
+ ALOGV("Reading configuration from %s\n", CONFIG_FILE);
+ f = fopen(CONFIG_FILE, "r");
if (!f) {
- ALOGE("Failed to open %s\n", file);
+ ALOGE("Failed to open %s\n", CONFIG_FILE);
return -ENODEV;
}
@@ -3126,7 +3122,7 @@ static int adev_config_parse(struct m0_audio_device *adev)
XML_SetElementHandler(p, adev_config_start, adev_config_end);
while (!eof) {
- len = fread(file, 1, sizeof(file), f);
+ len = fread(buf, 1, sizeof(buf), f);
if (ferror(f)) {
ALOGE("I/O error reading config\n");
ret = -EIO;
@@ -3134,7 +3130,7 @@ static int adev_config_parse(struct m0_audio_device *adev)
}
eof = feof(f);
- if (XML_Parse(p, file, len, eof) == XML_STATUS_ERROR) {
+ if (XML_Parse(p, buf, len, eof) == XML_STATUS_ERROR) {
ALOGE("Parse error at line %u:\n%s\n",
(unsigned int)XML_GetCurrentLineNumber(p),
XML_ErrorString(XML_GetErrorCode(p)));
diff --git a/audio/audio_hw.h b/audio/audio_hw.h
index e70f2b1..a35fd5a 100644
--- a/audio/audio_hw.h
+++ b/audio/audio_hw.h
@@ -18,6 +18,8 @@
* limitations under the License.
*/
+#define CONFIG_FILE "/system/etc/sound/tiny_hw.xml"
+
/* ALSA cards for WM1811 */
#define CARD_DEFAULT 0
diff --git a/configs/Android.mk b/configs/Android.mk
new file mode 100644
index 0000000..c0d0384
--- /dev/null
+++ b/configs/Android.mk
@@ -0,0 +1,12 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := tiny_hw
+LOCAL_MODULE_OWNER := samsung
+LOCAL_SRC_FILES := tiny_hw.xml
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_SUFFIX := .xml
+LOCAL_MODULE_PATH := $(TARGET_OUT)/etc/sound
+include $(BUILD_PREBUILT)
+
diff --git a/extract-files.sh b/extract-files.sh
index af7bb63..015cff5 100755
--- a/extract-files.sh
+++ b/extract-files.sh
@@ -25,7 +25,7 @@ adb root
adb wait-for-device
echo "Pulling proprietary files..."
-for FILE in `cat proprietary-files.txt | grep -v ^# | grep -v ^$`; do
+for FILE in `cat ../$DEVICE/proprietary-files.txt | grep -v ^# | grep -v ^$`; do
DIR=`dirname $FILE`
if [ ! -d ../../../vendor/$VENDOR/$DEVICE/proprietary/$DIR ]; then
mkdir -p ../../../vendor/$VENDOR/$DEVICE/proprietary/$DIR
diff --git a/t0lte.mk b/t0lte.mk
index 4965ed1..faa1a1e 100644
--- a/t0lte.mk
+++ b/t0lte.mk
@@ -34,8 +34,8 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/rootdir/ueventd.smdk4x12.rc:root/ueventd.smdk4x12.rc
# Audio
-PRODUCT_COPY_FILES += \
- $(LOCAL_PATH)/configs/tiny_hw.xml:system/etc/sound/t0lte
+PRODUCT_PACKAGES += \
+ tiny_hw
# GPS
PRODUCT_COPY_FILES += \