mirror of
https://github.com/yurisieucuti/treble_evolution.git
synced 2024-11-24 08:36:19 +00:00
49 lines
2.3 KiB
Diff
49 lines
2.3 KiB
Diff
From 6cbd956e84ce543e18dd8106f1d5e8265df68502 Mon Sep 17 00:00:00 2001
|
|
From: Pierre-Hugues Husson <phh@phh.me>
|
|
Date: Wed, 5 Jul 2023 10:50:36 -0400
|
|
Subject: [PATCH 33/51] Detect Moto dynamic hardware feature
|
|
|
|
Moto added a custom node in sysconfig XMLs:
|
|
<unavailable-feature-conditional />
|
|
This node reads a property and enables a feature based on it.
|
|
|
|
Take those into account to enable NFC on Moto devices which have
|
|
NFC-less variants
|
|
---
|
|
.../java/com/android/server/SystemConfig.java | 19 +++++++++++++++++++
|
|
1 file changed, 19 insertions(+)
|
|
|
|
diff --git a/services/core/java/com/android/server/SystemConfig.java b/services/core/java/com/android/server/SystemConfig.java
|
|
index 40b29d7b09d5..38e82d8cac36 100644
|
|
--- a/services/core/java/com/android/server/SystemConfig.java
|
|
+++ b/services/core/java/com/android/server/SystemConfig.java
|
|
@@ -946,6 +946,25 @@ public class SystemConfig {
|
|
}
|
|
XmlUtils.skipCurrentTag(parser);
|
|
} break;
|
|
+ case "unavailable-feature-conditional": {
|
|
+ if (allowFeatures) {
|
|
+ String fname = parser.getAttributeValue(null, "name");
|
|
+ String prop = parser.getAttributeValue(null, "prop");
|
|
+ if (fname == null || prop == null) {
|
|
+ Slog.w(TAG, "<" + name + "> without name in " + permFile
|
|
+ + " at " + parser.getPositionDescription());
|
|
+ } else {
|
|
+ if(android.os.SystemProperties.getBoolean(prop, false)) {
|
|
+ addFeature(fname, 0);
|
|
+ } else {
|
|
+ mUnavailableFeatures.add(fname);
|
|
+ }
|
|
+ }
|
|
+ } else {
|
|
+ logNotAllowedInPartition(name, permFile, parser);
|
|
+ }
|
|
+ XmlUtils.skipCurrentTag(parser);
|
|
+ } break;
|
|
case "allow-in-power-save-except-idle": {
|
|
if (allowOverrideAppRestrictions) {
|
|
String pkgname = parser.getAttributeValue(null, "package");
|
|
--
|
|
2.25.1
|
|
|