AOD lock icons should always be white

Update lock icon colors based on the doze amount.

Test: manually test light theme with AOD enabled
Fixes: 207432957
Change-Id: Ife1ed7c9c5c7b806a6a9499d53de42c7ef3dab49
This commit is contained in:
Beverly
2021-11-29 08:57:09 -05:00
committed by Beverly Tai
parent 8a05667f8c
commit 0e9765ae92

View File

@@ -18,6 +18,7 @@ package com.android.keyguard;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.PointF;
import android.graphics.RectF;
import android.graphics.drawable.Drawable;
@@ -30,6 +31,7 @@ import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import com.android.internal.graphics.ColorUtils;
import com.android.settingslib.Utils;
import com.android.systemui.Dumpable;
import com.android.systemui.R;
@@ -82,14 +84,18 @@ public class LockIconView extends FrameLayout implements Dumpable {
void updateColorAndBackgroundVisibility() {
if (mUseBackground && mLockIcon.getDrawable() != null) {
mLockIconColor = Utils.getColorAttrDefaultColor(getContext(),
android.R.attr.textColorPrimary);
mLockIconColor = ColorUtils.blendARGB(
Utils.getColorAttrDefaultColor(getContext(), android.R.attr.textColorPrimary),
Color.WHITE,
mDozeAmount);
mBgView.setBackground(getContext().getDrawable(R.drawable.fingerprint_bg));
mBgView.setAlpha(1f - mDozeAmount);
mBgView.setVisibility(View.VISIBLE);
} else {
mLockIconColor = Utils.getColorAttrDefaultColor(getContext(),
R.attr.wallpaperTextColorAccent);
mLockIconColor = ColorUtils.blendARGB(
Utils.getColorAttrDefaultColor(getContext(), R.attr.wallpaperTextColorAccent),
Color.WHITE,
mDozeAmount);
mBgView.setVisibility(View.GONE);
}