Skip to content

Commit

Permalink
feat: Sync with Sep source of Spark
Browse files Browse the repository at this point in the history
* Synced with latest td source

Signed-off-by: naz664 <nazimnavas145@gmail.com>
  • Loading branch information
naz664 committed Oct 15, 2023
1 parent c346f8b commit c470570
Show file tree
Hide file tree
Showing 14 changed files with 535 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 513f08dade75dce317b22ef09d67f988c81838f5 Mon Sep 17 00:00:00 2001
From: naz664 <nazimnavas145@gmail.com>
Date: Mon, 26 Dec 2022 11:54:04 +0000
Subject: [PATCH] remove su from no-su builds

---
target/product/base_system.mk | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/product/base_system.mk b/target/product/base_system.mk
index 9935ffe8b..5095760ab 100644
--- a/target/product/base_system.mk
+++ b/target/product/base_system.mk
@@ -397,10 +397,10 @@ PRODUCT_PACKAGES_DEBUG := \
unwind_reg_info \
unwind_symbols \

-ifeq ($(SPARK_BUILD),)
-PRODUCT_PACKAGES_DEBUG += \
- su
-endif
+#ifeq ($(SPARK_BUILD),)
+#PRODUCT_PACKAGES_DEBUG += \
+# su
+#endif

# The set of packages whose code can be loaded by the system server.
PRODUCT_SYSTEM_SERVER_APPS += \
--
2.34.1

Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
From 1bd35f696ab783fcbe7ecddee76549584a11a5e4 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 29/36] FOD support for Asus ZF8 and Samsung devices
From b260611700022db35eb02b29101ac35a8f378a0a Mon Sep 17 00:00:00 2001
From: naz664 <nazimnavas145@gmail.com>
Date: Sun, 15 Oct 2023 06:08:20 +0000
Subject: [PATCH 1/7] FOD support for Asus ZF8 and Samsung devices Thanks Asus
for providing a free device to make this support And thanks @davigamer987 for
donating enough to get a Samsung FOD device to make this

Thanks Asus for providing a free device to make this support
And thanks @davigamer987 for donating enough to get a Samsung FOD device
to make this
---
packages/SystemUI/Android.bp | 1 +
packages/SystemUI/res/values/config.xml | 2 +-
.../biometrics/UdfpsControllerOverlay.kt | 7 +-
.../biometrics/UdfpsControllerOverlay.kt | 9 +-
.../android/systemui/biometrics/UdfpsView.kt | 161 ++++++++++--
services/core/Android.bp | 7 +-
.../server/biometrics/AuthService.java | 236 +++++++++++++++++-
6 files changed, 383 insertions(+), 31 deletions(-)
.../server/biometrics/AuthService.java | 240 +++++++++++++++++-
6 files changed, 385 insertions(+), 35 deletions(-)

diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp
index 7ac7a2fc7880..e039b9eb8a5f 100644
Expand All @@ -28,10 +27,10 @@ index 7ac7a2fc7880..e039b9eb8a5f 100644
manifest: "AndroidManifest.xml",
additional_manifests: ["LineageManifest.xml"],
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index ab6bd7abcaae..818cd0fd69b5 100644
index 7bd3cc7f22ad..adc96e701031 100644
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -591,7 +591,7 @@
@@ -592,7 +592,7 @@

<!-- The radius of the enrollment progress bar, in dp -->
<integer name="config_udfpsEnrollProgressBar" translatable="false">
Expand All @@ -41,21 +40,24 @@ index ab6bd7abcaae..818cd0fd69b5 100644

