Initial push

This commit is contained in:
PizzaG 2026-07-24 16:32:02 -05:00
commit a01d3e7cc2
1993 changed files with 106354 additions and 0 deletions

View file

@ -0,0 +1,74 @@
--- old/Build.java 2024-08-28 20:28:17.237201908 -0500
+++ new/Build.java 2024-08-28 20:57:13.685694204 -0500
@@ -1311,71 +1311,6 @@
* @hide
*/
public static boolean isBuildConsistent() {
- // Don't care on eng builds. Incremental build may trigger false negative.
- /*if (IS_ENG) return true;
-
- if (IS_TREBLE_ENABLED) {
- // If we can run this code, the device should already pass AVB.
- // So, we don't need to check AVB here.
- int result = VintfObject.verifyWithoutAvb();
-
- if (result != 0) {
- Slog.e(TAG, "Vendor interface is incompatible, error="
- + String.valueOf(result));
- }
-
- return result == 0;
- return true;
- }
-
- final String system = SystemProperties.get("ro.system.build.fingerprint");
- final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
- final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint");
- final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
- final String currentBootloader = SystemProperties.get("ro.bootloader");
- final String requiredRadio = SystemProperties.get("ro.build.expect.baseband");
- final String currentRadio = joinListOrElse(
- TelephonyProperties.baseband_version(), "");
-
- if (TextUtils.isEmpty(system)) {
- Slog.e(TAG, "Required ro.system.build.fingerprint is empty!");
- return false;
- }
-
- if (!TextUtils.isEmpty(vendor)) {
- if (!Objects.equals(system, vendor)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but vendor reported " + vendor);
- return false;
- }
- } */
-
- /* TODO: Figure out issue with checks failing
- if (!TextUtils.isEmpty(bootimage)) {
- if (!Objects.equals(system, bootimage)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but bootimage reported " + bootimage);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredBootloader)) {
- if (!Objects.equals(currentBootloader, requiredBootloader)) {
- Slog.e(TAG, "Mismatched bootloader version: build requires " + requiredBootloader
- + " but runtime reports " + currentBootloader);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredRadio)) {
- if (!Objects.equals(currentRadio, requiredRadio)) {
- Slog.e(TAG, "Mismatched radio version: build requires " + requiredRadio
- + " but runtime reports " + currentRadio);
- return false;
- }
- }
- */
-
return true;
}

View file

@ -0,0 +1,71 @@
--- old/Build.java 2024-09-07 16:15:30.875935795 -0500
+++ new/Build.java 2024-09-07 16:28:09.478062066 -0500
@@ -1313,68 +1313,6 @@
* @hide
*/
public static boolean isBuildConsistent() {
- // Don't care on eng builds. Incremental build may trigger false negative.
- if (IS_ENG) return true;
-
- if (IS_TREBLE_ENABLED) {
- int result = VintfObject.verifyBuildAtBoot();
-
- if (result != 0) {
- Slog.e(TAG, "Vendor interface is incompatible, error="
- + String.valueOf(result));
- }
-
- return result == 0;
- }
-
- final String system = SystemProperties.get("ro.system.build.fingerprint");
- final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
- final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint");
- final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
- final String currentBootloader = SystemProperties.get("ro.bootloader");
- final String requiredRadio = SystemProperties.get("ro.build.expect.baseband");
- final String currentRadio = joinListOrElse(
- TelephonyProperties.baseband_version(), "");
-
- if (TextUtils.isEmpty(system)) {
- Slog.e(TAG, "Required ro.system.build.fingerprint is empty!");
- return false;
- }
-
- if (!TextUtils.isEmpty(vendor)) {
- if (!Objects.equals(system, vendor)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but vendor reported " + vendor);
- return false;
- }
- }
-
- /* TODO: Figure out issue with checks failing
- if (!TextUtils.isEmpty(bootimage)) {
- if (!Objects.equals(system, bootimage)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but bootimage reported " + bootimage);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredBootloader)) {
- if (!Objects.equals(currentBootloader, requiredBootloader)) {
- Slog.e(TAG, "Mismatched bootloader version: build requires " + requiredBootloader
- + " but runtime reports " + currentBootloader);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredRadio)) {
- if (!Objects.equals(currentRadio, requiredRadio)) {
- Slog.e(TAG, "Mismatched radio version: build requires " + requiredRadio
- + " but runtime reports " + currentRadio);
- return false;
- }
- }
- */
-
return true;
}

View file

