From 6d327c6d3d819b80ea126ee33bd7b4cff53569d0 Mon Sep 17 00:00:00 2001 From: SebaUbuntu Date: Tue, 15 Jun 2021 11:37:47 +0200 Subject: [PATCH] Monet: Inherit from common tree Signed-off-by: xSylla --- Android.mk | 11 + AndroidProducts.mk | 13 + BoardConfig.mk | 32 ++ bluetooth/include/bdroid_buildcfg.h | 34 ++ device.mk | 29 ++ extract-files.sh | 21 + lineage_monet.mk | 28 ++ manifest.xml | 7 + .../SystemUI/res/values-port/dimens.xml | 20 + .../base/core/res/res/values/config.xml | 387 ++++++++++++++++++ .../base/core/res/res/values/dimens.xml | 36 ++ .../base/core/res/res/xml/power_profile.xml | 108 +++++ .../SystemUI/res/drawable/rounded.xml | 19 + .../packages/SystemUI/res/values/config.xml | 34 ++ .../packages/SystemUI/res/values/dimens.xml | 21 + setup-makefiles.sh | 15 + 16 files changed, 815 insertions(+) create mode 100644 Android.mk create mode 100644 AndroidProducts.mk create mode 100644 BoardConfig.mk create mode 100644 bluetooth/include/bdroid_buildcfg.h create mode 100644 device.mk create mode 100644 extract-files.sh create mode 100644 lineage_monet.mk create mode 100644 manifest.xml create mode 100644 overlay-lineage/frameworks/base/packages/SystemUI/res/values-port/dimens.xml create mode 100644 overlay/frameworks/base/core/res/res/values/config.xml create mode 100644 overlay/frameworks/base/core/res/res/values/dimens.xml create mode 100644 overlay/frameworks/base/core/res/res/xml/power_profile.xml create mode 100644 overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml create mode 100644 overlay/frameworks/base/packages/SystemUI/res/values/config.xml create mode 100644 overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml create mode 100644 setup-makefiles.sh diff --git a/Android.mk b/Android.mk new file mode 100644 index 0000000..c9161eb --- /dev/null +++ b/Android.mk @@ -0,0 +1,11 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +LOCAL_PATH := $(call my-dir) + +ifeq ($(TARGET_DEVICE),monet) +include $(call all-makefiles-under,$(LOCAL_PATH)) +endif diff --git a/AndroidProducts.mk b/AndroidProducts.mk new file mode 100644 index 0000000..2cab0fe --- /dev/null +++ b/AndroidProducts.mk @@ -0,0 +1,13 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +PRODUCT_MAKEFILES := \ + $(LOCAL_DIR)/lineage_monet.mk + +COMMON_LUNCH_CHOICES := \ + lineage_monet-user \ + lineage_monet-userdebug \ + lineage_monet-eng diff --git a/BoardConfig.mk b/BoardConfig.mk new file mode 100644 index 0000000..36ad863 --- /dev/null +++ b/BoardConfig.mk @@ -0,0 +1,32 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +# Inherit from sm7250-common +include device/xiaomi/sm7250-common/BoardConfigCommon.mk + +DEVICE_PATH := device/xiaomi/monet + +BUILD_BROKEN_DUP_RULES := true + +# Bluetooth +BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(DEVICE_PATH)/bluetooth/include + +# Display +TARGET_SCREEN_DENSITY := 440 + +# Fingerprint +SOONG_CONFIG_XIAOMI_LITO_FOD_POS_X = 445 +SOONG_CONFIG_XIAOMI_LITO_FOD_POS_Y = 2025 +SOONG_CONFIG_XIAOMI_LITO_FOD_SIZE = 190 + +# HIDL +DEVICE_MANIFEST_FILE += $(DEVICE_PATH)/manifest.xml + +# Kernel +TARGET_KERNEL_CONFIG := vendor/monet_user_defconfig + +# Inherit from the proprietary version +include vendor/xiaomi/monet/BoardConfigVendor.mk diff --git a/bluetooth/include/bdroid_buildcfg.h b/bluetooth/include/bdroid_buildcfg.h new file mode 100644 index 0000000..4d5e524 --- /dev/null +++ b/bluetooth/include/bdroid_buildcfg.h @@ -0,0 +1,34 @@ +/* + * 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 + * Copyright (C) 2018 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. + */ + +#ifndef _BDROID_BUILDCFG_H +#define _BDROID_BUILDCFG_H + +#define BTM_DEF_LOCAL_NAME "Mi 10 Lite" +// Disables read remote device feature +#define MAX_ACL_CONNECTIONS 16 +#define MAX_L2CAP_CHANNELS 16 +#define BLE_VND_INCLUDED TRUE +// skips conn update at conn completion +#define BT_CLEAN_TURN_ON_DISABLED 1 +/* Increasing SEPs to 12 from 6 to support SHO/MCast i.e. two streams per codec */ +#define AVDT_NUM_SEPS 12 +#endif diff --git a/device.mk b/device.mk new file mode 100644 index 0000000..c92ab7c --- /dev/null +++ b/device.mk @@ -0,0 +1,29 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +# Overlays +DEVICE_PACKAGE_OVERLAYS += \ + $(LOCAL_PATH)/overlay \ + $(LOCAL_PATH)/overlay-lineage + +# Device uses high-density artwork where available +PRODUCT_AAPT_CONFIG := normal +PRODUCT_AAPT_PREF_CONFIG := xhdpi + +# Boot animation +TARGET_SCREEN_HEIGHT := 2400 +TARGET_SCREEN_WIDTH := 1080 + +PRODUCT_SHIPPING_API_LEVEL := 29 + +# Fingerprint +TARGET_HAS_FOD := true + +# Inherit from sm7250-common +$(call inherit-product, device/xiaomi/sm7250-common/lito.mk) + +# Inherit from vendor blobs +$(call inherit-product, vendor/xiaomi/monet/monet-vendor.mk) diff --git a/extract-files.sh b/extract-files.sh new file mode 100644 index 0000000..c61beca --- /dev/null +++ b/extract-files.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +# If we're being sourced by the common script that we called, +# stop right here. No need to go down the rabbit hole. +if [ "${BASH_SOURCE[0]}" != "${0}" ]; then + return +fi + +set -e + +export DEVICE=monet +export DEVICE_COMMON=sm7250-common +export VENDOR=xiaomi + +"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@" diff --git a/lineage_monet.mk b/lineage_monet.mk new file mode 100644 index 0000000..ec3467e --- /dev/null +++ b/lineage_monet.mk @@ -0,0 +1,28 @@ +# +# Copyright (C) 2021 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +# Inherit from those products. Most specific first. +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) + +# Inherit some common Lineage stuff. +$(call inherit-product, vendor/lineage/config/common_full_phone.mk) + +# Inherit from monet device +$(call inherit-product, device/xiaomi/monet/device.mk) + +PRODUCT_NAME := lineage_monet +PRODUCT_DEVICE := monet +PRODUCT_MANUFACTURER := Xiaomi +PRODUCT_BRAND := Xiaomi +PRODUCT_MODEL := Xiaomi Mi 10 Lite 5G + +PRODUCT_GMS_CLIENTID_BASE := android-xiaomi + +PRODUCT_BUILD_PROP_OVERRIDES += \ + PRIVATE_BUILD_DESC="monet-user 11 RKQ1.200826.002 V12.5.1.0.RJIMIXM release-keys" + +BUILD_FINGERPRINT := Xiaomi/monet_global/monet:11/RKQ1.200826.002/V12.5.1.0.RJIMIXM:user/release-keys diff --git a/manifest.xml b/manifest.xml new file mode 100644 index 0000000..173d4f4 --- /dev/null +++ b/manifest.xml @@ -0,0 +1,7 @@ + + + vendor.xiaomi.hardware.displayfeature + hwbinder + @1.0::IDisplayFeature/default + + diff --git a/overlay-lineage/frameworks/base/packages/SystemUI/res/values-port/dimens.xml b/overlay-lineage/frameworks/base/packages/SystemUI/res/values-port/dimens.xml new file mode 100644 index 0000000..23e38c5 --- /dev/null +++ b/overlay-lineage/frameworks/base/packages/SystemUI/res/values-port/dimens.xml @@ -0,0 +1,20 @@ + + + + + 725px + diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml new file mode 100644 index 0000000..de9eb0b --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -0,0 +1,387 @@ + + + + + + + true + + + + 1 + 4 + 12 + 20 + 40 + 65 + 95 + 140 + 200 + 350 + 650 + 1300 + 2000 + 3300 + 6000 + 10000 + + + + + 3.5077 + 6.8394 + 15.2619 + 30.2619 + 40.671 + 52.3019 + 65.2512 + 77.37 + 90.152 + 100.297 + 110.385 + 135.064 + 160.5179 + 195.0267 + 380.2814 + 409.2867 + 427.6287 + + + + + 2.0482 + 2.7841 + 3.79505 + 4.4748 + 5.08 + 6.4233 + 8.0848 + 11.6607 + 13.2347 + 15.0676 + 16.8302 + 18.4261 + 20.3103 + 21.9042 + 23.5456 + 25.2137 + 27.1769 + 28.9571 + 30.5244 + 32.3535 + 34.0867 + 42.366 + 51.1309 + 59.52 + 67.744 + 75.9738 + 84.6332 + 94.1525 + 102.2207 + 110.4878 + 117.0405 + 124.3733 + 130.9928 + 140.4247 + 149.3156 + 157.1995 + 165.3651 + 173.2726 + 181.4272 + 189.1402 + 197.5334 + 205.6301 + 213.9381 + 222.2769 + 230.0891 + 238.6084 + 246.5399 + 255.6544 + 263.6221 + 271.9324 + 279.1449 + 288.5736 + 297.6628 + 306.1899 + 314.4511 + 322.1404 + 330.969 + 338.2251 + 346.2251 + 354.567 + 370.799 + 413.1738 + 415.6397 + 417.264 + 419.264 + 421.264 + 424.646 + 427.6287 + + + + + 0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 + 25 + 30 + 35 + 40 + 45 + 50 + 55 + 60 + 65 + 70 + 75 + 80 + 85 + 90 + 95 + 100 + 105 + 110 + 115 + 120 + 125 + 130 + 135 + 140 + 145 + 150 + 155 + 160 + 165 + 170 + 174 + 179 + 184 + 189 + 194 + 199 + 204 + 209 + 214 + 219 + 224 + 229 + 234 + 239 + 244 + 249 + 255 + + + + + 200 + 200 + 200 + 200 + 200 + 200 + 200 + 200 + 250 + 300 + 300 + 300 + 300 + 300 + 300 + 400 + 500 + + + + + 200 + 200 + 200 + 200 + 200 + 200 + 200 + 200 + 300 + 400 + 400 + 400 + 400 + 400 + 400 + 500 + 500 + + + + + 1 + 4 + 12 + 20 + 40 + 65 + 95 + 140 + 200 + 350 + 650 + 1300 + 2000 + 3300 + 6000 + 10000 + + + + 6 + + + 184 + + + 2 + + + 2000 + 4000 + + + 300% + + + 200 + + + true + + + false + + + M 0,0 H -45 V 69 H 45 V 0 H 0 Z + + + true + diff --git a/overlay/frameworks/base/core/res/res/values/dimens.xml b/overlay/frameworks/base/core/res/res/values/dimens.xml new file mode 100644 index 0000000..ef76884 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/values/dimens.xml @@ -0,0 +1,36 @@ + + + + + 35dp + + + 32dp + + + 144px + + + 40px + diff --git a/overlay/frameworks/base/core/res/res/xml/power_profile.xml b/overlay/frameworks/base/core/res/res/xml/power_profile.xml new file mode 100644 index 0000000..fd5a298 --- /dev/null +++ b/overlay/frameworks/base/core/res/res/xml/power_profile.xml @@ -0,0 +1,108 @@ + + + 0 + 72.43 + 354.31 + 11.79 + 1.45 + 0.25 + 413.16 + 18.1 + 24.62 + 42.87 + 154.44 + 568.51 + 60.51 + 304.88 + 105.13 + + 7.16 + 7.16 + + 0 + 0 + 0 + 0 + + 6 + 1 + 1 + + + 300000 + 576000 + 614400 + 864000 + 1075200 + 1363200 + 1516800 + 1651200 + 1804800 + + + 35.28 + 40.6 + 39.97 + 43.54 + 46.41 + 51.6 + 57.9 + 62.26 + 62.31 + + + 652800 + 940800 + 1152000 + 1478400 + 1728000 + 1900800 + 2092800 + 2208000 + + + 59.71 + 72.42 + 84.56 + 122.28 + 157.38 + 206.98 + 244 + 269.03 + + + 806400 + 1094400 + 1401600 + 1766400 + 1996800 + 2188800 + 2304000 + 2400000 + + + 68.45 + 90.76 + 120.95 + 163.22 + 213 + 279.49 + 309.1 + 334.01 + + 11.42 + 6.34 + 4160 + 0 + 0 + 0 + + 0 + + .0002 + .002 + .02 + .2 + 2 + + \ No newline at end of file diff --git a/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml b/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml new file mode 100644 index 0000000..f5b63f4 --- /dev/null +++ b/overlay/frameworks/base/packages/SystemUI/res/drawable/rounded.xml @@ -0,0 +1,19 @@ + + + + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml new file mode 100644 index 0000000..74dcd66 --- /dev/null +++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml @@ -0,0 +1,34 @@ + + + + + + + M122,0 C71.76,3.59 52.03,8.07 29.6,29.6 8.07,52.03 3.59,71.76 0,122 + + + 122px + + + #ffffff + diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml new file mode 100644 index 0000000..61247a3 --- /dev/null +++ b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml @@ -0,0 +1,21 @@ + + + + + @*android:dimen/status_bar_height + diff --git a/setup-makefiles.sh b/setup-makefiles.sh new file mode 100644 index 0000000..d047f44 --- /dev/null +++ b/setup-makefiles.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# +# Copyright (C) 2016 The CyanogenMod Project +# Copyright (C) 2017-2020 The LineageOS Project +# +# SPDX-License-Identifier: Apache-2.0 +# + +set -e + +export DEVICE=monet +export DEVICE_COMMON=sm7250-common +export VENDOR=xiaomi + +"./../../${VENDOR}/${DEVICE_COMMON}/setup-makefiles.sh" "$@"