Show icon in PendingAppWidgetHostView immediately.

Before this change, PendingAppWidgetHostView would appear 'blank'
until they were loaded -- which could take a while depending on
how many apps the user had, because the all apps icons are loaded
first.

Bug: 36815047
Change-Id: Ia7449cce4341ed9e9384fc8aaadeaae6c33bb262
This commit is contained in:
Jon Miranda committed 2017-05-03 17:05:41 -07:00
1 parent 0811bc5003
commit 2b823f452b
4 files changed
+26 -4

No files matched your search

@@ -80,10 +80,13 @@ public class PendingAppWidgetHostView extends LauncherAppWidgetHostView
updateAppWidget(null);
setOnClickListener(mLauncher);
// Load icon
PackageItemInfo item = new PackageItemInfo(info.providerName.getPackageName());
item.user = info.user;
cache.updateIconInBackground(this, item);
if (info.pendingItemInfo == null) {
info.pendingItemInfo = new PackageItemInfo(info.providerName.getPackageName());
info.pendingItemInfo.user = info.user;
cache.updateIconInBackground(this, info.pendingItemInfo);
} else {
reapplyItemInfo(info.pendingItemInfo);
}
}
@Override