summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/LockIconView.java
diff options
context:
space:
mode:
authorMatt Pietal <mpietal@google.com>2021-09-23 10:18:41 -0400
committerMatt Pietal <mpietal@google.com>2021-09-23 15:16:24 +0000
commitddfb4df1a83d6e51e23177790f0b0ecae207f764 (patch)
tree99896fc7f12930edc5fb074fa37f8dff73b37175 /packages/SystemUI/src/com/android/keyguard/LockIconView.java
parent38c00180bcfd4e2faeb0b183806a6c15a8c28a3f (diff)
[DO NOT MERGE] Only show lock icon background with UDFPS
Otherwise the background should remain hidden (View.GONE) for devices without the UDFPS sensor. Fixes: 200813382 Test: atest LockIconViewControllerTest Change-Id: I1ef3cef37de60e6968432869f4c946b6de414db4
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/LockIconView.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/LockIconView.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconView.java b/packages/SystemUI/src/com/android/keyguard/LockIconView.java
index 371564a98aad..ef4353b93179 100644
--- a/packages/SystemUI/src/com/android/keyguard/LockIconView.java
+++ b/packages/SystemUI/src/com/android/keyguard/LockIconView.java
@@ -48,6 +48,7 @@ public class LockIconView extends FrameLayout implements Dumpable {
private ImageView mBgView;
private int mLockIconColor;
+ private boolean mUseBackground = false;
public LockIconView(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -61,8 +62,8 @@ public class LockIconView extends FrameLayout implements Dumpable {
mBgView = findViewById(R.id.lock_icon_bg);
}
- void updateColorAndBackgroundVisibility(boolean useBackground) {
- if (useBackground && mLockIcon.getDrawable() != null) {
+ void updateColorAndBackgroundVisibility() {
+ if (mUseBackground && mLockIcon.getDrawable() != null) {
mLockIconColor = Utils.getColorAttrDefaultColor(getContext(),
android.R.attr.textColorPrimary);
mBgView.setBackground(getContext().getDrawable(R.drawable.fingerprint_bg));
@@ -78,6 +79,9 @@ public class LockIconView extends FrameLayout implements Dumpable {
void setImageDrawable(Drawable drawable) {
mLockIcon.setImageDrawable(drawable);
+
+ if (!mUseBackground) return;
+
if (drawable == null) {
mBgView.setVisibility(View.INVISIBLE);
} else {
@@ -86,6 +90,14 @@ public class LockIconView extends FrameLayout implements Dumpable {
}
/**
+ * Whether or not to render the lock icon background. Mainly used for UDPFS.
+ */
+ public void setUseBackground(boolean useBackground) {
+ mUseBackground = useBackground;
+ updateColorAndBackgroundVisibility();
+ }
+
+ /**
* Set the location of the lock icon.
*/
@VisibleForTesting