Using WidgetCell in the Pin Item confirmation prompt for a consistent UI

Also fixing some platform API changes in PinItemRequestCompat

Bug: 33584624
Change-Id: I255829f0079f1a3967bf8d6a337da12c890eb7ec
This commit is contained in:
Sunny Goyal
2017-01-20 11:54:25 -08:00
parent dbb28b2bf8
commit 65513ba58c
9 changed files with 139 additions and 76 deletions

View File

@@ -592,7 +592,10 @@ public class WidgetPreviewLoader {
// Fetch the version info before we generate the preview, so that, in-case the
// app was updated while we are generating the preview, we use the old version info,
// which would gets re-written next time.
mVersions = getPackageVersion(mKey.componentName.getPackageName());
boolean persistable = mInfo.activityInfo == null
|| mInfo.activityInfo.isPersistable();
mVersions = persistable ? getPackageVersion(mKey.componentName.getPackageName())
: null;
// it's not in the db... we need to generate it
preview = generatePreview(mActivity, mInfo, unusedBitmap, mPreviewWidth, mPreviewHeight);