Skip to content

Commit

Permalink
feat: Sync with latest sources of TrebleDroid
Browse files Browse the repository at this point in the history
  • Loading branch information
ponces committed Oct 26, 2023
1 parent 1010bba commit 74cea9d
Show file tree
Hide file tree
Showing 47 changed files with 196 additions and 100 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Change-Id: Id45f3ff1d31e3d4492f956e68a1eb4b2fb82ce63
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/product/emulator_vendor.mk b/target/product/emulator_vendor.mk
index f71b275b0e..62984253f3 100644
index f71b275b0e2..62984253f31 100644
--- a/target/product/emulator_vendor.mk
+++ b/target/product/emulator_vendor.mk
@@ -28,7 +28,7 @@ PRODUCT_PACKAGES += \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Change-Id: I69830d6264356dadd7b037553a899a4eb3d211f1
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk
index 6c907db0ed..0adced1672 100644
index 6c907db0edd..0adced1672e 100644
--- a/target/product/aosp_arm64.mk
+++ b/target/product/aosp_arm64.mk
@@ -54,9 +54,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Change-Id: I7c14fe5229e953f620bb225fa5c981752d0ac5f9
delete mode 100644 target/product/gsi/init.vndk-nodef.rc

diff --git a/target/product/gsi/Android.mk b/target/product/gsi/Android.mk
index 107c94f685..0ad39c3610 100644
index 107c94f6859..0ad39c36101 100644
--- a/target/product/gsi/Android.mk
+++ b/target/product/gsi/Android.mk
@@ -256,16 +256,3 @@ LOCAL_SYSTEM_EXT_MODULE := true
Expand All @@ -40,7 +40,7 @@ index 107c94f685..0ad39c3610 100644
-
-include $(BUILD_PREBUILT)
diff --git a/target/product/gsi/init.gsi.rc b/target/product/gsi/init.gsi.rc
index 69c8e467be..c6faba78d9 100644
index 69c8e467be0..c6faba78d99 100644
--- a/target/product/gsi/init.gsi.rc
+++ b/target/product/gsi/init.gsi.rc
@@ -1,5 +1,3 @@
Expand All @@ -51,15 +51,15 @@ index 69c8e467be..c6faba78d9 100644
-import /system/system_ext/etc/gsi/init.vndk-${ro.vndk.version:-nodef}.rc
diff --git a/target/product/gsi/init.vndk-nodef.rc b/target/product/gsi/init.vndk-nodef.rc
deleted file mode 100644
index 1b141a05e7..0000000000
index 1b141a05e70..00000000000
--- a/target/product/gsi/init.vndk-nodef.rc
+++ /dev/null
@@ -1,3 +0,0 @@
-on early-init
- # Reboot if BOARD_VNDK_VERSION is not defined
- exec - root -- /system/bin/reboot bootloader
diff --git a/target/product/gsi_release.mk b/target/product/gsi_release.mk
index 3b977927d1..7bade98ca1 100644
index 3b977927d19..7bade98ca14 100644
--- a/target/product/gsi_release.mk
+++ b/target/product/gsi_release.mk
@@ -62,7 +62,6 @@ PRODUCT_PACKAGES += com.android.apex.cts.shim.v1_with_prebuilts.flattened
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Change-Id: I29384a820a0c07b29d3f11d7039bed40eeaee926
1 file changed, 1 deletion(-)

diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index a3f5ab3470..0096f23b3d 100644
index a3f5ab34703..0096f23b3d2 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -208,7 +208,6 @@ PRODUCT_PACKAGES += \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH 5/5] Include vndk v28 sepolicy support
1 file changed, 1 insertion(+)

