forked from ParsaAslaniYC/device_xiaomi_topaz
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Decommonized device tree conversion Change-Id: I1402efbffcc95eab43c9be4695ce0b72b56c639f
- Loading branch information
0 parents
commit 32034fa
Showing
40 changed files
with
9,394 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
soong_namespace { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# | ||
# Copyright (C) 2023 The LineageOS Project | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
LOCAL_PATH := $(call my-dir) | ||
|
||
ifeq ($(TARGET_DEVICE),topaz) | ||
include $(call all-makefiles-under,$(LOCAL_PATH)) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# Copyright (C) 2023 The LineageOS Project | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
PRODUCT_MAKEFILES := \ | ||
$(LOCAL_DIR)/lineage_topaz.mk | ||
|
||
COMMON_LUNCH_CHOICES := \ | ||
lineage_topaz-user \ | ||
lineage_topaz-userdebug \ | ||
lineage_topaz-eng |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# | ||
# Copyright (C) 2023 The LineageOS Project | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# Inherit from xiaomi sm6225-common | ||
include device/xiaomi/sm6225-common/BoardConfigCommon.mk | ||
|
||
# Inherit from the proprietary version | ||
include vendor/xiaomi/topaz/BoardConfigVendor.mk | ||
|
||
DEVICE_PATH := device/xiaomi/topaz | ||
|
||
# Init | ||
TARGET_INIT_VENDOR_LIB := //$(DEVICE_PATH):init_topaz | ||
TARGET_RECOVERY_DEVICE_MODULES := init_topaz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
Copyright (C) 2023 The LineageOS Project | ||
|
||
Device configuration for Xiaomi Redmi Note 12 4G/12 4G NFC | ||
========================================= | ||
|
||
The Xiaomi Redmi Note 12 4G/12 4G NFC (codenamed _"tapas/topaz"_) is a mid-range smartphone from Xiaomi. | ||
|
||
Redmi Note 12 4G was announced and released in March 2023. | ||
|
||
## Device specifications | ||
|
||
| Device | Xiaomi Redmi Note 12 4G | | ||
| -----------: | :-------------------------------------------------- | | ||
| SoC | Qualcomm SM6225 Snapdragon 685 (6 nm) | | ||
| CPU | 4x2.8 GHz Cortex-A73 & 4x1.9 GHz Cortex-A53 | | ||
| GPU | Adreno 610 | | ||
| Memory | 4GB/6GB/8GB RAM (LPDDR4X) | | ||
| Storage | 64GB/128GB/256GB UFS 2.2 flash storage | | ||
| Shipped Android version | 13.0 with MIUI 14 | | ||
| Battery | Non-removable Li-Po 5000 mAh | | ||
| Dimensions | 165.7 x 76 x 7.9 mm | | ||
| Display | 1080 x 2400 pixels, 20:9 ratio 6.67" inch | | ||
| Type | AMOLED, 120Hz, 450 nits (typ), 700 nits (HBM), 1200 nits (peak) | | ||
| NFC | Yes ( Redmi Note 12 4G NFC ) | | ||
| Rear camera 1 | 50 MP, f/1.8, (wide), 1/2.76", 0.64µm, PDAF | | ||
| Rear camera 2 | 8 MP, f/2.2, 120˚ (ultrawide), 1/4", 1.12µm | | ||
| Rear camera 3 | 2 MP, f/2.4, (macro) | | ||
| Front camera | 13 MP, f/2.5, (wide), 1/3.0" | | ||
|
||
## Device picture | ||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# | ||
# Copyright (C) 2023 The LineageOS Project | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
# Inherit from xiaomi sm6225-common | ||
$(call inherit-product, device/xiaomi/sm6225-common/common.mk) | ||
|
||
# Inherit from the proprietary version | ||
$(call inherit-product, vendor/xiaomi/topaz/topaz-vendor.mk) | ||
|
||
# Overlays | ||
PRODUCT_PACKAGES += \ | ||
FrameworksResTopaz \ | ||
SettingsResTopaz \ | ||
SettingsOverlayM7G \ | ||
SettingsOverlayM7N \ | ||
SettingsOverlayM7L \ | ||
SettingsOverlayM7IN \ | ||
SystemUIResTopaz | ||
|
||
# Soong namespaces | ||
PRODUCT_SOONG_NAMESPACES += \ | ||
$(LOCAL_PATH) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright (C) 2016 The CyanogenMod Project | ||
# Copyright (C) 2017-2020 The LineageOS Project | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
|
||
function blob_fixup() { | ||
case "${1}" in | ||
esac | ||
} | ||
|
||
# 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=topaz | ||
export DEVICE_COMMON=sm6225-common | ||
export VENDOR=xiaomi | ||
|
||
"./../../${VENDOR}/${DEVICE_COMMON}/extract-files.sh" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// Copyright (C) 2023 The LineageOS Project | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
cc_library_static { | ||
name: "init_topaz", | ||
recovery_available: true, | ||
shared_libs: ["libbase"], | ||
srcs: ["init_topaz.cpp"], | ||
include_dirs: [ | ||
"system/core/init", | ||
"system/libbase/include" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
/* | ||
* Copyright (C) 2023 Paranoid Android | ||
* | ||
* 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 <cstdlib> | ||
#include <fstream> | ||
#include <string.h> | ||
#include <unistd.h> | ||
#include <vector> | ||
|
||
#include <android-base/properties.h> | ||
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_ | ||
#include <sys/_system_properties.h> | ||
#include <sys/sysinfo.h> | ||
|
||
#include "property_service.h" | ||
#include "vendor_init.h" | ||
|
||
using android::base::GetProperty; | ||
using std::string; | ||
|
||
std::vector<std::string> ro_props_default_source_order = { | ||
"", | ||
"odm.", | ||
"product.", | ||
"system.", | ||
"system_dlkm.", | ||
"system_ext.", | ||
"vendor.", | ||
"vendor_dlkm.", | ||
}; | ||
|
||
bool IsRecoveryMode() { | ||
return access("/system/bin/recovery", F_OK) == 0; | ||
} | ||
|
||
void property_override(string prop, string value) | ||
{ | ||
auto pi = (prop_info*) __system_property_find(prop.c_str()); | ||
|
||
if (pi != nullptr) | ||
__system_property_update(pi, value.c_str(), value.size()); | ||
else | ||
__system_property_add(prop.c_str(), prop.size(), value.c_str(), value.size()); | ||
} | ||
|
||
void load_redmi_topaz() { | ||
property_override("bluetooth.device.default_name", "Redmi Note 12"); | ||
property_override("ro.product.brand", "Redmi"); | ||
property_override("ro.product.device", "topaz"); | ||
property_override("ro.product.manufacturer", "Xiaomi"); | ||
property_override("ro.product.marketname", "Redmi Note 12"); | ||
property_override("ro.product.model", "23021RAA2Y"); | ||
property_override("ro.product.mod_device", "topaz_global"); | ||
property_override("ro.product.name", "topaz_global"); | ||
property_override("vendor.usb.product_string", "Redmi Note 12"); | ||
} | ||
|
||
void load_redmi_tapas() { | ||
property_override("bluetooth.device.default_name", "Redmi Note 12"); | ||
property_override("ro.product.brand", "Redmi"); | ||
property_override("ro.product.device", "tapas"); | ||
property_override("ro.product.manufacturer", "Xiaomi"); | ||
property_override("ro.product.marketname", "Redmi Note 12"); | ||
property_override("ro.product.model", "23021RAAEG"); | ||
property_override("ro.product.mod_device", "tapas_global"); | ||
property_override("ro.product.name", "tapas_global"); | ||
property_override("vendor.usb.product_string", "Redmi Note 12"); | ||
} | ||
|
||
void vendor_load_properties() { | ||
std::string hwname = GetProperty("ro.boot.hwname", ""); | ||
if (access("/system/bin/recovery", F_OK) != 0) { | ||
if (hwname == "topaz") { | ||
load_redmi_topaz(); | ||
} else if (hwname == "tapas") { | ||
load_redmi_tapas(); | ||
} | ||
} | ||
|
||
// Override first api level for safetynet | ||
if (!IsRecoveryMode()) { | ||
property_override("ro.product.first_api_level", "32"); | ||
} | ||
|
||
// Set hardware revision | ||
property_override("ro.boot.hardware.revision", GetProperty("ro.boot.hwversion", "").c_str()); | ||
|
||
// Set dalvik heap configuration | ||
std::string heapstartsize, heapgrowthlimit, heapsize, heapminfree, | ||
heapmaxfree, heaptargetutilization; | ||
|
||
struct sysinfo sys; | ||
sysinfo(&sys); | ||
|
||
if (sys.totalram > 5072ull * 1024 * 1024) { | ||
// from - phone-xhdpi-6144-dalvik-heap.mk | ||
heapstartsize = "16m"; | ||
heapgrowthlimit = "256m"; | ||
heapsize = "512m"; | ||
heaptargetutilization = "0.5"; | ||
heapminfree = "8m"; | ||
heapmaxfree = "32m"; | ||
} else if (sys.totalram > 3072ull * 1024 * 1024) { | ||
// from - phone-xhdpi-4096-dalvik-heap.mk | ||
heapstartsize = "8m"; | ||
heapgrowthlimit = "192m"; | ||
heapsize = "512m"; | ||
heaptargetutilization = "0.6"; | ||
heapminfree = "8m"; | ||
heapmaxfree = "16m"; | ||
} else { | ||
// from - phone-xhdpi-2048-dalvik-heap.mk | ||
heapstartsize = "8m"; | ||
heapgrowthlimit = "192m"; | ||
heapsize = "512m"; | ||
heaptargetutilization = "0.75"; | ||
heapminfree = "512k"; | ||
heapmaxfree = "8m"; | ||
} | ||
|
||
property_override("dalvik.vm.heapstartsize", heapstartsize); | ||
property_override("dalvik.vm.heapgrowthlimit", heapgrowthlimit); | ||
property_override("dalvik.vm.heapsize", heapsize); | ||
property_override("dalvik.vm.heaptargetutilization", heaptargetutilization); | ||
property_override("dalvik.vm.heapminfree", heapminfree); | ||
property_override("dalvik.vm.heapmaxfree", heapmaxfree); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Copyright (C) 2023 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 from topaz device | ||
$(call inherit-product, device/xiaomi/topaz/device.mk) | ||
|
||
# Inherit some common Lineage stuff. | ||
$(call inherit-product, vendor/lineage/config/common_full_phone.mk) | ||
|
||
PRODUCT_NAME := lineage_topaz | ||
PRODUCT_DEVICE := topaz | ||
PRODUCT_MANUFACTURER := Xiaomi | ||
PRODUCT_BRAND := Redmi | ||
PRODUCT_MODEL := Redmi Note 12 4G | ||
|
||
PRODUCT_GMS_CLIENTID_BASE := android-xiaomi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// Copyright (C) 2023 The LineageOS Project | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
// | ||
|
||
runtime_resource_overlay { | ||
name: "FrameworksResTopaz", | ||
device_specific: true, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- | ||
Copyright (C) 2023 The LineageOS Project | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="android.overlay.xiaomi_topaz"> | ||
|
||
<overlay | ||
android:isStatic="true" | ||
android:priority="700" | ||
android:targetPackage="android" /> | ||
</manifest> |
Oops, something went wrong.