From 23fdba10d2a22eab7cf0f476ecb283400954df84 Mon Sep 17 00:00:00 2001 From: Akari Tsuneta Date: Thu, 10 Aug 2017 20:51:44 +0900 Subject: [PATCH] Fix QS user icon in guest mode When the profile is updated in guest mode, the user icon in QS footer is not displayed correctly. To fix this issue, the tinting of guest icon is applied only when the drawable is not UserIconDrawable. Fixes: 65148947 Test: manual - switch to guest and update the profile. Change-Id: I9690e9fd286703a25ee08d877c3dd7f4729e2b31 --- packages/SystemUI/src/com/android/systemui/qs/QSFooter.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java b/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java index 488fc03032fd4..2473335e6e158 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java +++ b/packages/SystemUI/src/com/android/systemui/qs/QSFooter.java @@ -45,6 +45,7 @@ import com.android.internal.logging.MetricsLogger; import com.android.internal.logging.nano.MetricsProto; import com.android.keyguard.KeyguardStatusView; import com.android.settingslib.Utils; +import com.android.settingslib.drawable.UserIconDrawable; import com.android.systemui.Dependency; import com.android.systemui.FontSizeUtils; import com.android.systemui.R; @@ -427,8 +428,9 @@ public class QSFooter extends FrameLayout implements @Override public void onUserInfoChanged(String name, Drawable picture, String userAccount) { if (picture != null && - UserManager.get(mContext).isGuestUser(ActivityManager.getCurrentUser())) { - picture = picture.getConstantState().newDrawable().mutate(); + UserManager.get(mContext).isGuestUser(ActivityManager.getCurrentUser()) && + !(picture instanceof UserIconDrawable)) { + picture = picture.getConstantState().newDrawable(mContext.getResources()).mutate(); picture.setColorFilter( Utils.getColorAttr(mContext, android.R.attr.colorForeground), Mode.SRC_IN);