diff --git a/core/config.mk b/core/config.mk
index 0c086ee090..6006a5e8f5 100644
index 0c086ee0907..6006a5e8f5f 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -911,6 +911,7 @@ endif
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 38999b41d5c2a54387748cc1bdc058761df07a0d Mon Sep 17 00:00:00 2001
From f8f0e27db4fd44fb2e376e31a2892acd559c8551 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 18 Dec 2022 18:20:40 -0500
Subject: [PATCH 39/47] FOD support for Asus, Samsung and recent Xiaomi devices
Expand Down Expand Up @@ -58,7 +58,7 @@ index cabe9008ab47..826804492bc7 100644
if (accessibilityManager.isTouchExplorationEnabled) {
setOnHoverListener { v, event -> onTouch(v, event, true) }
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
index 06dee7a2b9f6..505b57f3a1f9 100644
index 06dee7a2b9f6..bfc875290216 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
@@ -19,16 +19,30 @@ import android.content.Context
Expand Down Expand Up @@ -122,7 +122,7 @@ index 06dee7a2b9f6..505b57f3a1f9 100644
+ try {
+ canvas = p0.lockCanvas();
+ Log.d("PHH", "Surface dimensions ${canvas.getWidth()*1.0f} ${canvas.getHeight()*1.0f}")
+ canvas.drawOval(RectF(0.0f, 0.0f, canvas.getWidth()*1.0f, canvas.getHeight()*1.0f), paint);
+ canvas.drawOval(RectF(overlayParams.sensorBounds), paint);
+ } finally {
+ // Make sure the surface is never left in a bad state.
+ if (canvas != null) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From d09e5b4ad397b8483911103b3d4765c2bb849682 Mon Sep 17 00:00:00 2001
From f8f001272af3f0d09b1ebe85223e09cbbd82cf65 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Sun, 15 Oct 2023 11:21:58 +0800
Subject: [PATCH 40/47] SystemUI: Add MTK's brightness path for FOD
Expand All @@ -11,7 +11,7 @@ Change-Id: Ifec88c625210301b5d1146bba0275cd9699243e8
1 file changed, 22 insertions(+), 8 deletions(-)

diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
index 505b57f3a1f9..c005c66f96bc 100644
index bfc875290216..f03642f47d02 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
@@ -35,6 +35,7 @@ import com.android.settingslib.udfps.UdfpsOverlayParams
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 115b3a67a05bee8d8f984de4fdc33db2fc9b5323 Mon Sep 17 00:00:00 2001
From e0f3f6f430cbbe6e05adc01798415695771dd32b Mon Sep 17 00:00:00 2001
From: ChonDoit <thphantomblog@gmail.com>
Date: Thu, 24 Aug 2023 15:58:15 -0300
Subject: [PATCH 41/47] Fix brightness slider curve for some devices
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b65bdc652b7358cc42ef28d8874a4a4ee25cd3a7 Mon Sep 17 00:00:00 2001
From 33672a9813f5b878a42ce0c6945656736570739b Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 18 Oct 2023 16:53:40 -0400
Subject: [PATCH 42/47] Ignore cgroup creation errors
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From aff6d95f97bea391c6fe0b08fa3928567fcb055c Mon Sep 17 00:00:00 2001
From 1bfba29a4d321658b59faa1203fb365c51690e9c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 18 Oct 2023 16:57:34 -0400
Subject: [PATCH 43/47] Samsung tablets use SW_MACHINE_COVER rather than SW_LID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 15bde0a7262a0ab82011bd21d155c5ab52bccf25 Mon Sep 17 00:00:00 2001
From bb37b93411693ec1b49e2aea8f83f1b4a40842c6 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <ponces26@gmail.com>
Date: Fri, 20 Oct 2023 09:26:19 +0000
Subject: [PATCH 44/47] Revert "Removed IWLAN legacy mode support"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b8ece716485d12a69b1570eadd7200edb7d5862d Mon Sep 17 00:00:00 2001
From 4c70bc31d36cd686e01c855e853eddf8213baa54 Mon Sep 17 00:00:00 2001
From: Huy Hoang <38396158+boydaihungst@users.noreply.github.com>
Date: Sat, 14 Oct 2023 12:44:36 +0700
Subject: [PATCH 45/47] add: nubia red magic 6 series udfps/fod
Expand All @@ -24,7 +24,7 @@ index 7f77e39041d1..5d7b5494d7fd 100644
manifest: "AndroidManifest.xml",

diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
index 10e45dadee60..27ab0db69756 100644
index 10e45dadee60..efb88b9fe1ec 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java
@@ -47,6 +47,7 @@ import android.os.Handler;
Expand Down Expand Up @@ -119,14 +119,14 @@ index 10e45dadee60..27ab0db69756 100644
}
}
+ if(SystemProperties.get("ro.vendor.build.fingerprint").contains("nubia/NX669")) {
+ processCmd(14, 0, 0, new byte[0], 0);
+ processCmd(15, 0, 0, new byte[0], 0);
+ }
+
for (Callback cb : mCallbacks) {
cb.onFingerUp();
}
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
index c005c66f96bc..084fcb8d260f 100644
index f03642f47d02..f86e8436b608 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
@@ -45,6 +45,8 @@ import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
From 67460d4704d5d0cc353e34470e77c6922ebb05d2 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 25 Oct 2023 07:30:10 -0400
Subject: [PATCH 46/47] UDFPS: Don't crash if we can't compute a dim. Just
don't dim.