@ -0,0 +1,72 @@
--- old/Build.java 2024-09-17 19:53:05.089632939 -0500
+++ new/Build.java 2024-09-17 19:56:32.676339765 -0500
@@ -1370,69 +1370,6 @@
* @hide
*/
public static boolean isBuildConsistent() {
- // Don't care on eng builds. Incremental build may trigger false negative.
- /*if (IS_ENG) return true;
-
- if (IS_TREBLE_ENABLED) {
- int result = VintfObject.verifyBuildAtBoot();
-
- if (result != 0) {
- Slog.e(TAG, "Vendor interface is incompatible, error="
- + String.valueOf(result));
- }
-
- return result == 0;
- return true;
- }
-
- final String system = SystemProperties.get("ro.system.build.fingerprint");
- final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
- final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint");
- final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
- final String currentBootloader = SystemProperties.get("ro.bootloader");
- final String requiredRadio = SystemProperties.get("ro.build.expect.baseband");
- final String currentRadio = joinListOrElse(
- TelephonyProperties.baseband_version(), "");
-
- if (TextUtils.isEmpty(system)) {
- Slog.e(TAG, "Required ro.system.build.fingerprint is empty!");
- return false;
- }
-
- if (!TextUtils.isEmpty(vendor)) {
- if (!Objects.equals(system, vendor)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but vendor reported " + vendor);
- return false;
- }
- }*/
-
- /* TODO: Figure out issue with checks failing
- if (!TextUtils.isEmpty(bootimage)) {
- if (!Objects.equals(system, bootimage)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but bootimage reported " + bootimage);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredBootloader)) {
- if (!Objects.equals(currentBootloader, requiredBootloader)) {
- Slog.e(TAG, "Mismatched bootloader version: build requires " + requiredBootloader
- + " but runtime reports " + currentBootloader);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredRadio)) {
- if (!Objects.equals(currentRadio, requiredRadio)) {
- Slog.e(TAG, "Mismatched radio version: build requires " + requiredRadio
- + " but runtime reports " + currentRadio);
- return false;
- }
- }
- */
-
return true;
}

View file

@ -0,0 +1,72 @@
--- old/Build.java 2024-07-12 00:26:24.440826777 -0500
+++ new/Build.java 2024-07-12 00:46:19.599535691 -0500
@@ -1313,69 +1313,6 @@
* @hide
*/
public static boolean isBuildConsistent() {
- // Don't care on eng builds. Incremental build may trigger false negative.
- /*if (IS_ENG) return true;
-
- if (IS_TREBLE_ENABLED) {
- int result = VintfObject.verifyBuildAtBoot();
-
- if (result != 0) {
- Slog.e(TAG, "Vendor interface is incompatible, error="
- + String.valueOf(result));
- }
-
- return result == 0;
- return true;
- }
-
- final String system = SystemProperties.get("ro.system.build.fingerprint");
- final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
- final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint");
- final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
- final String currentBootloader = SystemProperties.get("ro.bootloader");
- final String requiredRadio = SystemProperties.get("ro.build.expect.baseband");
- final String currentRadio = joinListOrElse(
- TelephonyProperties.baseband_version(), "");
-
- if (TextUtils.isEmpty(system)) {
- Slog.e(TAG, "Required ro.system.build.fingerprint is empty!");
- return false;
- }
-
- if (!TextUtils.isEmpty(vendor)) {
- if (!Objects.equals(system, vendor)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but vendor reported " + vendor);
- return false;
- }
- } */
-
- /* TODO: Figure out issue with checks failing
- if (!TextUtils.isEmpty(bootimage)) {
- if (!Objects.equals(system, bootimage)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but bootimage reported " + bootimage);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredBootloader)) {
- if (!Objects.equals(currentBootloader, requiredBootloader)) {
- Slog.e(TAG, "Mismatched bootloader version: build requires " + requiredBootloader
- + " but runtime reports " + currentBootloader);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredRadio)) {
- if (!Objects.equals(currentRadio, requiredRadio)) {
- Slog.e(TAG, "Mismatched radio version: build requires " + requiredRadio
- + " but runtime reports " + currentRadio);
- return false;
- }
- }
- */
-
return true;
}

73
patches/Build.java.patch Normal file
View file

