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
2017-05-02 18:36:18 -07:00
parent 0811bc5003
commit 2b823f452b
4 changed files with 26 additions and 4 deletions

View File

@@ -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