<!-- The time (in ms) needed to trigger the lock icon view's long-press affordance -->
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
index baa46e875529..fdbdf90f03e8 100644
index 277cde1efd5e..8d2cb39c6e98 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsControllerOverlay.kt
@@ -120,7 +120,9 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
@@ -120,10 +120,10 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
gravity = android.view.Gravity.TOP or android.view.Gravity.LEFT
layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS
flags = (Utils.FINGERPRINT_OVERLAY_LAYOUT_PARAM_FLAGS or
- WindowManager.LayoutParams.FLAG_DIM_BEHIND or
- WindowManager.LayoutParams.FLAG_SPLIT_TOUCH)
- privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY
+ WindowManager.LayoutParams.FLAG_SPLIT_TOUCH) or
+ WindowManager.LayoutParams.FLAG_DIM_BEHIND
+ dimAmount = 0.0f
privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY
dimAmount = 0.0f
+ privateFlags = WindowManager.LayoutParams.PRIVATE_FLAG_TRUSTED_OVERLAY

// Avoid announcing window title.
accessibilityTitle = " "
@@ -189,6 +191,9 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
@@ -198,6 +198,9 @@ class UdfpsControllerOverlay @JvmOverloads constructor(
windowManager.addView(this, coreLayoutParams.updateDimensions(animation))
sensorRect = sensorBounds
touchExplorationEnabled = accessibilityManager.isTouchExplorationEnabled
Expand Down Expand Up @@ -296,15 +298,15 @@ index 1e2e6c8bb253..cdaad81b9222 100644
}
}
diff --git a/services/core/Android.bp b/services/core/Android.bp
index f4d582b5f1a1..03055e2855b6 100644
index f4d582b5f1a1..68ac3911ffdd 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -181,7 +181,12 @@ java_library_static {
"kotlin-stdlib",
"kotlinx_coroutines_android",
"kotlinx_coroutines",
- "vendor.samsung.hardware.sysinput-V1.2-java", // HIDL
+ // HIDL
+ // HIDL
+ "vendor.samsung.hardware.sysinput-V1.2-java",
+ "vendor.goodix.hardware.biometrics.fingerprint-V2.1-java",
+ "vendor.samsung.hardware.biometrics.fingerprint-V3.0-java",
Expand All @@ -314,7 +316,7 @@ index f4d582b5f1a1..03055e2855b6 100644
javac_shard_size: 50,
}
diff --git a/services/core/java/com/android/server/biometrics/AuthService.java b/services/core/java/com/android/server/biometrics/AuthService.java
index 7e6f35acc398..e3d951648432 100644
index 7e6f35acc398..dad82e5264e4 100644
--- a/services/core/java/com/android/server/biometrics/AuthService.java
+++ b/services/core/java/com/android/server/biometrics/AuthService.java
@@ -77,6 +77,22 @@ import java.util.ArrayList;
Expand Down Expand Up @@ -422,8 +424,12 @@ index 7e6f35acc398..e3d951648432 100644
}

