Avoid duplicate text on keyguard indication

It's possible that the transient indication will say "Charged" and the
power indication will be the same. In those cases they should not be on
top of each other.

Test: plug device, press power to wake-up
Fixes: 151181410
Change-Id: I15a6ab799a655ef84e7c8d5229b2d9cf4d8597fc
This commit is contained in:
Lucas Dupin
2020-03-23 17:30:15 -07:00
parent 25f8496e7c
commit d9af6311e9

View File

@@ -340,7 +340,7 @@ public class KeyguardIndicationController implements StateListener,
mTextView.switchIndication(com.android.internal.R.string.lockscreen_storage_locked);
mTextView.setTextColor(mInitialTextColorState);
} else if (!TextUtils.isEmpty(mTransientIndication)) {
if (powerIndication != null) {
if (powerIndication != null && !mTransientIndication.equals(powerIndication)) {
String indication = mContext.getResources().getString(
R.string.keyguard_indication_trust_unlocked_plugged_in,
mTransientIndication, powerIndication);