From 25949002d6ad7c94d3863b5a577d520c2c75e810 Mon Sep 17 00:00:00 2001 From: Ziyan Date: Fri, 29 Jan 2016 19:19:51 +0100 Subject: Set up unified build for wifi-only variants Change-Id: I9fffe523aefac96e2cd0461b9398806b02e4c131 --- Android.mk | 4 +- AndroidProducts.mk | 19 ++++ BoardConfig.mk | 20 +++++ BoardConfigCommon.mk | 14 +-- aosp_espresso.mk | 34 +++++++ audio/audio_policy.conf | 100 +++++++++++++++++++++ cm.mk | 31 +++++++ device.mk | 32 +++++++ espresso-common.mk | 4 +- .../frameworks/base/core/res/res/values/config.xml | 28 ------ .../frameworks/base/core/res/res/values/config.xml | 87 ++++++++++++++++++ vendorsetup.sh | 1 + 12 files changed, 334 insertions(+), 40 deletions(-) create mode 100644 AndroidProducts.mk create mode 100644 BoardConfig.mk create mode 100644 aosp_espresso.mk create mode 100644 audio/audio_policy.conf create mode 100644 cm.mk create mode 100644 device.mk delete mode 100644 overlay/aosp-p31xx/frameworks/base/core/res/res/values/config.xml create mode 100644 overlay/aosp/frameworks/base/core/res/res/values/config.xml create mode 100644 vendorsetup.sh diff --git a/Android.mk b/Android.mk index 6a291bc..c7b3acd 100644 --- a/Android.mk +++ b/Android.mk @@ -23,8 +23,6 @@ LOCAL_PATH := $(call my-dir) -ifneq ($(filter p3100 p3110 p5100 p5110,$(TARGET_DEVICE)),) - +ifneq ($(filter espresso espresso3g,$(TARGET_DEVICE)),) include $(call all-makefiles-under,$(LOCAL_PATH)) - endif diff --git a/AndroidProducts.mk b/AndroidProducts.mk new file mode 100644 index 0000000..59bba81 --- /dev/null +++ b/AndroidProducts.mk @@ -0,0 +1,19 @@ +# +# Copyright (C) 2012 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. +# + +PRODUCT_MAKEFILES := \ + $(LOCAL_DIR)/aosp_espresso.mk \ + $(LOCAL_DIR)/cm.mk diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..71cb113 --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,20 @@ +# +# 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. +# + +include device/samsung/espresso/BoardConfigCommon.mk + +# assert +TARGET_OTA_ASSERT_DEVICE := espresso,p3110,GT-P3110,p3113,GT-P3113,espressowifi,espressowifixx,p5110,GT-P5110,p5113,GT-P5113,espresso10wifi,espresso10wifixx diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 9ca5c43..4fbd490 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -17,7 +17,7 @@ # Inherit common omap4 board config -include hardware/ti/omap4/BoardConfigCommon.mk -TARGET_SPECIFIC_HEADER_PATH += device/samsung/espresso-common/include +TARGET_SPECIFIC_HEADER_PATH += device/samsung/espresso/include TARGET_NO_BOOTLOADER := true TARGET_NO_RADIOIMAGE := true @@ -89,8 +89,8 @@ BOARD_NO_APSME_ATTR := true # Bluetooth BOARD_HAVE_BLUETOOTH := true BOARD_HAVE_BLUETOOTH_BCM := true -BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/samsung/espresso-common/bluetooth -BOARD_BLUEDROID_VENDOR_CONF := device/samsung/espresso-common/bluetooth/vnd_espresso.txt +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/samsung/espresso/bluetooth +BOARD_BLUEDROID_VENDOR_CONF := device/samsung/espresso/bluetooth/vnd_espresso.txt # Charger BOARD_CHARGER_SHOW_PERCENTAGE := true @@ -103,7 +103,7 @@ BOARD_USE_LEGACY_SENSORS_FUSION := false # Selinux BOARD_SEPOLICY_DIRS += \ - device/samsung/espresso-common/sepolicy + device/samsung/espresso/sepolicy # Recovery TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888" @@ -112,8 +112,8 @@ BOARD_USES_MMCUTILS := true BOARD_HAS_NO_MISC_PARTITION := true BOARD_HAS_NO_SELECT_BUTTON := true BOARD_SUPPRESS_EMMC_WIPE := true -TARGET_RECOVERY_FSTAB := device/samsung/espresso-common/rootdir/etc/fstab.tab2 -TARGET_RECOVERY_DEVICE_DIRS += device/samsung/espresso-common +TARGET_RECOVERY_FSTAB := device/samsung/espresso/rootdir/etc/fstab.tab2 +TARGET_RECOVERY_DEVICE_DIRS += device/samsung/espresso RECOVERY_FSTAB_VERSION := 2 BOARD_HAS_DOWNLOAD_MODE := true @@ -121,5 +121,5 @@ BOARD_HAS_DOWNLOAD_MODE := true BOARD_VENDOR := samsung BOARD_PROVIDES_LIBRIL := true BOARD_MODEM_TYPE := xmm6260 -BOARD_RIL_CLASS := ../../../device/samsung/espresso-common/ril +BOARD_RIL_CLASS := ../../../device/samsung/espresso/ril COMMON_GLOBAL_CFLAGS += -DDISABLE_ASHMEM_TRACKING diff --git a/aosp_espresso.mk b/aosp_espresso.mk new file mode 100644 index 0000000..36ac5e2 --- /dev/null +++ b/aosp_espresso.mk @@ -0,0 +1,34 @@ +# +# Copyright 2013 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. +# + +# Use 44.1 kHz UI sounds +$(call inherit-product-if-exists, frameworks/base/data/sounds/AudioPackage13.mk) + +# This is a wifi-only device +PRODUCT_PROPERTY_OVERRIDES += \ + ro.carrier=wifi-only + +# Inherit from the common Open Source product configuration +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk) + +# Inherit device configuration +$(call inherit-product, device/samsung/espresso/device.mk) + +PRODUCT_NAME := aosp_espresso +PRODUCT_DEVICE := espresso +PRODUCT_BRAND := Android +PRODUCT_MODEL := Galaxy Tab 2 +PRODUCT_MANUFACTURER := Samsung diff --git a/audio/audio_policy.conf b/audio/audio_policy.conf new file mode 100644 index 0000000..303a338 --- /dev/null +++ b/audio/audio_policy.conf @@ -0,0 +1,100 @@ +# Global configuration section: lists input and output devices always present on the device +# as well as the output device selected by default. +# Devices are designated by a string that corresponds to the enum in audio.h + +global_configuration { + attached_output_devices AUDIO_DEVICE_OUT_SPEAKER + default_output_device AUDIO_DEVICE_OUT_SPEAKER + attached_input_devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_REMOTE_SUBMIX +} + +# audio hardware module section: contains descriptors for all audio hw modules present on the +# device. Each hw module node is named after the corresponding hw module library base name. +# For instance, "primary" corresponds to audio.primary..so. +# The "primary" module is mandatory and must include at least one output with +# AUDIO_OUTPUT_FLAG_PRIMARY flag. +# Each module descriptor contains one or more output profile descriptors and zero or more +# input profile descriptors. Each profile lists all the parameters supported by a given output +# or input stream category. +# The "channel_masks", "formats", "devices" and "flags" are specified using strings corresponding +# to enums in audio.h and audio_policy.h. They are concatenated by use of "|" without space or "\n". + +audio_hw_modules { + primary { + outputs { + primary { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE|AUDIO_DEVICE_OUT_ALL_SCO|AUDIO_DEVICE_OUT_ANLG_DOCK_HEADSET|AUDIO_DEVICE_OUT_AUX_DIGITAL|AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET + flags AUDIO_OUTPUT_FLAG_PRIMARY + } + deep_buffer { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_SPEAKER|AUDIO_DEVICE_OUT_WIRED_HEADSET|AUDIO_DEVICE_OUT_WIRED_HEADPHONE + flags AUDIO_OUTPUT_FLAG_DEEP_BUFFER + } + hdmi { + sampling_rates 44100|48000 + channel_masks dynamic + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_AUX_DIGITAL + flags AUDIO_OUTPUT_FLAG_DIRECT + } + } + inputs { + primary { + sampling_rates 8000|11025|16000|22050|24000|32000|44100|48000 + channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET + } + } + } + a2dp { + outputs { + a2dp { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_ALL_A2DP + } + } + } + usb { + outputs { + usb_accessory { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_USB_ACCESSORY + } + usb_device { + sampling_rates 44100 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_USB_DEVICE + } + } + } + r_submix { + outputs { + submix { + sampling_rates 48000 + channel_masks AUDIO_CHANNEL_OUT_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX + } + } + inputs { + submix { + sampling_rates 48000 + channel_masks AUDIO_CHANNEL_IN_STEREO + formats AUDIO_FORMAT_PCM_16_BIT + devices AUDIO_DEVICE_IN_REMOTE_SUBMIX + } + } + } +} diff --git a/cm.mk b/cm.mk new file mode 100644 index 0000000..efd9a9e --- /dev/null +++ b/cm.mk @@ -0,0 +1,31 @@ +# +# Copyright (C) 2016 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. +# + +# Boot animation +TARGET_SCREEN_HEIGHT := 480 +TARGET_SCREEN_WIDTH := 600 + +# Inherit common CM configuration +$(call inherit-product, vendor/cm/config/common_full_tablet_wifionly.mk) + +# CyanogenMod specific overlay +DEVICE_PACKAGE_OVERLAYS += device/samsung/espresso/overlay/cm-common + +# Inherit device configuration +$(call inherit-product, device/samsung/espresso/aosp_espresso.mk) + +# Device identifier. This must come after all inclusions +PRODUCT_NAME := cm_espresso diff --git a/device.mk b/device.mk new file mode 100644 index 0000000..e0e4337 --- /dev/null +++ b/device.mk @@ -0,0 +1,32 @@ +# +# 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. +# + +# Include common device configuration +$(call inherit-product, device/samsung/espresso/espresso-common.mk) + +# Include wifi-only overlays +DEVICE_PACKAGE_OVERLAYS += device/samsung/espresso/overlay/aosp + +# Audio +PRODUCT_COPY_FILES += \ + device/samsung/espresso/audio/audio_policy.conf:system/etc/audio_policy.conf + +# IR +PRODUCT_PACKAGES += \ + consumerir.piranha + +PRODUCT_COPY_FILES += \ + frameworks/native/data/etc/android.hardware.consumerir.xml:system/etc/permissions/android.hardware.consumerir.xml diff --git a/espresso-common.mk b/espresso-common.mk index 9b58bfa..d0600af 100644 --- a/espresso-common.mk +++ b/espresso-common.mk @@ -17,11 +17,11 @@ # Include common omap4 makefile $(call inherit-product, hardware/ti/omap4/omap4.mk) -DEVICE_PACKAGE_OVERLAYS += device/samsung/espresso-common/overlay/aosp-common +DEVICE_PACKAGE_OVERLAYS += device/samsung/espresso/overlay/aosp-common $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk) -LOCAL_PATH := device/samsung/espresso-common +LOCAL_PATH := device/samsung/espresso # Enable higher-res drawables while keeping mdpi as primary source PRODUCT_AAPT_CONFIG := large diff --git a/overlay/aosp-p31xx/frameworks/base/core/res/res/values/config.xml b/overlay/aosp-p31xx/frameworks/base/core/res/res/values/config.xml deleted file mode 100644 index fc41b6a..0000000 --- a/overlay/aosp-p31xx/frameworks/base/core/res/res/values/config.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - true - - - diff --git a/overlay/aosp/frameworks/base/core/res/res/values/config.xml b/overlay/aosp/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..4cb1b01 --- /dev/null +++ b/overlay/aosp/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,87 @@ + + + + + + + + eth0 + + + false + + + + false + + + + + + + + + "wifi,1,1,1,-1,true" + "bluetooth,7,7,0,-1,true" + "wifi_p2p,13,1,0,-1,true" + + + + + + "1,1" + "7,1" + + + + + + 1 + 7 + + + diff --git a/vendorsetup.sh b/vendorsetup.sh new file mode 100644 index 0000000..854fbc8 --- /dev/null +++ b/vendorsetup.sh @@ -0,0 +1 @@ +add_lunch_combo cm_espresso-userdebug -- cgit v1.1