/**
@@ -775,18 +859,104 @@ public class AuthService extends SystemService {
? modality : (modality & ~BiometricAuthenticator.TYPE_CREDENTIAL);
@@ -772,21 +856,107 @@ public class AuthService extends SystemService {
@BiometricAuthenticator.Modality
private static int getCredentialBackupModality(@BiometricAuthenticator.Modality int modality) {
return modality == BiometricAuthenticator.TYPE_CREDENTIAL
- ? modality : (modality & ~BiometricAuthenticator.TYPE_CREDENTIAL);
+ ? modality : (modality & ~BiometricAuthenticator.TYPE_CREDENTIAL);
}

+ private int[] dynamicUdfpsProps() {
Expand Down Expand Up @@ -511,7 +517,7 @@ index 7e6f35acc398..e3d951648432 100644
@BiometricManager.Authenticators.Types int strength) {
// The existence of config_udfps_sensor_props indicates that the sensor is UDFPS.
- final int[] udfpsProps = getContext().getResources().getIntArray(
+ int[] udfpsProps = getContext().getResources().getIntArray(
+ int[] udfpsProps = getContext().getResources().getIntArray(
com.android.internal.R.array.config_udfps_sensor_props);

// Non-empty workaroundLocations indicates that the sensor is SFPS.
Expand All @@ -529,10 +535,13 @@ index 7e6f35acc398..e3d951648432 100644

// config_is_powerbutton_fps indicates whether device has a power button fingerprint sensor.
final boolean isPowerbuttonFps = getContext().getResources().getBoolean(
@@ -854,4 +1024,66 @@ public class AuthService extends SystemService {
@@ -852,6 +1022,68 @@ public class AuthService extends SystemService {
return new SensorPropertiesInternal(sensorId,
Utils.authenticatorStrengthToPropertyStrength(strength), maxEnrollmentsPerUser,
componentInfo, resetLockoutRequiresHardwareAuthToken,
resetLockoutRequiresChallenge);
}
- resetLockoutRequiresChallenge);
+ resetLockoutRequiresChallenge);
+ }
+
+ private static boolean samsungHasCmd(String cmd) {
+ try {
Expand Down Expand Up @@ -574,7 +583,7 @@ index 7e6f35acc398..e3d951648432 100644
+ } catch(Exception e) {
+ android.util.Log.d("PHH", "Failed writing to " + path + ": " + value);
+ }
+ }
}
+
+ private static void writeFile(File file, String value) {
+ try {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From cf6479c7dba53ea522a7282e397a697bc5418bbb Mon Sep 17 00:00:00 2001
From d42f7b533ecf304a08f7c86bcebe0f927bbf9c36 Mon Sep 17 00:00:00 2001
From: ItsLynix <71310187+ItsLynix@users.noreply.github.com>
Date: Sat, 28 Jan 2023 10:25:16 +0100
Subject: [PATCH 31/36] SystemUI: Implement alternate brightness path for FOD
Subject: [PATCH 2/7] SystemUI: Implement alternate brightness path for FOD

---
.../com/android/systemui/biometrics/UdfpsView.kt | 15 +++++++++++++--
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8e60f55ce0b0768c25a6e0b8d4ff31449aa1924f Mon Sep 17 00:00:00 2001
From ebaf78e343c4ac85703dcea181279d4627dc0eaf Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Sat, 17 Jun 2023 08:31:55 -0400
Subject: [PATCH 34/36] Add Mediatek power hints on touch
Subject: [PATCH 3/7] Add Mediatek power hints on touch

Mediatek has multiple HALs (which existed concurrently), so it is a bit
of a mess.
Expand All @@ -25,19 +25,19 @@ smoother.
2 files changed, 52 insertions(+)

diff --git a/services/core/Android.bp b/services/core/Android.bp
index 03055e2855b6..2386b54abf7f 100644
index 68ac3911ffdd..363d1fe02a20 100644
--- a/services/core/Android.bp
+++ b/services/core/Android.bp
@@ -182,6 +182,7 @@ java_library_static {
"kotlinx_coroutines_android",
"kotlinx_coroutines",
// HIDL
// HIDL
+ "vendor.mediatek.hardware.mtkpower-V1.1-java",
"vendor.samsung.hardware.sysinput-V1.2-java",
"vendor.goodix.hardware.biometrics.fingerprint-V2.1-java",
"vendor.samsung.hardware.biometrics.fingerprint-V3.0-java",
diff --git a/services/core/java/com/android/server/wm/DisplayPolicy.java b/services/core/java/com/android/server/wm/DisplayPolicy.java
index 489fdc44555c..8d3708d8e0f3 100644
index 2f32d61805f9..b88c912de288 100644
--- a/services/core/java/com/android/server/wm/DisplayPolicy.java
+++ b/services/core/java/com/android/server/wm/DisplayPolicy.java
@@ -224,6 +224,9 @@ public class DisplayPolicy {
Expand Down Expand Up @@ -76,7 +76,7 @@ index 489fdc44555c..8d3708d8e0f3 100644
Boost.INTERACTION, duration);
}
+
+ if(mOldMtkPerf != null) {
+ if(mOldMtkPerf != null) {
+ try {
+ android.util.Log.d("PHH-Power", "mtk1 fling power hint");
+ int hint = 36; // MTKPOWER_HINT_APP_TOUCH
Expand Down
Loading

0 comments on commit c470570

Please sign in to comment.