Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Dil3mm4/185654bb335904a2b5c79fb3fe8ee7f8 to your computer and use it in GitHub Desktop.
Save Dil3mm4/185654bb335904a2b5c79fb3fe8ee7f8 to your computer and use it in GitHub Desktop.
From 7fa25ce710b70847e991f4ed2f5e9cf457bc97bd Mon Sep 17 00:00:00 2001
From: Dil3mm4 <dil3mm4.dev@gmail.com>
Date: Sun, 7 Nov 2021 17:44:17 +0100
Subject: [PATCH] UdfpsView: have a config for debugging purposes instead of
relying on build type
---
packages/SystemUI/res/values/descendant_config.xml | 1 +
.../src/com/android/systemui/biometrics/UdfpsView.java | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/packages/SystemUI/res/values/descendant_config.xml b/packages/SystemUI/res/values/descendant_config.xml
index b8223f567173..cb4e738d3ad1 100644
--- a/packages/SystemUI/res/values/descendant_config.xml
+++ b/packages/SystemUI/res/values/descendant_config.xml
@@ -1,4 +1,5 @@
<resources>
<!-- Allow devices override audio panel location to the left side -->
<bool name="config_audioPanelOnLeftSide">false</bool>
+ <bool name="config_udfps_debug">false</bool>
</resources>
diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
index ac391f63f4da..e5f73d9c2b8f 100644
--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
+++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.java
@@ -69,6 +69,7 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
@Nullable private UdfpsHbmProvider mHbmProvider;
@Nullable private String mDebugMessage;
private boolean mIlluminationRequested;
+ private boolean mIsDebugUdfps;
public UdfpsView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -97,7 +98,8 @@ public class UdfpsView extends FrameLayout implements DozeReceiver, UdfpsIllumin
com.android.internal.R.integer.config_udfps_illumination_transition_ms);
DEFAULT_HBM_TYPE = mContext.getResources().getInteger(R.integer.config_udfps_hbm_type);
- if (Build.IS_ENG || Build.IS_USERDEBUG) {
+ mIsDebugUdfps = mContext.getResources().getBoolean(R.bool.config_udfps_debug);
+ if (mIsDebugUdfps) {
mHbmType = Settings.Secure.getIntForUser(mContext.getContentResolver(),
SETTING_HBM_TYPE, DEFAULT_HBM_TYPE, UserHandle.USER_CURRENT);
} else {
--
2.20.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment