Fix LockIcon to use Context.getDrawable(int)

Using Resources.getDrawable(int) is deprecated because it lacks theme information,
and I was seeing a crash because theme attributes were not fully resolved.

Test: manual
Change-Id: Idf1b13e16362c2e06227813f4298091ba4406bd5
This commit is contained in:
Jeff DeCew
2020-09-25 10:51:33 -04:00
parent faeec12c7d
commit bf881172ff

View File

@@ -168,7 +168,7 @@ public class LockIcon extends KeyguardAffordanceView {
int iconRes = isAnim ? getThemedAnimationResId(lockAnimIndex) : getIconForState(newState);
if (!mDrawableCache.contains(iconRes)) {
mDrawableCache.put(iconRes, getResources().getDrawable(iconRes));
mDrawableCache.put(iconRes, getContext().getDrawable(iconRes));
}
return mDrawableCache.get(iconRes);