diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2017-01-06 16:32:57 -0800 |
---|---|---|
committer | Sunny Goyal <sunnygoyal@google.com> | 2017-01-10 23:42:49 -0800 |
commit | 1cc1c9ad83014ec8af54a44112138339c52795b0 (patch) | |
tree | c1b92a862d86a9c99ff06925861cd8f58da8ab75 /src/com/android/launcher3/shortcuts | |
parent | 19ea5cc0c853d48db59363f763d9a06c8691e00d (diff) | |
download | android_packages_apps_Trebuchet-1cc1c9ad83014ec8af54a44112138339c52795b0.tar.gz android_packages_apps_Trebuchet-1cc1c9ad83014ec8af54a44112138339c52795b0.tar.bz2 android_packages_apps_Trebuchet-1cc1c9ad83014ec8af54a44112138339c52795b0.zip |
Enforcing background thread when accessing iconCacheDb.
> Moving any icon cache access to background thread
> Updating Apps list to avoid loading icons for ignored apps
Bug: 21325319
Change-Id: Id72755100f1176ccfcc99249c5e02873cc249a13
Diffstat (limited to 'src/com/android/launcher3/shortcuts')
-rw-r--r-- | src/com/android/launcher3/shortcuts/DeepShortcutView.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/com/android/launcher3/shortcuts/DeepShortcutView.java b/src/com/android/launcher3/shortcuts/DeepShortcutView.java index 679613789..04c71ecd2 100644 --- a/src/com/android/launcher3/shortcuts/DeepShortcutView.java +++ b/src/com/android/launcher3/shortcuts/DeepShortcutView.java @@ -34,6 +34,7 @@ import com.android.launcher3.Utilities; import com.android.launcher3.shortcuts.DeepShortcutsContainer.UnbadgedShortcutInfo; import com.android.launcher3.util.PillRevealOutlineProvider; import com.android.launcher3.util.PillWidthRevealOutlineProvider; +import com.android.launcher3.util.Provider; /** * A {@link android.widget.FrameLayout} that contains a {@link DeepShortcutView}. @@ -114,10 +115,17 @@ public class DeepShortcutView extends FrameLayout implements ValueAnimator.Anima * Returns the shortcut info that is suitable to be added on the homescreen */ public ShortcutInfo getFinalInfo() { - ShortcutInfo badged = new ShortcutInfo(mInfo); + final ShortcutInfo badged = new ShortcutInfo(mInfo); // Queue an update task on the worker thread. This ensures that the badged // shortcut eventually gets its icon updated. - Launcher.getLauncher(getContext()).getModel().updateShortcutInfo(mInfo.mDetail, badged); + Launcher.getLauncher(getContext()).getModel().updateAndBindShortcutInfo( + new Provider<ShortcutInfo>() { + @Override + public ShortcutInfo get() { + badged.updateFromDeepShortcutInfo(mInfo.mDetail, getContext()); + return badged; + } + }); return badged; } |