1
0
mirror of https://github.com/yurisieucuti/treble_evolution.git synced 2024-11-24 12:06:19 +00:00
treble_evolution/patches/trebledroid/platform_frameworks_base/0050-Try-catch-the-Xiaomi-calls.patch
2024-03-10 06:48:11 +00:00

46 lines
2.4 KiB
Diff

From efdb89653e9a6f144199d721310e2a3869e1394c Mon Sep 17 00:00:00 2001
From: Pierre-Hugues Husson <phh@phh.me>
Date: Mon, 29 Jan 2024 17:06:34 -0500
Subject: [PATCH 50/56] Try catch the Xiaomi calls
---
.../src/com/android/systemui/biometrics/UdfpsView.kt | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
index 91053b2c5f8e..d47a7d2068fa 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt
@@ -298,14 +298,16 @@ class UdfpsView(
Log.d("PHH-Enroll", "Xiaomi scenario in UdfpsView reached!")
mySurfaceView.setVisibility(INVISIBLE)
- IXiaomiFingerprint.getService().extCmd(android.os.SystemProperties.getInt("persist.phh.xiaomi.fod.enrollment.id", 4), 1);
- var res = ITouchFeature.getService().setTouchMode(0, 10, 1);
+ try {
+ IXiaomiFingerprint.getService().extCmd(android.os.SystemProperties.getInt("persist.phh.xiaomi.fod.enrollment.id", 4), 1);
+ } catch(t: Throwable) {}
+ var res = try { ITouchFeature.getService().setTouchMode(0, 10, 1) } catch(t: Throwable){ -1 }
if(res != 0){
Log.d("PHH-Enroll", "SetTouchMode 10,1 was NOT executed successfully. Res is " + res)
}
myHandler.postDelayed({
- var ret200 = ITouchFeature.getService().setTouchMode(0, 10, 1);
+ var ret200 = try { ITouchFeature.getService().setTouchMode(0, 10, 1); } catch(t: Throwable) { -1 }
if(ret200 != 0){
Log.d("PHH-Enroll", "myHandler.postDelayed 200ms -SetTouchMode was NOT executed successfully. Ret is " + ret200)
@@ -313,7 +315,7 @@ class UdfpsView(
myHandler.postDelayed({
Log.d("PHH-Enroll", "myHandler.postDelayed 600ms - line prior to setTouchMode 10,0")
- var ret600 = ITouchFeature.getService().setTouchMode(0, 10, 0);
+ var ret600 = try { ITouchFeature.getService().setTouchMode(0, 10, 0); } catch(t: Throwable) { -1 }
if(ret600 != 0){
Log.d("PHH-Enroll", "myHandler.postDelayed 600ms -SetTouchMode 10,0 was NOT executed successfully. Ret is " + ret600)
--
2.25.1