diff --git a/Android.mk b/Android.mk index ee9c599..52b4e36 100644 --- a/Android.mk +++ b/Android.mk @@ -6,7 +6,7 @@ LOCAL_PATH := $(call my-dir) -ifneq ($(filter Atom_L_EEA Atom_XL_EEA Atom_L_TEE Atom_XL_TEE ,$(TARGET_DEVICE)),) +ifneq ($(filter Jelly2_TEE ,$(TARGET_DEVICE)),) subdir_makefiles=$(call first-makefiles-under,$(LOCAL_PATH)) $(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk))) endif diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk index 810f512..7fc683a 100644 --- a/BoardConfigCommon.mk +++ b/BoardConfigCommon.mk @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # -DEVICE_COMMON_PATH := device/Unihertz/Atom_LXL +DEVICE_COMMON_PATH := device/Unihertz/Jelly2 # Architecture TARGET_ARCH := arm64 @@ -68,7 +68,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 452984832 BOARD_USERDATAIMAGE_PARTITION_SIZE := 121978716160 BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3670016000 BOARD_PRODUCTIMAGE_PARTITION_SIZE := 681574400 -BOARD_VENDORIMAGE_PARTITION_SIZE := 367001600 +BOARD_VENDORIMAGE_PARTITION_SIZE := 367001600 BOARD_SUPER_PARTITION_SIZE := 4831838208 BOARD_SUPER_PARTITION_GROUPS := main BOARD_MAIN_SIZE := 4829741056 @@ -109,3 +109,6 @@ TARGET_PRODUCT_PROP += $(DEVICE_COMMON_PATH)/product.prop # We need this for apns-conf # We would like to override instead of merge BUILD_BROKEN_DUP_RULES := true + +# Bluetooth +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_COMMON_PATH)/bluetooth/include diff --git a/bluetooth/include/bdroid_buildcfg.h b/bluetooth/include/bdroid_buildcfg.h new file mode 100644 index 0000000..4eb0d0f --- /dev/null +++ b/bluetooth/include/bdroid_buildcfg.h @@ -0,0 +1,32 @@ +/* + * + * Copyright (c) 2013, The Linux Foundation. All rights reserved. + * Not a Contribution, Apache license notifications and license are retained + * for attribution purposes only. + * + * Copyright (C) 2012 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. + */ + +#ifndef _BDROID_BUILDCFG_H +#define _BDROID_BUILDCFG_H +#define BTM_DEF_LOCAL_NAME "Jell2" +// Disables read remote device feature +#define BTM_WBS_INCLUDED TRUE +#define BTIF_HF_WBS_PREFERRED TRUE + +#define BLE_VND_INCLUDED TRUE +// skips conn update at conn completion +#define BT_CLEAN_TURN_ON_DISABLED 1 +#endif diff --git a/deviceCommon.mk b/deviceCommon.mk index 7fe0611..76b1819 100644 --- a/deviceCommon.mk +++ b/deviceCommon.mk @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # -DEVICE_PATH := device/Unihertz/Atom_LXL +DEVICE_PATH := device/Unihertz/Jelly2 #Include GAPPS if applicable -include $(DEVICE_PATH)/gapps_prop.mk @@ -39,7 +39,7 @@ PRODUCT_PACKAGES += \ #PRODUCT_PACKAGES += \ # FMRadio \ # libfmcust - + # fastbootd PRODUCT_PACKAGES += \ fastbootd @@ -47,7 +47,7 @@ PRODUCT_PACKAGES += \ # fstab PRODUCT_COPY_FILES += \ $(DEVICE_PATH)/rootdir/etc/fstab.mt6771:$(TARGET_COPY_OUT_RAMDISK)/fstab.mt6771 - + # NFC stack (AOSP) PRODUCT_PACKAGES += \ NfcNci @@ -55,7 +55,7 @@ PRODUCT_PACKAGES += \ # ImsInit hack PRODUCT_PACKAGES += \ ImsInit - + # Init PRODUCT_PACKAGES += \ init.mt6771.rc \ @@ -123,11 +123,11 @@ PRODUCT_PACKAGES += \ android.hardware.radio@1.4 \ android.hardware.vibrator@1.0 \ android.hardware.vibrator@1.3 - + # Additional tools PRODUCT_HOST_PACKAGES += \ unpack_bootimg \ - lpmake + lpmake # Keylayouts PRODUCT_COPY_FILES += \ @@ -135,7 +135,7 @@ PRODUCT_COPY_FILES += \ $(DEVICE_PATH)/keylayout/mtk-kpd.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/mtk-kpd.kl \ $(DEVICE_PATH)/keylayout/mtk-tpd-kpd.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/mtk-tpd-kpd.kl \ $(DEVICE_PATH)/keylayout/fingerprint_key.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/fingerprint_key.kl - + # Overlays DEVICE_PACKAGE_OVERLAYS += \ $(DEVICE_PATH)/overlay \ @@ -155,5 +155,5 @@ PRODUCT_BOOT_JARS += \ mediatek-telephony-base \ mediatek-telephony-common -#Include GAPPS if applicable +#Include GAPPS if applicable $(call inherit-product-if-exists, vendor/opengapps/build/opengapps-packages.mk) diff --git a/extract-files.sh b/extract-files.sh new file mode 100755 index 0000000..75f1597 --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,73 @@ +#!/bin/bash +# +# Copyright (C) 2020 The LineageOS 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. +# + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +LINEAGE_ROOT="${MY_DIR}"/../../.. + +HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +function blob_fixup() { + case "${1}" in + esac +} + +# Default to sanitizing the vendor folder before extraction +CLEAN_VENDOR=true + +SECTION= +KANG= + +while [ "${#}" -gt 0 ]; do + case "${1}" in + -n | --no-cleanup ) + CLEAN_VENDOR=false + ;; + -k | --kang ) + KANG="--kang" + ;; + -s | --section ) + SECTION="${2}"; shift + CLEAN_VENDOR=false + ;; + * ) + SRC="${1}" + ;; + esac + shift +done + +if [ -z "${SRC}" ]; then + SRC="adb" +fi + +# Initialize the helper for common device +setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" false "${CLEAN_VENDOR}" + +extract "${LINEAGE_ROOT}/device/${VENDOR}/Jelly2/proprietary-files.txt" "${SRC}" \ + "${KANG}" --section "${SECTION}" + +COMMON_BLOB_ROOT="${LINEAGE_ROOT}/vendor/${VENDOR}/${DEVICE}/proprietary" + +"${LINEAGE_ROOT}/device/${VENDOR}/${DEVICE}/setup-makefiles.sh" diff --git a/product.prop b/product.prop index 6393326..539f05e 100644 --- a/product.prop +++ b/product.prop @@ -15,3 +15,7 @@ ro.other_notifi_ledcolor=Green ro.unread_notifi_ledcolor=Red ro.incoming_ledcolor=Blue ro.scridle_ledcolor=None + +ro.build.wifi.ssid=Jelly2 +ro.build.bluetooth.name=Jelly2 +ro.build.wifip2pDN=Jelly2 diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100755 index 0000000..e9dadf1 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# +# Copyright (C) 2020 The LineageOS 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. +# + +# Load extract_utils and do some sanity checks +MY_DIR="${BASH_SOURCE%/*}" +if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi + +LINEAGE_ROOT="${MY_DIR}/../../.." + +HELPER="${LINEAGE_ROOT}/vendor/lineage/build/tools/extract_utils.sh" +if [ ! -f "${HELPER}" ]; then + echo "Unable to find helper script at ${HELPER}" + exit 1 +fi +source "${HELPER}" + +# Initialize the helper for common +setup_vendor "${DEVICE}" "${VENDOR}" "${LINEAGE_ROOT}" + +# Copyright headers and guards +write_headers + +# The standard common blobs +write_makefiles "${LINEAGE_ROOT}/device/${VENDOR}/Jelly2/proprietary-files.txt" true + +# Finish +write_footers