@ -0,0 +1,73 @@
--- Build.java-original 2023-05-02 02:07:56.857725000 -0500
+++ Build.java 2023-05-05 02:18:10.386748000 -0500
@@ -1248,70 +1248,6 @@
* @hide
*/
public static boolean isBuildConsistent() {
- // Don't care on eng builds. Incremental build may trigger false negative.
- if (IS_ENG) return true;
-
- if (IS_TREBLE_ENABLED) {
- // If we can run this code, the device should already pass AVB.
- // So, we don't need to check AVB here.
- int result = VintfObject.verifyWithoutAvb();
-
- if (result != 0) {
- Slog.e(TAG, "Vendor interface is incompatible, error="
- + String.valueOf(result));
- }
-
- return result == 0;
- }
-
- final String system = SystemProperties.get("ro.system.build.fingerprint");
- final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
- final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint");
- final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
- final String currentBootloader = SystemProperties.get("ro.bootloader");
- final String requiredRadio = SystemProperties.get("ro.build.expect.baseband");
- final String currentRadio = joinListOrElse(
- TelephonyProperties.baseband_version(), "");
-
- if (TextUtils.isEmpty(system)) {
- Slog.e(TAG, "Required ro.system.build.fingerprint is empty!");
- return false;
- }
-
- if (!TextUtils.isEmpty(vendor)) {
- if (!Objects.equals(system, vendor)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but vendor reported " + vendor);
- return false;
- }
- }
-
- /* TODO: Figure out issue with checks failing
- if (!TextUtils.isEmpty(bootimage)) {
- if (!Objects.equals(system, bootimage)) {
- Slog.e(TAG, "Mismatched fingerprints; system reported " + system
- + " but bootimage reported " + bootimage);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredBootloader)) {
- if (!Objects.equals(currentBootloader, requiredBootloader)) {
- Slog.e(TAG, "Mismatched bootloader version: build requires " + requiredBootloader
- + " but runtime reports " + currentBootloader);
- return false;
- }
- }
-
- if (!TextUtils.isEmpty(requiredRadio)) {
- if (!Objects.equals(currentRadio, requiredRadio)) {
- Slog.e(TAG, "Mismatched radio version: build requires " + requiredRadio
- + " but runtime reports " + currentRadio);
- return false;
- }
- }
- */
-
return true;
}

View file

@ -0,0 +1,66 @@
From d79a845a63486dec9a536126722c8ecf2f8b6e0b Mon Sep 17 00:00:00 2001
From: Pranav Vashi <neobuddy89@gmail.com>
Date: Sat, 1 Apr 2023 19:50:59 +0530
Subject: [PATCH] MediaProfiles: Check before overriding media settings xml
* Some devices copy init.qti.media.rc or such qcom scripts which makes MediaProfiles
to select platform specific xml without checking if that xml is present.
* Issue highlighted by @Electimon
Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
---
media/libmedia/MediaProfiles.cpp | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/media/libmedia/MediaProfiles.cpp b/media/libmedia/MediaProfiles.cpp
index 199c226fbf..9bdfd74a1c 100644
--- a/media/libmedia/MediaProfiles.cpp
+++ b/media/libmedia/MediaProfiles.cpp
@@ -978,7 +978,8 @@ MediaProfiles::getInstance()
property_get("ro.board.platform", platform, NULL);
if (!strcmp(platform, "msm8953")){
if (property_get("vendor.media.target.version", value, "0") &&
- (atoi(value) == 1)){
+ (atoi(value) == 1) &&
+ checkXmlFile("/vendor/etc/media_profiles_8953_v1.xml")){
strlcpy(value, "/vendor/etc/media_profiles_8953_v1.xml",
PROPERTY_VALUE_MAX);
} else {
@@ -987,7 +988,8 @@ MediaProfiles::getInstance()
}
} else if (!strcmp(platform, "sdm660")) {
property_get("vendor.media.target.version", value, "0");
- if (atoi(value) == 1) {
+ if (atoi(value) == 1 &&
+ checkXmlFile("/vendor/etc/media_profiles_sdm660_v1.xml")) {
strlcpy(value, "/vendor/etc/media_profiles_sdm660_v1.xml",
PROPERTY_VALUE_MAX);
} else {
@@ -996,10 +998,12 @@ MediaProfiles::getInstance()
}
} else if (!strcmp(platform, "bengal")) {
property_get("vendor.sys.media.target.version", value, "0");
- if (atoi(value) == 3) {
+ if (atoi(value) == 3 &&
+ checkXmlFile("/vendor/etc/media_profiles_khaje.xml")) {
strlcpy(value, "/vendor/etc/media_profiles_khaje.xml",
PROPERTY_VALUE_MAX);
- } else if (atoi(value) == 2) {
+ } else if (atoi(value) == 2 &&
+ checkXmlFile("/vendor/etc/media_profiles_scuba.xml")) {
strlcpy(value, "/vendor/etc/media_profiles_scuba.xml",
PROPERTY_VALUE_MAX);
} else {
@@ -1011,8 +1015,10 @@ MediaProfiles::getInstance()
if (property_get("ro.media.xml_variant.codecs", variant, NULL) > 0) {
std::string xmlPath = std::string("/vendor/etc/media_profiles") +
std::string(variant) + std::string(".xml");
- strlcpy(value, xmlPath.c_str(), PROPERTY_VALUE_MAX);
- ALOGI("Profiles xml path: %s", value);
+ if (checkXmlFile(xmlPath.c_str())) {
+ strlcpy(value, xmlPath.c_str(), PROPERTY_VALUE_MAX);
+ ALOGI("Profiles xml path: %s", value);
+ }
}
}
sInstance = createInstanceFromXmlFile(value);