---
.../src/com/android/systemui/biometrics/UdfpsView.kt | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
index f86e8436b608..4377dd7e70a7 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
@@ -270,12 +270,13 @@ class UdfpsView(
}
}

- if (!bmFilesExist) {
- throw FileNotFoundException("No brightness files under expected paths")
+ val dim = if (bmFilesExist) {
+ 1.0 - Math.pow( (brightness / maxBrightness), 1/2.3);
+ } else {
+ 0.0
}

// Assume HBM is max brightness
- val dim = 1.0 - Math.pow( (brightness / maxBrightness), 1/2.3);
Log.d("PHH-Enroll", "Brightness is $brightness / $maxBrightness, setting dim to $dim")
if (hasAsusGhbm) {
dimUpdate(dim.toFloat())
--
2.34.1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From ff8a0ebfcca14acbb4a69efc7bdf724938fce8c5 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 25 Oct 2023 07:30:45 -0400
Subject: [PATCH 47/47] UDFPS Don't crash if we can't find UDFPS props

---
.../java/com/android/server/biometrics/AuthService.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
index add882656713..26ca8c9940f5 100644
--- a/services/core/java/com/android/server/biometrics/AuthService.java
+++ b/services/core/java/com/android/server/biometrics/AuthService.java
@@ -1016,7 +1016,13 @@ public class AuthService extends SystemService {
com.android.internal.R.array.config_udfps_sensor_props);

boolean isUdfps = !ArrayUtils.isEmpty(udfpsProps);
- if(!isUdfps) udfpsProps = dynamicUdfpsProps();
+ if(!isUdfps) {
+ try {
+ udfpsProps = dynamicUdfpsProps();
+ } catch(Throwable t) {
+ Slog.e("PHH-Enroll", "Failed generating UDFPS props");
+ }
+ }
isUdfps = !ArrayUtils.isEmpty(udfpsProps);

if(udfpsProps.length > 0) {
--
2.34.1

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From b4326dbe1c0ad9c80c5a5da3b6222f08f25628ab Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sun, 19 Dec 2021 17:03:15 -0500
Subject: [PATCH 1/2] Add a vendor800 command, to be able to call
Subject: [PATCH 1/3] Add a vendor800 command, to be able to call
vendor-specific hwc functions

Change-Id: Icbef1e9e3a331ae3bd5a05687d545851d94d88a8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 7adc66904796a05023a6ed6ec81e5ada75fe3991 Mon Sep 17 00:00:00 2001
From: Andy CrossGate Yan <GeForce8800Ultra@gmail.com>
Date: Tue, 18 Apr 2023 23:48:15 +0000
Subject: [PATCH 2/2] Fix light sensor crash on Xiaomi 13
Subject: [PATCH 2/3] Fix light sensor crash on Xiaomi 13

SensorService expects a scalar, but Xiaomi HAL returns a pose6DOF vector encapsulation
Thanks @phhusson for the analysis
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From cd80c23bc3bd357946d679da60704a70757eaffd Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Tue, 24 Oct 2023 04:59:57 -0400
Subject: [PATCH 3/3] Fix crash on Samsung S23 using stock properties, because
of sensor reporting vec3 instead of scalar. Likely the device orientation
sensor

---
sensors/aidl/convert/convert.cpp | 3 +++
1 file changed, 3 insertions(+)

diff --git a/sensors/aidl/convert/convert.cpp b/sensors/aidl/convert/convert.cpp
index be3833dfa7..c56b30475c 100644
--- a/sensors/aidl/convert/convert.cpp
+++ b/sensors/aidl/convert/convert.cpp
@@ -167,6 +167,9 @@ void convertToSensorEvent(const Event& src, sensors_event_t* dst) {
auto dstr = ::android::internal::ToString(d);
// ALOGE("Received 6DOF for expected scalar %s", dstr.c_str());
dst->data[0] = d.values[0];
+ } else if (src.payload.getTag() == Event::EventPayload::vec3) {
+ auto d = src.payload.get<Event::EventPayload::vec3>();
+ dst->data[0] = d.x;
} else {
dst->data[0] = src.payload.get<Event::EventPayload::scalar>();
}
--
2.34.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
From 0e5671e933147c3a6d4c334dcd9bebf4c76a00ba Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Fri, 20 Oct 2023 13:02:43 -0400
Subject: [PATCH] Don't crash when there is no VR service

Change-Id: I02d672f9a2688df7b1abf16377634fdcf4132511
---
src/com/android/nfc/NfcService.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/com/android/nfc/NfcService.java b/src/com/android/nfc/NfcService.java
index f22dc9da..1b786842 100644
--- a/src/com/android/nfc/NfcService.java
+++ b/src/com/android/nfc/NfcService.java
@@ -572,7 +572,11 @@ public class NfcService implements DeviceHostListener, ForegroundUtils.Callback
mActivityManager = mContext.getSystemService(ActivityManager.class);
mVibrator = mContext.getSystemService(Vibrator.class);
mVibrationEffect = VibrationEffect.createOneShot(200, VibrationEffect.DEFAULT_AMPLITUDE);
- mVrManager = mContext.getSystemService(VrManager.class);
+ try {
+ mVrManager = mContext.getSystemService(VrManager.class);
+ } catch(Throwable t) {
+ mVrManager = null;
+ }

mScreenState = mScreenStateHelper.checkScreenState();

--
2.34.1

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 6fce17125705b5efd0987d6ff86759b12ef114c5 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Wed, 23 Feb 2022 17:37:47 -0500
Subject: [PATCH 01/21] Let system override ro.apex.updatable
Subject: [PATCH 01/22] Let system override ro.apex.updatable

APEX are broken because of a kernel bug in Android 10 devices
So we have system set ro.apex.updatable = false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 092f6994e24f4d13f2635c4576e243214376a688 Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Thu, 12 Sep 2019 13:05:37 +0200
Subject: [PATCH 02/21] If Vboot2 fails, fall-back to Vboot1
Subject: [PATCH 02/22] If Vboot2 fails, fall-back to Vboot1

Some devices, for instance Honor View 10, running Pie vendor declares
vbmeta in their device-tree, but doesn't have a vbmeta partition.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 4f1bde38a1c252f515b32e7333c822edfbf5c399 Mon Sep 17 00:00:00 2001
From: Alberto Ponces <ponces26@gmail.com>
Date: Wed, 28 Sep 2022 17:04:03 +0100
Subject: [PATCH 03/21] Revert "Remove support for AVB 1.0."
Subject: [PATCH 03/22] Revert "Remove support for AVB 1.0."

This reverts commit 21ef2310eb1ef4e61117b8a63741f3a9577a20c9.

Expand Down
Loading

0 comments on commit 74cea9d

Please sign in to comment.