summaryrefslogtreecommitdiff
path: root/src/com/android/settings/widget/EntityHeaderController.java
diff options
context:
space:
mode:
authorFan Zhang <zhfan@google.com>2018-05-18 10:31:32 -0700
committerFan Zhang <zhfan@google.com>2018-05-18 14:31:48 -0700
commitfcbf155b474981d1ff9bf2905df9aff79b033c99 (patch)
tree251ee22877cce8102461ae868368967a5415d4f8 /src/com/android/settings/widget/EntityHeaderController.java
parent76a0ef6adb906ed8986db7af599e7be439143510 (diff)
Don't use cached app icon in app info page.
The cache in ApplicationsState is causing a lot of damage because AS object is not smart enough to invalidate the cache in all conditions. So we end up having bugs like stale app label or icon in weird cases. This change stops using the cache when loading app icon in entity headres. This is only a stop gap solution to fix most visible (and most frequently complained) parts of the page. We still need to address the cache in ApplicationsState eventually. Change-Id: Iea88ad99d4069d678d09943cfb0b0e5c94eb3326 Fixes: 79881693 Test: robotests
Diffstat (limited to 'src/com/android/settings/widget/EntityHeaderController.java')
-rw-r--r--src/com/android/settings/widget/EntityHeaderController.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/com/android/settings/widget/EntityHeaderController.java b/src/com/android/settings/widget/EntityHeaderController.java
index 6d67eb4903..5bf0e4c2df 100644
--- a/src/com/android/settings/widget/EntityHeaderController.java
+++ b/src/com/android/settings/widget/EntityHeaderController.java
@@ -35,6 +35,7 @@ import android.support.annotation.IntDef;
import android.support.annotation.VisibleForTesting;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
+import android.util.IconDrawableFactory;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
@@ -146,9 +147,7 @@ public class EntityHeaderController {
* accessibility purposes.
*/
public EntityHeaderController setIcon(ApplicationsState.AppEntry appEntry) {
- if (appEntry.icon != null) {
- mIcon = appEntry.icon.getConstantState().newDrawable(mAppContext.getResources());
- }
+ mIcon = IconDrawableFactory.newInstance(mAppContext).getBadgedIcon(appEntry.info);
return this;
}